/
G4_DSTReader_fsPHENIX.C
184 lines (161 loc) · 4.02 KB
/
G4_DSTReader_fsPHENIX.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#ifndef MACRO_G4DSTREADERFSPHENIX_C
#define MACRO_G4DSTREADERFSPHENIX_C
#include <GlobalVariables.C>
#include <G4_CEmc_Spacal.C>
#include <G4_FEMC.C>
#include <G4_FGEM_fsPHENIX.C>
#include <G4_FHCAL.C>
#include <G4_HcalIn_ref.C>
#include <G4_HcalOut_ref.C>
#include <G4_Intt.C>
#include <G4_Magnet.C>
#include <G4_Mvtx.C>
#include <G4_TPC.C>
#include <g4eval/PHG4DSTReader.h>
#include <fun4all/Fun4AllServer.h>
R__LOAD_LIBRARY(libg4eval.so)
//////////////////////////////////////////////////////////////////
/*!
\file G4_DSTReader.C
\brief Convert DST to human command readable TTree for quick poke around the outputs
\author Jin Huang
\version $Revision: $
\date $Date: $
*/
//////////////////////////////////////////////////////////////////
namespace Enable
{
bool DSTREADER = false;
int DSTREADER_VERBOSITY = 0;
} // namespace Enable
namespace G4DSTREADER
{
bool save_g4_raw = true;
double tower_zero_supp = 1.e-6;
} // namespace G4DSTREADER
void G4DSTreader_fsPHENIXInit() {}
void G4DSTreader_fsPHENIX(const string &outputFile = "G4sPHENIXCells.root")
{
//! debug output on screen?
int verbosity = max(Enable::VERBOSITY, Enable::DSTREADER_VERBOSITY);
// save a comprehensive evaluation file
PHG4DSTReader *ana = new PHG4DSTReader(outputFile);
ana->set_save_particle(true);
ana->set_load_all_particle(false);
ana->set_load_active_particle(true);
ana->set_save_vertex(true);
ana->Verbosity(verbosity);
if (G4DSTREADER::save_g4_raw)
{
if (Enable::MVTX)
{
ana->AddNode("MVTX");
}
if (Enable::INTT)
{
ana->AddNode("INTT");
}
if (Enable::TPC)
{
ana->AddNode("TPC");
}
if (Enable::CEMC)
{
ana->AddNode("CEMC");
if (Enable::ABSORBER || Enable::CEMC_ABSORBER)
{
ana->AddNode("ABSORBER_CEMC");
ana->AddNode("CEMC_ELECTRONICS");
ana->AddNode("CEMC_SPT");
}
}
if (Enable::HCALIN)
{
ana->AddNode("HCALIN");
if (Enable::ABSORBER || Enable::HCALIN_ABSORBER)
ana->AddNode("ABSORBER_HCALIN");
}
if (Enable::MAGNET)
{
if (Enable::ABSORBER || Enable::MAGNET_ABSORBER)
ana->AddNode("MAGNET");
}
if (Enable::HCALOUT)
{
ana->AddNode("HCALOUT");
if (Enable::ABSORBER || Enable::HCALOUT_ABSORBER)
ana->AddNode("ABSORBER_HCALOUT");
}
if (Enable::FHCAL)
{
ana->AddNode("FHCAL");
if (Enable::ABSORBER || Enable::FHCAL_ABSORBER)
ana->AddNode("ABSORBER_FHCAL");
}
if (Enable::FEMC)
{
ana->AddNode("FEMC");
if (Enable::ABSORBER || Enable::FEMC_ABSORBER)
ana->AddNode("ABSORBER_FEMC");
}
if (Enable::FGEM)
{
ana->AddNode("FGEM_0");
ana->AddNode("FGEM_1");
ana->AddNode("FGEM_2");
ana->AddNode("FGEM_3");
ana->AddNode("FGEM_4");
}
if (Enable::BLACKHOLE)
{
ana->AddNode("BH_1");
ana->AddNode("BH_FORWARD_PLUS");
ana->AddNode("BH_FORWARD_NEG");
}
}
ana->set_tower_zero_sup(G4DSTREADER::tower_zero_supp);
if (Enable::CEMC_TOWER)
{
ana->AddTower("SIM_CEMC");
ana->AddTower("RAW_CEMC");
ana->AddTower("CALIB_CEMC");
}
if (Enable::HCALIN_TOWER)
{
ana->AddTower("SIM_HCALIN");
ana->AddTower("RAW_HCALIN");
ana->AddTower("CALIB_HCALIN");
}
if (Enable::HCALOUT_TOWER)
{
ana->AddTower("SIM_HCALOUT");
ana->AddTower("RAW_HCALOUT");
ana->AddTower("CALIB_HCALOUT");
}
if (Enable::FHCAL_TOWER)
{
ana->AddTower("SIM_FHCAL");
ana->AddTower("RAW_FHCAL");
ana->AddTower("CALIB_FHCAL");
}
if (Enable::FEMC_TOWER)
{
ana->AddTower("SIM_FEMC");
ana->AddTower("RAW_FEMC");
ana->AddTower("CALIB_FEMC");
}
// Jets disabled for now
// if (Enable::JETS)
// {
//
// ana->AddJet("AntiKt06JetsInPerfect");
// ana->AddJet("G4TowerJets_6");
// }
// if (embed_input_file && do_jet_reco)
// {
// ana->AddJet("G4TowerJets_combined_6");
// }
Fun4AllServer *se = Fun4AllServer::instance();
se->registerSubsystem(ana);
}
#endif