forked from sPHENIX-Collaboration/coresoftware
/
RawTowerCalibration.h
177 lines (142 loc) · 3.75 KB
/
RawTowerCalibration.h
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
#ifndef CALORECO_RAWTOWERCALIBRATION_H
#define CALORECO_RAWTOWERCALIBRATION_H
#include <fun4all/SubsysReco.h>
#include <phparameter/PHParameters.h>
#include <iostream>
#include <string>
class PHCompositeNode;
class RawTowerContainer;
class RawTowerGeomContainer;
//! calibrate ADC value to measured energy deposition in calorimeter towers
//! default input DST node is TOWER_RAW_DETECTOR
//! default output DST node is TOWER_CALIB_DETECTOR
class RawTowerCalibration : public SubsysReco
{
public:
RawTowerCalibration(const std::string &name = "RawTowerCalibration");
~RawTowerCalibration() override
{
}
int InitRun(PHCompositeNode *topNode) override;
int process_event(PHCompositeNode *topNode) override;
int End(PHCompositeNode *topNode) override;
void
Detector(const std::string &d)
{
detector = d;
_tower_calib_params.set_name(d);
}
void
TowerType(const int type)
{
_tower_type = type;
}
enum enu_calib_algorithm
{
//! directly pass the energy of raw tower to calibrated tower. Zero suppression is applied
kNo_calibration = 0,
//! simple calibration with pedstal subtraction and a global energy scale (sampling fraction) correction
kSimple_linear_calibration = 1,
//! input calibration file for tower by tower calibration. Use GetCalibrationParameters() to set the calibration parameters
kTower_by_tower_calibration = 2
};
enu_calib_algorithm
get_calib_algorithm() const
{
return _calib_algorithm;
}
void
set_calib_algorithm(enu_calib_algorithm calibAlgorithm)
{
_calib_algorithm = calibAlgorithm;
}
double
get_calib_const_GeV_ADC() const
{
return _calib_const_GeV_ADC;
}
void
set_calib_const_GeV_ADC(double calibConstGeVAdc)
{
_calib_const_GeV_ADC = calibConstGeVAdc;
}
void
set_variable_GeV_ADC(const bool value)
{
_GeV_ADC_file = value;
}
std::string
get_calib_tower_node_prefix() const
{
return _calib_tower_node_prefix;
}
void
set_calib_tower_node_prefix(const std::string &calibTowerNodePrefix)
{
_calib_tower_node_prefix = calibTowerNodePrefix;
}
double
get_pedstal_ADC() const
{
return _pedstal_ADC;
}
void
set_pedstal_ADC(double pedstalAdc)
{
_pedstal_ADC = pedstalAdc;
}
void
set_variable_pedestal(const bool value)
{
_pedestal_file = value;
}
std::string
get_raw_tower_node_prefix() const
{
return _raw_tower_node_prefix;
}
void
set_raw_tower_node_prefix(const std::string &rawTowerNodePrefix)
{
_raw_tower_node_prefix = rawTowerNodePrefix;
}
void
set_zero_suppression_GeV(double)
{
std::cout << "RawTowerCalibration::set_zero_suppression_GeV is deprecated!" << std::endl
<< " See discussion at https://github.com/sPHENIX-Collaboration/coresoftware/pull/867" << std::endl
<< std::endl;
}
//! Get the parameters for update. Useful fields are listed in SetDefaultParameters();
PHParameters &
GetCalibrationParameters()
{
return _tower_calib_params;
}
protected:
void
CreateNodes(PHCompositeNode *topNode);
enu_calib_algorithm _calib_algorithm;
RawTowerContainer *_calib_towers;
RawTowerContainer *_raw_towers;
RawTowerGeomContainer *rawtowergeom;
std::string detector;
std::string RawTowerNodeName;
std::string CaliTowerNodeName;
std::string TowerGeomNodeName;
std::string _calib_tower_node_prefix;
std::string _raw_tower_node_prefix;
//! pedstal in unit of ADC
double _pedstal_ADC;
//! pedestal from file
bool _pedestal_file;
//! calibration constant in unit of GeV per ADC
double _calib_const_GeV_ADC;
//! GeV per ADC from file
bool _GeV_ADC_file;
//! tower type to act on
int _tower_type;
//! Tower by tower calibration parameters
PHParameters _tower_calib_params;
};
#endif