All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
BasicTrackAnalysis::BasicTrackAnalysis Class Reference
Inheritance diagram for BasicTrackAnalysis::BasicTrackAnalysis:
ITrackHistogramTool

Public Member Functions

 BasicTrackAnalysis (fhicl::ParameterSet const &pset)
 Constructor. More...
 
 ~BasicTrackAnalysis ()
 Destructor. More...
 
void configure (fhicl::ParameterSet const &pset) override
 
void initializeHists (art::ServiceHandle< art::TFileService > &, const std::string &) override
 Interface for initializing the histograms to be filled. More...
 
void endJob (int numEvents) override
 Interface for method to executve at the end of run processing. More...
 
void fillHistograms (const art::Event &) const override
 Interface for filling histograms. More...
 
- Public Member Functions inherited from ITrackHistogramTool
virtual ~ITrackHistogramTool () noexcept=default
 Virtual Destructor. More...
 

Private Attributes

std::vector< art::InputTag > fTrackProducerLabelVec
 tag for finding the tracks More...
 
std::string fLocalDirName
 Directory name for histograms. More...
 
TH1D * fHitsByWire [3]
 
TH2D * fPulseHVsWidth [3]
 
TProfile * fPulseHVsHitNo [3]
 
const geo::GeometryCorefGeometry
 pointer to Geometry service More...
 

Detailed Description

Definition at line 50 of file BasicTrackAnalysis_tool.cc.

Constructor & Destructor Documentation

BasicTrackAnalysis::BasicTrackAnalysis::BasicTrackAnalysis ( fhicl::ParameterSet const &  pset)
explicit

Constructor.

Parameters
psetConstructor.

Arguments:

pset - Fcl parameters.

Definition at line 110 of file BasicTrackAnalysis_tool.cc.

111 {
112  fGeometry = lar::providerFrom<geo::Geometry>();
113 
114  configure(pset);
115 
116  // Report.
117  mf::LogInfo("BasicTrackAnalysis") << "BasicTrackAnalysis configured\n";
118 }
void configure(fhicl::ParameterSet const &pset) override
const geo::GeometryCore * fGeometry
pointer to Geometry service
BasicTrackAnalysis::BasicTrackAnalysis::~BasicTrackAnalysis ( )

Destructor.

Definition at line 122 of file BasicTrackAnalysis_tool.cc.

123 {}

Member Function Documentation

void BasicTrackAnalysis::BasicTrackAnalysis::configure ( fhicl::ParameterSet const &  pset)
overridevirtual

Reconfigure method.

Arguments:

pset - Fcl parameter set.

Implements ITrackHistogramTool.

Definition at line 132 of file BasicTrackAnalysis_tool.cc.

133 {
134  fTrackProducerLabelVec = pset.get<std::vector<art::InputTag>>("TrackProducerLabel", std::vector<art::InputTag>()={""});
135  fLocalDirName = pset.get<std::string >( "LocalDirName", std::string("wow"));
136 }
std::string fLocalDirName
Directory name for histograms.
std::vector< art::InputTag > fTrackProducerLabelVec
tag for finding the tracks
void BasicTrackAnalysis::BasicTrackAnalysis::endJob ( int  numEvents)
overridevirtual

Interface for method to executve at the end of run processing.

Parameters
intnumber of events to use for normalization

Implements ITrackHistogramTool.

Definition at line 186 of file BasicTrackAnalysis_tool.cc.

187 {
188  // Normalize wire profiles to be hits/event
189  double normFactor(1./numEvents);
190 
191  for(size_t idx = 0; idx < 3; idx++) fHitsByWire[idx]->Scale(normFactor);
192 
193  return;
194 }
Scale(size_t pos, T factor) -> Scale< T >
void BasicTrackAnalysis::BasicTrackAnalysis::fillHistograms ( const art::Event &  event) const
overridevirtual

Interface for filling histograms.

Implements ITrackHistogramTool.

Definition at line 160 of file BasicTrackAnalysis_tool.cc.

