LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
nnet::RawWaveformDump Class Reference
Inheritance diagram for nnet::RawWaveformDump:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

 RawWaveformDump (fhicl::ParameterSet const &p)
 
 RawWaveformDump (RawWaveformDump const &)=delete
 
 RawWaveformDump (RawWaveformDump &&)=delete
 
RawWaveformDumpoperator= (RawWaveformDump const &)=delete
 
RawWaveformDumpoperator= (RawWaveformDump &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () override
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Attributes

std::string fDumpWaveformsFileName
 
std::string fSimulationProducerLabel
 producer that tracked simulated part. through detector More...
 
std::string fSimChannelLabel
 module that made simchannels More...
 
std::string fDigitModuleLabel
 module that made digits More...
 
std::string fWireProducerLabel
 
bool fUseFullWaveform
 
unsigned int fShortWaveformSize
 
std::string fSelectGenLabel
 
std::string fSelectProcID
 
int fSelectPDGCode
 
std::string fPlaneToDump
 
double fMinParticleEnergyGeV
 
double fMinEnergyDepositedMeV
 
int fMinNumberOfElectrons
 
int fMaxNumberOfElectrons
 
bool fSaveSignal
 
int fMaxNoiseChannelsPerEvent
 
std::string fCollectionPlaneLabel
 
geo::WireReadoutGeom const * fWireReadoutGeom
 
art::ServiceHandle< cheat::ParticleInventoryServicePIS
 
CLHEP::RandFlat fRandFlat
 
c2numpy_writer npywriter
 

Detailed Description

Definition at line 84 of file RawWaveformDump_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

nnet::RawWaveformDump::RawWaveformDump ( fhicl::ParameterSet const &  p)
explicit

Definition at line 173 of file RawWaveformDump_module.cc.

References art::detail::EngineCreator::createEngine(), fCollectionPlaneLabel, fDigitModuleLabel, fDumpWaveformsFileName, fMaxNoiseChannelsPerEvent, fMaxNumberOfElectrons, fMinEnergyDepositedMeV, fMinNumberOfElectrons, fMinParticleEnergyGeV, fPlaneToDump, fRandFlat, fSaveSignal, fSelectGenLabel, fSelectPDGCode, fSelectProcID, fShortWaveformSize, fSimChannelLabel, fSimulationProducerLabel, fUseFullWaveform, and fWireProducerLabel.

174  : EDAnalyzer{p}
175  , fDumpWaveformsFileName(p.get<std::string>("DumpWaveformsFileName", "dumpwaveforms"))
176  , fSimulationProducerLabel(p.get<std::string>("SimulationProducerLabel", "larg4Main"))
177  , fSimChannelLabel(p.get<std::string>("SimChannelLabel", "elecDrift"))
178  , fDigitModuleLabel(p.get<std::string>("DigitModuleLabel", "simWire"))
179  , fWireProducerLabel(p.get<std::string>("WireProducerLabel"))
180  , fUseFullWaveform(p.get<bool>("UseFullWaveform", true))
181  , fShortWaveformSize(p.get<unsigned int>("ShortWaveformSize"))
182  , fSelectGenLabel(p.get<std::string>("SelectGenLabel", "ANY"))
183  , fSelectProcID(p.get<std::string>("SelectProcID", "ANY"))
184  , fSelectPDGCode(p.get<int>("SelectPDGCode", 0))
185  , fPlaneToDump(p.get<std::string>("PlaneToDump"))
186  , fMinParticleEnergyGeV(p.get<double>("MinParticleEnergyGeV", 0.))
187  , fMinEnergyDepositedMeV(p.get<double>("MinEnergyDepositedMeV", 0.))
188  , fMinNumberOfElectrons(p.get<int>("MinNumberOfElectrons", 600))
189  , fMaxNumberOfElectrons(p.get<int>("MaxNumberOfElectrons", -1))
190  , fSaveSignal(p.get<bool>("SaveSignal", true))
191  , fMaxNoiseChannelsPerEvent(p.get<int>("MaxNoiseChannelsPerEvent"))
192  , fCollectionPlaneLabel(p.get<std::string>("CollectionPlaneLabel"))
195  -> declareEngine(instanceName, p, "SeedForRawWaveformDump"),
196  "HepJamesRandom",
197  instanceName)}
198 {
199  if (std::getenv("CLUSTER") && std::getenv("PROCESS")) {
201  string(std::getenv("CLUSTER")) + "-" + string(std::getenv("PROCESS")) + "-";
202  }
203 
204  if (fDigitModuleLabel.empty() && fWireProducerLabel.empty()) {
205  throw cet::exception("RawWaveformDump")
206  << "Both DigitModuleLabel and WireProducerLabel are empty";
207  }
208 
209  if ((!fDigitModuleLabel.empty()) && (!fWireProducerLabel.empty())) {
210  throw cet::exception("RawWaveformDump")
211  << "Only one of DigitModuleLabel and WireProducerLabel should be set";
212  }
213 }
std::string fDigitModuleLabel
module that made digits
base_engine_t & createEngine(seed_t seed)
std::string fSimChannelLabel
module that made simchannels
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
std::string fSimulationProducerLabel
producer that tracked simulated part. through detector
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
nnet::RawWaveformDump::RawWaveformDump ( RawWaveformDump const &  )
delete
nnet::RawWaveformDump::RawWaveformDump ( RawWaveformDump &&  )
delete

