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

Public Member Functions

 HitEfficiencyAna (fhicl::ParameterSet const &pset)
 
virtual ~HitEfficiencyAna ()
 
void beginJob ()
 
void endJob ()
 
void beginRun (const art::Run &run)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void analyze (const art::Event &evt)
 
 HitEfficiencyAna (fhicl::ParameterSet const &pset)
 
virtual ~HitEfficiencyAna ()
 
void beginJob ()
 
void endJob ()
 
void beginRun (const art::Run &run)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void analyze (const art::Event &evt)
 

Private Attributes

int fEvent
 
int fRun
 
int fSubRun
 
int fNumEvents
 
int fNumCalls
 
std::vector< std::unique_ptr
< IHitEfficiencyHistogramTool > > 
fHitHistogramToolVec
 
TTree * fTree
 
const geo::GeometryCorefGeometry
 
const lariov::DetPedestalProviderfPedestalRetrievalAlg
 Keep track of an instance to the pedestal retrieval alg. More...
 

Detailed Description

Definition at line 74 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

Constructor & Destructor Documentation

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

Definition at line 131 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

132  : EDAnalyzer(parameterSet),
133  fNumCalls(0),
134  fPedestalRetrievalAlg(*lar::providerFrom<lariov::DetPedestalService>())
135 
136 {
137  fGeometry = lar::providerFrom<geo::Geometry>();
138 
139  // Read in the parameters from the .fcl file.
140  this->reconfigure(parameterSet);
141 }
const lariov::DetPedestalProvider & fPedestalRetrievalAlg
Keep track of an instance to the pedestal retrieval alg.
HitEfficiencyAna::HitEfficiencyAna::~HitEfficiencyAna ( )
virtual
HitEfficiencyAna::HitEfficiencyAna::HitEfficiencyAna ( fhicl::ParameterSet const &  pset)
explicit
virtual HitEfficiencyAna::HitEfficiencyAna::~HitEfficiencyAna ( )
virtual

Member Function Documentation

void HitEfficiencyAna::HitEfficiencyAna::analyze ( const art::Event &  evt)
void HitEfficiencyAna::HitEfficiencyAna::analyze ( const art::Event &  evt)

Definition at line 204 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

205 {
206  // Start by fetching some basic event information for our n-tuple.
207  fEvent = event.id().event();
208  fRun = ++fNumCalls; //event.run();
209  fSubRun = event.subRun();
210 
211  fNumEvents++;
212 
213  // Make a pass through all hits to make contrasting plots
214  std::cout << "-- Run: " << fRun << ", SubRun: " << fSubRun << ", Event: " << fEvent << " -------" << std::endl;
215  for(auto& hitHistTool : fHitHistogramToolVec) hitHistTool->fillHistograms(event);
216 
217  fTree->Fill();
218 
219  return;
220 }
std::vector< std::unique_ptr< IHitEfficiencyHistogramTool > > fHitHistogramToolVec
BEGIN_PROLOG could also be cout
void HitEfficiencyAna::HitEfficiencyAna::beginJob ( )
void HitEfficiencyAna::HitEfficiencyAna::beginJob ( )

Definition at line 149 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

150 {
151  // Get the detector length, to determine the maximum bin edge of one
152  // of the histograms.
153  //double detectorLength = fGeometry->DetLength();
154 
155  // Access ART's TFileService, which will handle creating and writing
156  // histograms and n-tuples for us.
157  art::ServiceHandle<art::TFileService> tfs;
158 
159  // First task is to create a TTree..
160  fTree = tfs->makeAndRegister<TTree>("HitEffic_t","Hit Efficiency Tuple");
161 
162  fTree->Branch("Run", &fRun, "Run/I");
163  fTree->Branch("SubRun", &fSubRun, "SubRun/I");
164  fTree->Branch("Event", &fEvent, "Event/I");
165 
166  // The arguments to 'make<whatever>' are the same as those passed
167  // to the 'whatever' constructor, provided 'whatever' is a ROOT
168  // class that TFileService recognizes.
169  for (auto& hitHistTool : fHitHistogramToolVec)
170  {
171  hitHistTool->initializeHists(tfs, "HitEffic");
172  hitHistTool->initializeTuple(fTree);
173  }
174 
175  // zero out the event counter
176  fNumEvents = 0;
177 }
std::vector< std::unique_ptr< IHitEfficiencyHistogramTool > > fHitHistogramToolVec
art::ServiceHandle< art::TFileService > tfs
void HitEfficiencyAna::HitEfficiencyAna::beginRun ( const art::Run &  run)
void HitEfficiencyAna::HitEfficiencyAna::beginRun ( const art::Run &  run)

Definition at line 180 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

181 {
182  // How to convert from number of electrons to GeV. The ultimate
183  // source of this conversion factor is
184  // ${LARSIM_DIR}/include/SimpleTypesAndConstants/PhysicalConstants.h.
185 // art::ServiceHandle<sim::LArG4Parameters> larParameters;
186 // fElectronsToGeV = 1./larParameters->GeVToElectrons();
187 }
void HitEfficiencyAna::HitEfficiencyAna::endJob ( )
void HitEfficiencyAna::HitEfficiencyAna::endJob ( )

Definition at line 222 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

223 {
224  // Make a call to normalize histograms if so desired
225  for(auto& hitHistTool : fHitHistogramToolVec) hitHistTool->endJob(fNumEvents);
226 
227  return;
228 }
std::vector< std::unique_ptr< IHitEfficiencyHistogramTool > > fHitHistogramToolVec
void HitEfficiencyAna::HitEfficiencyAna::reconfigure ( fhicl::ParameterSet const &  pset)
void HitEfficiencyAna::HitEfficiencyAna::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 190 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

191 {
192  // Read parameters from the .fcl file. The names in the arguments
193  // to p.get<TYPE> must match names in the .fcl file.
194  // Implement the tools for handling the responses
195  const std::vector<fhicl::ParameterSet>& hitHistogramToolVec = p.get<std::vector<fhicl::ParameterSet>>("HitEfficiencyHistogramToolList");
196 
197  for(auto& hitHistogramTool : hitHistogramToolVec)
198  fHitHistogramToolVec.push_back(art::make_tool<IHitEfficiencyHistogramTool>(hitHistogramTool));
199 
200  return;
201 }
pdgs p
Definition: selectors.fcl:22
std::vector< std::unique_ptr< IHitEfficiencyHistogramTool > > fHitHistogramToolVec

Member Data Documentation

int HitEfficiencyAna::HitEfficiencyAna::fEvent
private
const geo::GeometryCore * HitEfficiencyAna::HitEfficiencyAna::fGeometry
private
std::vector< std::unique_ptr< IHitEfficiencyHistogramTool > > HitEfficiencyAna::HitEfficiencyAna::fHitHistogramToolVec
private
int HitEfficiencyAna::HitEfficiencyAna::fNumCalls
private
int HitEfficiencyAna::HitEfficiencyAna::fNumEvents
private
const lariov::DetPedestalProvider& HitEfficiencyAna::HitEfficiencyAna::fPedestalRetrievalAlg
private

Keep track of an instance to the pedestal retrieval alg.

Definition at line 121 of file icaruscode/icaruscode/Analysis/HitEfficiencyAna_module.cc.

int HitEfficiencyAna::HitEfficiencyAna::fRun
private
int HitEfficiencyAna::HitEfficiencyAna::fSubRun
private
TTree * HitEfficiencyAna::HitEfficiencyAna::fTree
mutableprivate

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