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

Public Member Functions

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

Private Attributes

std::vector< art::InputTag > fWireProducerLabelVec
 
art::InputTag fSimChannelProducerLabel
 
int fEvent
 
int fRun
 
int fSubRun
 
int fNumEvents
 
std::vector< std::unique_ptr
< IWireHistogramTool > > 
fWireHistogramToolVec
 
std::vector< std::vector
< double > > 
fChannelPedVec
 
const geo::GeometryCorefGeometry
 
const lariov::DetPedestalProviderfPedestalRetrievalAlg
 Keep track of an instance to the pedestal retrieval alg. More...
 

Detailed Description

Definition at line 60 of file WireAna_module.cc.

Constructor & Destructor Documentation

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

Definition at line 116 of file WireAna_module.cc.

117  : EDAnalyzer(parameterSet),
118  fPedestalRetrievalAlg(*lar::providerFrom<lariov::DetPedestalService>())
119 
120 {
121  fGeometry = lar::providerFrom<geo::Geometry>();
122 
123  // Read in the parameters from the .fcl file.
124  this->reconfigure(parameterSet);
125 }
const geo::GeometryCore * fGeometry
void reconfigure(fhicl::ParameterSet const &pset)
const lariov::DetPedestalProvider & fPedestalRetrievalAlg
Keep track of an instance to the pedestal retrieval alg.
WireAna::WireAna::~WireAna ( )
virtual

Definition at line 129 of file WireAna_module.cc.

130 {}

Member Function Documentation

void WireAna::WireAna::analyze ( const art::Event &  evt)
override

Definition at line 180 of file WireAna_module.cc.

181 {
182  // Start by fetching some basic event information for our n-tuple.
183  fEvent = event.id().event();
184  fRun = event.run();
185  fSubRun = event.subRun();
186 
187  fNumEvents++;
188 
189  // Loop over input list of wire producers
190  for(const auto& wireLabel : fWireProducerLabelVec)
191  {
192  // Make a pass through all hits to make contrasting plots
193  art::Handle< std::vector<recob::Wire> > wireHandle;
194  event.getByLabel(wireLabel, wireHandle);
195 
196  // Recover sim channels (if they exist) so we know when a
197  // channel has signal (or not)
198  art::Handle<std::vector<sim::SimChannel>> simChannelHandle;
199  event.getByLabel(fSimChannelProducerLabel, simChannelHandle);
200 
201  // Recover list of simChannels mapped by channel to make
202  // look up easier below
204 
205  if (simChannelHandle.isValid())
206  {
207  for(const auto& simChannel : *simChannelHandle) channelMap[simChannel.Channel()] = &simChannel;
208 // {
209 // raw::ChannelID_t channel = simChannel.Channel();
210 // const sim::SimChannel* simChannelPtr = &simChannel;
211 //
212 // channelMap.at(channel) = simChannelPtr;
213 // }
214  }
215 
216  if (wireHandle.isValid())
217  {
219  art::fill_ptr_vector(wireVec, wireHandle);
220 
221  for(auto& wireHistTool : fWireHistogramToolVec) wireHistTool->fillHistograms(wireVec,channelMap,fNumEvents);
222  }
223  }
224 
225  return;
226 }
std::vector< std::unique_ptr< IWireHistogramTool > > fWireHistogramToolVec
std::vector< art::Ptr< recob::Wire >> WirePtrVec
Interface for filling histograms.
std::vector< art::InputTag > fWireProducerLabelVec
std::map< raw::ChannelID_t, const sim::SimChannel * > SimChannelMap
art::InputTag fSimChannelProducerLabel
void WireAna::WireAna::beginJob ( )
override

Definition at line 133 of file WireAna_module.cc.