Member Function Documentation

void nnet::RawWaveformDump::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 278 of file RawWaveformDump_module.cc.

References raw::RawDigit::ADCs(), genFinder::add(), c2numpy_float32(), c2numpy_int16(), c2numpy_int32(), c2numpy_string(), c2numpy_uint16(), c2numpy_uint32(), raw::RawDigit::Channel(), recob::Wire::Channel(), raw::RawDigit::Compression(), DEFINE_ART_MODULE, simb::MCParticle::E(), WireSigInfo::edep, art::EventID::event(), fCollectionPlaneLabel, fDigitModuleLabel, art::fill_ptr_vector(), fMaxNoiseChannelsPerEvent, fMaxNumberOfElectrons, fMinEnergyDepositedMeV, fMinNumberOfElectrons, fMinParticleEnergyGeV, fPlaneToDump, fRandFlat, fSaveSignal, fSelectGenLabel, fSelectPDGCode, fSelectProcID, fShortWaveformSize, fSimChannelLabel, fSimulationProducerLabel, fUseFullWaveform, fWireProducerLabel, fWireReadoutGeom, WireSigInfo::genlab, genFinder::get_gen(), art::ProductRetriever::getByLabel(), art::ProductRetriever::getMany(), raw::RawDigit::GetPedestal(), art::ProductRetriever::getValidHandle(), art::Event::id(), raw::InvalidChannelID, npywriter, WireSigInfo::numel, WireSigInfo::pdgcode, simb::MCParticle::PdgCode(), PIS, simb::MCParticle::Process(), WireSigInfo::procid, art::EventID::run(), raw::RawDigit::Samples(), seed, recob::Wire::Signal(), util::size(), art::EventID::subRun(), WireSigInfo::tdcmax, WireSigInfo::tdcmin, cheat::ParticleInventoryService::TrackIdToEveTrackId(), cheat::ParticleInventoryService::TrackIdToMotherParticle(), raw::Uncompress(), geo::WireReadoutGeom::View(), and geo::PlaneGeo::ViewName().

