CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
CastorDbHardcode Namespace Reference

Functions

CastorCalibrationQIECoder makeCalibrationQIECoder (HcalGenericDetId fId)
 
CastorGain makeGain (HcalGenericDetId fId, bool fSmear=false)
 
CastorGainWidth makeGainWidth (HcalGenericDetId fId)
 
void makeHardcodeMap (CastorElectronicsMap &emap)
 
CastorPedestal makePedestal (HcalGenericDetId fId, bool fSmear=false)
 
CastorPedestalWidth makePedestalWidth (HcalGenericDetId fId)
 
CastorQIECoder makeQIECoder (HcalGenericDetId fId)
 
CastorQIEShape makeQIEShape ()
 
CastorRecoParam makeRecoParam (HcalGenericDetId fId)
 
CastorSaturationCorr makeSaturationCorr (HcalGenericDetId fId)
 

Function Documentation

CastorCalibrationQIECoder CastorDbHardcode::makeCalibrationQIECoder ( HcalGenericDetId  fId)

Definition at line 85 of file CastorDbHardcode.cc.

References mps_fire::i, DetId::rawId(), and mps_fire::result.

85  {
87  float lowEdges[32];
88  for (int i = 0; i < 32; i++)
89  lowEdges[i] = -1.5 + i * 0.35;
90  result.setMinCharges(lowEdges);
91  return result;
92 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
tuple result
Definition: mps_fire.py:311
CastorGain CastorDbHardcode::makeGain ( HcalGenericDetId  fId,
bool  fSmear = false 
)

Definition at line 47 of file CastorDbHardcode.cc.

References HcalDetId::depth(), HcalGenericDetId::genericSubdet(), CastorGainWidth::getValue(), HcalGenericDetId::HcalGenForward, mps_fire::i, makeGainWidth(), DetId::rawId(), mps_fire::result, and relativeConstraints::value.

Referenced by SiStripGainESSource::produce(), and CastorHardcodeCalibrations::produceGains().

47  {
48  CastorGainWidth width = makeGainWidth(fId);
49  float value0 = 0;
51  value0 = 0.177; // GeV/fC
52  else {
53  if (HcalDetId(fId).depth() == 1)
54  value0 = 0.2146;
55  else if (HcalDetId(fId).depth() == 2)
56  value0 = 0.3375;
57  }
58  float value[4] = {value0, value0, value0, value0};
59  if (fSmear)
60  for (int i = 0; i < 4; i++)
61  value[i] = CLHEP::RandGauss::shoot(value0, width.getValue(i));
62  CastorGain result(fId.rawId(), value[0], value[1], value[2], value[3]);
63  return result;
64 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
float getValue(int fCapId) const
get value for capId = 0..3
tuple result
Definition: mps_fire.py:311
CastorGainWidth makeGainWidth(HcalGenericDetId fId)
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
HcalGenericSubdetector genericSubdet() const
CastorGainWidth CastorDbHardcode::makeGainWidth ( HcalGenericDetId  fId)

Definition at line 66 of file CastorDbHardcode.cc.

References DetId::rawId(), mps_fire::result, and relativeConstraints::value.

Referenced by makeGain(), and CastorHardcodeCalibrations::produceGainWidths().

66  {
67  float value = 0;
69  return result;
70 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
tuple result
Definition: mps_fire.py:311
void CastorDbHardcode::makeHardcodeMap ( CastorElectronicsMap emap)

load map

Definition at line 117 of file CastorDbHardcode.cc.

References EMAP_NFBR, EMAP_NFCH, EMAP_NHBHECR, EMAP_NHFCR, EMAP_NHOCR, EMAP_NHSETS, EMAP_NHSETSHO, EMAP_NHTRS, EMAP_NHTRSHO, EMAP_NTOPBOT, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, CastorElectronicsMap::mapEId2chId(), CastorElectronicsId::setHTR(), CastorElectronicsMap::sort(), AlCaHLTBitMon_QueryRunRegistry::string, and HcalDetId::Undefined.

Referenced by CastorHardcodeCalibrations::produceElectronicsMap().

117  {
118  /* HBHE crate numbering */
119  int hbhecrate[EMAP_NHBHECR] = {0, 1, 4, 5, 10, 11, 14, 15, 17};
120  /* HF crate numbering */
121  int hfcrate[EMAP_NHFCR] = {2, 9, 12};
122  /* HO crate numbering */
123  int hocrate[EMAP_NHOCR] = {3, 7, 6, 13};
124  /* HBHE FED numbering of DCCs */
125  int fedhbhenum[EMAP_NHBHECR][2] = {
126  {702, 703}, {704, 705}, {700, 701}, {706, 707}, {716, 717}, {708, 709}, {714, 715}, {710, 711}, {712, 713}};
127  /* HF FED numbering of DCCs */
128  int fedhfnum[EMAP_NHFCR][2] = {{718, 719}, {720, 721}, {722, 723}};
129  /* HO FED numbering of DCCs */
130  int fedhonum[EMAP_NHOCR][2] = {{724, 725}, {726, 727}, {728, 729}, {730, 731}};
131  /* HBHE/HF htr slot offsets for set of three htrs */
132  int ihslot[EMAP_NHSETS] = {2, 5, 13, 16};
133  /* HO htr slot offsets for three sets of four htrs */
134  int ihslotho[EMAP_NHSETSHO][EMAP_NHTRSHO] = {{2, 3, 4, 5}, {6, 7, 13, 14}, {15, 16, 17, 18}};
135  /* iphi (lower) starting index for each HBHE crate */
136  int ihbhephis[EMAP_NHBHECR] = {11, 19, 3, 27, 67, 35, 59, 43, 51};
137  /* iphi (lower) starting index for each HF crate */
138  int ihfphis[EMAP_NHFCR] = {3, 27, 51};
139  /* iphi (lower) starting index for each HO crate */
140  int ihophis[EMAP_NHOCR] = {71, 17, 35, 53};
141  /* ihbheetadepth - unique HBHE {eta,depth} assignments per fiber and fiber channel */
142  int ihbheetadepth[EMAP_NHTRS][EMAP_NTOPBOT][EMAP_NFBR][EMAP_NFCH][2] = {
143  {{{{11, 1}, {7, 1}, {3, 1}}, /* htr 0 (HB) -bot(+top) */
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}}, /* htr 0 (HB) +bot(-top) */
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}}, /* htr 1 (HBHE) -bot(+top) */
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}}, /* htr 1 (HBHE) +bot(-top) */
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}}, /* htr 2 (HE) -bot(+top) */
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}}, /* htr 2 (HE) +bot(-top) */
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}}}}};
191  /* ihfetadepth - unique HF {eta,depth} assignments per fiber and fiber channel */
192  int ihfetadepth[EMAP_NTOPBOT][EMAP_NFBR][EMAP_NFCH][2] = {{{{33, 1}, {31, 1}, {29, 1}}, /* top */
193  {{32, 1}, {30, 1}, {34, 1}},
194  {{33, 2}, {31, 2}, {29, 2}},
195  {{32, 2}, {30, 2}, {34, 2}},
196  {{34, 2}, {32, 2}, {30, 2}},
197  {{31, 2}, {29, 2}, {33, 2}},
198  {{34, 1}, {32, 1}, {30, 1}},
199  {{31, 1}, {29, 1}, {33, 1}}},
200  {{{41, 1}, {37, 1}, {35, 1}}, /* bot */
201  {{38, 1}, {36, 1}, {39, 1}},
202  {{41, 2}, {37, 2}, {35, 2}},
203  {{38, 2}, {36, 2}, {39, 2}},
204  {{40, 2}, {38, 2}, {36, 2}},
205  {{37, 2}, {35, 2}, {39, 2}},
206  {{40, 1}, {38, 1}, {36, 1}},
207  {{37, 1}, {35, 1}, {39, 1}}}};
208  /* ihoetasidephi - unique HO {eta,side,phi} assignments per fiber and fiber channel */
209  int ihoetasidephi[EMAP_NHTRSHO][EMAP_NTOPBOT][EMAP_NFBR][EMAP_NFCH][3] = {
210  {{{{1, -1, 0}, {2, -1, 0}, {3, -1, 0}}, /* htr 0 (HO) top */
211  {{1, -1, 1}, {2, -1, 1}, {3, -1, 1}},
212  {{1, -1, 2}, {2, -1, 2}, {3, -1, 2}},
213  {{1, -1, 3}, {2, -1, 3}, {3, -1, 3}},
214  {{1, -1, 4}, {2, -1, 4}, {3, -1, 4}},
215  {{1, -1, 5}, {2, -1, 5}, {3, -1, 5}},
216  {{14, 1, 0}, {14, 1, 1}, {14, 1, 2}},
217  {{14, 1, 3}, {14, 1, 4}, {14, 1, 5}}},
218  {{{1, 1, 0}, {2, 1, 0}, {3, 1, 0}}, /* htr 0 (HO) bot */
219  {{1, 1, 1}, {2, 1, 1}, {3, 1, 1}},
220  {{1, 1, 2}, {2, 1, 2}, {3, 1, 2}},
221  {{1, 1, 3}, {2, 1, 3}, {3, 1, 3}},
222  {{1, 1, 4}, {2, 1, 4}, {3, 1, 4}},
223  {{1, 1, 5}, {2, 1, 5}, {3, 1, 5}},
224  {{15, 1, 0}, {15, 1, 1}, {15, 1, 2}},
225  {{15, 1, 3}, {15, 1, 4}, {15, 1, 5}}}},
226  {{{{6, 1, 0}, {6, 1, 1}, {6, 1, 2}}, /* htr 1 (HO) top */
227  {{6, 1, 3}, {6, 1, 4}, {6, 1, 5}},
228  {{7, 1, 0}, {7, 1, 1}, {7, 1, 2}},
229  {{7, 1, 3}, {7, 1, 4}, {7, 1, 5}},
230  {{8, 1, 0}, {8, 1, 1}, {8, 1, 2}},
231  {{8, 1, 3}, {8, 1, 4}, {8, 1, 5}},
232  {{9, 1, 0}, {9, 1, 1}, {9, 1, 2}},
233  {{9, 1, 3}, {9, 1, 4}, {9, 1, 5}}},
234  {{{10, 1, 0}, {10, 1, 1}, {10, 1, 2}}, /* htr 1 (HO) bot */
235  {{10, 1, 3}, {10, 1, 4}, {10, 1, 5}},
236  {{11, 1, 0}, {11, 1, 1}, {11, 1, 2}},
237  {{11, 1, 3}, {11, 1, 4}, {11, 1, 5}},
238  {{12, 1, 0}, {12, 1, 1}, {12, 1, 2}},
239  {{12, 1, 3}, {12, 1, 4}, {12, 1, 5}},
240  {{13, 1, 0}, {13, 1, 1}, {13, 1, 2}},
241  {{13, 1, 3}, {13, 1, 4}, {13, 1, 5}}}},
242  {{{{4, -1, 0}, {4, -1, 1}, {0, 0, 0}}, /* htr 2 (HO) top */
243  {{4, -1, 2}, {4, -1, 3}, {0, 0, 0}},
244  {{4, -1, 4}, {4, -1, 5}, {0, 0, 0}},
245  {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
246  {{5, -1, 0}, {5, -1, 1}, {5, -1, 2}},
247  {{5, -1, 3}, {5, -1, 4}, {5, -1, 5}},
248  {{14, -1, 0}, {14, -1, 1}, {14, -1, 2}},
249  {{14, -1, 3}, {14, -1, 4}, {14, -1, 5}}},
250  {{{4, 1, 0}, {4, 1, 1}, {0, 0, 0}}, /* htr 2 (HO) bot */
251  {{4, 1, 2}, {4, 1, 3}, {0, 0, 0}},
252  {{4, 1, 4}, {4, 1, 5}, {0, 0, 0}},
253  {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
254  {{5, 1, 0}, {5, 1, 1}, {5, 1, 2}},
255  {{5, 1, 3}, {5, 1, 4}, {5, 1, 5}},
256  {{15, -1, 0}, {15, -1, 1}, {15, -1, 2}},
257  {{15, -1, 3}, {15, -1, 4}, {15, -1, 5}}}},
258  {{{{6, -1, 0}, {6, -1, 1}, {6, -1, 2}}, /* htr 3 (HO) top */
259  {{6, -1, 3}, {6, -1, 4}, {6, -1, 5}},
260  {{7, -1, 0}, {7, -1, 1}, {7, -1, 2}},
261  {{7, -1, 3}, {7, -1, 4}, {7, -1, 5}},
262  {{8, -1, 0}, {8, -1, 1}, {8, -1, 2}},
263  {{8, -1, 3}, {8, -1, 4}, {8, -1, 5}},
264  {{9, -1, 0}, {9, -1, 1}, {9, -1, 2}},
265  {{9, -1, 3}, {9, -1, 4}, {9, -1, 5}}},
266  {{{10, -1, 0}, {10, -1, 1}, {10, -1, 2}}, /* htr 3 (HO) bot */
267  {{10, -1, 3}, {10, -1, 4}, {10, -1, 5}},
268  {{11, -1, 0}, {11, -1, 1}, {11, -1, 2}},
269  {{11, -1, 3}, {11, -1, 4}, {11, -1, 5}},
270  {{12, -1, 0}, {12, -1, 1}, {12, -1, 2}},
271  {{12, -1, 3}, {12, -1, 4}, {12, -1, 5}},
272  {{13, -1, 0}, {13, -1, 1}, {13, -1, 2}},
273  {{13, -1, 3}, {13, -1, 4}, {13, -1, 5}}}}};
274  int ic, is, ih, itb, ifb, ifc, ifwtb, iphi_loc;
275  int iside, ieta, iphi, idepth, icrate, ihtr, ihtr_fi, ifi_ch, ispigot, idcc, /*idcc_sl,*/ ifed;
276  std::string det;
277  std::string fpga;
278  // printf(" side eta phi depth det crate htr fpga htr_fi fi_ch spigo dcc dcc_sl fedid\n");
279  /* all HBHE crates */
280  for (ic = 0; ic < EMAP_NHBHECR; ic++) {
281  /* four sets of three htrs per crate */
282  for (is = 0; is < EMAP_NHSETS; is++) {
283  /* three htrs per set */
284  for (ih = 0; ih < EMAP_NHTRS; ih++) {
285  /* top and bottom */
286  for (itb = 0; itb < EMAP_NTOPBOT; itb++) {
287  /* eight fibers per HTR FPGA */
288  for (ifb = 0; ifb < EMAP_NFBR; ifb++) {
289  /* three channels per fiber */
290  for (ifc = 0; ifc < EMAP_NFCH; ifc++) {
291  icrate = hbhecrate[ic];
292  iside = is < EMAP_NHSETS / 2 ? -1 : 1;
293  ifwtb = (is / 2 + itb + 1) % 2;
294  ieta = ihbheetadepth[ih][ifwtb][ifb][ifc][0];
295  idepth = ihbheetadepth[ih][ifwtb][ifb][ifc][1];
296  ihtr = ihslot[is] + ih;
297  det = ((ieta > 16 || idepth > 2) ? ("HE") : ("HB"));
298  fpga = ((itb % 2) == 1) ? ("bot") : ("top");
299  ihtr_fi = ifb + 1;
300  ifi_ch = ifc;
301  iphi = (ieta > 20) ? (ihbhephis[ic] + (is % 2) * 4 + itb * 2 - 1) % 72 + 1
302  : (ihbhephis[ic] + (is % 2) * 4 + itb * 2 + (ifb / 2 + is / 2 + 1) % 2 - 1) % 72 + 1;
303  ispigot = (is % 2) * 6 + ih * 2 + itb;
304  idcc = is < EMAP_NHSETS / 2 ? 1 : 2;
305  //idcc_sl=idcc==1?9:19;
306  ifed = fedhbhenum[ic][idcc - 1];
308  CastorElectronicsId elId(ifi_ch, ihtr_fi, ispigot, ifed - 700);
309  elId.setHTR(icrate, ihtr, (fpga == "top") ? (1) : (0));
310  HcalDetId hId((det == "HB") ? (HcalBarrel) : (HcalEndcap), ieta * iside, iphi, idepth);
311  emap.mapEId2chId(elId, hId);
312 
313  // printf(" %9d %9d %9d %9d %9s %9d %9d %9s %9d %9d %9d %9d %9d %9d\n",iside,ieta,iphi,idepth,&det,icrate,ihtr,&fpga,ihtr_fi,ifi_ch,ispigot,idcc,idcc_sl,ifed);
314  }
315  }
316  }
317  }
318  }
319  }
320  /* all HF crates */
321  for (ic = 0; ic < EMAP_NHFCR; ic++) {
322  /* four sets of three htrs per crate */
323  for (is = 0; is < EMAP_NHSETS; is++) {
324  /* three htrs per set */
325  for (ih = 0; ih < EMAP_NHTRS; ih++) {
326  /* top and bottom */
327  for (itb = 0; itb < EMAP_NTOPBOT; itb++) {
328  /* eight fibers per HTR FPGA */
329  for (ifb = 0; ifb < EMAP_NFBR; ifb++) {
330  /* three channels per fiber */
331  for (ifc = 0; ifc < EMAP_NFCH; ifc++) {
332  icrate = hfcrate[ic];
333  iside = is < EMAP_NHSETS / 2 ? -1 : 1;
334  ieta = ihfetadepth[itb][ifb][ifc][0];
335  idepth = ihfetadepth[itb][ifb][ifc][1];
336  ihtr = ihslot[is] + ih;
337  det = "HF";
338  fpga = ((itb % 2) == 1) ? ("bot") : ("top");
339  ihtr_fi = ifb + 1;
340  ifi_ch = ifc;
341  iphi = (ieta > 39) ? (ihfphis[ic] + (is % 2) * 12 + ih * 4 - 3) % 72 + 1
342  : (ihfphis[ic] + (is % 2) * 12 + ih * 4 + (ifb / 4) * 2 - 1) % 72 + 1;
343  ispigot = (is % 2) * 6 + ih * 2 + itb;
344  idcc = is < EMAP_NHSETS / 2 ? 1 : 2;
345  //idcc_sl=idcc==1?9:19;
346  ifed = fedhfnum[ic][idcc - 1];
347  CastorElectronicsId elId(ifi_ch, ihtr_fi, ispigot, ifed - 700);
348  elId.setHTR(icrate, ihtr, (fpga == "top") ? (1) : (0));
349  HcalDetId hId(HcalForward, ieta * iside, iphi, idepth);
350  emap.mapEId2chId(elId, hId);
351  // printf(" %9d %9d %9d %9d %9s %9d %9d %9s %9d %9d %9d %9d %9d %9d\n",iside,ieta,iphi,idepth,&det,icrate,ihtr,&fpga,ihtr_fi,ifi_ch,ispigot,idcc,idcc_sl,ifed);
352  }
353  }
354  }
355  }
356  }
357  }
358  /* all HO crates */
359  for (ic = 0; ic < EMAP_NHOCR; ic++) {
360  /* three sets of four htrs per crate */
361  for (is = 0; is < EMAP_NHSETSHO; is++) {
362  /* four htrs per set */
363  for (ih = 0; ih < EMAP_NHTRSHO; ih++) {
364  /* top and bottom */
365  for (itb = 0; itb < EMAP_NTOPBOT; itb++) {
366  /* eight fibers per HTR FPGA */
367  for (ifb = 0; ifb < EMAP_NFBR; ifb++) {
368  /* three channels per fiber */
369  for (ifc = 0; ifc < EMAP_NFCH; ifc++) {
370  icrate = hocrate[ic];
371  idepth = 1;
372  ieta = ihoetasidephi[ih][itb][ifb][ifc][0];
373  iside = ihoetasidephi[ih][itb][ifb][ifc][1];
374  iphi_loc = ihoetasidephi[ih][itb][ifb][ifc][2];
375  ihtr = ihslotho[is][ih];
376  det = "HO";
377  fpga = ((itb % 2) == 1) ? ("bot") : ("top");
378  ihtr_fi = ifb + 1;
379  ifi_ch = ifc;
380  iphi = (ihophis[ic] + is * 6 + iphi_loc - 1) % 72 + 1;
381  ispigot = ihtr < 9 ? (ihtr - 2) * 2 + itb : (ihtr - 13) * 2 + itb;
382  idcc = ihtr < 9 ? 1 : 2;
383  //idcc_sl=idcc==1?9:19;
384  ifed = fedhonum[ic][idcc - 1];
385  CastorElectronicsId elId(ifi_ch, ihtr_fi, ispigot, ifed - 700);
386  elId.setHTR(icrate, ihtr, (fpga == "top") ? (1) : (0));
387  if (ieta == 0) { // unmapped
389  } else {
390  HcalDetId hId(HcalOuter, ieta * iside, iphi, 4); // HO is officially "depth=4"
391  emap.mapEId2chId(elId, hId);
392  }
393  // printf(" %9d %9d %9d %9d %9s %9d %9d %9s %9d %9d %9d %9d %9d %9d\n",iside,ieta,iphi,idepth,&det,icrate,ihtr,&fpga,ihtr_fi,ifi_ch,ispigot,idcc,idcc_sl,ifed);
394  }
395  }
396  }
397  }
398  }
399  }
400 
401  emap.sort();
402 }
static const HcalDetId Undefined
Definition: HcalDetId.h:273
#define EMAP_NHSETSHO
#define EMAP_NHTRSHO
#define EMAP_NHTRS
#define EMAP_NFCH
#define EMAP_NFBR
#define EMAP_NHFCR
Definition: DetId.h:17
#define EMAP_NHSETS
#define EMAP_NHOCR
bool mapEId2chId(CastorElectronicsId fElectronicsId, DetId fId)
Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] ...
#define EMAP_NTOPBOT
#define EMAP_NHBHECR
CastorPedestal CastorDbHardcode::makePedestal ( HcalGenericDetId  fId,
bool  fSmear = false 
)

