forked from ECCE-EIC/macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
G4_EventEvaluator.C
86 lines (73 loc) · 2.8 KB
/
G4_EventEvaluator.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef MACRO_EventEvaluator_C
#define MACRO_EventEvaluator_C
#include <fun4all/Fun4AllServer.h>
#include <eiceval/EventEvaluatorEIC.h>
R__LOAD_LIBRARY(libfun4all.so)
R__LOAD_LIBRARY(libeiceval.so)
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;
bool EVENT_EVAL_DO_HITS = false;
bool EVENT_EVAL_DO_HITS_ABSORBER = false;
bool EVENT_EVAL_DO_HITS_CALO = false;
bool EVENT_EVAL_DO_HITS_BLACKHOLE = false;
} // namespace Enable
namespace EVENT_EVALUATOR
{
int Verbosity = 0;
float EnergyThreshold = 0.05;
} // namespace EVENT_EVALUATOR
void Event_Eval(const std::string &filename)
{
Fun4AllServer *se = Fun4AllServer::instance();
EventEvaluatorEIC *eval = new EventEvaluatorEIC("EVENTEVALUATOR", filename);
eval->set_reco_tracing_energy_thresholdMC(EVENT_EVALUATOR::EnergyThreshold);
eval->Verbosity(EVENT_EVALUATOR::Verbosity);
if (Enable::TRACKING)
{
eval->set_do_TRACKS(true);
if (Enable::EVENT_EVAL_DO_HITS) {
std::cout << "Enabled hits in event eval.\n";
eval->set_do_HITS(true);
if (Enable::EVENT_EVAL_DO_HITS_ABSORBER) {
std::cout << "Enabled absorber hits in event eval.\n";
eval->set_do_HITS_ABSORBER(true);
}
if (Enable::EVENT_EVAL_DO_HITS_CALO) {
std::cout << "Enabled calorimeter hits in event eval.\n";
eval->set_do_HITS_CALO(true);
}
if (Enable::BLACKHOLE_SAVEHITS && Enable::EVENT_EVAL_DO_HITS_BLACKHOLE) eval->set_do_BLACKHOLE(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);
}
// set calorimeter Infos
if (Enable::CEMC) eval->set_do_CEMC(true);
if (Enable::EEMC || Enable::EEMCH) eval->set_do_EEMC(true);
if (Enable::EEMCH && G4EEMCH::SETTING::USEHYBRID) eval->set_do_EEMCG(true);
if (Enable::FEMC) eval->set_do_FEMC(true);
if (Enable::EHCAL) eval->set_do_EHCAL(true);
if (Enable::HCALIN) eval->set_do_HCALIN(true);
if (Enable::HCALOUT) eval->set_do_HCALOUT(true);
if (Enable::FHCAL) eval->set_do_FHCAL(true);
if (Enable::FHCAL_CLUSTER || Enable::FEMC_CLUSTER || Enable::EEMC_CLUSTER) eval->set_do_CLUSTERS(true);
if (Enable::DRCALO) eval->set_do_DRCALO(true);
if (Enable::LFHCAL) eval->set_do_LFHCAL(true);
if (Enable::BECAL) eval->set_do_BECAL(true);
// storing MC event info
eval->set_do_MCPARTICLES(true);
eval->set_do_HEPMC(Enable::EVENT_EVAL_DO_HEPMC);
eval->set_do_store_event_level_info(Enable::EVENT_EVAL_DO_EVT_LVL);
// storing geometry
eval->set_do_GEOMETRY(true);
se->registerSubsystem(eval);
return;
}
#endif