279 {
280  cout << "Event "
281  << " " << evt.id().run() << " " << evt.id().subRun() << " " << evt.id().event() << endl;
282 
283  std::unique_ptr<genFinder> gf(new genFinder());
284 
285  // ... Read in the digit List object(s).
287  std::vector<art::Ptr<raw::RawDigit>> rawdigitlist;
288  if (evt.getByLabel(fDigitModuleLabel, digitVecHandle)) {
289  art::fill_ptr_vector(rawdigitlist, digitVecHandle);
290  }
291 
292  // ... Read in the wire List object(s).
293  art::Handle<std::vector<recob::Wire>> wireListHandle;
294  std::vector<art::Ptr<recob::Wire>> wirelist;
295  if (evt.getByLabel(fWireProducerLabel, wireListHandle)) {
296  art::fill_ptr_vector(wirelist, wireListHandle);
297  }
298 
299  if (rawdigitlist.empty() && wirelist.empty()) return;
300  if (rawdigitlist.size() && wirelist.size()) return;
301 
302  // channel status
303  lariov::ChannelStatusProvider const& channelStatus =
305 
306  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
307  auto const detProp =
309 
310  // ... Use the handle to get a particular (0th) element of collection.
311  unsigned int dataSize;
312  if (rawdigitlist.size()) {
313  art::Ptr<raw::RawDigit> digitVec0(digitVecHandle, 0);
314  dataSize = digitVec0->Samples(); //size of raw data vectors
315  }
316  else {
317  dataSize = (wirelist[0]->Signal()).size();
318  }
319  if (dataSize != detProp.ReadOutWindowSize()) {
320  std::cout << "!!!!! Bad dataSize: " << dataSize << std::endl;
321  return;
322  }
323 
324  // ... Build a map from channel number -> rawdigitVec
325  std::map<raw::ChannelID_t, art::Ptr<raw::RawDigit>> rawdigitMap;
326  raw::ChannelID_t chnum = raw::InvalidChannelID; // channel number
327  if (rawdigitlist.size()) {
328  for (size_t rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter) {
329  art::Ptr<raw::RawDigit> digitVec(digitVecHandle, rdIter);
330  chnum = digitVec->Channel();
331  if (chnum == raw::InvalidChannelID) continue;
332  rawdigitMap[chnum] = digitVec;
333  }
334  }
335  // ... Build a map from channel number -> wire
336  std::map<raw::ChannelID_t, art::Ptr<recob::Wire>> wireMap;
337  if (wirelist.size()) {
338  for (size_t ich = 0; ich < wirelist.size(); ++ich) {
339  art::Ptr<recob::Wire> wire = wirelist[ich];
340  chnum = wire->Channel();
341  if (chnum == raw::InvalidChannelID) continue;
342  wireMap[chnum] = wire;
343  }
344  }
345 
346  // ... Read in MC particle list
348  if (!evt.getByLabel(fSimulationProducerLabel, particleHandle)) {
349  throw cet::exception("AnalysisExample")
350  << " No simb::MCParticle objects in this event - "
351  << " Line " << __LINE__ << " in file " << __FILE__ << std::endl;
352  }
353 
354  // ... Read in sim channel list
355  auto simChannelHandle = evt.getValidHandle<std::vector<sim::SimChannel>>(fSimChannelLabel);
356 
357  if (!simChannelHandle->size()) return;
358 
359  // ... Create a map of track IDs to generator labels
360  auto mcHandles = evt.getMany<std::vector<simb::MCTruth>>();
361  std::vector<std::pair<int, std::string>> track_id_to_label;
362 
363  for (auto const& mcHandle : mcHandles) {
364  const std::string& sModuleLabel = mcHandle.provenance()->moduleLabel();
366  std::vector<art::Ptr<simb::MCParticle>> mcParts = findMCParts.at(0);
367  for (const art::Ptr<simb::MCParticle> ptr : mcParts) {
368  int track_id = ptr->TrackId();
369  gf->add(track_id, sModuleLabel);
370  }
371  }
372 
373  std::string dummystr6 = "none ";
374  std::string dummystr7 = "none ";
375 
376  if (fSaveSignal) {
377  // .. create a channel number to trackid-wire signal info map
378  std::map<raw::ChannelID_t, std::map<int, WireSigInfo>> Ch2TrkWSInfoMap;
379 
380  // .. create a track ID to vector of channel numbers (in w/c this track deposited energy) map
381  std::map<int, std::vector<raw::ChannelID_t>> Trk2ChVecMap;
382 
383  // ... Loop over simChannels
384  for (auto const& channel : (*simChannelHandle)) {
385 
386  // .. get simChannel channel number
387  const raw::ChannelID_t ch1 = channel.Channel();
388  if (ch1 == raw::InvalidChannelID) continue;
389  if (geo::PlaneGeo::ViewName(fWireReadoutGeom->View(ch1)) != fPlaneToDump[0]) continue;
390 
391  bool selectThisChannel = false;
392 
393  // .. create a track ID to wire signal info map
394  std::map<int, WireSigInfo> Trk2WSInfoMap;
395 
396  // ... Loop over all ticks with ionization energy deposited
397  auto const& timeSlices = channel.TDCIDEMap();
398  for (auto const& timeSlice : timeSlices) {
399 
400  auto const& energyDeposits = timeSlice.second;
401  auto const tpctime = timeSlice.first;
402  unsigned int tdctick = static_cast<unsigned int>(clockData.TPCTDC2Tick(double(tpctime)));
403  if (tdctick < 0 || tdctick > (dataSize - 1)) continue;
404 
405  // ... Loop over all energy depositions in this tick
406  for (auto const& energyDeposit : energyDeposits) {
407 
408  if (!energyDeposit.trackID) continue;
409  int trkid = energyDeposit.trackID;
410  simb::MCParticle particle = PIS->TrackIdToMotherParticle(trkid);
411 
412  // .. ignore this energy deposition if incident particle energy below some threshold
413  if (particle.E() < fMinParticleEnergyGeV) continue;
414 
415  int eve_id = PIS->TrackIdToEveTrackId(trkid);
416  if (!eve_id) continue;
417  std::string genlab = gf->get_gen(eve_id);
418 
419  if (Trk2WSInfoMap.find(trkid) == Trk2WSInfoMap.end()) {
420  WireSigInfo wsinf;
421  wsinf.pdgcode = particle.PdgCode();
422  wsinf.genlab = genlab;
423  wsinf.procid = particle.Process();
424  wsinf.tdcmin = dataSize - 1;
425  wsinf.tdcmax = 0;
426  wsinf.edep = 0.;
427  wsinf.numel = 0;
428  Trk2WSInfoMap.insert(std::pair<int, WireSigInfo>(trkid, wsinf));
429  }
430  if (tdctick < Trk2WSInfoMap.at(trkid).tdcmin) Trk2WSInfoMap.at(trkid).tdcmin = tdctick;
431  if (tdctick > Trk2WSInfoMap.at(trkid).tdcmax) Trk2WSInfoMap.at(trkid).tdcmax = tdctick;
432  Trk2WSInfoMap.at(trkid).edep += energyDeposit.energy;
433  Trk2WSInfoMap.at(trkid).numel += energyDeposit.numElectrons;
434  }
435  }
436 
437  if (!Trk2WSInfoMap.empty()) {
438  for (std::pair<int, WireSigInfo> itmap : Trk2WSInfoMap) {
439  if (fSelectGenLabel != "ANY") {
440  if (itmap.second.genlab != fSelectGenLabel) continue;
441  }
442  if (fSelectProcID != "ANY") {
443  if (itmap.second.procid != fSelectProcID) continue;
444  }
445  if (fSelectPDGCode != 0) {
446  if (itmap.second.pdgcode != fSelectPDGCode) continue;
447  }
448  itmap.second.genlab.resize(6, ' ');
449  itmap.second.procid.resize(7, ' ');
450  if (itmap.second.numel >= fMinNumberOfElectrons &&
451  itmap.second.edep >= fMinEnergyDepositedMeV) {
452  if (fMaxNumberOfElectrons >= 0 && itmap.second.numel >= fMaxNumberOfElectrons) {
453  continue;
454  }
455  else {
456  int trkid = itmap.first;
457  if (Trk2ChVecMap.find(trkid) == Trk2ChVecMap.end()) {
458  std::vector<raw::ChannelID_t> chvec;
459  Trk2ChVecMap.insert(std::pair<int, std::vector<raw::ChannelID_t>>(trkid, chvec));
460  }
461  Trk2ChVecMap.at(trkid).push_back(ch1);
462  selectThisChannel = true;
463  }
464  }
465  } // loop over Trk2WSinfoMap
466  if (selectThisChannel) {
467  Ch2TrkWSInfoMap.insert(
468  std::pair<raw::ChannelID_t, std::map<int, WireSigInfo>>(ch1, Trk2WSInfoMap));
469  }
470  } // if Trk2WSInfoMap not empty
471 
472  } // loop over SimChannels
473 
474  std::set<raw::ChannelID_t> selected_channels;
475 
476  // ... Now write out the signal waveforms for each track
477  if (!Trk2ChVecMap.empty()) {
478  for (auto const& ittrk : Trk2ChVecMap) {
479  int i = fRandFlat.fireInt(
480  ittrk.second.size()); // randomly select one channel with a signal from this particle
481  chnum = ittrk.second[i];
482 
483  if (not selected_channels.insert(chnum).second) { continue; }
484 
485  std::map<raw::ChannelID_t, std::map<int, WireSigInfo>>::iterator itchn;
486  itchn = Ch2TrkWSInfoMap.find(chnum);
487  if (itchn != Ch2TrkWSInfoMap.end()) {
488 
489  std::vector<short> adcvec(dataSize); // vector to hold zero-padded full waveform
490 
491  if (rawdigitlist.size()) {
492  auto search = rawdigitMap.find(chnum);
493  if (search == rawdigitMap.end()) continue;
494  art::Ptr<raw::RawDigit> rawdig = (*search).second;
495  std::vector<short> rawadc(dataSize); // vector to hold uncompressed adc values later
496  raw::Uncompress(rawdig->ADCs(), rawadc, rawdig->GetPedestal(), rawdig->Compression());
497  for (size_t j = 0; j < rawadc.size(); ++j) {
498  adcvec[j] = rawadc[j] - rawdig->GetPedestal();
499  }
500  }
501  else if (wirelist.size()) {
502  auto search = wireMap.find(chnum);
503  if (search == wireMap.end()) continue;
504  art::Ptr<recob::Wire> wire = (*search).second;
505  const auto& signal = wire->Signal();
506  for (size_t j = 0; j < adcvec.size(); ++j) {
507  adcvec[j] = signal[j];
508  }
509  }
510 
511  // .. write out info for each peak
512  // a full waveform has at least one peak; the output will save up to 5 peaks (if there is
513  // only 1 peak, will fill the other 4 with 0);
514  // for fShortWaveformSize: only use the first peak's start_tick
515 
516  if (fUseFullWaveform) {
517 
518  c2numpy_uint32(&npywriter, evt.id().event());
519  c2numpy_uint32(&npywriter, chnum);
522  c2numpy_uint16(&npywriter, itchn->second.size()); // size of Trk2WSInfoMap, or #peaks
523  unsigned int icnt = 0;
524  for (auto const& it : itchn->second) {
525  c2numpy_int32(&npywriter, it.first); // trackid
526  c2numpy_int32(&npywriter, it.second.pdgcode); // pdgcode
527  c2numpy_string(&npywriter, it.second.genlab.c_str()); // genlab
528  c2numpy_string(&npywriter, it.second.procid.c_str()); // procid
529  c2numpy_float32(&npywriter, it.second.edep); // edepo
530  c2numpy_uint32(&npywriter, it.second.numel); // numelec
531 
532  c2numpy_uint16(&npywriter, it.second.tdcmin); // stck1
533  c2numpy_uint16(&npywriter, it.second.tdcmax); // stc2
534 
535  icnt++;
536  if (icnt == 5) break;
537  }
538 
539  // .. pad with 0's if number of peaks less than 5
540  for (unsigned int i = icnt; i < 5; ++i) {
543  c2numpy_string(&npywriter, dummystr6.c_str());
544  c2numpy_string(&npywriter, dummystr7.c_str());
549  }
550 
551  for (unsigned int itck = 0; itck < dataSize; ++itck) {
552  c2numpy_int16(&npywriter, adcvec[itck]);
553  }
554  }
555  else {
556 
557  // .. first loop to find largest signal
558  double EDep = 0.;
559  unsigned int TDCMin, TDCMax;
560  bool foundmaxsig = false;
561  for (auto& it : itchn->second) {
562  if (it.second.edep > EDep && it.second.numel > 0) {
563  EDep = it.second.edep;
564  TDCMin = it.second.tdcmin;
565  TDCMax = it.second.tdcmax;
566  foundmaxsig = true;
567  }
568  }
569  if (foundmaxsig) {
570  int sigtdc1, sigtdc2, sighwid, sigfwid, sigtdcm;
572  sigtdc1 = TDCMin - 14 / 2;
573  sigtdc2 = TDCMax + 3 * 14 / 2;
574  }
575  else {
576  sigtdc1 = TDCMin - 32 / 2;
577  sigtdc2 = TDCMax + 32 / 2;
578  }
579  sigfwid = sigtdc2 - sigtdc1;
580  sighwid = sigfwid / 2;
581  sigtdcm = sigtdc1 + sighwid;
582 
583  int start_tick = -1;
584  int end_tick = -1;
585  // .. set window edges to contain the largest signal
586  if (sigfwid < (int)fShortWaveformSize) {
587  // --> case 1: signal range fits within window
588  int dt = fShortWaveformSize - sigfwid;
589  start_tick = sigtdc1 - dt * fRandFlat.fire(0, 1);
590  }
591  else {
592  // --> case 2: signal range larger than window
593  int mrgn = fShortWaveformSize / 20;
594  int dt = fShortWaveformSize - 2 * mrgn;
595  start_tick = sigtdcm - mrgn - dt * fRandFlat.fire(0, 1);
596  }
597  if (start_tick < 0) start_tick = 0;
598  end_tick = start_tick + fShortWaveformSize - 1;
599  if (end_tick > int(dataSize - 1)) {
600  end_tick = dataSize - 1;
601  start_tick = end_tick - fShortWaveformSize + 1;
602  }
603 
604  c2numpy_uint32(&npywriter, evt.id().event());
605  c2numpy_uint32(&npywriter, chnum);
608 
609  // .. second loop to select only signals that are within the window
610 
611  int it_trk[5], it_pdg[5], it_nel[5];
612  unsigned int stck_1[5], stck_2[5];
613  std::string it_glb[5], it_prc[5];
614  double it_edp[5];
615 
616  unsigned int icnt = 0;
617 
618  for (auto& it : itchn->second) {
619  if ((it.second.tdcmin >= (unsigned int)start_tick &&
620  it.second.tdcmin < (unsigned int)end_tick) ||
621  (it.second.tdcmax > (unsigned int)start_tick &&
622  it.second.tdcmax <= (unsigned int)end_tick)) {
623 
624  it_trk[icnt] = it.first;
625  it_pdg[icnt] = it.second.pdgcode;
626  it_glb[icnt] = it.second.genlab;
627  it_prc[icnt] = it.second.procid;
628  it_edp[icnt] = it.second.edep;
629  it_nel[icnt] = it.second.numel;
630 
631  unsigned int mintdc = it.second.tdcmin;
632  unsigned int maxtdc = it.second.tdcmax;
633  if (mintdc < (unsigned int)start_tick) mintdc = start_tick;
634  if (maxtdc > (unsigned int)end_tick) maxtdc = end_tick;
635 
636  stck_1[icnt] = mintdc - start_tick;
637  stck_2[icnt] = maxtdc - start_tick;
638 
639  icnt++;
640  if (icnt == 5) break;
641  }
642  }
643 
644  c2numpy_uint16(&npywriter, icnt); // number of peaks
645 
646  for (unsigned int i = 0; i < icnt; ++i) {
647  c2numpy_int32(&npywriter, it_trk[i]); // trackid
648  c2numpy_int32(&npywriter, it_pdg[i]); // pdgcode
649  c2numpy_string(&npywriter, it_glb[i].c_str()); // genlab
650  c2numpy_string(&npywriter, it_prc[i].c_str()); // procid
651  c2numpy_float32(&npywriter, it_edp[i]); // edepo
652  c2numpy_uint32(&npywriter, it_nel[i]); // numelec
653  c2numpy_uint16(&npywriter, stck_1[i]); // stck1
654  c2numpy_uint16(&npywriter, stck_2[i]); // stck2
655  }
656 
657  // .. pad with 0's if number of peaks less than 5
658  for (unsigned int i = icnt; i < 5; ++i) {
661  c2numpy_string(&npywriter, dummystr6.c_str());
662  c2numpy_string(&npywriter, dummystr7.c_str());
667  }
668 
669  for (unsigned int itck = start_tick; itck < (start_tick + fShortWaveformSize);
670  ++itck) {
671  c2numpy_int16(&npywriter, adcvec[itck]);
672  }
673 
674  } // foundmaxsig
675  }
676  }
677  }
678  }
679  }
680  else {
681  //save noise
682  int noisechancount = 0;
683  std::map<raw::ChannelID_t, bool> signalMap;
684  for (auto const& channel : (*simChannelHandle)) {
685  signalMap[channel.Channel()] = true;
686  }
687  // .. create a vector for shuffling the wire channel indices
688  auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count();
689  size_t nchan = (rawdigitlist.empty() ? wirelist.size() : rawdigitlist.size());
690  std::vector<size_t> randigitmap;
691  for (size_t i = 0; i < nchan; ++i)
692  randigitmap.push_back(i);
693  std::shuffle(randigitmap.begin(), randigitmap.end(), std::mt19937(seed));
694 
695  for (size_t rdIter = 0; rdIter < (rawdigitlist.empty() ? wirelist.size() : rawdigitlist.size());
696  ++rdIter) {
697 
698  if (noisechancount == fMaxNoiseChannelsPerEvent) break;
699 
700  std::vector<short> adcvec(dataSize); // vector to wire adc values
701  if (rawdigitlist.size()) {
702  size_t ranIdx = randigitmap[rdIter];
703  art::Ptr<raw::RawDigit> digitVec(digitVecHandle, ranIdx);
704  if (signalMap[digitVec->Channel()]) continue;
705 
706  std::vector<short> rawadc(dataSize); // vector to hold uncompressed adc values later
707  if (geo::PlaneGeo::ViewName(fWireReadoutGeom->View(digitVec->Channel())) != fPlaneToDump[0])
708  continue;
709  raw::Uncompress(digitVec->ADCs(), rawadc, digitVec->GetPedestal(), digitVec->Compression());
710  for (size_t j = 0; j < rawadc.size(); ++j) {
711  adcvec[j] = rawadc[j] - digitVec->GetPedestal();
712  }
713  c2numpy_uint32(&npywriter, evt.id().event());
714  c2numpy_uint32(&npywriter, digitVec->Channel());
716  &npywriter, geo::PlaneGeo::ViewName(fWireReadoutGeom->View(digitVec->Channel())).c_str());
717  }
718  else if (wirelist.size()) {
719  size_t ranIdx = randigitmap[rdIter];
720  art::Ptr<recob::Wire> wire = wirelist[ranIdx];
721  if (signalMap[wire->Channel()]) continue;
722  if (channelStatus.IsBad(wire->Channel())) continue;
724  continue;
725  const auto& signal = wire->Signal();
726  for (size_t j = 0; j < adcvec.size(); ++j) {
727  adcvec[j] = signal[j];
728  }
729  c2numpy_uint32(&npywriter, evt.id().event());
730  c2numpy_uint32(&npywriter, wire->Channel());
733  }
734 
735  c2numpy_uint16(&npywriter, 0); //number of peaks
736  for (unsigned int i = 0; i < 5; ++i) {
739  c2numpy_string(&npywriter, dummystr6.c_str());
740  c2numpy_string(&npywriter, dummystr7.c_str());
745  }
746 
747  if (fUseFullWaveform) {
748  for (unsigned int itck = 0; itck < dataSize; ++itck) {
749  c2numpy_int16(&npywriter, adcvec[itck]);
750  }
751  }
752  else {
753  int start_tick = int((dataSize - fShortWaveformSize) * fRandFlat.fire(0, 1));
754  for (unsigned int itck = start_tick; itck < (start_tick + fShortWaveformSize); ++itck) {
755  c2numpy_int16(&npywriter, adcvec[itck]);
756  }
757  }
758 
759  ++noisechancount;
760  }
761  std::cout << "Total number of noise channels " << noisechancount << std::endl;
762  }
763 }
double E(const int i=0) const
Definition: MCParticle.h:234
float GetPedestal() const
Definition: RawDigit.h:221
std::string fDigitModuleLabel
module that made digits
int c2numpy_int32(c2numpy_writer *writer, int32_t data)
Definition: c2numpy.h:298
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Definition: RawDigit.h:209
int PdgCode() const
Definition: MCParticle.h:213
unsigned int event
Definition: DataStructs.h:626
static std::string ViewName(View_t view)
Returns the name of the specified view.
Definition: PlaneGeo.cxx:584
unsigned int run
Definition: DataStructs.h:627
std::string fSimChannelLabel
module that made simchannels
std::string Process() const
Definition: MCParticle.h:216
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
geo::WireReadoutGeom const * fWireReadoutGeom
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
long seed
Definition: chem4.cc:67
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:223
int c2numpy_uint32(c2numpy_writer *writer, uint32_t data)
Definition: c2numpy.h:334
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: Wire.cxx:30
int c2numpy_float32(c2numpy_writer *writer, float data)
Definition: c2numpy.h:369
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Definition: RawDigit.h:229
simb::MCParticle TrackIdToMotherParticle(int const id) const
View_t View(raw::ChannelID_t const channel) const
Returns the view (wire orientation) on the specified TPC channel.
int c2numpy_uint16(c2numpy_writer *writer, uint16_t data)
Definition: c2numpy.h:325
int c2numpy_int16(c2numpy_writer *writer, int16_t data)
Definition: c2numpy.h:289
unsigned int subRun
Definition: DataStructs.h:628
art::ServiceHandle< cheat::ParticleInventoryService > PIS
TCEvent evt
Definition: DataStructs.cxx:8
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:306
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:744
std::string fSimulationProducerLabel
producer that tracked simulated part. through detector
int c2numpy_string(c2numpy_writer *writer, const char *data)
Definition: c2numpy.h:411
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void nnet::RawWaveformDump::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 216 of file RawWaveformDump_module.cc.

