Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Proto4ShowerCalib.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Proto4ShowerCalib.h
1
#ifndef __Proto4ShowerCalib_H__
2
#define __Proto4ShowerCalib_H__
3
4
#include <TFile.h>
5
#include <TNtuple.h>
6
#include <
fun4all/SubsysReco.h
>
7
#include <stdint.h>
8
#include <fstream>
9
#include <string>
10
11
class
PHCompositeNode
;
12
class
PHG4HitContainer
;
13
class
Fun4AllHistoManager
;
14
class
TH1F;
15
class
TH2F;
16
class
TTree;
17
class
TChain;
18
class
SvtxEvalStack
;
19
class
PHG4Particle
;
20
class
RawTowerGeom
;
21
class
RawTowerContainer
;
22
class
SvtxTrack
;
23
25
class
Proto4ShowerCalib
:
public
SubsysReco
26
{
27
public
:
29
Proto4ShowerCalib
(
const
std::string
&
filename
=
"Proto4ShowerCalib.root"
);
30
32
virtual
~Proto4ShowerCalib
();
33
35
int
Init
(
PHCompositeNode
*topNode);
36
38
int
InitRun
(
PHCompositeNode
*topNode);
39
41
int
process_event
(
PHCompositeNode
*topNode);
42
44
int
End
(
PHCompositeNode
*topNode);
45
47
void
48
is_sim
(
bool
b
)
49
{
50
_is_sim
=
b
;
51
}
52
53
// ShowerCalib Analysis
54
int
InitAna
();
55
56
int
MakeAna
();
57
58
int
FinishAna
();
59
60
void
set_runID
(
std::string
runID)
61
{
62
_mRunID
= runID;
63
}
64
65
66
class
Eval_Run :
public
TObject
67
{
68
public
:
69
Eval_Run
()
70
{
71
reset
();
72
}
73
virtual
~Eval_Run
()
74
{
75
}
76
77
void
78
reset
()
79
{
80
run
= -31454;
81
event
= -31454;
82
beam_mom
= -0;
83
hodo_h
= -31454;
84
hodo_v
= -31454;
85
C2_sum
= -31454;
86
C1
= -31454;
87
88
valid_hodo_v
=
false
;
89
valid_hodo_h
=
false
;
90
trigger_veto_pass
=
false
;
91
good_e
=
false
;
92
good_anti_e
=
false
;
93
94
beam_2CH_mm
= -31454;
95
beam_2CV_mm
= -31454;
96
97
truth_y
= -31454;
98
truth_z
= -31454;
99
100
sum_E_CEMC
= -31454;
101
sum_E_HCAL_OUT
= -31454;
102
sum_E_HCAL_IN
= -31454;
103
}
104
105
int
run
;
106
int
event
;
107
109
float
beam_mom
;
110
112
int
hodo_h
;
113
int
hodo_v
;
114
116
float
C2_sum
;
117
float
C1
;
118
120
bool
valid_hodo_v
;
121
bool
valid_hodo_h
;
122
124
bool
trigger_veto_pass
;
125
127
bool
good_e
;
128
130
bool
good_anti_e
;
131
133
float
beam_2CH_mm
;
134
float
beam_2CV_mm
;
135
137
float
truth_y
;
138
float
truth_z
;
139
141
double
sum_E_CEMC
;
142
double
sum_E_HCAL_OUT
;
143
double
sum_E_HCAL_IN
;
144
145
ClassDef(
Eval_Run
, 10)
146
};
147
148
class
HCAL_Tower
:
public
TObject
149
{
150
public
:
151
HCAL_Tower
()
152
{
153
reset
();
154
}
155
156
virtual
~HCAL_Tower
(){}
157
158
void
reset
()
159
{
160
// HCALIN
161
hcalin_e_sim
= 0.;
162
163
hcalin_lg_e_raw
= 0.;
164
hcalin_lg_e_calib
= 0.;
165
166
for
(
int
itwr=0; itwr<16; itwr++)
167
{
168
hcalin_twr_sim
[itwr] = 0.;
169
hcalin_lg_twr_raw
[itwr] = 0.;
170
hcalin_lg_twr_calib
[itwr] = 0.;
171
}
172
173
// HCALOUT
174
hcalout_e_sim
= 0.;
175
176
hcalout_lg_e_raw
= 0.;
177
hcalout_lg_e_calib
= 0.;
178
179
hcalout_hg_e_raw
= 0.;
180
hcalout_hg_e_calib
= 0.;
181
182
for
(
int
itwr=0; itwr<16; itwr++)
183
{
184
hcalout_twr_sim
[itwr] = 0.;
185
186
hcalout_lg_twr_raw
[itwr] = 0.;
187
hcalout_lg_twr_calib
[itwr] = 0.;
188
189
hcalout_hg_twr_raw
[itwr] = 0.;
190
hcalout_hg_twr_calib
[itwr] = 0.;
191
}
192
193
// total energy and asymmetry
194
hcal_total_sim
= -999.;
195
hcal_total_raw
= -999.;
196
hcal_total_calib
= -999.;
197
198
hcal_asym_sim
= -999.;
199
hcal_asym_raw
= -999.;
200
hcal_asym_calib
= -999.;
201
}
202
203
204
// HCALIN
205
float
hcalin_e_sim
;
206
float
hcalin_twr_sim
[16];
207
208
float
hcalin_lg_e_raw
;
209
float
hcalin_lg_twr_raw
[16];
210
211
float
hcalin_lg_e_calib
;
212
float
hcalin_lg_twr_calib
[16];
213
214
// HCALOUT
215
float
hcalout_e_sim
;
216
float
hcalout_twr_sim
[16];
217
218
float
hcalout_lg_e_raw
;
219
float
hcalout_lg_twr_raw
[16];
220
221
float
hcalout_lg_e_calib
;
222
float
hcalout_lg_twr_calib
[16];
223
224
float
hcalout_hg_e_raw
;
225
float
hcalout_hg_twr_raw
[16];
226
227
float
hcalout_hg_e_calib
;
228
float
hcalout_hg_twr_calib
[16];
229
230
// total energy and asymmetry
231
float
hcal_total_sim
;
232
float
hcal_total_raw
;
233
float
hcal_total_calib
;
234
235
float
hcal_asym_sim
;
236
float
hcal_asym_raw
;
237
float
hcal_asym_calib
;
238
239
ClassDef(
HCAL_Tower
, 10)
240
};
241
242
private
:
243
// calorimeter size
244
enum
245
{
246
n_size
= 8
247
};
248
250
bool
_is_sim
;
251
253
Fun4AllHistoManager
*
254
get_HistoManager
();
255
256
std::pair<int, int>
257
find_max
(
RawTowerContainer
*towers,
int
cluster_size);
258
260
std::string
_filename
;
261
263
unsigned
long
_ievent
;
264
266
Eval_Run
_eval_run
;
267
269
HCAL_Tower
_tower
;
270
271
// TowerCalib Analysis
272
TFile *
mFile_OutPut
;
273
TChain *
mChainInPut
;
274
unsigned
long
_mStartEvent
;
275
unsigned
long
_mStopEvent
;
276
int
_mInPut_flag
;
277
std::string
_mList
;
278
std::string
_mRunID
;
279
280
Eval_Run
*
_mInfo
;
281
HCAL_Tower
*
_mTower
;
282
283
// TH2F *h_mAsymmEnergy_mixed_sim_wo_cut; // sim
284
TH2F *
h_mAsymmEnergy_pion_sim_wo_cut
;
285
286
// TH2F *h_mAsymmEnergy_mixed_sim;
287
TH2F *
h_mAsymmEnergy_pion_sim
;
288
289
TH2F *
h_mAsymmAdc_mixed
;
// production
290
TH2F *
h_mAsymmAdc_electron
;
291
TH2F *
h_mAsymmAdc_pion
;
292
293
TH2F *
h_mAsymmEnergy_mixed_wo_cut
;
294
TH2F *
h_mAsymmEnergy_electron_wo_cut
;
295
TH2F *
h_mAsymmEnergy_pion_wo_cut
;
296
297
TH2F *
h_mAsymmEnergy_mixed
;
// MIP study
298
TH2F *
h_mAsymmEnergy_electron
;
299
TH2F *
h_mAsymmEnergy_pion
;
300
301
// balancing
302
TH2F *
h_mAsymmEnergy_mixed_balancing
;
303
TH2F *
h_mAsymmEnergy_electron_balancing
;
304
TH2F *
h_mAsymmEnergy_pion_balancing
;
305
306
// leveling correction
307
TH2F *
h_mAsymmEnergy_mixed_leveling
;
308
TH2F *
h_mAsymmEnergy_electron_leveling
;
309
TH2F *
h_mAsymmEnergy_pion_leveling
;
310
311
// shower calib
312
TH2F *
h_mAsymmEnergy_mixed_ShowerCalib
;
313
TH2F *
h_mAsymmEnergy_electron_ShowerCalib
;
314
TH2F *
h_mAsymmEnergy_pion_ShowerCalib
;
315
316
// Outer HCal only study
317
TH2F *
h_mAsymmEnergy_mixed_MIP
;
318
TH1F *
h_mEnergyOut_electron
;
// hadron MIP through inner HCal
319
TH1F *
h_mEnergyOut_pion
;
320
TH1F *
h_mEnergyOut_electron_ShowerCalib
;
321
TH1F *
h_mEnergyOut_pion_ShowerCalib
;
322
323
int
getChannelNumber
(
int
column,
int
row);
324
int
setTowerCalibParas
();
325
326
// correction factors
327
const
double
samplefrac_in
= 0.09267;
328
const
double
samplefrac_out
= 0.02862;
329
330
// inner HCAL MIP energy extracted from muon
331
const
double
MIP_mean
= 0.654927;
332
const
double
MIP_width
= 0.151484;
333
334
// const double samplefrac_in = 0.0631283; // from Songkyo
335
// const double samplefrac_out = 0.0338021;
336
337
double
towercalib_lg_in
[16];
338
double
towercalib_lg_out
[16];
339
double
towercalib_hg_out
[16];
340
341
// const double showercalib = 3.03185; // extracted with 12 GeV Test Beam Data
342
const
double
showercalib
= 2.92243;
// extracted with 8 GeV Test Beam Data
343
const
double
showercalib_ohcal
= 3.37511;
// extracted with 8 GeV Test Beam Data
344
345
float
find_range
();
346
int
find_energy
();
347
348
// used by RAW
349
};
350
351
#endif // __Proto4ShowerCalib_H__
analysis
blob
master
Prototype4
HCal
ShowerCalib
Proto4ShowerCalib.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:56
using
1.8.2 with
sPHENIX GitHub integration