eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TAnalysisLoop.cxx
Go to the documentation of this file.
1 #include <cmath>
2 #include <exception>
3 #include <iostream>
4 
5 #include <TString.h>
6 #include <TND280Output.hxx>
7 #include <TOADatabase.hxx>
8 #include <nd280EventLoop.hxx>
9 
10 #include "eventAnalysisEnums.hxx"
11 
12 #include "TAnalysisModuleBase.hxx"
14 #include "TBasicHeaderModule.hxx"
16 #include "TFgdOnlyModule.hxx"
19 #include "TGlobalReconModule.hxx"
20 #include "TLowLevelInfoModule.hxx"
21 #include "TND280Input.hxx"
23 #include "TP0DECALReconModule.hxx"
24 #include "TSFGReconModule.hxx"
25 #include "TTagsModule.hxx"
26 #include "TP0DReconModule.hxx"
28 #include "TSmrdReconModule.hxx"
29 #include "TTRExReconModule.hxx"
31 #include "TTrackerReconModule.hxx"
33 #include "TTruthVerticesModule.hxx"
34 
35 #include "TAnalysisLoop.hxx"
36 
37 namespace AnalysisLoopGlobals {
38 int EventNumber = -1;
39 std::string CurrentlyProcessingModule = "";
40 bool StopProcessing = false;
41 ;
42 }
43 
44 namespace ND {
45 //******************************************************************************
46 // Utils Funcs
47 //******************************************************************************
48 
49 /// Used to sort Preselecting modules to the end of the vector.
50 ///
51 ///\note this does not obey strict weak ordering and so should only be used with
52 /// std::stable_sort
54  std::pair<std::string, ND::TAnalysisModuleBase *> const &LHS,
55  std::pair<std::string, ND::TAnalysisModuleBase *> const &RHS) {
56  /// Only swap if the LHS is used for preselection and the RHS isn't
57  return !(LHS.second->IsUsedForPreselection() &&
58  (!RHS.second->IsUsedForPreselection()));
59 }
60 
61 //******************************************************************************
62 // Analysis Loop Funcs
63 //******************************************************************************
64 
66  : fEventCount(0),
67  fSaveOriginalFullEvent(false),
68  fSaveOutputOaEventTree(false),
69  fDisableAll(false),
70  fEnableAll(false),
71  fProduction(false),
72  fExit(false),
73  fValidation(false),
74  fGeometry(false) {
75  fAnalysisModules.push_back(
76  std::make_pair("TBasicHeaderModule", new ND::TBasicHeaderModule));
77  /*fAnalysisModules.push_back(std::make_pair("TBasicDataQualityModule",
78  new ND::TBasicDataQualityModule));*/
79  fAnalysisModules.push_back(std::make_pair("TTruthTrajectoriesModule",
81  fAnalysisModules.push_back(
82  std::make_pair("TTruthVerticesModule", new ND::TTruthVerticesModule));
83  fAnalysisModules.push_back(
84  std::make_pair("TSFGReconModule", new ND::TSFGReconModule));
85  fAnalysisModules.push_back(
86  std::make_pair("TTagsModule", new ND::TTagsModule));
87  fAnalysisModules.push_back(
88  std::make_pair("TP0DReconModule", new ND::TP0DReconModule));
89  fAnalysisModules.push_back(
90  std::make_pair("TP0DECALReconModule", new ND::TP0DECALReconModule));
91  fAnalysisModules.push_back(
92  std::make_pair("TTrackerECALReconModule",
94  fAnalysisModules.push_back(
95  std::make_pair("TGlobalReconModule", new ND::TGlobalReconModule));
96  fAnalysisModules.push_back(
97  std::make_pair("TTrackerReconModule", new ND::TTrackerReconModule));
98  fAnalysisModules.push_back(
99  std::make_pair("TSmrdReconModule", new ND::TSmrdReconModule));
100  fAnalysisModules.push_back(
101  std::make_pair("TLowLevelInfoModule", new ND::TLowLevelInfoModule));
102  fAnalysisModules.push_back(
103  std::make_pair("TFgdOnlyModule", new ND::TFgdOnlyModule));
104  fAnalysisModules.push_back(
105  std::make_pair("TBeamSummaryDataModule", new ND::TBeamSummaryDataModule));
106  fAnalysisModules.push_back(std::make_pair(
107  "TReconPerformanceEvalModule", new ND::TReconPerformanceEvalModule));
108  fAnalysisModules.push_back(
109  std::make_pair("TGeometrySummaryModule", new ND::TGeometrySummaryModule));
110  fAnalysisModules.push_back(
111  std::make_pair("TTRExReconModule", new ND::TTRExReconModule));
112  fAnalysisModules.push_back(
113  std::make_pair("TGRooTrackerVtxModule", new ND::TGRooTrackerVtxModule));
114  fAnalysisModules.push_back(
115  std::make_pair("TNRooTrackerVtxModule", new ND::TNRooTrackerVtxModule));
116 
117  // Set defaults for enabling or disabling modules.
119 }
120 
122 
124  std::cout
125  << "\t-O inputdir=<path/to/dir> Set an input directory where the "
126  "modules\n"
127  "\t can pick up non-nd280 files. For example use this if you need "
128  "to\n"
129  "\t recover pass-through information from a given directory\n"
130  "\t-O production Run eventAnalysis in production mode. It will exit if "
131  "no \n"
132  "\t RooTracker information is found for MC files or if "
133  "any \n"
134  "\t modules enabled modules crash\n"
135  "\t-O validation Run eventAnalysis in validation mode. It will exit if "
136  "any \n"
137  "\t enabled module crashes\n"
138  "\t-O geometry Save the ND280 geometry to the eventAnalysis file\n"
139  "\t (not saved by default)\n"
140  "\t-O save Save the original full TND280Event in analysis file\n\n"
141  "=====================Module Level Options=====================\n"
142  "\t-O enable=<modulename> Enable a particular module \n"
143  "\t (overrides all other disable/enable)\n"
144  "\t-O disable=<modulename> Disable a particular module \n"
145  "\t (overrides disable/enable all)\n"
146  "\t-O enable=all Enable all modules (overrides disable all)\n"
147  "\t-O disable=all Disable all modules\n"
148  "\t-O preselection=<modulename> Use module to output pre-selected\n"
149  "\t events in the ND280Events oaEvent tree\n"
150  "\t-O modulename=<option> Configure module\n"
151  "\t(for example. -O TTruthTrajectoriesModule=saveall)\n\n"
152  "\tAvailable modules {default status} and options are:"
153  << std::endl;
154 
155  for (ModDescripterator mod_it = fAnalysisModules.begin();
156  mod_it != fAnalysisModules.end(); ++mod_it) {
157  std::cout << "\t\t" << mod_it->first
158  << (mod_it->second->IsEnabledByDefault() ? " {enabled}"
159  : " {disabled}")
160  << std::endl;
161  mod_it->second->SayAvailableOpts("\t\t ");
162  }
163 }
164 
165 bool TAnalysisLoop::SetOption(std::string option, std::string value) {
166  if (option == "production") {
167  ND280NamedLog("TAnalysisLoop", "Running in production mode");
168  fProduction = true;
169  return true;
170  }
171 
172  if (option == "validation") {
173  ND280NamedLog("TAnalysisLoop", "Running in validation mode");
174  fValidation = true;
175  return true;
176  }
177 
178  if (option == "geometry") {
179  ND280NamedLog("TAnalysisLoop", "Saving the ND280 geometry");
180  fGeometry = true;
181  return true;
182  }
183 
184  if (option == "disable" && value == "all") {
185  ND280NamedLog("TAnalysisLoop",
186  "Disabling all modules due to user command line option");
187  fDisableAll = true;
188  return true;
189  }
190  if (option == "enable" && value == "all") {
191  ND280NamedInfo("TAnalysisLoop", " " << value);
192  ND280NamedLog("TAnalysisLoop",
193  "Enabling all modules due to user command line option "
194  << "(takes precedence over the disable=all option)");
195  fEnableAll = true;
196  return true;
197  }
198 
199  if ((option == "disable") || (option == "enable") ||
200  (option == "preselection")) {
202  if (mod_it == fAnalysisModules.end()) {
203  ND280NamedError("TAnalysisLoop",
204  "Module name " << value << " does not match any module.");
205  return false;
206  }
207 
208  ND::TAnalysisModuleBase *module = mod_it->second;
209 
210  if (option == "disable") {
211  ND280NamedLog("TAnalysisLoop", "Disabling module "
212  << value
213  << " due to user cmd line option.");
214  // Enabling takes precedence over disabling so only set to
215  // false if not already set to true.
216  if (!fUserEnabled.count(value)) {
217  fUserEnabled[value] = false;
218  }
219  } else if (option == "enable") {
220  ND280NamedLog("TAnalysisLoop", "Enabling module "
221  << value
222  << " due to user cmd line option ");
223  // Enabling takes precedence over disabling.
224  fUserEnabled[value] = true;
225  } else if (option == "preselection") {
226  ND280NamedLog("TAnalysisLoop", "Enabling module "
227  << value << ", and using it for");
228  ND280NamedLog("TAnalysisLoop",
229  "\toaEvent output preselection, "
230  "due to user cmd line option.");
231  module->SetEnabled();
232  module->SetUsedForPreselection();
233  fSaveOutputOaEventTree = true;
234  }
235  return true;
236 
237  } else if (option == "save") {
238  fSaveOriginalFullEvent = true;
239  fSaveOutputOaEventTree = true;
240  }
241  // Add the input directory to all the modules.
242  else if (option == "inputdir") {
243  void *dir = gSystem->OpenDirectory(value.c_str());
244  if (dir != NULL) {
245  for (ModDescripterator mod_it = fAnalysisModules.begin();
246  mod_it != fAnalysisModules.end(); ++mod_it) {
247  mod_it->second->SetInputDirectory(value);
248  }
249  ND280NamedLog(
250  "TAnalysisLoop",
251  "Set input directory as: " << value.c_str());
252  return true;
253  }
254  ND280NamedError(
255  "TAnalysisLoop",
256  "Unable to open specified input directory: " << value.c_str());
257  return false;
258  } else {
259  // for options of the type TTruthTrajectoriesModule=SaveAll
260  // Test if the option name is that of a module
262  if (mod_it == fAnalysisModules.end()) {
263  ND280NamedError("TAnalysisLoop", "Module name "
264  << option
265  << " does not match any module.");
266  return false;
267  }
268  return mod_it->second->Configure(value);
269  }
270  return false;
271 }
272 
273 bool TAnalysisLoop::operator()(ND::TND280Event &event) {
274  // Enables reporting of current event number while exiting quickly.
275  fEventCount++;
278  return false;
279  }
280  if ((fEventCount % 100) == 1) {
281  ND280NamedInfo("TAnalysisLoop", "Processed Events " << fEventCount);
282  }
283 
284  // Need to make sure we can get geoemtry before going through analysis
285  // modules.
286  fGeom = ND::TOADatabase::Get().Geometry();
287 
288  bool saveThisFullOaEvent = false;
289 
290  for (ModDescripterator mod_it = fAnalysisModules.begin();
291  mod_it != fAnalysisModules.end(); ++mod_it) {
292  ND::TAnalysisModuleBase &module =
293  static_cast<TAnalysisModuleBase &>(*mod_it->second);
294 
295  if (!module.IsEnabled()) {
296  continue;
297  }
298 
299  ND280NamedVerbose("TAnalysisLoop", "Processing with module "
300  << module.GetName());
301 
303 
304  bool passThroughException = false;
305  try {
306  if (fEventCount == 1) {
307  // As a special case, call ProcessFirstEvent() for the first event.
308  // This is a good time to save persistent quantities in modules'
309  // data members, which will be retrievable from the eventAnalysis output
310  // file.
311  // Not intended for filling in the tree with the first event, as
312  // Process() will also be called.
313  module.ProcessFirstEvent(event);
314  }
315  // Call the module's own Process, passing it the event. If returns true
316  // and module is selected for preselection then save original nd280
317  // event as well as the output analysis trees.
318  saveThisFullOaEvent =
319  module.Process(event) && module.IsUsedForPreselection();
320  } catch (ND::EDataFile &ex) {
321  ND280NamedVerbose("TAnalysisLoop",
322  "Analysing data file, will disable "
323  "Monte Carlo module: "
324  << module.GetName() << " module");
325  module.SetDisabled();
326  continue;
327  } catch (ND::ENoKinematicsPassThroughTrees &ex) {
328  ND280NamedWarn("TAnalysisLoop",
329  "Caught ND::ENoKinematicsPassThroughTr"
330  "ees, "
331  << ex.what());
332  passThroughException = true;
333  } catch (ND::EIncorrectInputGenerator &ex) {
334  ND280NamedWarn("TAnalysisLoop", "Caught ND::EIncorrectInputGenerator, "
335  << ex.what());
336  passThroughException = true;
337  } catch (ND::ENoBeamSummaryData &ex) {
338  if (fProduction) {
339  fExit = true;
340  ND280NamedError(
341  "TAnalysisLoop",
342  "No BSD data available for this "
343  "Spill event - running in production mode - program will exit");
344  }
345  } catch (std::exception &ex) {
346  ND280NamedError("TAnalysisLoop", ex.what());
347  ND280NamedError("TAnalysisLoop", "Disabling module " << module.GetName());
348  if (fProduction || fValidation) {
349  fExit = true;
350  ND280NamedError("TAnalysisLoop",
351  "eventAnalysis is running in production"
352  " mode and has caught an exception so will exit");
353  }
354  module.SetDisabled();
355  continue;
356  } catch (...) {
357  ND280NamedError("TAnalysisLoop", "Disabling module " << module.GetName());
358  if (fProduction || fValidation) {
359  fExit = true;
360  ND280NamedError("TAnalysisLoop",
361  "eventAnalysis is running in production"
362  " mode and has caught an exception so will exit");
363  }
364  module.SetDisabled();
365  continue;
366  }
367 
368  if (passThroughException) {
369  ModDescripterator groo_mod_it =
370  FindNamedModule(fAnalysisModules, "TGRooTrackerVtxModule");
371  ModDescripterator nroo_mod_it =
372  FindNamedModule(fAnalysisModules, "TNRooTrackerVtxModule");
373 
374  bool NRooIsEnabled = (nroo_mod_it != fAnalysisModules.end()) &&
375  (nroo_mod_it->second->IsEnabled());
376  bool GRooIsEnabled = (groo_mod_it != fAnalysisModules.end()) &&
377  (groo_mod_it->second->IsEnabled());
378 
379  // check that the module pointers match up
380  if ((nroo_mod_it->second == mod_it->second) && NRooIsEnabled) {
381  ND280NamedVerbose("TAnalysisLoop",
382  "No neutrino interaction pass-through information"
383  " found for the "
384  << module.GetName() << " module, so it will be "
385  "disabled");
386  nroo_mod_it->second->SetDisabled();
387  ND280NamedLog("TAnalysisLoop", "Deleting pass-through tree for module: "
388  << nroo_mod_it->second->GetName());
389  nroo_mod_it->second->KillOutputTree();
390  NRooIsEnabled = false;
391  }
392 
393  // check that the module pointers match up
394  if ((groo_mod_it->second == mod_it->second) && GRooIsEnabled) {
395  ND280NamedVerbose("TAnalysisLoop",
396  "No neutrino interaction pass-through information"
397  " found for the "
398  << module.GetName() << " module, so it will be "
399  "disabled");
400  groo_mod_it->second->SetDisabled();
401  ND280NamedLog("TAnalysisLoop", "Deleting pass-through tree for module: "
402  << groo_mod_it->second->GetName());
403  groo_mod_it->second->KillOutputTree();
404  GRooIsEnabled = false;
405  }
406 
407  if (!NRooIsEnabled && !GRooIsEnabled) {
408  ND280NamedWarn(
409  "TAnalysisLoop",
410  "No pass through information could be found from the "
411  "neutrino generators. Both RooTracker modules have therefore "
412  "been disabled so no generator information will be available in "
413  "the eventAnalysis file.");
414  if (fProduction) {
415  fExit = true;
416  ND280NamedError(
417  "TAnalysisLoop",
418  "No pass through information has been found for this"
419  " MC file and eventAnalysis is running in production mode, so "
420  "will exit");
421  }
422  }
423  continue;
424  }
425  }
426 
427  if (fExit) {
428  throw EProductionException();
429  }
430 
431  if (saveThisFullOaEvent || fSaveOriginalFullEvent) {
432  return true;
433  } else {
434  return false;
435  }
436 }
437 
439  // Check that the output file is writable first
440  if (!gFile) {
441  ND280NamedError(
442  "TAnalysisLoop",
443  "Output file not specified. Please use the -o filename option");
444  exit(1);
445  }
446 
447  // Override default enable/disable based on usr cmd line options.
448  for (ModDescripterator mod_it = fAnalysisModules.begin();
449  mod_it != fAnalysisModules.end(); ++mod_it) {
450  ND::TAnalysisModuleBase &module =
451  static_cast<TAnalysisModuleBase &>(*mod_it->second);
452 
453  std::string className(mod_it->first);
454 
455  // Ignore enable/disable options if selected for preselection.
456  if (!module.IsUsedForPreselection()) {
457  if (fDisableAll) module.SetDisabled(); // Overrides default values.
458  if (fEnableAll) module.SetEnabled(); // Overrides disable all.
459  if (fUserEnabled.count(className)) {
460  // Override enable/disable all.
461  if (fUserEnabled[className]) {
462  module.SetEnabled();
463  } else {
464  module.SetDisabled();
465  }
466  }
467  }
468  }
469 
470  // Move modules with fIsUsedForPreselection set to the end of the
471  // fAnalysisModules vector
472  std::stable_sort(fAnalysisModules.begin(), fAnalysisModules.end(),
474 
475  for (ModDescripterator mod_it = fAnalysisModules.begin();
476  mod_it != fAnalysisModules.end(); ++mod_it) {
477  ND::TAnalysisModuleBase &module =
478  static_cast<TAnalysisModuleBase &>(*mod_it->second);
479 
480  module.Print();
481 
482  std::string dirname = module.GetDirectoryName();
483  gFile->cd("/");
484  gDirectory->cd("/");
485  if (gFile && !gFile->GetDirectory(dirname.c_str())) {
486  ND280NamedVerbose("TAnalysisLoop", "Making " << dirname);
487  gDirectory->mkdir(dirname.c_str());
488  gDirectory->cd(dirname.c_str());
489  gDirectory->cd("/");
490  }
491  if (module.IsEnabled()) {
492  gDirectory->cd(dirname.c_str());
493  try {
494  // Call the module's own Initialize, passing it its own tree
495  module.Initialize(new TTree(module.GetName(), module.GetTitle()));
496  } catch (std::exception &ex) {
497  ND280NamedError("TAnalysisLoop", ex.what());
498  ND280NamedError("TAnalysisLoop",
499  "Disabling module (unable to initialise) "
500  << module.GetName());
501  module.SetDisabled();
502  continue;
503  } catch (...) {
504  ND280NamedError("TAnalysisLoop",
505  "Disabling module (unable to initialise) "
506  << module.GetName());
507  module.SetDisabled();
508  continue;
509  }
510  }
511  }
512 }
513 
514 void TAnalysisLoop::BeginFile(ND::TVInputFile *vinput) {
515  ND280NamedLog("TAnalysisLoop", "Begin reading input file");
516  ND::TND280Input *input = dynamic_cast<ND::TND280Input *>(vinput);
517  if (input) {
518  ND280NamedLog("TAnalysisLoop", "Successfully cast TVInputFile");
519  TFile *file = input->GetFilePointer();
520  if (file) {
521  ND280NamedLog("TAnalysisLoop", "Setting RooTracker module input files.");
522  ModDescripterator groo_mod_it =
523  FindNamedModule(fAnalysisModules, "TGRooTrackerVtxModule");
524  if (groo_mod_it != fAnalysisModules.end()) {
525  static_cast<TRooTrackerVtxModuleBase *>(groo_mod_it->second)
526  ->SetBeginFile(file);
527  }
528  ModDescripterator nroo_mod_it =
529  FindNamedModule(fAnalysisModules, "TNRooTrackerVtxModule");
530  if (nroo_mod_it != fAnalysisModules.end()) {
531  static_cast<TRooTrackerVtxModuleBase *>(nroo_mod_it->second)
532  ->SetBeginFile(file);
533  }
534  }
535  }
536 }
537 
538 void TAnalysisLoop::EndFile(ND::TVInputFile *) {}
539 
540 void TAnalysisLoop::Finalize(ND::TND280Output *const output) {
541  // Write geometry if needed
542  if (fGeometry) {
543  output->WriteGeometry(fGeom);
544  }
545  // Testing [lp208:2016-03-10]
546  output->cd("/");
547  std::string utilsdir("Config");
548  ND280NamedLog("TAnalysisLoop", "Writing Utils directory: \"" << utilsdir
549  << "\"");
550 
551  output->mkdir(utilsdir.c_str());
552  if (output->cd(utilsdir.c_str())) {
553  TTree *SubDetectorTree =
554  new TTree("ESubdetector",
555  "Tree containing eventAnalysis subdetector enum Definitions.");
556 
557  int sdet;
558  TObjString *sdetName = 0;
559  SubDetectorTree->Branch("ESubdetector_Value", &sdet);
560  SubDetectorTree->Branch("ESubdetector_Name", &sdetName);
561 
563  sdet_it != eventAnalysisEnums::kNSubdetectors; sdet_it = Next(sdet_it)) {
564  (*sdetName) = eventAnalysisEnums::DetectorName(sdet_it).c_str();
565  sdet = static_cast<int>(sdet_it);
566  SubDetectorTree->Fill();
567  }
568 
569  TTree *ParticleCategoryTree = new TTree(
570  "EParticlecategory",
571  "Tree containing eventAnalysis particle category enum Definitions.");
572 
573  int part;
574  TObjString *partName = 0;
575  ParticleCategoryTree->Branch("EParticleCategory_Value", &part);
576  ParticleCategoryTree->Branch("EParticleCategory_Name", &partName);
577 
581  part_it = Next(part_it)) {
582  (*partName) = eventAnalysisEnums::ParticleName(part_it).c_str();
583  part = static_cast<int>(part_it);
584  ParticleCategoryTree->Fill();
585  }
586 
587  for (ModDescripterator mod_it = fAnalysisModules.begin();
588  mod_it != fAnalysisModules.end(); ++mod_it) {
589  ND::TAnalysisModuleBase &module =
590  static_cast<TAnalysisModuleBase &>(*mod_it->second);
591 
592  TTree *modConfigTree =
593  new TTree(module.GetName(),
594  (std::string(module.GetName()) + "-ConfigTree").c_str());
595  module.FillConfigTree(modConfigTree);
596  }
597 
598  } else {
599  ND280NamedError("TAnalysisLoop", "Failed to make Config directory.");
600  }
601 
602  // Call the modules destructor to clean up memory resident objects so they
603  // are not saved in the output file. For some reason std::list::clear() does
604  // not call the destructors so doing it explicitly.
605  //[ed] It's a list/map of pointers, the list doesn't own the memory
606  // and has no right calling the destructor, it will correctly destruct the
607  // pointers that it does own.
608  for (ModDescripterator mod_it = fAnalysisModules.begin();
609  mod_it != fAnalysisModules.end(); ++mod_it) {
610  delete mod_it->second;
611  }
612  fAnalysisModules.clear();
613 
614  ND280NamedLog("TAnalysisLoop",
615  "Total number of events processed in Analysis "
616  "Format: "
617  << fEventCount);
618  output->cd("/");
619  if (!fSaveOutputOaEventTree) {
620  output->Delete("ND280Events;*");
621  }
622 }
623 
625  for (ModDescripterator mod_it = fAnalysisModules.begin();
626  mod_it != fAnalysisModules.end(); ++mod_it) {
627  mod_it->second->SetEnabled(mod_it->second->IsEnabledByDefault());
628  }
629 }
630 
632  std::vector<TAnalysisLoop::ModDescriptor> const &ModMap,
633  std::string ModuleName) {
634  for (TAnalysisLoop::CModDescripterator mod_it = ModMap.begin();
635  mod_it != ModMap.end(); ++mod_it) {
636  if (mod_it->first == ModuleName) {
637  return mod_it;
638  }
639  }
640  return ModMap.end();
641 }
642 
644  std::vector<TAnalysisLoop::ModDescriptor> &ModMap, std::string ModuleName) {
645  for (TAnalysisLoop::ModDescripterator mod_it = ModMap.begin();
646  mod_it != ModMap.end(); ++mod_it) {
647  if (mod_it->first == ModuleName) {
648  return mod_it;
649  }
650  }
651  return ModMap.end();
652 }
653 }
virtual void Print()
Prints a simple message describing the module.
bool fGeometry
Flag to control saving ND280 geometry.
std::string CurrentlyProcessingModule
Holds the name of the module that is currently executing TAnalysisBase::Process.
virtual bool Process(ND::TND280Event &event)
Gets the run and event IDs and calls FillTree with the event, and then actually calls fOutputTree-&gt;Fi...
An analysis module which carries some very simple event-level header information. ...
bool fEnableAll
Enables All modules, if a given module isn&#39;t disabled in fUserEnabled.
virtual Bool_t IsEnabled() const
Whether the module is enable or not.
eventAnalysis module for storing the truth information for primary vertices in events ...
Abstract base class for converting the neutrino MC pass-through information into eventAnalysis define...
bool fExit
If set to true during execution will result in execution termination at the end of the next event...
Used to summarise the reconstruction of an event in the P0DECal.
virtual Bool_t IsUsedForPreselection() const
Whether the module should call IsFullEventWorthSaving() function for each event, to decide if the ful...
Responsible for setting up output tree, looping over oaEvent containers, and filling output objects...
A base class for classes which specify how to set up an Analysis format output tree, and fill it.
virtual void SetDisabled()
Disables the module.
std::string DetectorName(ESubdetector const subdet)
std::vector< ModDescriptor > fAnalysisModules
Internal map of all modules.
bool fSaveOutputOaEventTree
Set automatically if the oaEvent tree needs to be saved in output file.
TGeoManager * fGeom
The ND280 geometry to be saved.
TAnalysisLoop()
Initialize any class specific variables.
Used to fill a TTree of summary information for the SFG reconstruction algorithms.
int EventNumber
Holds the number of processed events.
void SetModuleDefaults()
Method to set the the default enable/disable values for all modules in fAnalysisModules map...
TReconPerformanceEvalModule - Object that contains information related to the performance of global r...
Used to fill a TTree of summary information for the P0D reconstruction algorithms.
std::string const GetDirectoryName() const
Returns the name of the directory which the output of a particular module will be saved in...
int fEventCount
Keep track of the events that have been read.
virtual void SetUsedForPreselection(Bool_t isused=true)
Sets whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output.
This module summarizes the information from global reconstruction.
bool fSaveOriginalFullEvent
Flag if the full event (not the analysis format) is also to be saved This overrides any -preselection...
bool operator()(ND::TND280Event &event)
Called for each event inside the event loop, and returns true if the event should be saved to the out...
ESubdetector Next(ESubdetector const subdet)
virtual void SetEnabled(Bool_t isenabled=true)
Sets whether the module is enabled.
std::map< std::string, bool > fUserEnabled
Store whether a module has been set to disabled/enables by user as well as whether the disable/enable...
bool fProduction
Controls production mode.
TTRExReconModule - Object that contains information related to reconstructed object from the extende...
virtual void BeginFile(ND::TVInputFile *input)
Called before the first event of a file is read, but you should prefer TAnalysisLoop::Initialize for ...
std::string ParticleName(EParticleCategory const category)
Summary information from smrdRecon output.
virtual Bool_t ProcessFirstEvent(ND::TND280Event &)=0
Is called after the first event is loaded in.
virtual void Finalize(ND::TND280Output *const output)
An analysis module which carries some low level hit information.
virtual void EndFile(ND::TVInputFile *)
Called after the last event of a file is read, but you should prefer TAnalysisLoop: Finalize() for ge...
virtual ~TAnalysisLoop()
void Usage(void)
Print a usage message.
The eventAnalysis module responsible for saving information about the True Particles in an event from...
std::vector< ModDescriptor >::iterator ModDescripterator
Private typedef which makes talking to fAnalysisModules slightly nicer.
bool fDisableAll
This is overridden by fEnableAll.
virtual void Initialize(void)
Called after the arguments are processes by before reading the first event.
bool StopProcessing
Used to notify the event loop to stop processing events and finish quickly.
This module summarizes the reconstruction information from the trackerRecon.
bool fValidation
Control validation mode.
An analysis module which carries some simple event-level header information.
ModDescripterator FindNamedModule(std::vector< TAnalysisLoop::ModDescriptor > &ModMap, std::string ModuleName)
Searches through TAnalysisLoop::fAnalysisModules for a street module named Bob.
std::vector< ModDescriptor >::const_iterator CModDescripterator
Private typedef which makes talking to fAnalysisModules slightly nicer.
virtual bool SetOption(std::string, std::string)
Set an option and return true if it is valid.
An analysis module which stores the contents of the tags part of oaEvent.
Definition: TTagsModule.hxx:27
bool PreselectionSorter(std::pair< std::string, ND::TAnalysisModuleBase * > const &LHS, std::pair< std::string, ND::TAnalysisModuleBase * > const &RHS)
Used to sort Preselecting modules to the end of the vector.
virtual void FillConfigTree(TTree *)

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:43:58 for eventAnalysis by doxygen 1.8.5