9 #include "CLHEP/Random/RandGauss.h"
17 float value [4] = {value0, value0, value0, value0};
19 for (
int i = 0;
i < 4;
i++) {
20 value [
i] = CLHEP::RandGauss::shoot (value0, width.
getWidth (
i) / 100.);
21 while (value [
i] <= 0) value [
i] = CLHEP::RandGauss::shoot (value0, width.
getWidth (
i));
25 value[0], value[1], value[2], value[3]
40 for (
int i = 0;
i < 4;
i++) {
42 for (
int j = 0;
j < 4;
j++) {
43 result.setSigma (
i,
j,
i ==
j ? width * width : 0);
57 float value [4] = {value0, value0, value0, value0};
58 if (fSmear)
for (
int i = 0;
i < 4;
i++) value [
i] = CLHEP::RandGauss::shoot (value0, width.
getValue (
i));
73 for (
unsigned range = 0; range < 4; range++) {
74 for (
unsigned capid = 0; capid < 4; capid++) {
75 result.setOffset (capid, range, offset);
76 result.setSlope (capid, range, slope);
85 for (
int i = 0;
i < 32;
i++) lowEdges[
i] = -1.5 +
i*0.35;
86 result.setMinCharges (lowEdges);
104 #define EMAP_NHBHECR 9
110 #define EMAP_NHSETS 4
111 #define EMAP_NTOPBOT 2
112 #define EMAP_NHTRSHO 4
113 #define EMAP_NHSETSHO 3
124 int fedhbhenum[
EMAP_NHBHECR][2]={{702,703},{704,705},{700,701},
125 {706,707},{716,717},{708,709},
126 {714,715},{710,711},{712,713}};
128 int fedhfnum[
EMAP_NHFCR][2]={{718,719},{720,721},{722,723}};
130 int fedhonum[
EMAP_NHOCR][2]={{724,725},{726,727},{728,729},{730,731}};
134 int ihslotho[
EMAP_NHSETSHO][
EMAP_NHTRSHO]={{2,3,4,5},{6,7,13,14},{15,16,17,18}};
136 int ihbhephis[
EMAP_NHBHECR]={11,19,3,27,67,35,59,43,51};
143 {{{{11,1},{ 7,1},{ 3,1}},
144 {{ 5,1},{ 1,1},{ 9,1}},
145 {{11,1},{ 7,1},{ 3,1}},
146 {{ 5,1},{ 1,1},{ 9,1}},
147 {{10,1},{ 6,1},{ 2,1}},
148 {{ 8,1},{ 4,1},{12,1}},
149 {{10,1},{ 6,1},{ 2,1}},
150 {{ 8,1},{ 4,1},{12,1}}},
151 {{{11,1},{ 7,1},{ 3,1}},
152 {{ 5,1},{ 1,1},{ 9,1}},
153 {{11,1},{ 7,1},{ 3,1}},
154 {{ 5,1},{ 1,1},{ 9,1}},
155 {{10,1},{ 6,1},{ 2,1}},
156 {{ 8,1},{ 4,1},{12,1}},
157 {{10,1},{ 6,1},{ 2,1}},
158 {{ 8,1},{ 4,1},{12,1}}}},
159 {{{{16,2},{15,2},{14,1}},
160 {{15,1},{13,1},{16,1}},
161 {{16,2},{15,2},{14,1}},
162 {{15,1},{13,1},{16,1}},
163 {{17,1},{16,3},{26,1}},
164 {{18,1},{18,2},{26,2}},
165 {{17,1},{16,3},{25,1}},
166 {{18,1},{18,2},{25,2}}},
167 {{{16,2},{15,2},{14,1}},
168 {{15,1},{13,1},{16,1}},
169 {{16,2},{15,2},{14,1}},
170 {{15,1},{13,1},{16,1}},
171 {{17,1},{16,3},{25,1}},
172 {{18,1},{18,2},{25,2}},
173 {{17,1},{16,3},{26,1}},
174 {{18,1},{18,2},{26,2}}}},
175 {{{{28,1},{28,2},{29,1}},
176 {{28,3},{24,2},{24,1}},
177 {{27,1},{27,2},{29,2}},
178 {{27,3},{23,2},{23,1}},
179 {{19,2},{20,1},{22,2}},
180 {{19,1},{20,2},{22,1}},
181 {{19,2},{20,1},{21,2}},
182 {{19,1},{20,2},{21,1}}},
183 {{{27,1},{27,2},{29,2}},
184 {{27,3},{23,2},{23,1}},
185 {{28,1},{28,2},{29,1}},
186 {{28,3},{24,2},{24,1}},
187 {{19,2},{20,1},{21,2}},
188 {{19,1},{20,2},{21,1}},
189 {{19,2},{20,1},{22,2}},
190 {{19,1},{20,2},{22,1}}}}
194 {{{33,1},{31,1},{29,1}},
195 {{32,1},{30,1},{34,1}},
196 {{33,2},{31,2},{29,2}},
197 {{32,2},{30,2},{34,2}},
198 {{34,2},{32,2},{30,2}},
199 {{31,2},{29,2},{33,2}},
200 {{34,1},{32,1},{30,1}},
201 {{31,1},{29,1},{33,1}}},
202 {{{41,1},{37,1},{35,1}},
203 {{38,1},{36,1},{39,1}},
204 {{41,2},{37,2},{35,2}},
205 {{38,2},{36,2},{39,2}},
206 {{40,2},{38,2},{36,2}},
207 {{37,2},{35,2},{39,2}},
208 {{40,1},{38,1},{36,1}},
209 {{37,1},{35,1},{39,1}}}
213 {{{{ 1,-1,0},{ 2,-1,0},{ 3,-1,0}},
214 {{ 1,-1,1},{ 2,-1,1},{ 3,-1,1}},
215 {{ 1,-1,2},{ 2,-1,2},{ 3,-1,2}},
216 {{ 1,-1,3},{ 2,-1,3},{ 3,-1,3}},
217 {{ 1,-1,4},{ 2,-1,4},{ 3,-1,4}},
218 {{ 1,-1,5},{ 2,-1,5},{ 3,-1,5}},
219 {{14, 1,0},{14, 1,1},{14, 1,2}},
220 {{14, 1,3},{14, 1,4},{14, 1,5}}},
221 {{{ 1, 1,0},{ 2, 1,0},{ 3, 1,0}},
222 {{ 1, 1,1},{ 2, 1,1},{ 3, 1,1}},
223 {{ 1, 1,2},{ 2, 1,2},{ 3, 1,2}},
224 {{ 1, 1,3},{ 2, 1,3},{ 3, 1,3}},
225 {{ 1, 1,4},{ 2, 1,4},{ 3, 1,4}},
226 {{ 1, 1,5},{ 2, 1,5},{ 3, 1,5}},
227 {{15, 1,0},{15, 1,1},{15, 1,2}},
228 {{15, 1,3},{15, 1,4},{15, 1,5}}}},
229 {{{{ 6, 1,0},{ 6, 1,1},{ 6, 1,2}},
230 {{ 6, 1,3},{ 6, 1,4},{ 6, 1,5}},
231 {{ 7, 1,0},{ 7, 1,1},{ 7, 1,2}},
232 {{ 7, 1,3},{ 7, 1,4},{ 7, 1,5}},
233 {{ 8, 1,0},{ 8, 1,1},{ 8, 1,2}},
234 {{ 8, 1,3},{ 8, 1,4},{ 8, 1,5}},
235 {{ 9, 1,0},{ 9, 1,1},{ 9, 1,2}},
236 {{ 9, 1,3},{ 9, 1,4},{ 9, 1,5}}},
237 {{{10, 1,0},{10, 1,1},{10, 1,2}},
238 {{10, 1,3},{10, 1,4},{10, 1,5}},
239 {{11, 1,0},{11, 1,1},{11, 1,2}},
240 {{11, 1,3},{11, 1,4},{11, 1,5}},
241 {{12, 1,0},{12, 1,1},{12, 1,2}},
242 {{12, 1,3},{12, 1,4},{12, 1,5}},
243 {{13, 1,0},{13, 1,1},{13, 1,2}},
244 {{13, 1,3},{13, 1,4},{13, 1,5}}}},
245 {{{{ 4,-1,0},{ 4,-1,1},{ 0, 0,0}},
246 {{ 4,-1,2},{ 4,-1,3},{ 0, 0,0}},
247 {{ 4,-1,4},{ 4,-1,5},{ 0, 0,0}},
248 {{ 0, 0,0},{ 0, 0,0},{ 0, 0,0}},
249 {{ 5,-1,0},{ 5,-1,1},{ 5,-1,2}},
250 {{ 5,-1,3},{ 5,-1,4},{ 5,-1,5}},
251 {{14,-1,0},{14,-1,1},{14,-1,2}},
252 {{14,-1,3},{14,-1,4},{14,-1,5}}},
253 {{{ 4, 1,0},{ 4, 1,1},{ 0, 0,0}},
254 {{ 4, 1,2},{ 4, 1,3},{ 0, 0,0}},
255 {{ 4, 1,4},{ 4, 1,5},{ 0, 0,0}},
256 {{ 0, 0,0},{ 0, 0,0},{ 0, 0,0}},
257 {{ 5, 1,0},{ 5, 1,1},{ 5, 1,2}},
258 {{ 5, 1,3},{ 5, 1,4},{ 5, 1,5}},
259 {{15,-1,0},{15,-1,1},{15,-1,2}},
260 {{15,-1,3},{15,-1,4},{15,-1,5}}}},
261 {{{{ 6,-1,0},{ 6,-1,1},{ 6,-1,2}},
262 {{ 6,-1,3},{ 6,-1,4},{ 6,-1,5}},
263 {{ 7,-1,0},{ 7,-1,1},{ 7,-1,2}},
264 {{ 7,-1,3},{ 7,-1,4},{ 7,-1,5}},
265 {{ 8,-1,0},{ 8,-1,1},{ 8,-1,2}},
266 {{ 8,-1,3},{ 8,-1,4},{ 8,-1,5}},
267 {{ 9,-1,0},{ 9,-1,1},{ 9,-1,2}},
268 {{ 9,-1,3},{ 9,-1,4},{ 9,-1,5}}},
269 {{{10,-1,0},{10,-1,1},{10,-1,2}},
270 {{10,-1,3},{10,-1,4},{10,-1,5}},
271 {{11,-1,0},{11,-1,1},{11,-1,2}},
272 {{11,-1,3},{11,-1,4},{11,-1,5}},
273 {{12,-1,0},{12,-1,1},{12,-1,2}},
274 {{12,-1,3},{12,-1,4},{12,-1,5}},
275 {{13,-1,0},{13,-1,1},{13,-1,2}},
276 {{13,-1,3},{13,-1,4},{13,-1,5}}}}
278 int ic,is,ih,itb,ifb,ifc,ifwtb,iphi_loc;
279 int iside,ieta,iphi,idepth,icrate,ihtr,ihtr_fi,ifi_ch,ispigot,idcc,ifed;
295 icrate=hbhecrate[ic];
296 iside=is<EMAP_NHSETS/2?-1:1;
297 ifwtb=(is/2+itb+1)%2;
298 ieta=ihbheetadepth[ih][ifwtb][ifb][ifc][0];
299 idepth=ihbheetadepth[ih][ifwtb][ifb][ifc][1];
301 det=((ieta>16||idepth>2)?(
"HE"):(
"HB"));
302 fpga=((itb%2)==1)?(
"bot"):(
"top");
305 iphi=(ieta>20)?(ihbhephis[ic]+(is%2)*4+itb*2-1)%72+1:(ihbhephis[ic]+(is%2)*4+itb*2+(ifb/2+is/2+1)%2-1)%72+1;
306 ispigot=(is%2)*6+ih*2+itb;
307 idcc=is<EMAP_NHSETS/2?1:2;
309 ifed=fedhbhenum[ic][idcc-1];
312 elId.
setHTR(icrate, ihtr, (fpga==
"top")?(1):(0));
331 iside=is<EMAP_NHSETS/2?-1:1;
332 ieta=ihfetadepth[itb][ifb][ifc][0];
333 idepth=ihfetadepth[itb][ifb][ifc][1];
336 fpga=((itb%2)==1)?(
"bot"):(
"top");
339 iphi=(ieta>39)?(ihfphis[ic]+(is%2)*12+ih*4-3)%72+1:(ihfphis[ic]+(is%2)*12+ih*4+(ifb/4)*2-1)%72+1;
340 ispigot=(is%2)*6+ih*2+itb;
341 idcc=is<EMAP_NHSETS/2?1:2;
343 ifed=fedhfnum[ic][idcc-1];
345 elId.
setHTR(icrate, ihtr, (fpga==
"top")?(1):(0));
364 ieta=ihoetasidephi[ih][itb][ifb][ifc][0];
365 iside=ihoetasidephi[ih][itb][ifb][ifc][1];
366 iphi_loc=ihoetasidephi[ih][itb][ifb][ifc][2];
367 ihtr=ihslotho[is][ih];
369 fpga=((itb%2)==1)?(
"bot"):(
"top");
372 iphi=(ihophis[ic]+is*6+iphi_loc-1)%72+1;
373 ispigot=ihtr<9?(ihtr-2)*2+itb:(ihtr-13)*2+itb;
376 ifed=fedhonum[ic][idcc-1];
378 elId.
setHTR(icrate, ihtr, (fpga==
"top")?(1):(0));
CastorPedestalWidth makePedestalWidth(HcalGenericDetId fId)
static const HcalDetId Undefined
CastorQIECoder makeQIECoder(HcalGenericDetId fId)
void makeHardcodeMap(CastorElectronicsMap &emap)
static const double slope[3]
void setHTR(int crate, int slot, int tb)
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
float getValue(int fCapId) const
get value for capId = 0..3
uint32_t rawId() const
get the raw id
int depth() const
get the tower depth
CastorQIEShape makeQIEShape()
CastorRecoParam makeRecoParam(HcalGenericDetId fId)
CastorSaturationCorr makeSaturationCorr(HcalGenericDetId fId)
unsigned int offset(bool)
CastorGainWidth makeGainWidth(HcalGenericDetId fId)
CastorPedestal makePedestal(HcalGenericDetId fId, bool fSmear=false)
CastorGain makeGain(HcalGenericDetId fId, bool fSmear=false)
bool mapEId2chId(CastorElectronicsId fElectronicsId, DetId fId)
Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] ...
CastorCalibrationQIECoder makeCalibrationQIECoder(HcalGenericDetId fId)
HcalGenericSubdetector genericSubdet() const