8 #include "CLHEP/Random/RandGauss.h"
15 float value [4] = {value0, value0, value0, value0};
17 for (
int i = 0;
i < 4;
i++) {
18 value [
i] = CLHEP::RandGauss::shoot (value0, width.
getWidth (
i) / 100.);
19 while (value [
i] <= 0) value [
i] = CLHEP::RandGauss::shoot (value0, width.
getWidth (
i));
23 value[0], value[1], value[2], value[3]
35 for (
int i = 0;
i < 4;
i++) {
37 for (
int j = 0;
j < 4;
j++) {
38 result.setSigma (
i,
j,
i ==
j ? width * width : 0);
77 float value [4] = {value0, value0, value0, value0};
78 if (fSmear)
for (
int i = 0;
i < 4;
i++) value [
i] = CLHEP::RandGauss::shoot (value0, width.
getValue (
i));
93 for (
unsigned range = 0; range < 4; range++) {
94 for (
unsigned capid = 0; capid < 4; capid++) {
95 result.setOffset (capid, range, offset);
96 result.setSlope (capid, range, slope);
105 for (
int i = 0;
i < 32;
i++) lowEdges[
i] = -1.5 +
i*0.35;
106 result.setMinCharges (lowEdges);
115 #define EMAP_NHBHECR 9
121 #define EMAP_NHSETS 4
122 #define EMAP_NTOPBOT 2
123 #define EMAP_NHTRSHO 4
124 #define EMAP_NHSETSHO 3
150 int fedhbhenum[
EMAP_NHBHECR][2]={{702,703},{704,705},{700,701},
151 {706,707},{716,717},{708,709},
152 {714,715},{710,711},{712,713}};
154 int fedhfnum[
EMAP_NHFCR][2]={{718,719},{720,721},{722,723}};
156 int fedhonum[
EMAP_NHOCR][2]={{724,725},{726,727},{728,729},{730,731}};
160 int ihslotho[
EMAP_NHSETSHO][
EMAP_NHTRSHO]={{2,3,4,5},{6,7,13,14},{15,16,17,18}};
162 int ihbhephis[
EMAP_NHBHECR]={11,19,3,27,67,35,59,43,51};
169 {{{{11,1},{ 7,1},{ 3,1}},
170 {{ 5,1},{ 1,1},{ 9,1}},
171 {{11,1},{ 7,1},{ 3,1}},
172 {{ 5,1},{ 1,1},{ 9,1}},
173 {{10,1},{ 6,1},{ 2,1}},
174 {{ 8,1},{ 4,1},{12,1}},
175 {{10,1},{ 6,1},{ 2,1}},
176 {{ 8,1},{ 4,1},{12,1}}},
177 {{{11,1},{ 7,1},{ 3,1}},
178 {{ 5,1},{ 1,1},{ 9,1}},
179 {{11,1},{ 7,1},{ 3,1}},
180 {{ 5,1},{ 1,1},{ 9,1}},
181 {{10,1},{ 6,1},{ 2,1}},
182 {{ 8,1},{ 4,1},{12,1}},
183 {{10,1},{ 6,1},{ 2,1}},
184 {{ 8,1},{ 4,1},{12,1}}}},
185 {{{{16,2},{15,2},{14,1}},
186 {{15,1},{13,1},{16,1}},
187 {{16,2},{15,2},{14,1}},
188 {{15,1},{13,1},{16,1}},
189 {{17,1},{16,3},{26,1}},
190 {{18,1},{18,2},{26,2}},
191 {{17,1},{16,3},{25,1}},
192 {{18,1},{18,2},{25,2}}},
193 {{{16,2},{15,2},{14,1}},
194 {{15,1},{13,1},{16,1}},
195 {{16,2},{15,2},{14,1}},
196 {{15,1},{13,1},{16,1}},
197 {{17,1},{16,3},{25,1}},
198 {{18,1},{18,2},{25,2}},
199 {{17,1},{16,3},{26,1}},
200 {{18,1},{18,2},{26,2}}}},
201 {{{{28,1},{28,2},{29,1}},
202 {{28,3},{24,2},{24,1}},
203 {{27,1},{27,2},{29,2}},
204 {{27,3},{23,2},{23,1}},
205 {{19,2},{20,1},{22,2}},
206 {{19,1},{20,2},{22,1}},
207 {{19,2},{20,1},{21,2}},
208 {{19,1},{20,2},{21,1}}},
209 {{{27,1},{27,2},{29,2}},
210 {{27,3},{23,2},{23,1}},
211 {{28,1},{28,2},{29,1}},
212 {{28,3},{24,2},{24,1}},
213 {{19,2},{20,1},{21,2}},
214 {{19,1},{20,2},{21,1}},
215 {{19,2},{20,1},{22,2}},
216 {{19,1},{20,2},{22,1}}}}
220 {{{33,1},{31,1},{29,1}},
221 {{32,1},{30,1},{34,1}},
222 {{33,2},{31,2},{29,2}},
223 {{32,2},{30,2},{34,2}},
224 {{34,2},{32,2},{30,2}},
225 {{31,2},{29,2},{33,2}},
226 {{34,1},{32,1},{30,1}},
227 {{31,1},{29,1},{33,1}}},
228 {{{41,1},{37,1},{35,1}},
229 {{38,1},{36,1},{39,1}},
230 {{41,2},{37,2},{35,2}},
231 {{38,2},{36,2},{39,2}},
232 {{40,2},{38,2},{36,2}},
233 {{37,2},{35,2},{39,2}},
234 {{40,1},{38,1},{36,1}},
235 {{37,1},{35,1},{39,1}}}
239 {{{{ 1,-1,0},{ 2,-1,0},{ 3,-1,0}},
240 {{ 1,-1,1},{ 2,-1,1},{ 3,-1,1}},
241 {{ 1,-1,2},{ 2,-1,2},{ 3,-1,2}},
242 {{ 1,-1,3},{ 2,-1,3},{ 3,-1,3}},
243 {{ 1,-1,4},{ 2,-1,4},{ 3,-1,4}},
244 {{ 1,-1,5},{ 2,-1,5},{ 3,-1,5}},
245 {{14, 1,0},{14, 1,1},{14, 1,2}},
246 {{14, 1,3},{14, 1,4},{14, 1,5}}},
247 {{{ 1, 1,0},{ 2, 1,0},{ 3, 1,0}},
248 {{ 1, 1,1},{ 2, 1,1},{ 3, 1,1}},
249 {{ 1, 1,2},{ 2, 1,2},{ 3, 1,2}},
250 {{ 1, 1,3},{ 2, 1,3},{ 3, 1,3}},
251 {{ 1, 1,4},{ 2, 1,4},{ 3, 1,4}},
252 {{ 1, 1,5},{ 2, 1,5},{ 3, 1,5}},
253 {{15, 1,0},{15, 1,1},{15, 1,2}},
254 {{15, 1,3},{15, 1,4},{15, 1,5}}}},
255 {{{{ 6, 1,0},{ 6, 1,1},{ 6, 1,2}},
256 {{ 6, 1,3},{ 6, 1,4},{ 6, 1,5}},
257 {{ 7, 1,0},{ 7, 1,1},{ 7, 1,2}},
258 {{ 7, 1,3},{ 7, 1,4},{ 7, 1,5}},
259 {{ 8, 1,0},{ 8, 1,1},{ 8, 1,2}},
260 {{ 8, 1,3},{ 8, 1,4},{ 8, 1,5}},
261 {{ 9, 1,0},{ 9, 1,1},{ 9, 1,2}},
262 {{ 9, 1,3},{ 9, 1,4},{ 9, 1,5}}},
263 {{{10, 1,0},{10, 1,1},{10, 1,2}},
264 {{10, 1,3},{10, 1,4},{10, 1,5}},
265 {{11, 1,0},{11, 1,1},{11, 1,2}},
266 {{11, 1,3},{11, 1,4},{11, 1,5}},
267 {{12, 1,0},{12, 1,1},{12, 1,2}},
268 {{12, 1,3},{12, 1,4},{12, 1,5}},
269 {{13, 1,0},{13, 1,1},{13, 1,2}},
270 {{13, 1,3},{13, 1,4},{13, 1,5}}}},
271 {{{{ 4,-1,0},{ 4,-1,1},{ 0, 0,0}},
272 {{ 4,-1,2},{ 4,-1,3},{ 0, 0,0}},
273 {{ 4,-1,4},{ 4,-1,5},{ 0, 0,0}},
274 {{ 0, 0,0},{ 0, 0,0},{ 0, 0,0}},
275 {{ 5,-1,0},{ 5,-1,1},{ 5,-1,2}},
276 {{ 5,-1,3},{ 5,-1,4},{ 5,-1,5}},
277 {{14,-1,0},{14,-1,1},{14,-1,2}},
278 {{14,-1,3},{14,-1,4},{14,-1,5}}},
279 {{{ 4, 1,0},{ 4, 1,1},{ 0, 0,0}},
280 {{ 4, 1,2},{ 4, 1,3},{ 0, 0,0}},
281 {{ 4, 1,4},{ 4, 1,5},{ 0, 0,0}},
282 {{ 0, 0,0},{ 0, 0,0},{ 0, 0,0}},
283 {{ 5, 1,0},{ 5, 1,1},{ 5, 1,2}},
284 {{ 5, 1,3},{ 5, 1,4},{ 5, 1,5}},
285 {{15,-1,0},{15,-1,1},{15,-1,2}},
286 {{15,-1,3},{15,-1,4},{15,-1,5}}}},
287 {{{{ 6,-1,0},{ 6,-1,1},{ 6,-1,2}},
288 {{ 6,-1,3},{ 6,-1,4},{ 6,-1,5}},
289 {{ 7,-1,0},{ 7,-1,1},{ 7,-1,2}},
290 {{ 7,-1,3},{ 7,-1,4},{ 7,-1,5}},
291 {{ 8,-1,0},{ 8,-1,1},{ 8,-1,2}},
292 {{ 8,-1,3},{ 8,-1,4},{ 8,-1,5}},
293 {{ 9,-1,0},{ 9,-1,1},{ 9,-1,2}},
294 {{ 9,-1,3},{ 9,-1,4},{ 9,-1,5}}},
295 {{{10,-1,0},{10,-1,1},{10,-1,2}},
296 {{10,-1,3},{10,-1,4},{10,-1,5}},
297 {{11,-1,0},{11,-1,1},{11,-1,2}},
298 {{11,-1,3},{11,-1,4},{11,-1,5}},
299 {{12,-1,0},{12,-1,1},{12,-1,2}},
300 {{12,-1,3},{12,-1,4},{12,-1,5}},
301 {{13,-1,0},{13,-1,1},{13,-1,2}},
302 {{13,-1,3},{13,-1,4},{13,-1,5}}}}
304 int ic,is,ih,itb,ifb,ifc,ifwtb,iphi_loc;
305 int iside,ieta,iphi,idepth,icrate,ihtr,ihtr_fi,ifi_ch,ispigot,idcc,ifed;
322 icrate=hbhecrate[ic];
323 iside=is<EMAP_NHSETS/2?-1:1;
324 ifwtb=(is/2+itb+1)%2;
325 ieta=ihbheetadepth[ih][ifwtb][ifb][ifc][0];
326 idepth=ihbheetadepth[ih][ifwtb][ifb][ifc][1];
328 det=((ieta>16||idepth>2)?(
"HE"):(
"HB"));
329 fpga=((itb%2)==1)?(
"bot"):(
"top");
332 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;
333 ispigot=(is%2)*6+ih*2+itb;
334 idcc=is<EMAP_NHSETS/2?1:2;
336 ifed=fedhbhenum[ic][idcc-1];
339 elId.setHTR(icrate, ihtr, (fpga==
"top")?(1):(0));
358 iside=is<EMAP_NHSETS/2?-1:1;
359 ieta=ihfetadepth[itb][ifb][ifc][0];
360 idepth=ihfetadepth[itb][ifb][ifc][1];
363 fpga=((itb%2)==1)?(
"bot"):(
"top");
366 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;
367 ispigot=(is%2)*6+ih*2+itb;
368 idcc=is<EMAP_NHSETS/2?1:2;
370 ifed=fedhfnum[ic][idcc-1];
372 elId.setHTR(icrate, ihtr, (fpga==
"top")?(1):(0));
391 ieta=ihoetasidephi[ih][itb][ifb][ifc][0];
392 iside=ihoetasidephi[ih][itb][ifb][ifc][1];
393 iphi_loc=ihoetasidephi[ih][itb][ifb][ifc][2];
394 ihtr=ihslotho[is][ih];
396 fpga=((itb%2)==1)?(
"bot"):(
"top");
399 iphi=(ihophis[ic]+is*6+iphi_loc-1)%72+1;
400 ispigot=ihtr<9?(ihtr-2)*2+itb:(ihtr-13)*2+itb;
403 ifed=fedhonum[ic][idcc-1];
405 elId.setHTR(icrate, ihtr, (fpga==
"top")?(1):(0));
static const HcalDetId Undefined
HcalQIEShape makeQIEShape()
HcalTimingParam makeTimingParam(HcalGenericDetId fId)
bool mapGeomId2DcsId(HcalDetId fId, HcalDcsDetId fDcsId)
static const double slope[3]
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
HcalCalibrationQIECoder makeCalibrationQIECoder(HcalGenericDetId fId)
float getValue(int fCapId) const
get value for capId = 0..3
void makeHardcodeMap(HcalElectronicsMap &emap)
uint32_t rawId() const
get the raw id
HcalQIECoder makeQIECoder(HcalGenericDetId fId)
HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId)
void makeHardcodeDcsMap(HcalDcsMap &dcs_map)
int depth() const
get the tower depth
HcalGain makeGain(HcalGenericDetId fId, bool fSmear=false)
unsigned int offset(bool)
HcalRecoParam makeRecoParam(HcalGenericDetId fId)
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
HcalGainWidth makeGainWidth(HcalGenericDetId fId)
HcalGenericSubdetector genericSubdet() const
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear=false)