Definition at line 12 of file CastorDbHardcode.cc.

References HcalGenericDetId::genericSubdet(), CastorPedestalWidth::getWidth(), HcalGenericDetId::HcalGenForward, mps_fire::i, makePedestalWidth(), DetId::rawId(), mps_fire::result, and relativeConstraints::value.

Referenced by CastorHardcodeCalibrations::producePedestals().

12  {
14  float value0 = fId.genericSubdet() == HcalGenericDetId::HcalGenForward ? 11. : 4.; // fC
15  float value[4] = {value0, value0, value0, value0};
16  if (fSmear) {
17  for (int i = 0; i < 4; i++) {
18  value[i] =
19  CLHEP::RandGauss::shoot(value0, width.getWidth(i) / 100.); // ignore correlations, assume 10K pedestal run
20  while (value[i] <= 0)
21  value[i] = CLHEP::RandGauss::shoot(value0, width.getWidth(i));
22  }
23  }
24  CastorPedestal result(fId.rawId(), value[0], value[1], value[2], value[3]);
25  return result;
26 }
CastorPedestalWidth makePedestalWidth(HcalGenericDetId fId)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
tuple result
Definition: mps_fire.py:311
HcalGenericSubdetector genericSubdet() const
CastorPedestalWidth CastorDbHardcode::makePedestalWidth ( HcalGenericDetId  fId)