161 {
162  // The game plan for this module is to look at recob::Tracks and objects associated to tracks
163  // To do this we need a valid track collection for those we are hoping to look at
164  for(const auto& trackLabel : fTrackProducerLabelVec)
165  {
166  art::Handle<std::vector<recob::Track> > trackHandle;
167  event.getByLabel(trackLabel, trackHandle);
168 
169  if (trackHandle.isValid())
170  {
171  // Recover the collection of associations between tracks and hits
172  art::FindManyP<recob::Hit> trackHitAssns(trackHandle, event, trackLabel);
173 
174  for(size_t trackIdx = 0; trackIdx < trackHandle->size(); trackIdx++)
175  {
176  art::Ptr<recob::Track> track(trackHandle,trackIdx);
177 
178  }
179  }
180  }
181 
182  return;
183 }
process_name use argoneut_mc_hitfinder track
std::vector< art::InputTag > fTrackProducerLabelVec
tag for finding the tracks
void BasicTrackAnalysis::BasicTrackAnalysis::initializeHists ( art::ServiceHandle< art::TFileService > &  tfs,
const std::string &  dirName 
)
overridevirtual

Interface for initializing the histograms to be filled.

Begin job method.

Parameters
TFileServicehandle to the TFile service
stringsubdirectory to store the hists in

Implements ITrackHistogramTool.

Definition at line 140 of file BasicTrackAnalysis_tool.cc.

141 {
142  // Make a directory for these histograms
143  art::TFileDirectory dir = tfs->mkdir(dirName.c_str());
144 
145  fHitsByWire[0] = dir.make<TH1D>("HitsByWire0", ";Wire #", fGeometry->Nwires(0), 0., fGeometry->Nwires(0));
146  fHitsByWire[1] = dir.make<TH1D>("HitsByWire1", ";Wire #", fGeometry->Nwires(1), 0., fGeometry->Nwires(1));
147  fHitsByWire[2] = dir.make<TH1D>("HitsByWire2", ";Wire #", fGeometry->Nwires(2), 0., fGeometry->Nwires(2));
148 
149  fPulseHVsWidth[0] = dir.make<TH2D>("PHVsWidth0", ";PH;Width", 100, 0., 100., 100, 0., 20.);
150  fPulseHVsWidth[1] = dir.make<TH2D>("PHVsWidth1", ";PH;Width", 100, 0., 100., 100, 0., 20.);
151  fPulseHVsWidth[2] = dir.make<TH2D>("PHVsWidth2", ";PH;Width", 100, 0., 100., 100, 0., 20.);
152 
153  fPulseHVsHitNo[0] = dir.make<TProfile>("PHVsNo0", ";Hit #;PH", 1000, 0., 1000., 0., 100.);
154  fPulseHVsHitNo[1] = dir.make<TProfile>("PHVsNo1", ";Hit #;PH", 1000, 0., 1000., 0., 100.);
155  fPulseHVsHitNo[2] = dir.make<TProfile>("PHVsNo2", ";Hit #;PH", 1000, 0., 1000., 0., 100.);
156 
157  return;
158 }
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
tuple dir
Definition: dropbox.py:28
art::ServiceHandle< art::TFileService > tfs
const geo::GeometryCore * fGeometry
pointer to Geometry service

Member Data Documentation

const geo::GeometryCore* BasicTrackAnalysis::BasicTrackAnalysis::fGeometry
private

pointer to Geometry service

Definition at line 100 of file BasicTrackAnalysis_tool.cc.

TH1D* BasicTrackAnalysis::BasicTrackAnalysis::fHitsByWire[3]
private

Definition at line 95 of file BasicTrackAnalysis_tool.cc.

std::string BasicTrackAnalysis::BasicTrackAnalysis::fLocalDirName
private

Directory name for histograms.

Definition at line 92 of file BasicTrackAnalysis_tool.cc.

TProfile* BasicTrackAnalysis::BasicTrackAnalysis::fPulseHVsHitNo[3]
private

Definition at line 97 of file BasicTrackAnalysis_tool.cc.

TH2D* BasicTrackAnalysis::BasicTrackAnalysis::fPulseHVsWidth[3]
private

Definition at line 96 of file BasicTrackAnalysis_tool.cc.

std::vector<art::InputTag> BasicTrackAnalysis::BasicTrackAnalysis::fTrackProducerLabelVec
private

tag for finding the tracks

Definition at line 91 of file BasicTrackAnalysis_tool.cc.


The documentation for this class was generated from the following file: