LArSoft  v09_90_00
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
 
art::ServiceHandle< geo::Geometryfgeom
 
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 172 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.

173  : EDAnalyzer{p}
174  , fDumpWaveformsFileName(p.get<std::string>("DumpWaveformsFileName", "dumpwaveforms"))
175  , fSimulationProducerLabel(p.get<std::string>("SimulationProducerLabel", "larg4Main"))
176  , fSimChannelLabel(p.get<std::string>("SimChannelLabel", "elecDrift"))
177  , fDigitModuleLabel(p.get<std::string>("DigitModuleLabel", "simWire"))
178  , fWireProducerLabel(p.get<std::string>("WireProducerLabel"))
179  , fUseFullWaveform(p.get<bool>("UseFullWaveform", true))
180  , fShortWaveformSize(p.get<unsigned int>("ShortWaveformSize"))
181  , fSelectGenLabel(p.get<std::string>("SelectGenLabel", "ANY"))
182  , fSelectProcID(p.get<std::string>("SelectProcID", "ANY"))
183  , fSelectPDGCode(p.get<int>("SelectPDGCode", 0))
184  , fPlaneToDump(p.get<std::string>("PlaneToDump"))
185  , fMinParticleEnergyGeV(p.get<double>("MinParticleEnergyGeV", 0.))
186  , fMinEnergyDepositedMeV(p.get<double>("MinEnergyDepositedMeV", 0.))
187  , fMinNumberOfElectrons(p.get<int>("MinNumberOfElectrons", 600))
188  , fMaxNumberOfElectrons(p.get<int>("MaxNumberOfElectrons", -1))
189  , fSaveSignal(p.get<bool>("SaveSignal", true))
190  , fMaxNoiseChannelsPerEvent(p.get<int>("MaxNoiseChannelsPerEvent"))
191  , fCollectionPlaneLabel(p.get<std::string>("CollectionPlaneLabel"))
194  -> declareEngine(instanceName, p, "SeedForRawWaveformDump"),
195  "HepJamesRandom",
196  instanceName)}
197 {
198  if (std::getenv("CLUSTER") && std::getenv("PROCESS")) {
200  string(std::getenv("CLUSTER")) + "-" + string(std::getenv("PROCESS")) + "-";
201  }
202 
203  if (fDigitModuleLabel.empty() && fWireProducerLabel.empty()) {
204  throw cet::exception("RawWaveformDump")
205  << "Both DigitModuleLabel and WireProducerLabel are empty";
206  }
207 
208  if ((!fDigitModuleLabel.empty()) && (!fWireProducerLabel.empty())) {
209  throw cet::exception("RawWaveformDump")
210  << "Only one of DigitModuleLabel and WireProducerLabel should be set";
211  }
212 }
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 277 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, fgeom, art::fill_ptr_vector(), fMaxNoiseChannelsPerEvent, fMaxNumberOfElectrons, fMinEnergyDepositedMeV, fMinNumberOfElectrons, fMinParticleEnergyGeV, fPlaneToDump, fRandFlat, fSaveSignal, fSelectGenLabel, fSelectPDGCode, fSelectProcID, fShortWaveformSize, fSimChannelLabel, fSimulationProducerLabel, fUseFullWaveform, fWireProducerLabel, 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::GeometryCore::View(), and geo::PlaneGeo::ViewName().

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

216 {
217  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
218 
224 
225  for (unsigned int i = 0; i < 5; i++) {
226  std::ostringstream name;
227 
228  name.str("");
229  name << "tid" << i;
230  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_INT32);
231 
232  name.str("");
233  name << "pdg" << i;
234  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_INT32);
235 
236  name.str("");
237  name << "gen" << i;
238  c2numpy_addcolumn(&npywriter, name.str().c_str(), (c2numpy_type)((int)C2NUMPY_STRING + 6));
239 
240  name.str("");
241  name << "pid" << i;
242  c2numpy_addcolumn(&npywriter, name.str().c_str(), (c2numpy_type)((int)C2NUMPY_STRING + 7));
243 
244  name.str("");
245  name << "edp" << i;
246  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_FLOAT32);
247 
248  name.str("");
249  name << "nel" << i;
250  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_UINT32);
251 
252  name.str("");
253  name << "sti" << i;
254  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_UINT16);
255 
256  name.str("");
257  name << "stf" << i;
258  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_UINT16);
259  }
260 
261  for (unsigned int i = 0;
262  i < (fUseFullWaveform ? detProp.ReadOutWindowSize() : fShortWaveformSize);
263  i++) {
264  std::ostringstream name;
265  name << "tck_" << i;
266  c2numpy_addcolumn(&npywriter, name.str().c_str(), C2NUMPY_INT16);
267  }
268 }
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 271 of file RawWaveformDump_module.cc.

References c2numpy_close(), and npywriter.

272 {
274 }
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().

art::ServiceHandle<geo::Geometry> nnet::RawWaveformDump::fgeom
private

Definition at line 124 of file RawWaveformDump_module.cc.

Referenced by analyze().

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 127 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().

c2numpy_writer nnet::RawWaveformDump::npywriter
private

Definition at line 129 of file RawWaveformDump_module.cc.

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

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

Definition at line 125 of file RawWaveformDump_module.cc.

Referenced by analyze().


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