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

Public Member Functions

 RawDigitAna (fhicl::ParameterSet const &pset)
 
virtual ~RawDigitAna ()
 
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 > fRawDigitProducerLabelVec
 
art::InputTag fSimChannelProducerLabel
 
int fEvent
 
int fRun
 
int fSubRun
 
int fNumEvents
 
std::vector< std::unique_ptr
< IRawDigitHistogramTool > > 
fRawDigitHistogramToolVec
 
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 61 of file RawDigitAna_module.cc.

Constructor & Destructor Documentation

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

Definition at line 117 of file RawDigitAna_module.cc.

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

Definition at line 130 of file RawDigitAna_module.cc.

131 {}

Member Function Documentation

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

Definition at line 183 of file RawDigitAna_module.cc.

184 {
185  // Start by fetching some basic event information for our n-tuple.
186  fEvent = event.id().event();
187  fRun = event.run();
188  fSubRun = event.subRun();
189 
190  fNumEvents++;
191 
192  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
193  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
194 
195  // Loop over RawDigits
196  for(const auto& rawDigitLabel : fRawDigitProducerLabelVec)
197  {
198  // Make a pass through all hits to make contrasting plots
199  art::Handle< std::vector<raw::RawDigit> > rawDigitHandle;
200  event.getByLabel(rawDigitLabel, rawDigitHandle);
201 
202  // Recover sim channels (if they exist) so we know when a
203  // channel has signal (or not)
204  art::Handle<std::vector<sim::SimChannel>> simChannelHandle;
205  event.getByLabel(fSimChannelProducerLabel, simChannelHandle);
206 
207  // Recover list of simChannels mapped by channel to make
208  // look up easier below
210 
211  if (simChannelHandle.isValid())
212  {
213  for(const auto& simChannel : *simChannelHandle) channelMap[simChannel.Channel()] = &simChannel;
214  }
215 
216  if (rawDigitHandle.isValid())
217  {
219  art::fill_ptr_vector(allRawDigitVec, rawDigitHandle);
220 
221  for(auto& rawDigitHistTool : fRawDigitHistogramToolVec) rawDigitHistTool->fillHistograms(clockData, detProp, allRawDigitVec,channelMap);
222  }
223  }
224 
225  return;
226 }
std::vector< art::InputTag > fRawDigitProducerLabelVec
std::map< raw::ChannelID_t, const sim::SimChannel * > SimChannelMap
std::vector< art::Ptr< raw::RawDigit >> RawDigitPtrVec
Interface for filling histograms.
art::InputTag fSimChannelProducerLabel
std::vector< std::unique_ptr< IRawDigitHistogramTool > > fRawDigitHistogramToolVec
auto const detProp
void RawDigitAna::RawDigitAna::beginJob ( )
override

Definition at line 134 of file RawDigitAna_module.cc.

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

Definition at line 156 of file RawDigitAna_module.cc.

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

Definition at line 228 of file RawDigitAna_module.cc.

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

Definition at line 166 of file RawDigitAna_module.cc.

167 {
168  // Read parameters from the .fcl file. The names in the arguments
169  // to p.get<TYPE> must match names in the .fcl file.
170  fRawDigitProducerLabelVec = p.get< std::vector<art::InputTag> >("RawDigitModuleLabel", std::vector<art::InputTag>() = {"rawdigitfilter"});
171  fSimChannelProducerLabel = p.get< std::string >("SimChannelModuleLabel", "largeant" );
172 
173  // Implement the tools for handling the responses
174  const std::vector<fhicl::ParameterSet>& rawDigitHistogramToolVec = p.get<std::vector<fhicl::ParameterSet>>("RawDigitHistogramToolList");
175 
176  for(auto& rawDigitHistogramTool : rawDigitHistogramToolVec)
177  fRawDigitHistogramToolVec.push_back(art::make_tool<IRawDigitHistogramTool>(rawDigitHistogramTool));
178 
179  return;
180 }
std::vector< art::InputTag > fRawDigitProducerLabelVec
pdgs p
Definition: selectors.fcl:22
art::InputTag fSimChannelProducerLabel
std::vector< std::unique_ptr< IRawDigitHistogramTool > > fRawDigitHistogramToolVec

Member Data Documentation

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

Definition at line 103 of file RawDigitAna_module.cc.

int RawDigitAna::RawDigitAna::fEvent
private

Definition at line 95 of file RawDigitAna_module.cc.

const geo::GeometryCore* RawDigitAna::RawDigitAna::fGeometry
private

Definition at line 106 of file RawDigitAna_module.cc.

int RawDigitAna::RawDigitAna::fNumEvents
private

Definition at line 98 of file RawDigitAna_module.cc.

const lariov::DetPedestalProvider& RawDigitAna::RawDigitAna::fPedestalRetrievalAlg
private

Keep track of an instance to the pedestal retrieval alg.

Definition at line 107 of file RawDigitAna_module.cc.

std::vector<std::unique_ptr<IRawDigitHistogramTool> > RawDigitAna::RawDigitAna::fRawDigitHistogramToolVec
private

Definition at line 101 of file RawDigitAna_module.cc.

std::vector<art::InputTag> RawDigitAna::RawDigitAna::fRawDigitProducerLabelVec
private

Definition at line 91 of file RawDigitAna_module.cc.

int RawDigitAna::RawDigitAna::fRun
private

Definition at line 96 of file RawDigitAna_module.cc.

art::InputTag RawDigitAna::RawDigitAna::fSimChannelProducerLabel
private

Definition at line 92 of file RawDigitAna_module.cc.

int RawDigitAna::RawDigitAna::fSubRun
private

Definition at line 97 of file RawDigitAna_module.cc.


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