References c2numpy_addcolumn(), C2NUMPY_FLOAT32, c2numpy_init(), C2NUMPY_INT16, C2NUMPY_INT32, C2NUMPY_STRING, C2NUMPY_UINT16, C2NUMPY_UINT32, fDumpWaveformsFileName, fShortWaveformSize, fUseFullWaveform, and npywriter.

217 {
218  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
219 
225 
226  for (unsigned int i = 0; i < 5; i++) {
227  std::ostringstream name;
228 
229  name.str("");
230  name << "tid" << i;
231  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_INT32);
232 
233  name.str("");
234  name << "pdg" << i;
235  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_INT32);
236 
237  name.str("");
238  name << "gen" << i;
239  c2numpy_addcolumn(&npywriter, name.str().c_str(), (c2numpy_type)((int)C2NUMPY_STRING + 6));
240 
241  name.str("");
242  name << "pid" << i;
243  c2numpy_addcolumn(&npywriter, name.str().c_str(), (c2numpy_type)((int)C2NUMPY_STRING + 7));
244 
245  name.str("");
246  name << "edp" << i;
247  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_FLOAT32);
248 
249  name.str("");
250  name << "nel" << i;
251  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_UINT32);
252 
253  name.str("");
254  name << "sti" << i;
255  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_UINT16);
256 
257  name.str("");
258  name << "stf" << i;
259  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_UINT16);
260  }
261 
262  for (unsigned int i = 0;
263  i < (fUseFullWaveform ? detProp.ReadOutWindowSize() : fShortWaveformSize);
264  i++) {
265  std::ostringstream name;
266  name << "tck_" << i;
267  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_INT16);
268  }
269 }
int c2numpy_init(c2numpy_writer *writer, const std::string outputFilePrefix, int32_t numRowsPerFile)
Definition: c2numpy.h:140
c2numpy_type
Definition: c2numpy.h:29
int c2numpy_addcolumn(c2numpy_writer *writer, const std::string name, c2numpy_type type)
Definition: c2numpy.h:157
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 100 of file Analyzer.cc.