Definition at line 28 of file CastorDbHardcode.cc.

References mps_fire::i, dqmiolumiharvest::j, DetId::rawId(), mps_fire::result, and relativeConstraints::value.

Referenced by makePedestal(), and CastorHardcodeCalibrations::producePedestalWidths().

28  {
29  float value = 0;
30  /*
31  if (fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel ||
32  fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) value = 0.7;
33  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap) value = 0.9;
34  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) value = 2.5;
35  */
36  // everything in fC
38  for (int i = 0; i < 4; i++) {
39  double width = value;
40  for (int j = 0; j < 4; j++) {
41  result.setSigma(i, j, i == j ? width * width : 0);
42  }
43  }
44  return result;
45 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
tuple result
Definition: mps_fire.py:311
CastorQIECoder CastorDbHardcode::makeQIECoder ( HcalGenericDetId  fId)

Definition at line 72 of file CastorDbHardcode.cc.

References HcalGenericDetId::genericSubdet(), HcalGenericDetId::HcalGenForward, hltrates_dqm_sourceclient-live_cfg::offset, sistrip::SpyUtilities::range(), DetId::rawId(), mps_fire::result, and slope.

Referenced by CastorHardcodeCalibrations::produceQIEData().

72  {
74  float offset = 0;
75  float slope = fId.genericSubdet() == HcalGenericDetId::HcalGenForward ? 0.36 : 0.92; // ADC/fC
76  for (unsigned range = 0; range < 4; range++) {
77  for (unsigned capid = 0; capid < 4; capid++) {
78  result.setOffset(capid, range, offset);
79  result.setSlope(capid, range, slope);
80  }
81  }
82  return result;
83 }
static const double slope[3]
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const uint16_t range(const Frame &aFrame)
tuple result
Definition: mps_fire.py:311
HcalGenericSubdetector genericSubdet() const
CastorQIEShape CastorDbHardcode::makeQIEShape ( )

Definition at line 94 of file CastorDbHardcode.cc.

94 { return CastorQIEShape(); }
CastorRecoParam CastorDbHardcode::makeRecoParam ( HcalGenericDetId  fId)

Definition at line 96 of file CastorDbHardcode.cc.

References DetId::rawId(), and mps_fire::result.

Referenced by CastorHardcodeCalibrations::produceRecoParams().

96  {
97  CastorRecoParam result(fId.rawId(), 4, 2);
98  return result;
99 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
tuple result
Definition: mps_fire.py:311
CastorSaturationCorr CastorDbHardcode::makeSaturationCorr ( HcalGenericDetId  fId)

Definition at line 101 of file CastorDbHardcode.cc.

References DetId::rawId(), and mps_fire::result.

Referenced by CastorHardcodeCalibrations::produceSaturationCorrs().

101  {
103  return result;
104 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
tuple result
Definition: mps_fire.py:311