134 {
135  // Get the detector length, to determine the maximum bin edge of one
136  // of the histograms.
137  //double detectorLength = fGeometry->DetLength();
138 
139  // Access ART's TFileService, which will handle creating and writing
140  // histograms and n-tuples for us.
141  art::ServiceHandle<art::TFileService> tfs;
142 
143  // The arguments to 'make<whatever>' are the same as those passed
144  // to the 'whatever' constructor, provided 'whatever' is a ROOT
145  // class that TFileService recognizes.
146  for (auto& wireHistTool : fWireHistogramToolVec) wireHistTool->initializeHists(tfs, "WireAna");
147 
148  // zero out the event counter
149  fNumEvents = 0;
150 }
std::vector< std::unique_ptr< IWireHistogramTool > > fWireHistogramToolVec
art::ServiceHandle< art::TFileService > tfs
void WireAna::WireAna::beginRun ( const art::Run &  run)
override

Definition at line 153 of file WireAna_module.cc.

154 {
155  // How to convert from number of electrons to GeV. The ultimate
156  // source of this conversion factor is
157  // ${LARSIM_DIR}/include/SimpleTypesAndConstants/PhysicalConstants.h.
158 // art::ServiceHandle<sim::LArG4Parameters> larParameters;
159 // fElectronsToGeV = 1./larParameters->GeVToElectrons();
160 }
void WireAna::WireAna::endJob ( )
override

Definition at line 228 of file WireAna_module.cc.

229 {
230  // Make a call to normalize histograms if so desired
231  for(auto& wireHistTool : fWireHistogramToolVec) wireHistTool->endJob(fNumEvents);
232 
233  return;
234 }
std::vector< std::unique_ptr< IWireHistogramTool > > fWireHistogramToolVec
void WireAna::WireAna::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 163 of file WireAna_module.cc.

164 {
165  // Read parameters from the .fcl file. The names in the arguments
166  // to p.get<TYPE> must match names in the .fcl file.
167  fWireProducerLabelVec = p.get< std::vector<art::InputTag> >("WireModuleLabel", std::vector<art::InputTag>() = {"recowire"});
168  fSimChannelProducerLabel = p.get< std::string >("SimChannelModuleLabel", "daq" );
169 
170  // Implement the tools for handling the responses
171  const std::vector<fhicl::ParameterSet>& wireHistogramToolVec = p.get<std::vector<fhicl::ParameterSet>>("WireHistogramToolList");
172 
173  for(auto& wireHistogramTool : wireHistogramToolVec)
174  fWireHistogramToolVec.push_back(art::make_tool<IWireHistogramTool>(wireHistogramTool));
175 
176  return;
177 }
std::vector< std::unique_ptr< IWireHistogramTool > > fWireHistogramToolVec
pdgs p
Definition: selectors.fcl:22
std::vector< art::InputTag > fWireProducerLabelVec
art::InputTag fSimChannelProducerLabel

Member Data Documentation

std::vector<std::vector<double> > WireAna::WireAna::fChannelPedVec
private

Definition at line 102 of file WireAna_module.cc.

int WireAna::WireAna::fEvent
private

Definition at line 94 of file WireAna_module.cc.

const geo::GeometryCore* WireAna::WireAna::fGeometry
private

Definition at line 105 of file WireAna_module.cc.

int WireAna::WireAna::fNumEvents
private

Definition at line 97 of file WireAna_module.cc.

const lariov::DetPedestalProvider& WireAna::WireAna::fPedestalRetrievalAlg
private

Keep track of an instance to the pedestal retrieval alg.

Definition at line 106 of file WireAna_module.cc.

int WireAna::WireAna::fRun
private

Definition at line 95 of file WireAna_module.cc.

art::InputTag WireAna::WireAna::fSimChannelProducerLabel
private

Definition at line 91 of file WireAna_module.cc.

int WireAna::WireAna::fSubRun
private

Definition at line 96 of file WireAna_module.cc.

std::vector<std::unique_ptr<IWireHistogramTool> > WireAna::WireAna::fWireHistogramToolVec
private

Definition at line 100 of file WireAna_module.cc.

std::vector<art::InputTag> WireAna::WireAna::fWireProducerLabelVec
private

Definition at line 90 of file WireAna_module.cc.


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