Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
evtsum::EventSummary Class Reference
Inheritance diagram for evtsum::EventSummary:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 EventSummary (fhicl::ParameterSet const &pset)
 
 EventSummary (int i1, int i2, int i3, int i4, int i5, int i6, std::string s1, std::string s2, std::string s3, std::string s4, std::string s5, std::string s6, std::string s7, std::string s8, std::string s9, fhicl::ParameterSet const &pset)
 
 ~EventSummary ()
 
void analyze (art::Event const &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void PrintInfo (art::Event const &evt)
 
void MakeOutput (art::Event const &evt, std::ostringstream &os)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

int fBasicInfoPrint
 flag variable to tell module to print basic info More...
 
int fHitCountPrint
 flag variable to tell module to print hit count info More...
 
int fSpillPrint
 flag variable to tell module to print spill info More...
 
int fMCPrint
 flag variable to tell module to print MC truth info More...
 
int fRecoPrint
 flag variable to tell module to print reconstruction info More...
 
int fExtraRecoPrint
 flag variable to tell module to print extended reconstruction info More...
 
std::string fRawDigitLabel
 label for module that made RawDigit More...
 
std::string fRawTriggerLabel
 label for module that made RawTrigger More...
 
std::string fSpillLabel
 label for module that made SpillData More...
 
std::string fMCLabel
 label for module that made MCTruth More...
 
std::string fHoughLabel
 label for module that made HoughResults More...
 
std::string fVertexLabel
 label for module that made vertices More...
 
std::string fClusterLabel
 label for module that made clusters More...
 
std::string fProngLabel
 label for module that made prongs More...
 
std::string fTrackLabel
 label for module that made tracks More...
 

Detailed Description

Definition at line 51 of file EventSummary_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

evtsum::EventSummary::EventSummary ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 99 of file EventSummary_module.cc.

References reconfigure().

100  : EDAnalyzer(pset)
101  {
102 
103  // constructor
104 
105  this->reconfigure(pset);
106 
107  // Be noisy to demonstrate what's happening
108  mf::LogInfo("EventSummary") << " EventSummary::EventSummary()\n";
109 
110  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
void reconfigure(const fhicl::ParameterSet &pset)
evtsum::EventSummary::EventSummary ( int  i1,
int  i2,
int  i3,
int  i4,
int  i5,
int  i6,
std::string  s1,
std::string  s2,
std::string  s3,
std::string  s4,
std::string  s5,
std::string  s6,
std::string  s7,
std::string  s8,
std::string  s9,
fhicl::ParameterSet const &  pset 
)
explicit

Definition at line 112 of file EventSummary_module.cc.

References fBasicInfoPrint, fClusterLabel, fExtraRecoPrint, fHitCountPrint, fHoughLabel, fMCLabel, fMCPrint, fProngLabel, fRawDigitLabel, fRawTriggerLabel, fRecoPrint, fSpillLabel, fSpillPrint, fTrackLabel, and fVertexLabel.

119  : EDAnalyzer(pset)
120  {
121  // alternate constructor
122  fBasicInfoPrint = i1;
123  fHitCountPrint = i2;
124  fSpillPrint = i3;
125  fMCPrint = i4;
126  fRecoPrint = i5;
127  fExtraRecoPrint = i6;
128 
129  // set to default values
130  if(s1 == "") fRawDigitLabel = "daq";
131  else fRawDigitLabel = s1;
132 
133  if(s2 == "") fRawTriggerLabel = "daq";
134  else fRawTriggerLabel = s2;
135 
136  if(s3 == "") fSpillLabel = "ifdbspillinfo";
137  else fSpillLabel = s3;
138 
139  if(s4 == "") fMCLabel = "generator";
140  else fMCLabel = s4;
141 
142  if(s5 == "") fHoughLabel = "MultiHoughT";
143  else fHoughLabel = s5;
144 
145  if(s6 == "") fVertexLabel = "HoughVertexFinder";
146  else fVertexLabel = s6;
147 
148  if(s7 == "") fClusterLabel = "slicer";
149  else fClusterLabel = s7;
150 
151  if(s8 == "") fProngLabel = "KalmanTrack";
152  else fProngLabel = s8;
153 
154  if(s9 == "") fTrackLabel = "trackmerge";
155  else fTrackLabel = s9;
156  }
int fExtraRecoPrint
flag variable to tell module to print extended reconstruction info
std::string fSpillLabel
label for module that made SpillData
std::string fProngLabel
label for module that made prongs
std::string fRawTriggerLabel
label for module that made RawTrigger
std::string fRawDigitLabel
label for module that made RawDigit
std::string fHoughLabel
label for module that made HoughResults
std::string fMCLabel
label for module that made MCTruth
int fMCPrint
flag variable to tell module to print MC truth info
std::string fVertexLabel
label for module that made vertices
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
std::string fTrackLabel
label for module that made tracks
int fHitCountPrint
flag variable to tell module to print hit count info
int fBasicInfoPrint
flag variable to tell module to print basic info
int fSpillPrint
flag variable to tell module to print spill info
std::string fClusterLabel
label for module that made clusters
int fRecoPrint
flag variable to tell module to print reconstruction info
evtsum::EventSummary::~EventSummary ( )

Definition at line 162 of file EventSummary_module.cc.

163  {
164  //======================================================================
165  // Clean up any memory allocated by your module
166  //======================================================================
167  }

Member Function Documentation

void evtsum::EventSummary::analyze ( art::Event const &  evt)
virtual

Implements art::EDAnalyzer.

Definition at line 194 of file EventSummary_module.cc.

References PrintInfo().

195  {
196 
197  this->PrintInfo(evt);
198 
199  return;
200 
201  }
int evt
void PrintInfo(art::Event const &evt)
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
void evtsum::EventSummary::MakeOutput ( art::Event const &  evt,
std::ostringstream &  os 
)

Some unique number assigned for DCM in the detector

Definition at line 222 of file EventSummary_module.cc.

References chaninfo::BadChanList::Apply(), b, getBrightness::cell, visualisationForPaperMasterPlot::cmap, febshutoff_auto::day, DEFINE_ART_MODULE(), sumdata::SpillData::deltaspilltimensec, geo::GeometryBase::DetId(), daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), fBasicInfoPrint, fClusterLabel, fExtraRecoPrint, fHitCountPrint, fHoughLabel, fMCLabel, fMCPrint, fProngLabel, fRawDigitLabel, fRawTriggerLabel, fRecoPrint, fSpillLabel, fSpillPrint, fTrackLabel, fVertexLabel, geom(), art::DataViewImpl::getByLabel(), cmap::dataprov::CMap::GetCell(), daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getDiBlock(), cmap::dataprov::CMap::GetPlane(), sumdata::SpillData::hornI, febshutoff_auto::hour, allInOneTrainingPlots::hr, MECModelEnuComparisons::i, art::Event::id(), art::Handle< T >::isValid(), calib::j, simb::kBeamNeutrino, simb::kCosmicRay, simb::kSingleParticle, simb::kSuperNovaNeutrino, comi::kUSEC_PER_TDC, geo::kX, geo::kY, m, cmap::dataprov::CMap::Map(), febshutoff_auto::minute, genie::utils::res::PdgCode(), geo::GeometryBase::Plane(), NDAPDHVSetting::plane, sumdata::SpillData::posx, sumdata::SpillData::posy, art::PtrVector< T >::push_back(), moon_position_table_new3::second, art::PtrVector< T >::size(), caf_analysis::spill, sumdata::SpillData::spillpot, sumdata::SpillData::spilltimensec, string, getGoodRuns4SAM::t1, t2, art::Event::time(), track, daqdataformats::trigIDStrings, registry_explorer::v, art::Timestamp::value(), geo::PlaneGeo::View(), sumdata::SpillData::widthx, sumdata::SpillData::widthy, and Munits::year.

Referenced by PrintInfo().

223  {
224 
225  // This module works in several steps:
226  //
227  // 1. read in raw digits
228  // 2. disect the timestamp into date/time
229  // 3. count hits per DCM
230  // 4. count hits w/ bad channels masked in X,Y views
231  // 5. get trigger and spill information
232  // 6. count hits in NuMI or BNB spill windows
233  // 7. get MC truth info
234  // 8. get reconstruction info
235  // 9. create string of event summary info
236 
237 
238 
239 
240 
241  //
242  // read in the rawdigits
243  //
245  evt.getByLabel(fRawDigitLabel, digitcol);
246 
248  for(unsigned int i = 0; i < digitcol->size(); ++i) {
249  art::Ptr<rawdata::RawDigit> rd(digitcol, i);
250  digitlist.push_back(rd);
251  }
252  //
253  // end reading in raw digits
254 
255 
256 
257 
258 
259  //
260  // DISECTING the time from evt.time().value() into "human readable" format to display the date & time
261  // taken from EventDisplay/HeaderDrawer.cxx
262  //
263  unsigned int year, month, day, dayofweek;
264  unsigned int hour, minute, second;
265  int nano;
266 
267  // get the time stamp. art::Timestamp::value() returns a TimeValue_t which is a typedef to unsigned long long.
268  // The conventional use is for the upper 32 bits to have the seconds since 1970 epoch and the lower 32 bits to be
269  // the number of microseconds with the current second.
270  unsigned long long int tsval = evt.time().value();
271 
272  // taking it apart
273  const unsigned long int mask32 = 0xFFFFFFFFUL;
274  unsigned long int lup = ( tsval >> 32 ) & mask32;
275  unsigned long int llo = tsval & mask32;
276  TTimeStamp ts(lup, (int)llo);
277  ts.GetDate(kTRUE,0,&year,&month,&day);
278  ts.GetTime(kTRUE,0,&hour,&minute,&second);
279  nano = ts.GetNanoSec();
280  dayofweek = ts.GetDayOfWeek();
281 
282  double sec = (second + nano/1.0e9);
283 
284  // define some arrays to aid in printing
285  static const char* days[] = {"","Mon","Tue","Wed","Thu","Fri","Sat","Sun"};
286  static const char* months[] = {"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
287  //
288  // end section for DISECTING the time
289 
290 
291 
292 
293 
294  //
295  // counting hits by DCM (before bad channel mask is applied)
296  // This is used to determine the number of DCM's reporting information for
297  // each event.
298  // (modeled after ChannelInfo/HotChannels.cxx)
299  //
302 
303  const int detid = geom->DetId();
304 
305  const int nDCM = 200; // a number big enough to include the number of DCM's in the far detector
306  unsigned int DCMHits[nDCM] = {0}; // count of hits per DCM
307 
308  for (unsigned int i = 0; i < digitlist.size(); ++i) {
309  // for each digit, get plane and cell and determine DCM ID with getDCMGlobal
310  const uint32_t plane = cmap->GetPlane(digitlist[i].get());
311  const uint32_t cell = cmap->GetCell(digitlist[i].get());
312 
313  const daqchannelmap::lchan LogicalChannel = cmap->Map()->encodeLChan(detid, plane, cell);
314  const daqchannelmap::dchan DAQChannel = cmap->Map()->encodeDChan(LogicalChannel);
315  const uint32_t DCM = cmap->Map()->getDCM(DAQChannel); // this is the DCM id number
316  const uint32_t diblock_number = cmap->Map()->getDiBlock(DAQChannel);
317 
318  /// Some unique number assigned for DCM in the detector
319  const uint32_t DCMGlobal = diblock_number*12 + DCM;
320 
321  ++DCMHits[DCMGlobal];
322  }
323 
324  // count of number of DCMs that reported hits
325  int DCMCount = 0;
326  for(int j = 1; j < nDCM; j++) {
327  if(DCMHits[j] != 0) DCMCount++;
328  }
329  //
330  // end counting hits by DCM
331 
332 
333 
334 
335 
336  //
337  // counting number of hits with bad channels masked
338  //
339  unsigned int rdsnm = digitlist.size(); // rdsnm = "raw digit size no mask"
340 
341  // apply bad channel mask
343  bcl->Apply(digitlist);
344 
345  // counting number of hits in x and y views
346  // (modeled after util::XYCount)
347  unsigned int nx = 0;
348  unsigned int ny = 0;
349 
350  for (unsigned int i = 0; i < digitlist.size(); ++i) {
351  unsigned int p = cmap->GetPlane(digitlist[i].get());
352  geo::View_t v = geom->Plane(p)->View();
353 
354  if(v == geo::kX) ++nx;
355  else if(v == geo::kY) ++ny;
356  }
357  //
358  // end counting number of hits
359 
360 
361 
362 
363 
364  //
365  // get trigger info
366  //
367  unsigned int fTrigger = 0;
368  unsigned int fTriggerLength = 0;
369  float trigwin = 0.0;
370 
372  evt.getByLabel(fRawTriggerLabel, trigv);
373 
374  fTrigger = (*trigv)[0].fTriggerMask_TriggerType;
375  fTriggerLength = (*trigv)[0].fTriggerRange_TriggerLength;
376 
377  // not sure what the units on fTriggerLength are (assuming it is in units of 500 ns)
378  // so we will convert it to micro-sec.
379  trigwin = fTriggerLength*0.5;
380  //
381  // end getting trigger info
382 
383 
384 
385 
386 
387  //
388  // get spill info
389  //
391  bool spillFlag = 0;
392 
393  try {
394  evt.getByLabel(fSpillLabel, spill);
395  spillFlag = spill.isValid();
396  }
397  catch(...) {}
398 
399 
400  //
401  // count hits in NuMI or BNB spill windows
402  //
403 
404  // define NuMI and BNB spill window times (in usec)
405  float t1 = 0.0;
406  float t2 = 0.0;
407  int incount = 0;
408 
409  // conversion factor for TDC to micro-sec
410  static const double kUSEC_PER_TDC = (1.0e6/64.0e6);
411 
412  // get spill start time
413  //unsigned int tdc0 = (*trigv)[0].TDCT0();
414 
415  // count hits in NuMI spill window
416  if(fTrigger == 0) {
417  // define the edges of the NuMI spill window (in micro-sec)
418  t1 = 216.0;
419  t2 = 228.0;
420  for(unsigned int i = 0; i < digitlist.size(); ++i) {
421 
422  // time of hit with respect to start of spill in micro-seconds
423  float hittime = (digitlist[i]->TDC())*kUSEC_PER_TDC;
424 
425  if(hittime >= t1 && hittime <= t2) incount++;
426  } // end loop over i
427  } // end if(fTrigger == 0)
428 
429  // count hits in BNB spill window
430  if(fTrigger == 1) {
431  // define the edges of the BNB spill window in (micro-sec)
432  t1 = 332.0;
433  t2 = 334.0;
434  for(unsigned int i = 0; i < digitlist.size(); ++i) {
435 
436  // time of hit with respect to start of spill in micro-seconds
437  float hittime = (digitlist[i]->TDC())*kUSEC_PER_TDC;
438 
439  if(hittime >= t1 && hittime <= t2) incount++;
440  } // end loop over i
441  } // end if(fTrigger == 1)
442  //
443  // end count hits in spill windows
444 
445 
446 
447 
448 
449  //
450  // get the MC truth info
451  //
453  bool MCFlag = 0;
454 
455  try {
456 
457  evt.getByLabel(fMCLabel, mclist);
458 
459  // some MC events are created with size zero (I'm not sure why) which causes
460  // a seg fault so we will test to make sure this isn't the case before moving on
461  if(mclist->size() > 0) MCFlag = 1;
462 
463  } // end of try
464  catch(...) {}
465  //
466  // end get MC truth info
467 
468 
469 
470 
471 
472  //
473  // get the reconstruction info
474  //
475 
476  // get HoughResults
478  bool HoughFlag = 0;
479  unsigned int hrXsz = 0, hrYsz = 0;
480 
481  try {
482  evt.getByLabel(fHoughLabel, hr);
483 
484  for(unsigned int i = 0; i < hr->size(); ++i) {
485  if((*hr)[i].fView == geo::kX) hrXsz += (*hr)[i].fPeak.size();
486  if((*hr)[i].fView == geo::kY) hrYsz += (*hr)[i].fPeak.size();
487  }
488 
489  HoughFlag = hr.isValid();
490  } // end of try
491  catch(...) {}
492 
493  // get vertices
495  bool VertexFlag = 0;
496 
497  try {
498  evt.getByLabel(fVertexLabel, vertices);
499  VertexFlag = vertices.isValid();
500  }
501  catch(...) {}
502 
503  // get cluster results
505  bool ClusterFlag = 0;
506 
507  try {
508  evt.getByLabel(fClusterLabel, cluster);
509  ClusterFlag = cluster.isValid();
510  }
511  catch(...) {}
512 
513  // get prong results
515  bool ProngFlag = 0;
516 
517  try {
518  evt.getByLabel(fProngLabel, prong);
519  ProngFlag = prong.isValid();
520  }
521  catch(...) {}
522 
523  // get track results
525  bool TrackFlag = 0;
526 
527  try {
528  evt.getByLabel(fTrackLabel, track);
529  TrackFlag = track.isValid();
530  }
531  catch(...) {}
532 
533  //
534  // end get reco info
535 
536 
537 
538 
539  //
540  // printing the EventSummary information
541  //
542 
543  os << "\n\n||==================== Begin EventSummary output ====================||\n\n";
544 
545  // printing basic info
546  if(fBasicInfoPrint != 0) {
547  os << "Date/Time: " << days[dayofweek]
548  << " " << months[month] << " " << day << ", " << year << " / ";
549 
550  if(hour < 10) os << "0";
551  os << hour << ":";
552 
553  if(minute < 10) os << "0";
554  os << minute << ":";
555 
556  if(sec < 10.0) os << "0";
557  os << sec << " UTC\n";
558 
559  os << "Event ID: " << evt.id() << "\n";
560 
561  os << "Trigger ID: " << fTrigger
562  << " (" << daqdataformats::trigIDStrings[fTrigger] << ")\n";
563 
564  os << "Trigger window: " << trigwin << " (micro-sec)\n\n";
565  } // end print basic info
566 
567 
568 
569  // printing hit count info
570  if(fHitCountPrint != 0) {
571 
572  os << "number of DCMs reporting: " << DCMCount << "\n";
573  os << "total number of hits (no masks applied): " << rdsnm << "\n";
574  os << "number of hits (with bad channels masked): " << digitlist.size() << "\n";
575  os << "number of XY hits (x-view,y-view): (" << nx << "," << ny << ")\n";
576 
577  if(fTrigger == 0) os << "number of hits in NuMI spill window: " << incount << "\n";
578  if(fTrigger == 1) os << "number of hits in BNB spill window: " << incount << "\n";
579  } // end print hit count info
580 
581 
582 
583  // printing spill info
584  if(fSpillPrint != 0) {
585  os << "\nSpill data:";
586  if(spillFlag)
587  os << "\n===========\n"
588  << "time (nsec): " << spill->spilltimensec << "\n"
589  << "delta time (nsec): " << spill->deltaspilltimensec << "\n"
590  << "POT: " << spill->spillpot << " x 10^12" << "\n"
591  << "horn current: " << spill->hornI << "\n"
592  << "beam position at target (X,Y): (" << spill->posx << "," << spill->posy << ") (mm)\n"
593  << "beam width (x,y): (" << spill->widthx << "," << spill->widthy << ") (mm)\n";
594  else os << " (no information under process label: " << fSpillLabel << ")\n";
595  } // end print spill info
596 
597 
598 
599  // printing MC truth info
600  if(fMCPrint != 0) {
601  os << "\nMC truth info:";
602  if(MCFlag == 1) {
603  os << "\n==============\n" << "at t = " << nano/1e6 << " (msec)\n"
604  << "total number of MC reactions: " << mclist->size() << "\n";
605 
606  // loop over total number of MC reactions
607 
608  const TDatabasePDG* databasePDG = TDatabasePDG::Instance();
609 
610  for(unsigned int j = 0; j < mclist->size(); j++) {
611 
612  os << "\nMC reaction number " << (j+1) << ":\n"
613  << "Origin: ";
614 
615  simb::Origin_t fOrigin = (*mclist)[j].Origin();
616  if(fOrigin == simb::kBeamNeutrino) os << "Beam Neutrino\n";
617  else if(fOrigin == simb::kCosmicRay) os << "Cosmic Ray\n";
618  else if(fOrigin == simb::kSuperNovaNeutrino) os << "Supernova Neutrino\n";
619  else if(fOrigin == simb::kSingleParticle) os << "Single Particle\n";
620  else os << "(Unknown)\n";
621 
622  os << "\ninitial particles in reaction:\n";
623 
624  // print initial particles in reaction (status code = 0)
625  for(int i = 0; i < (*mclist)[j].NParticles(); i++) {
626 
627  if((*mclist)[j].GetParticle(i).StatusCode() == 0) {
628 
629  const TParticlePDG* p = databasePDG->GetParticle((*mclist)[j].GetParticle(i).PdgCode());
630  std::string name = p ? p->GetName() : "(unknown)";
631 
632  if(name == "(unknown)") os << name << " pdgcode: " << (*mclist)[j].GetParticle(i).PdgCode()
633  << " [" << (*mclist)[j].GetParticle(i).E() << " GeV]\n";
634  else os << name << " [" << (*mclist)[j].GetParticle(i).E() << " GeV]\n";
635 
636  } // end if
637 
638  } // end for i
639 
640  os << "\nfinal particles in reaction:\n";
641 
642  // print final particles in reaction (status code = 1)
643  for(int k = 0; k < (*mclist)[j].NParticles(); k++) {
644 
645  if((*mclist)[j].GetParticle(k).StatusCode() == 1) {
646 
647  const TParticlePDG* p = databasePDG->GetParticle((*mclist)[j].GetParticle(k).PdgCode());
648  std::string name = p ? p->GetName() : "(unknown)";
649 
650  if(name == "(unknown)") os << name << " pdgcode: " << (*mclist)[j].GetParticle(k).PdgCode()
651  << " [" << (*mclist)[j].GetParticle(k).E() << " GeV]\n";
652  else os << name << " [" << (*mclist)[j].GetParticle(k).E() << " GeV]\n";
653 
654  } // end if
655 
656  } // end for k
657 
658  } // end for j
659 
660  } // end if(MCFlag == 1)
661 
662  else os << " (no information under process label: " << fMCLabel << ")\n";
663 
664  } // end printing MC truth info
665 
666 
667 
668  // print reconstruction info
669  if(fRecoPrint != 0) {
670  os << "\nReconstruction info:" << "\n====================\n\n";
671  os << "number of hits in each view w/ BCM applied (x,y): (" << nx << "," << ny << ")\n";
672 
673  // Hough Print
674  if(HoughFlag == 1) os << "HoughResults: size = " << hr->size() << "\n";
675  else os << "HoughResults: (no information under process label: " << fHoughLabel << ")\n";
676 
677  // vertices print
678  if(VertexFlag == 1) os << "Vertices: size = " << vertices->size() << "\n";
679  else os << "Vertices: (no information under process label: " << fVertexLabel << ")\n";
680 
681  // slice print
682  if(ClusterFlag == 1) os << "Clusters: size = " << cluster->size() << "\n";
683  else os << "Clusters: (no information under process label: " << fClusterLabel << ")\n";
684 
685  // prong print
686  if(ProngFlag == 1) os << "Prongs: size = " << prong->size() << "\n";
687  else os << "Prongs: (no information under process label: " << fProngLabel << ")\n";
688 
689  // track print
690  if(TrackFlag == 1) os << "Tracks: size = " << track->size() << "\n";
691  else os << "Tracks: (no information under process label: " << fTrackLabel << ")\n";
692  } // end if fRecoPrint
693 
694 
695 
696  // print extra Reco info
697  if(fExtraRecoPrint != 0) {
698  // extra hough lines info
699  if(HoughFlag == 1) {
700  os << "\nHoughResults: total number of Hough lines in each view (x,y): (" << hrXsz << "," << hrYsz << ")\n";
701  os << "Lines: view, (slope, intercept) [cm]\n";
702  for(unsigned int i = 0; i < hr->size(); ++i) {
703  for(unsigned int j = 0; j < (*hr)[i].fPeak.size(); ++j) {
704  double m = 0.0, b = 0.0;
705  (*hr)[i].SlopeIcept(j, &m, &b);
706  if((*hr)[i].fView == geo::kX) os << " X (";
707  else if((*hr)[i].fView == geo::kY) os << " Y (";
708  else os << " unknown view (";
709  os << m << ", " << b << ")\n";
710  }
711  }
712  }
713 
714  // extra vertex info
715  if(VertexFlag == 1) {
716  os << "\nVertices: (x,y,z,t) [cm,ns]\n";
717  for(unsigned int i = 0; i < vertices->size(); ++i) {
718  os << " (" << (*vertices)[i].GetX() << ", " << (*vertices)[i].GetY() << ", "
719  << (*vertices)[i].GetZ() << ", " << (*vertices)[i].GetT() << ")\n";
720  }
721  }
722 
723  // extra cluster info
724  if(ClusterFlag == 1) {
725  os << "\nClusters: view, # of hits, IsNoise\n";
726  for(unsigned int i = 0; i < cluster->size(); ++i) {
727  os << " ";
728  if((*cluster)[i].View() == geo::kX) os << "X " << (*cluster)[i].NXCell();
729  if((*cluster)[i].View() == geo::kY) os << "Y " << (*cluster)[i].NYCell();
730  if((*cluster)[i].Is3D()) os << "3D " << (*cluster)[i].NCell();
731  if((*cluster)[i].IsNoise()) os << " Y\n";
732  else os << " N\n";
733  }
734  }
735 
736 
737  // extra prong info
738  if(ProngFlag == 1) {
739  os << "\nProngs: view, # of hits, start (x,y,z) [cm], direction (x,y,z) [cm]\n";
740  for(unsigned int i = 0; i < prong->size(); ++i) {
741  if((*prong)[i].View() == geo::kX) os << "X " << (*prong)[i].NXCell();
742  if((*prong)[i].View() == geo::kY) os << "Y " << (*prong)[i].NYCell();
743  if((*prong)[i].Is3D()) os << "3D " << (*prong)[i].NCell();
744  os << " (" << (*prong)[i].Start().X() << ", "
745  << (*prong)[i].Start().Y() << ", "
746  << (*prong)[i].Start().Z() << ")"
747  << " (" << (*prong)[i].Dir().X() << ", "
748  << (*prong)[i].Dir().Y() << ", "
749  << (*prong)[i].Dir().Z() << ")\n";
750  }
751  }
752 
753  // extra track info
754  if(TrackFlag == 1) {
755  os << "\nTracks: view, # of hits, length [cm], start (x,y,z) [cm], stop (x,y,z) [cm]\n";
756  for(unsigned int i = 0; i < track->size(); ++i) {
757  if((*track)[i].View() == geo::kX) os << " X " << (*track)[i].NXCell();
758  if((*track)[i].View() == geo::kY) os << " Y " << (*track)[i].NYCell();
759  if((*track)[i].Is3D()) os << " 3D " << (*track)[i].NCell();
760  os << " " << (*track)[i].TotalLength();
761  os << " (" << (*track)[i].Start().X() << ", "
762  << (*track)[i].Start().Y() << ", "
763  << (*track)[i].Start().Z() << ")"
764  << " (" << (*track)[i].Stop().X() << ", "
765  << (*track)[i].Stop().Y() << ", "
766  << (*track)[i].Stop().Z() << ")\n";
767  }
768  }
769 
770 
771  }
772  os << "\n\n||===================== End EventSummary output =====================||\n\n\n";
773 
774  //
775  // end printing EventSummary information
776 
777  return;
778  }
virtual geo::View_t View() const
kXorY for 3D clusters.
Definition: Cluster.h:99
const XML_Char * name
Definition: expat.h:151
int fExtraRecoPrint
flag variable to tell module to print extended reconstruction info
const char * trigIDStrings[]
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
const char * p
Definition: xmltok.h:285
Vertical planes which measure X.
Definition: PlaneGeo.h:28
enum simb::_ev_origin Origin_t
event origin types
std::string fSpillLabel
label for module that made SpillData
std::string fProngLabel
label for module that made prongs
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
const PlaneGeo * Plane(unsigned int i) const
std::string fRawTriggerLabel
label for module that made RawTrigger
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
std::string fRawDigitLabel
label for module that made RawDigit
bool isValid() const
Definition: Handle.h:189
std::string fHoughLabel
label for module that made HoughResults
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:53
int PdgCode(Resonance_t res, int Q)
(resonance id, charge) -> PDG code
std::string fMCLabel
label for module that made MCTruth
signed long long int deltaspilltimensec
Definition: SpillData.h:24
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
single particles thrown at the detector
Definition: MCTruth.h:26
int fMCPrint
flag variable to tell module to print MC truth info
geo::View_t fView
view this cluster is in
Definition: Cluster.h:316
std::string fVertexLabel
label for module that made vertices
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
double widthx
mm
Definition: SpillData.h:36
int evt
unsigned long int spilltimensec
Definition: SpillData.h:21
unsigned short GetPlane(const rawdata::RawDigit *dig)
Definition: CMap.cxx:285
const double j
Definition: BetheBloch.cxx:29
double hornI
kA
Definition: SpillData.h:27
double t2
double posy
mm
Definition: SpillData.h:35
size_type size() const
Definition: PtrVector.h:308
std::string fTrackLabel
label for module that made tracks
virtual bool Is3D() const
Definition: Cluster.h:95
int fHitCountPrint
flag variable to tell module to print hit count info
void geom(int which=0)
Definition: geom.C:163
int Apply(art::PtrVector< rawdata::RawDigit > &rd)
const hit & b
Definition: hits.cxx:21
static const double kUSEC_PER_TDC
Supernova neutrinos.
Definition: MCTruth.h:25
int fBasicInfoPrint
flag variable to tell module to print basic info
int fSpillPrint
flag variable to tell module to print spill info
unsigned short GetCell(const rawdata::RawDigit *dig)
Definition: CMap.cxx:327
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
uint32_t dchan
< DAQ Channel Map Package
Float_t track
Definition: plot.C:35
double posx
mm
Definition: SpillData.h:34
double widthy
mm
Definition: SpillData.h:37
Definition: fwd.h:28
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
std::string fClusterLabel
label for module that made clusters
double spillpot
POT for spill normalized by 10^12.
Definition: SpillData.h:26
Cosmic rays.
Definition: MCTruth.h:24
int fRecoPrint
flag variable to tell module to print reconstruction info
Beam neutrinos.
Definition: MCTruth.h:23
static constexpr Double_t year
Definition: Munits.h:185
enum BeamMode string
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void evtsum::EventSummary::PrintInfo ( art::Event const &  evt)

Definition at line 206 of file EventSummary_module.cc.

References om::cout, and MakeOutput().

Referenced by analyze().

207  {
208 
209  std::ostringstream OutputStream;
210 
211  this->MakeOutput(evt, OutputStream);
212 
213  std::cout << OutputStream.str();
214 
215  return;
216 
217  }
void MakeOutput(art::Event const &evt, std::ostringstream &os)
int evt
OStream cout
Definition: OStream.cxx:6
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void evtsum::EventSummary::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 172 of file EventSummary_module.cc.

References fBasicInfoPrint, fClusterLabel, fExtraRecoPrint, fHitCountPrint, fHoughLabel, fMCLabel, fMCPrint, fProngLabel, fRawDigitLabel, fRawTriggerLabel, fRecoPrint, fSpillLabel, fSpillPrint, fTrackLabel, fVertexLabel, fhicl::ParameterSet::get(), and string.

Referenced by EventSummary().

173  { // get the input parameters from EventSummary.fcl
174  fBasicInfoPrint = pset.get< int >("BasicInfoPrint");
175  fHitCountPrint = pset.get< int >("HitCountPrint");
176  fSpillPrint = pset.get< int >("SpillPrint");
177  fMCPrint = pset.get< int >("MCPrint");
178  fRecoPrint = pset.get< int >("RecoPrint");
179  fExtraRecoPrint = pset.get< int >("ExtraRecoPrint");
180 
181  fRawDigitLabel = pset.get< std::string >("RawDigitLabel");
182  fRawTriggerLabel = pset.get< std::string >("RawTriggerLabel");
183  fSpillLabel = pset.get< std::string >("SpillLabel");
184  fMCLabel = pset.get< std::string >("MCLabel");
185  fHoughLabel = pset.get< std::string >("HoughLabel");
186  fVertexLabel = pset.get< std::string >("VertexLabel");
187  fClusterLabel = pset.get< std::string >("ClusterLabel");
188  fProngLabel = pset.get< std::string >("ProngLabel");
189  fTrackLabel = pset.get< std::string >("TrackLabel");
190  }
int fExtraRecoPrint
flag variable to tell module to print extended reconstruction info
std::string fSpillLabel
label for module that made SpillData
std::string fProngLabel
label for module that made prongs
std::string fRawTriggerLabel
label for module that made RawTrigger
std::string fRawDigitLabel
label for module that made RawDigit
std::string fHoughLabel
label for module that made HoughResults
std::string fMCLabel
label for module that made MCTruth
int fMCPrint
flag variable to tell module to print MC truth info
std::string fVertexLabel
label for module that made vertices
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fTrackLabel
label for module that made tracks
int fHitCountPrint
flag variable to tell module to print hit count info
int fBasicInfoPrint
flag variable to tell module to print basic info
int fSpillPrint
flag variable to tell module to print spill info
std::string fClusterLabel
label for module that made clusters
int fRecoPrint
flag variable to tell module to print reconstruction info
enum BeamMode string
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

int evtsum::EventSummary::fBasicInfoPrint
private

flag variable to tell module to print basic info

Definition at line 75 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fClusterLabel
private

label for module that made clusters

Definition at line 88 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

int evtsum::EventSummary::fExtraRecoPrint
private

flag variable to tell module to print extended reconstruction info

Definition at line 80 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

int evtsum::EventSummary::fHitCountPrint
private

flag variable to tell module to print hit count info

Definition at line 76 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fHoughLabel
private

label for module that made HoughResults

Definition at line 86 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fMCLabel
private

label for module that made MCTruth

Definition at line 85 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

int evtsum::EventSummary::fMCPrint
private

flag variable to tell module to print MC truth info

Definition at line 78 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fProngLabel
private

label for module that made prongs

Definition at line 89 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fRawDigitLabel
private

label for module that made RawDigit

Definition at line 82 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fRawTriggerLabel
private

label for module that made RawTrigger

Definition at line 83 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

int evtsum::EventSummary::fRecoPrint
private

flag variable to tell module to print reconstruction info

Definition at line 79 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fSpillLabel
private

label for module that made SpillData

Definition at line 84 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

int evtsum::EventSummary::fSpillPrint
private

flag variable to tell module to print spill info

Definition at line 77 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fTrackLabel
private

label for module that made tracks

Definition at line 90 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().

std::string evtsum::EventSummary::fVertexLabel
private

label for module that made vertices

Definition at line 87 of file EventSummary_module.cc.

Referenced by EventSummary(), MakeOutput(), and reconfigure().


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