15 double ADC_GEV_EM = 13.55, ADC_GEV_HAD = 0.6;
16 int LSB_EM = 1, LSB_HAD = 5;
17 std::vector<int> fC_TDR;
59 fC_TDR.push_back(102);
60 fC_TDR.push_back(107);
61 fC_TDR.push_back(112);
62 fC_TDR.push_back(117);
63 fC_TDR.push_back(122);
64 fC_TDR.push_back(127);
65 fC_TDR.push_back(132);
66 fC_TDR.push_back(142);
67 fC_TDR.push_back(152);
68 fC_TDR.push_back(162);
69 fC_TDR.push_back(172);
70 fC_TDR.push_back(182);
71 fC_TDR.push_back(192);
72 fC_TDR.push_back(202);
73 fC_TDR.push_back(217);
74 fC_TDR.push_back(232);
75 fC_TDR.push_back(247);
76 fC_TDR.push_back(262);
77 fC_TDR.push_back(282);
78 fC_TDR.push_back(302);
79 fC_TDR.push_back(322);
80 fC_TDR.push_back(347);
81 fC_TDR.push_back(372);
82 fC_TDR.push_back(397);
83 fC_TDR.push_back(372);
84 fC_TDR.push_back(397);
85 fC_TDR.push_back(422);
86 fC_TDR.push_back(447);
87 fC_TDR.push_back(472);
88 fC_TDR.push_back(497);
89 fC_TDR.push_back(522);
90 fC_TDR.push_back(547);
91 fC_TDR.push_back(572);
92 fC_TDR.push_back(597);
93 fC_TDR.push_back(622);
94 fC_TDR.push_back(647);
95 fC_TDR.push_back(672);
96 fC_TDR.push_back(697);
97 fC_TDR.push_back(722);
98 fC_TDR.push_back(772);
99 fC_TDR.push_back(822);
100 fC_TDR.push_back(872);
101 fC_TDR.push_back(922);
102 fC_TDR.push_back(972);
103 fC_TDR.push_back(1022);
104 fC_TDR.push_back(1072);
105 fC_TDR.push_back(1147);
106 fC_TDR.push_back(1222);
107 fC_TDR.push_back(1297);
108 fC_TDR.push_back(1372);
109 fC_TDR.push_back(1472);
110 fC_TDR.push_back(1572);
111 fC_TDR.push_back(1672);
112 fC_TDR.push_back(1797);
113 fC_TDR.push_back(1922);
114 fC_TDR.push_back(2047);
115 fC_TDR.push_back(1922);
116 fC_TDR.push_back(2047);
117 fC_TDR.push_back(2172);
118 fC_TDR.push_back(2297);
119 fC_TDR.push_back(2422);
120 fC_TDR.push_back(2547);
121 fC_TDR.push_back(2672);
122 fC_TDR.push_back(1797);
123 fC_TDR.push_back(2922);
124 fC_TDR.push_back(3047);
125 fC_TDR.push_back(3172);
126 fC_TDR.push_back(3297);
127 fC_TDR.push_back(3422);
128 fC_TDR.push_back(2547);
129 fC_TDR.push_back(3672);
130 fC_TDR.push_back(3922);
131 fC_TDR.push_back(4172);
132 fC_TDR.push_back(4422);
133 fC_TDR.push_back(4672);
134 fC_TDR.push_back(4922);
135 fC_TDR.push_back(5172);
136 fC_TDR.push_back(5422);
137 fC_TDR.push_back(5797);
138 fC_TDR.push_back(6172);
139 fC_TDR.push_back(6547);
140 fC_TDR.push_back(6922);
141 fC_TDR.push_back(7422);
142 fC_TDR.push_back(7922);
143 fC_TDR.push_back(8422);
144 fC_TDR.push_back(9047);
145 fC_TDR.push_back(9672);
146 fC_TDR.push_back(10297);
149 std::vector<int> HADlut(128);
150 std::vector<int> EMlut(128);
152 for (
int zdci = 0; zdci < 128; zdci++) {
153 EMlut[zdci] = (int)((fC_TDR[zdci] / ADC_GEV_EM) / LSB_EM + 0.5);
155 for (
int zdci = 0; zdci < 128; zdci++) {
156 HADlut[zdci] = (int)((fC_TDR[zdci] / ADC_GEV_HAD) / LSB_HAD + 0.5);
160 side[0].fiber.resize(3);
161 side[1].fiber.resize(3);
162 side[0].fiber[0].channel.resize(3);
163 side[0].fiber[1].channel.resize(3);
164 side[0].fiber[2].channel.resize(3);
165 side[1].fiber[0].channel.resize(3);
166 side[1].fiber[1].channel.resize(3);
167 side[1].fiber[2].channel.resize(3);
168 side[0].fiber[0].channel[0].LUT = EMlut;
169 side[0].fiber[0].channel[1].LUT = EMlut;
170 side[0].fiber[0].channel[2].LUT = EMlut;
171 side[0].fiber[1].channel[0].LUT = EMlut;
172 side[0].fiber[1].channel[1].LUT = EMlut;
173 side[0].fiber[1].channel[2].LUT = HADlut;
174 side[0].fiber[2].channel[0].LUT = HADlut;
175 side[0].fiber[2].channel[1].LUT = HADlut;
176 side[0].fiber[2].channel[2].LUT = HADlut;
177 side[1].fiber[0].channel[0].LUT = EMlut;
178 side[1].fiber[0].channel[1].LUT = EMlut;
179 side[1].fiber[0].channel[2].LUT = EMlut;
180 side[1].fiber[1].channel[0].LUT = EMlut;
181 side[1].fiber[1].channel[1].LUT = EMlut;
182 side[1].fiber[1].channel[2].LUT = HADlut;
183 side[1].fiber[2].channel[0].LUT = HADlut;
184 side[1].fiber[2].channel[1].LUT = HADlut;
185 side[1].fiber[2].channel[2].LUT = HADlut;
191 for (
unsigned int zdcs = 0; zdcs <
side.size(); zdcs++) {
192 for (
unsigned int zdcf = 0; zdcf <
side[zdcs].fiber.size(); zdcf++) {
193 for (
unsigned int zdcc = 0; zdcc <
side[zdcs].fiber[zdcf].channel.size(); zdcc++) {
194 for (
unsigned int zdcl = 0; zdcl <
side[zdcs].fiber[zdcf].channel[zdcc].LUT.size(); zdcl++) {
195 std::cout <<
side[zdcs].fiber[zdcf].channel[zdcc].LUT[zdcl] <<
" ";
207 int side_num = (1 - emap_side) / 2;
208 int fiber_num = (int)(emap_htr_fiber / 4) + (emap_htr_fiber % 4);
209 int channel_num = emap_fi_ch;
210 return side[side_num].fiber[fiber_num].channel[channel_num].LUT;
215 int side_num = (1 - zdc_side) / 2;
217 int channel_num = -1;
218 if (zdc_section.find(
"ZDC EM") != std::string::npos) {
219 fiber_num = (int)(zdc_channel / 4);
220 channel_num = (int)((zdc_channel - 1) / 3) % 3;
221 }
else if (zdc_section.find(
"ZDC HAD") != std::string::npos) {
222 if (zdc_channel == 1) {
225 }
else if (zdc_channel == 2) {
228 }
else if (zdc_channel == 3) {
231 }
else if (zdc_channel == 4) {
235 std::cout << zdc_channel <<
": unknown ZDC channel, exiting..." << std::endl;
239 std::cout << zdc_section <<
": unknown ZDC section, exiting..." << std::endl;
244 return side[side_num].fiber[fiber_num].channel[channel_num].LUT;
246 return side[side_num].fiber[fiber_num].channel[channel_num].LUT;
std::vector< int > get_lut(int emap_side, int emap_htr_fiber, int emap_fi_ch)
std::vector< ZDC_sides > side