From 7a017bb9fcd116270250ed9e62efa31b99efbb6f Mon Sep 17 00:00:00 2001 From: cdean-github Date: Tue, 5 Oct 2021 18:39:47 -0400 Subject: [PATCH] FIxed event eval so HepMC can be written independently of DST production --- common/G4_EventEvaluator.C | 12 ++++++------ detectors/EICDetector/Fun4All_G4_EICDetector.C | 3 ++- detectors/EICDetector/Fun4All_runEvaluators.C | 18 ++++++++++++------ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/common/G4_EventEvaluator.C b/common/G4_EventEvaluator.C index 4c06a3da..490e6cc2 100644 --- a/common/G4_EventEvaluator.C +++ b/common/G4_EventEvaluator.C @@ -11,6 +11,8 @@ namespace Enable { // use Enable::EVENT_EVAL = true; in your macro bool EVENT_EVAL = false; + bool EVENT_EVAL_DO_HEPMC = false; + bool EVENT_EVAL_DO_EVT_LVL = false; } // namespace Enable namespace EVENT_EVALUATOR @@ -32,10 +34,8 @@ void Event_Eval(const std::string &filename) eval->set_do_TRACKS(true); //eval->set_do_HITS(true); eval->set_do_PROJECTIONS(true); - if (G4TRACKING::DISPLACED_VERTEX) - eval->set_do_VERTEX(true); - if (Enable::DIRC_RECO or Enable::mRICH_RECO or Enable::RICH_RECO) - eval->set_do_PID_LogLikelihood(true); + if (G4TRACKING::DISPLACED_VERTEX) eval->set_do_VERTEX(true); + if (Enable::DIRC_RECO or Enable::mRICH_RECO or Enable::RICH_RECO) eval->set_do_PID_LogLikelihood(true); } if (Enable::CEMC) eval->set_do_CEMC(true); if (Enable::EEMC || Enable::EEMCH) eval->set_do_EEMC(true); @@ -51,8 +51,8 @@ void Event_Eval(const std::string &filename) if (Enable::BECAL) eval->set_do_BECAL(true); eval->set_do_MCPARTICLES(true); - eval->set_do_HEPMC(Input::PYTHIA6 or Input::PYTHIA8 or Input::SARTRE or Input::HEPMC or Input::READEIC); - eval->set_do_store_event_level_info(Input::PYTHIA6 or Input::PYTHIA8 or Input::READEIC); + eval->set_do_HEPMC(Enable::EVENT_EVAL_DO_HEPMC); + eval->set_do_store_event_level_info(Enable::EVENT_EVAL_DO_EVT_LVL); se->registerSubsystem(eval); return; diff --git a/detectors/EICDetector/Fun4All_G4_EICDetector.C b/detectors/EICDetector/Fun4All_G4_EICDetector.C index eac6a172..c70e8bbf 100644 --- a/detectors/EICDetector/Fun4All_G4_EICDetector.C +++ b/detectors/EICDetector/Fun4All_G4_EICDetector.C @@ -407,7 +407,8 @@ int Fun4All_G4_EICDetector( Enable::EVENT_EVAL = false; // EVENT_EVALUATOR::Verbosity = 1; // EVENT_EVALUATOR::EnergyThreshold = 0.05; // GeV - + Enable::EVENT_EVAL_DO_HEPMC = Input::PYTHIA6 or Input::PYTHIA8 or Input::SARTRE or Input::HEPMC or Input::READEIC; + Enable::EVENT_EVAL_DO_EVT_LVL = Input::PYTHIA6 or Input::PYTHIA8 or Input::READEIC; //Enable::USER = true; //--------------- diff --git a/detectors/EICDetector/Fun4All_runEvaluators.C b/detectors/EICDetector/Fun4All_runEvaluators.C index 0f70d79e..4306de36 100644 --- a/detectors/EICDetector/Fun4All_runEvaluators.C +++ b/detectors/EICDetector/Fun4All_runEvaluators.C @@ -126,11 +126,17 @@ int Fun4All_runEvaluators( //---- // Enable HepMC writing //---- - Input::HEPMC = true; - string singleParticles = "single"; - size_t = inputFile.find(singleParticles); - if (pos == ring::npos) Input::HEPMC = false; - + Enable::EVENT_EVAL_DO_HEPMC = true; + Enable::EVENT_EVAL_DO_EVT_LVL = true; + size_t pos = inputFile.find("single"); + if (pos != string::npos) + { + Enable::EVENT_EVAL_DO_HEPMC = false; + Enable::EVENT_EVAL_DO_EVT_LVL = false; + } + pos = inputFile.find("SARTRE"); + if (pos != string::npos) Enable::EVENT_EVAL_DO_EVT_LVL = false; + //----- // Output file headers and path //----- @@ -138,7 +144,7 @@ int Fun4All_runEvaluators( //Get base file name string baseFile = inputFile; string remove_this = ".root"; - size_t pos = baseFile.find(remove_this); + pos = baseFile.find(remove_this); if (pos != string::npos) { baseFile.erase(pos, remove_this.length());