EventSummary_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief Dumps a summary of info about events to the screen
3 /// \author Michael Baird - mbaird42@fnal.gov
4 /// \date June 2011
5 ////////////////////////////////////////////////////////////////////////
6 
7 #include <vector>
8 #include <iostream>
9 #include <sstream>
10 #include <map>
11 #include <cmath>
12 
13 // NOvASoft includes
14 
15 #include "ChannelInfo/BadChanList.h" // needed for bad channel mask
16 #include "CMap/service/CMapService.h" // needed to get number of hits info
17 #include "DAQDataFormats/TriggerDefines.h" // needed to print trigger ID
18 #include "Geometry/Geometry.h"
19 #include "RawData/RawDigit.h"
20 #include "RawData/RawTrigger.h"
21 #include "RecoBase/Cluster.h"
22 #include "RecoBase/HoughResult.h"
23 #include "RecoBase/Prong.h"
24 #include "RecoBase/Track.h"
25 #include "RecoBase/Vertex.h"
26 #include "SummaryData/SpillData.h" // needed for getting spill data
27 #include "nusimdata/SimulationBase/MCTruth.h" // needed to get MCTruth info
28 
29 // ROOT includes
30 #include "TDatabasePDG.h" // needed to print particle names from pdg codes
31 #include "TTimeStamp.h" // needed for printing the date/time
32 
33 // Framework includes
42 #include "fhiclcpp/ParameterSet.h"
44 
45 
46 
47 
48 
49 // EventSummary header
50 namespace evtsum {
51  class EventSummary : public art::EDAnalyzer {
52  public:
53  explicit EventSummary(fhicl::ParameterSet const& pset);
54  explicit EventSummary(int i1, int i2, int i3, int i4, int i5, int i6,
55  std::string s1, std::string s2,
56  std::string s3, std::string s4,
57  std::string s5, std::string s6,
58  std::string s7, std::string s8,
59  std::string s9,
60  fhicl::ParameterSet const& pset);
61 
62  ~EventSummary();
63 
64  void analyze(art::Event const & evt);
65 
66  void reconfigure(const fhicl::ParameterSet& pset);
67 
68  void PrintInfo(art::Event const & evt);
69 
70  void MakeOutput(art::Event const & evt, std::ostringstream & os);
71 
72  private:
73  // configuration parameters
74 
75  int fBasicInfoPrint; ///< flag variable to tell module to print basic info
76  int fHitCountPrint; ///< flag variable to tell module to print hit count info
77  int fSpillPrint; ///< flag variable to tell module to print spill info
78  int fMCPrint; ///< flag variable to tell module to print MC truth info
79  int fRecoPrint; ///< flag variable to tell module to print reconstruction info
80  int fExtraRecoPrint; ///< flag variable to tell module to print extended reconstruction info
81 
82  std::string fRawDigitLabel; ///< label for module that made RawDigit
83  std::string fRawTriggerLabel; ///< label for module that made RawTrigger
84  std::string fSpillLabel; ///< label for module that made SpillData
85  std::string fMCLabel; ///< label for module that made MCTruth
86  std::string fHoughLabel; ///< label for module that made HoughResults
87  std::string fVertexLabel; ///< label for module that made vertices
88  std::string fClusterLabel; ///< label for module that made clusters
89  std::string fProngLabel; ///< label for module that made prongs
90  std::string fTrackLabel; ///< label for module that made tracks
91 
92  };
93 }
94 
95 
96 
97 namespace evtsum {
98 
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  }
111 
112  EventSummary::EventSummary(int i1, int i2, int i3, int i4, int i5, int i6,
113  std::string s1, std::string s2,
114  std::string s3, std::string s4,
115  std::string s5, std::string s6,
116  std::string s7, std::string s8,
117  std::string s9,
118  fhicl::ParameterSet const& pset)
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  }
157 
158 
159 
160 
161  //......................................................................
163  {
164  //======================================================================
165  // Clean up any memory allocated by your module
166  //======================================================================
167  }
168 
169 
170 
171  //......................................................................
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  }
191 
192 
193  //......................................................................
195  {
196 
197  this->PrintInfo(evt);
198 
199  return;
200 
201  }
202 
203 
204 
205  //......................................................................
207  {
208 
209  std::ostringstream OutputStream;
210 
211  this->MakeOutput(evt, OutputStream);
212 
213  std::cout << OutputStream.str();
214 
215  return;
216 
217  }
218 
219 
220 
221  //......................................................................
222  void EventSummary::MakeOutput(art::Event const & evt, std::ostringstream & os)
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  }
779 } // end namespace
780 ////////////////////////////////////////////////////////////////////////
781 
782 
783 
785 namespace evtsum
786 {
788 }
const XML_Char * name
Definition: expat.h:151
int fExtraRecoPrint
flag variable to tell module to print extended reconstruction info
void MakeOutput(art::Event const &evt, std::ostringstream &os)
const char * trigIDStrings[]
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
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
DEFINE_ART_MODULE(TestTMapFile)
std::string fRawTriggerLabel
label for module that made RawTrigger
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
constexpr TimeValue_t value() const
Definition: Timestamp.h:24
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
std::string fVertexLabel
label for module that made vertices
T get(std::string const &key) const
Definition: ParameterSet.h:231
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
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
double t2
Vertex location in position and time.
double posy
mm
Definition: SpillData.h:35
Definition: View.py:1
size_type size() const
Definition: PtrVector.h:308
OStream cout
Definition: OStream.cxx:6
std::string fTrackLabel
label for module that made tracks
Dumps a summary of info about events to the screen.
Data resulting from a Hough transform on the cell hit positions.
void analyze(art::Event const &evt)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void reconfigure(const fhicl::ParameterSet &pset)
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
Timestamp time() const
Definition: Event.h:61
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
uint32_t dchan
< DAQ Channel Map Package
Float_t track
Definition: plot.C:35
double posx
mm
Definition: SpillData.h:34
EventSummary(fhicl::ParameterSet const &pset)
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
void PrintInfo(art::Event const &evt)
EventID id() const
Definition: Event.h:56
Encapsulate the geometry of one entire detector (near, far, ndos)
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