References e, and art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

48  {
49  ProcessingFrame const frame{ScheduleID{}};
51  }
TFile fb("Li6.root")
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

62  {
63  ProcessingFrame const frame{ScheduleID{}};
65  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

41  {
42  ProcessingFrame const frame{ScheduleID{}};
44  }
TFile fb("Li6.root")
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void nnet::RawWaveformDump::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 272 of file RawWaveformDump_module.cc.

References c2numpy_close(), and npywriter.

273 {
275 }
int c2numpy_close(c2numpy_writer *writer)
Definition: c2numpy.h:425
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
RawWaveformDump& nnet::RawWaveformDump::operator= ( RawWaveformDump const &  )
delete
RawWaveformDump& nnet::RawWaveformDump::operator= ( RawWaveformDump &&  )
delete
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79

Member Data Documentation

std::string nnet::RawWaveformDump::fCollectionPlaneLabel
private

Definition at line 123 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fDigitModuleLabel
private

module that made digits

Definition at line 108 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fDumpWaveformsFileName
private

Definition at line 104 of file RawWaveformDump_module.cc.

Referenced by beginJob(), and RawWaveformDump().

int nnet::RawWaveformDump::fMaxNoiseChannelsPerEvent
private

Definition at line 122 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

int nnet::RawWaveformDump::fMaxNumberOfElectrons
private

Definition at line 120 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

double nnet::RawWaveformDump::fMinEnergyDepositedMeV
private

Definition at line 118 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

int nnet::RawWaveformDump::fMinNumberOfElectrons
private

Definition at line 119 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

double nnet::RawWaveformDump::fMinParticleEnergyGeV
private

Definition at line 117 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fPlaneToDump
private

Definition at line 116 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

CLHEP::RandFlat nnet::RawWaveformDump::fRandFlat
private

Definition at line 128 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

bool nnet::RawWaveformDump::fSaveSignal
private

Definition at line 121 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fSelectGenLabel
private

Definition at line 113 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

int nnet::RawWaveformDump::fSelectPDGCode
private

Definition at line 115 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fSelectProcID
private

Definition at line 114 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

unsigned int nnet::RawWaveformDump::fShortWaveformSize
private

Definition at line 111 of file RawWaveformDump_module.cc.

Referenced by analyze(), beginJob(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fSimChannelLabel
private

module that made simchannels

Definition at line 107 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fSimulationProducerLabel
private

producer that tracked simulated part. through detector

Definition at line 106 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

bool nnet::RawWaveformDump::fUseFullWaveform
private

Definition at line 110 of file RawWaveformDump_module.cc.

Referenced by analyze(), beginJob(), and RawWaveformDump().

std::string nnet::RawWaveformDump::fWireProducerLabel
private

Definition at line 109 of file RawWaveformDump_module.cc.

Referenced by analyze(), and RawWaveformDump().

geo::WireReadoutGeom const* nnet::RawWaveformDump::fWireReadoutGeom
private
Initial value:

Definition at line 124 of file RawWaveformDump_module.cc.

Referenced by analyze().

c2numpy_writer nnet::RawWaveformDump::npywriter
private

Definition at line 130 of file RawWaveformDump_module.cc.

Referenced by analyze(), beginJob(), and endJob().

art::ServiceHandle<cheat::ParticleInventoryService> nnet::RawWaveformDump::PIS
private

Definition at line 126 of file RawWaveformDump_module.cc.

Referenced by analyze().


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