CMS 3D CMS Logo

HcalDbHardcode.cc
Go to the documentation of this file.
1 //
2 // F.Ratnikov (UMd), Dec 14, 2005
3 //
4 #include <vector>
5 #include <string>
6 #include <cmath>
7 #include <sstream>
8 #include <iostream>
9 
10 #include "CLHEP/Random/RandGauss.h"
15 
17 : theDefaultParameters_(3.0,0.5,{0.2,0.2},{0.0,0.0},0,{0.0,0.0,0.0,0.0},{0.9,0.9,0.9,0.9},125,105,0.0,{0.0}), //"generic" set of conditions
18  setHB_(false), setHE_(false), setHF_(false), setHO_(false),
19  setHBUpgrade_(false), setHEUpgrade_(false), setHFUpgrade_(false),
20  useHBUpgrade_(false), useHEUpgrade_(false), useHOUpgrade_(true),
21  useHFUpgrade_(false), testHFQIE10_(false), testHEPlan1_(false)
22 {
23 }
24 
28  else if(!useHBUpgrade_ && setHB_) return theHBParameters_;
29  else return theDefaultParameters_;
30  }
32  bool b_isHEPlan1 = testHEPlan1_ ? isHEPlan1(fId) : false;
33  if((useHEUpgrade_ || b_isHEPlan1) && setHEUpgrade_) return theHEUpgradeParameters_;
34  else if(!useHEUpgrade_ && !b_isHEPlan1 && setHE_) return theHEParameters_;
35  else return theDefaultParameters_;
36  }
39  else if(testHFQIE10_ && fId.isHcalDetId()){
40  HcalDetId hid(fId);
41  //special mixed case for HF 2016
42  if(hid.iphi()==39 && hid.zside()==1 && (hid.depth()>=3 || (hid.depth()==2 && (hid.ieta()==30 || hid.ieta()==34))) && setHFUpgrade_) return theHFUpgradeParameters_;
43  else if(setHF_) return theHFParameters_;
44  else return theDefaultParameters_;
45  }
46  else if(!useHFUpgrade_ && setHF_) return theHFParameters_;
47  else return theDefaultParameters_;
48  }
50  if(setHO_) return theHOParameters_;
51  else return theDefaultParameters_;
52  }
53  else return theDefaultParameters_;
54 }
55 
57  int index = 0;
59  HcalDetId hid(fId);
60  if ((hid.ieta() > -5) && (hid.ieta() < 5)) index = 0;
61  else index = 1;
62  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) {
63  HcalDetId hid(fId);
64  if (hid.depth() % 2 == 1) index = 0; //depths 1,3
65  else if (hid.depth() % 2 == 0) index = 1; //depths 2,4
66  }
67  return index;
68 }
69 
72  float value0 = getParameters(fId).pedestal();
73  float value [4] = {value0,value0,value0,value0};
74  if (fSmear) {
75  for (int i = 0; i < 4; i++) {
76  value[i] = 0.0f;
77  while (value [i] <= 0.0f)
78  // ignore correlations, assume 10K pedestal run
79  value [i] = value0 + (float)CLHEP::RandGauss::shoot (0.0, width.getWidth (i) / 100.);
80  }
81  }
82  HcalPedestal result (fId.rawId (),
83  value[0], value[1], value[2], value[3]
84  );
85  return result;
86 }
87 
89  float value = getParameters(fId).pedestalWidth();
90  // everything in fC
91 
93  float width2 = value*value;
94  for (int i = 0; i < 4; i++) {
95  for (int j = 0; j < 4; j++) {
96  result.setSigma (i, j, 0.0);
97  }
98  result.setSigma (i, i, width2);
99  }
100  return result;
101 }
102 
103 HcalGain HcalDbHardcode::makeGain (HcalGenericDetId fId, bool fSmear) { // GeV/fC
105  float value0 = getParameters(fId).gain(getGainIndex(fId));
106  float value [4] = {value0, value0, value0, value0};
107  if (fSmear) {
108  for (int i = 0; i < 4; i++) {
109  value[i] = 0.0f;
110  while (value [i] <= 0.0f) value [i] = value0 + (float)CLHEP::RandGauss::shoot (0.0, width.getValue (i));
111  }
112  }
113  HcalGain result (fId.rawId (), value[0], value[1], value[2], value[3]);
114  return result;
115 }
116 
118  float value = getParameters(fId).gainWidth(getGainIndex(fId));
120  return result;
121 }
122 
124  HcalQIECoder result (fId.rawId ());
125  // slope in ADC/fC
126  const HcalHardcodeParameters& param(getParameters(fId));
127  for (unsigned range = 0; range < 4; range++) {
128  for (unsigned capid = 0; capid < 4; capid++) {
129  result.setOffset (capid, range, param.qieOffset(range));
130  result.setSlope (capid, range, param.qieSlope(range));
131  }
132  }
133 
134  return result;
135 }
136 
138  HcalQIENum qieType = (HcalQIENum)(getParameters(fId).qieType());
139  HcalQIEType result(fId.rawId(),qieType);
140  return result;
141 }
142 
145  float lowEdges [64];
146  for (int i = 0; i < 64; i++) { lowEdges[i] = -1.5 + i; }
147  result.setMinCharges (lowEdges);
148  return result;
149 }
150 
152 
153  // std::cout << " !!! HcalDbHardcode::makeQIEShape " << std::endl;
154 
155  return HcalQIEShape ();
156 }
157 
158 
160 
161  int r1bit[5];
162  r1bit[0] = 9; // [0,9]
163  int syncPhase = 0; r1bit[1] = 1;
164  int binOfMaximum = 0; r1bit[2] = 4;
165  float phase = -25.0f; // [-25.0,25.0]
166  float Xphase = (phase + 32.0f) * 4.0f; // never change this line
167  // (offset 50nsec, 0.25ns step)
168  int Iphase = Xphase; r1bit[3] = 8; // [0,256] offset 50ns, .25ns step
169  int timeSmearing = 0; r1bit[4] = 1; // bool
170 
171  const HcalHardcodeParameters& hparam(getParameters(fId));
172  int pulseShapeID = hparam.mcShape(); // a0
173 
175 
176  syncPhase = 1; // a1 bool
177  binOfMaximum = 5; // a2
178  phase = 5.0f; // a3 [-25.0,25.0]
179  Xphase = (phase + 32.0f) * 4.0f; // never change this line
180  // (offset 50nsec, 0.25ns step)
181  Iphase = Xphase;
182  timeSmearing = 1; // a4
183 
184  }
185 
186  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap) {
187 
188  syncPhase = 1; // a1 bool
189  binOfMaximum = 5; // a2
190  phase = 5.0f; // a3 [-25.0,25.0]
191  Xphase = (phase + 32.0f) * 4.0f; // never change this line
192  // (offset 50nsec, 0.25ns step)
193  Iphase = Xphase;
194  timeSmearing = 1; // a4
195 
196  }
197 
198  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
199 
200  syncPhase = 1; // a1 bool
201  binOfMaximum = 5; // a2
202  phase = 5.0f; // a3 [-25.0,25.0]
203  Xphase = (phase + 32.0f) * 4.0f; // never change this line
204  // (offset 50nsec, 0.25ns step)
205  Iphase = Xphase;
206  timeSmearing = 0; // a4
207 
208  HcalDetId cell = HcalDetId(fId);
209  if (cell.ieta() == 1 && cell.iphi() == 1) pulseShapeID = 125;
210 
211  }
212 
213  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) {
214 
215  syncPhase = 1; // a1 bool
216  binOfMaximum = 3; // a2
217  phase = 14.0f; // a3 [-25.0,25.0]
218  Xphase = (phase + 32.0f) * 4.0f; // never change this line
219  // (offset 50nsec, 0.25ns step)
220  Iphase = Xphase;
221  timeSmearing = 0; // a4
222 
223  }
224 
225  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenZDC) {
226 
227  pulseShapeID = 401; // a0
228  syncPhase = 1; // a1 bool
229  binOfMaximum = 5; // a2
230  phase = -4.0f; // a3 [-25.0,25.0]
231  Xphase = (phase + 32.0f) * 4.0f; // never change this line
232  // (offset 50nsec, 0.25ns step)
233  Iphase = Xphase;
234  timeSmearing = 0; // a4
235 
236  }
237 
238 
239  int rshift[7];
240  rshift[0]=0;
241  for(int k=0; k<5; k++) {
242  rshift[k+1]=rshift[k]+r1bit[k];
243  }
244 
245  int packingScheme = 1; // a5
246  unsigned int param = pulseShapeID |
247  syncPhase<<rshift[1] |
248  (binOfMaximum << rshift[2]) |
249  (Iphase << rshift[3]) |
250  (timeSmearing << rshift[4] | packingScheme << 27);
251 
252  HcalMCParam result(fId.rawId(), param);
253  return result;
254 
255 }
256 
258 
259  // Mostly comes from S.Kunori's macro
260  int p1bit[6];
261 
262  // param1
263  int containmentCorrectionFlag = 0; p1bit[0]=1; // bool
264  int containmentCorrectionPreSample = 0; p1bit[1]=1; // bool
265  float phase = 13.0; // [-25.0,25.0]
266  float Xphase = (phase + 32.0) * 4.0; //never change this line
267  // (offset 50nsec, 0.25ns step)
268  int Iphase = Xphase; p1bit[2]=8; // [0,256]
269  // (offset 50ns, 0.25ns step
270  int firstSample = 4; p1bit[3]=4; // [0,9]
271  int samplesToAdd = 2; p1bit[4]=4; // [0,9]
272  p1bit[5]=9; // [0,9]
273 
274  const HcalHardcodeParameters& hparam(getParameters(fId));
275  int pulseShapeID = hparam.recoShape(); // a5
276 
277  int q2bit[10];
278  // param2.
279  int useLeakCorrection = 0; q2bit[0]=1; // bool
280  int LeakCorrectionID = 0; q2bit[1]=4; // [0,15]
281  int correctForTimeslew = 0; q2bit[2]=1; // bool
282  int timeCorrectionID = 0; q2bit[3]=4; // [0,15]
283  int correctTiming = 0; q2bit[4]=1; // bool
284  int firstAuxTS = 0; q2bit[5]=4; // [0,15]
285  int specialCaseID = 0; q2bit[6]=4; // [0,15]
286  int noiseFlaggingID = 0; q2bit[7]=4; // [0,15]
287  int pileupCleaningID = 0; q2bit[8]=4; // [0,15]
288  int packingScheme = 1; q2bit[9]=4;
289 
290 
293  // param1.
294  containmentCorrectionFlag = 1; // p0
295  containmentCorrectionPreSample = 0; // p1
296  float phase = 6.0;
297  float Xphase = (phase + 32.0) * 4.0; // never change this line
298  //(offset 50nsec, 0.25ns step)
299  Iphase = Xphase; // p2
300  firstSample = 4; // p3
301  samplesToAdd = 2; // p4
302 
303  // param2.
304  useLeakCorrection = 0; // q0
305  LeakCorrectionID = 0; // q1
306  correctForTimeslew = 1; // q2
307  timeCorrectionID = 0; // q3
308  correctTiming = 1; // q4
309  firstAuxTS = 4; // q5
310  specialCaseID = 0; // q6
311  noiseFlaggingID = 1; // q7
312  pileupCleaningID = 0; // q8
313  }
314 
315 
316  else if(fId.genericSubdet() == HcalGenericDetId::HcalGenOuter ) {
317  // param1.
318  containmentCorrectionFlag = 1; // p0
319  containmentCorrectionPreSample = 0; // p1
320  float phase = 13.0;
321  float Xphase = (phase + 32.0) * 4.0; // never change this line
322  // (offset 50nsec, 0.25ns step)
323  Iphase = Xphase; // p2
324  firstSample = 4; // p3
325  samplesToAdd = 4; // p4
326 
327  // param2.
328  useLeakCorrection = 0; // q0
329  LeakCorrectionID = 0; // q1
330  correctForTimeslew = 1; // q2
331  timeCorrectionID = 0; // q3
332  correctTiming = 1; // q4
333  firstAuxTS = 4; // q5
334  specialCaseID = 0; // q6
335  noiseFlaggingID = 1; // q7
336  pileupCleaningID = 0; // q8
337 
338  }
340  // param1.
341  containmentCorrectionFlag = 0; // p0
342  containmentCorrectionPreSample = 0; // p1
343  float phase = 13.0;
344  float Xphase = (phase + 32.0) * 4.0; // never change this line
345  // (offset 50nsec, 0.25ns step)
346  Iphase = Xphase; // p2
347  firstSample = 2; // p3
348  samplesToAdd = 1; // p4
349 
350  // param2.
351  useLeakCorrection = 0; // q0
352  LeakCorrectionID = 0; // q1
353  correctForTimeslew = 0; // q2
354  timeCorrectionID = 0; // q3
355  correctTiming = 1; // q4
356  firstAuxTS = 1; // q5
357  specialCaseID = 0; // q6
358  noiseFlaggingID = 1; // q7
359  pileupCleaningID = 0; // q8
360  }
361 
362 
363  // Packing parameters in two words
364 
365  int p1shift[7]; p1shift[0] = 0;
366  for(int k = 0; k < 6; k++) {
367  int j = k + 1;
368  p1shift[j] = p1shift[k] + p1bit[k];
369  // cout<<" j= "<<j<<" shift "<< p1shift[j]<<endl;
370  }
371  int param1 = 0;
372  param1 = containmentCorrectionFlag |
373  (containmentCorrectionPreSample << p1shift[1]) |
374  (Iphase << p1shift[2]) |
375  (firstSample << p1shift[3]) |
376  (samplesToAdd << p1shift[4]) |
377  (pulseShapeID << p1shift[5]) ;
378 
379  int q2shift[10]; q2shift[0] = 0;
380  for(int k = 0; k < 9; k++) {
381  int j = k + 1;
382  q2shift[j] = q2shift[k] + q2bit[k];
383  // cout<<" j= "<<j<<" shift "<< q2shift[j]<<endl;
384  }
385  int param2 = 0;
386  param2 = useLeakCorrection |
387  (LeakCorrectionID << q2shift[1]) |
388  (correctForTimeslew << q2shift[2]) |
389  (timeCorrectionID << q2shift[3]) |
390  (correctTiming << q2shift[4]) |
391  (firstAuxTS << q2shift[5]) |
392  (specialCaseID << q2shift[6]) |
393  (noiseFlaggingID << q2shift[7]) |
394  (pileupCleaningID << q2shift[8]) |
395  (packingScheme << q2shift[9]) ;
396 
397  HcalRecoParam result(fId.rawId(), param1, param2);
398 
399  return result;
400 }
401 
403  int nhits = 0;
404  float phase = 0.0;
405  float rms = 0.0;
406  if (fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel) {nhits=4; phase = 4.5; rms = 6.5;}
407  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap) {nhits=4;phase = 9.3; rms = 7.8;}
408  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {nhits=4;phase = 8.6; rms = 2.3;}
409  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) {nhits=4;phase = 12.4; rms = 12.29;}
410  HcalTimingParam result(fId.rawId(), nhits,phase, rms);
411 
412  return result;
413 }
414 
415 #define EMAP_NHBHECR 9
416 #define EMAP_NHFCR 3
417 #define EMAP_NHOCR 4
418 #define EMAP_NFBR 8
419 #define EMAP_NFCH 3
420 #define EMAP_NHTRS 3
421 #define EMAP_NHSETS 4
422 #define EMAP_NTOPBOT 2
423 #define EMAP_NHTRSHO 4
424 #define EMAP_NHSETSHO 3
425 
427  dcs_map.mapGeomId2DcsId(HcalDetId(HcalBarrel, -16, 1, 1),
429  dcs_map.mapGeomId2DcsId(HcalDetId(HcalForward, -41, 3, 1),
431  dcs_map.mapGeomId2DcsId(HcalDetId(HcalForward, -26, 25, 2),
433  dcs_map.mapGeomId2DcsId(HcalDetId(HcalBarrel, -15, 68, 1),
435  dcs_map.mapGeomId2DcsId(HcalDetId(HcalOuter, -14, 1, 4),
437  dcs_map.mapGeomId2DcsId(HcalDetId(HcalForward, 41, 71, 2),
439 }
440 
441 void HcalDbHardcode::makeHardcodeMap(HcalElectronicsMap& emap, const std::vector<HcalGenericDetId>& cells) {
442  static const int kUTCAMask = 0x4000000; //set bit 26 for uTCA version
443  static const int kLinearIndexMax = 0x7FFFF; //19 bits
444  static const int kTriggerBitMask = 0x02000000; //2^25
445  uint32_t counter = 0;
446  uint32_t counterTrig = 0;
447  for(const auto& fId : cells){
448  if(fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel ||
449  fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap ||
450  fId.genericSubdet() == HcalGenericDetId::HcalGenForward ||
451  fId.genericSubdet() == HcalGenericDetId::HcalGenOuter ||
452  fId.genericSubdet() == HcalGenericDetId::HcalGenZDC)
453  {
454  ++counter;
455  assert(counter < kLinearIndexMax);
456  uint32_t raw = counter;
457  raw |= kUTCAMask;
458  HcalElectronicsId elId(raw);
459  emap.mapEId2chId(elId,fId);
460  }
461  else if(fId.genericSubdet() == HcalGenericDetId::HcalGenTriggerTower){
462  ++counterTrig;
463  assert(counterTrig < kLinearIndexMax);
464  uint32_t raw = counterTrig;
465  raw |= kUTCAMask | kTriggerBitMask;
466  HcalElectronicsId elId(raw);
467  emap.mapEId2tId(elId,fId);
468  }
469  }
470  emap.sort();
471 }
472 
473 void HcalDbHardcode::makeHardcodeFrontEndMap(HcalFrontEndMap& emap, const std::vector<HcalGenericDetId>& cells) {
474 
475  std::stringstream mystream;
476  std::string detector[5] = {"XX","HB","HE","HO","HF"};
477  for (const auto& fId : cells) {
478  if (fId.isHcalDetId()) {
479  HcalDetId id = HcalDetId(fId.rawId());
480  HcalSubdetector subdet = id.subdet();
481  int ieta = id.ietaAbs();
482  int iside = id.zside();
483  int iphi = id.iphi();
484  std::string det, rbx;
485  int irm(0);
486  char tempbuff[30];
487  char sidesign = (iside == -1) ? 'M' : 'P';
488  if (subdet == HcalBarrel || subdet == HcalEndcap) {
489  det = detector[subdet];
490  irm = (iphi+1)%4 + 1;
491  int iwedge(0);
492  if (ieta >= 21 && (irm == 1 || irm == 3))
493  iwedge = (iphi + 1 + irm + 1) / 4;
494  else
495  iwedge = (iphi + irm + 1) / 4;
496  if (iwedge > 18) iwedge -= 18;
497  sprintf (tempbuff,"%s%c%2.2i%c",det.c_str(),sidesign,iwedge,'\0');
498  mystream << tempbuff;
499  rbx = mystream.str();
500  mystream.str("");
501  emap.loadObject(id,irm,rbx);
502  } else if (subdet == HcalForward) {
503  det = detector[subdet];
504  int hfphi(0);
505  if ((iside == 1 && ieta == 40) || (iside == -1 && ieta == 41)) {
506  irm = ((iphi + 1) / 2) % 36 + 1;
507  hfphi = ((iphi + 1) / 6) % 12 + 1;
508  } else {
509  irm = ( iphi + 1) / 2;
510  hfphi = (iphi - 1) / 6 + 1;
511  }
512  irm = (irm - 1) % 3 + 1;
513  sprintf (tempbuff,"%s%c%2.2i%c",det.c_str(),sidesign,hfphi,'\0');
514  mystream << tempbuff;
515  rbx = mystream.str();
516  mystream.str("");
517  emap.loadObject(id,irm,rbx);
518  } else if (subdet == HcalOuter) {
519  det = detector[subdet];
520  int ring(0), sector(0);
521  if (ieta <= 4) ring = 0;
522  else if (ieta >= 5 && ieta <= 10) ring = 1;
523  else ring = 2;
524  for (int i = -2; i < iphi; i+=6) sector++;
525  if (sector > 12) sector = 1;
526  irm = ((iphi+1)/2)%6 + 1;
527  if (ring != 0 && sector % 2 != 0) sector++;
528  if (ring == 0)
529  sprintf (tempbuff,"%s%i%2.2d",det.c_str(),ring,sector);
530  else
531  sprintf (tempbuff,"%s%i%c%2.2d",det.c_str(),ring,sidesign,sector);
532  mystream << tempbuff;
533  rbx = mystream.str();
534  mystream.str("");
535  emap.loadObject(id,irm,rbx);
536  }
537  }
538  }
539  emap.sort();
540 }
541 
542 int HcalDbHardcode::getLayersInDepth(int ieta, int depth, const HcalTopology* topo){
543  //check for cached value
544  auto eta_depth_pair = std::make_pair(ieta,depth);
545  auto nLayers = theLayersInDepths_.find(eta_depth_pair);
546  if(nLayers != theLayersInDepths_.end()){
547  return nLayers->second;
548  }
549  else {
550  std::vector<int> segmentation;
551  topo->getDepthSegmentation(ieta,segmentation);
552  //assume depth segmentation vector is sorted
553  int nLayersInDepth = std::distance(std::lower_bound(segmentation.begin(),segmentation.end(),depth),
554  std::upper_bound(segmentation.begin(),segmentation.end(),depth));
555  theLayersInDepths_.insert(std::make_pair(eta_depth_pair,nLayersInDepth));
556  return nLayersInDepth;
557  }
558 }
559 
561  if(fId.isHcalDetId()){
562  HcalDetId hid(fId);
563  //special mixed case for HE 2017
564  if(hid.zside()==1 && (hid.iphi()==63 || hid.iphi()==64 || hid.iphi()==65 || hid.iphi()==66)) return true;
565  }
566  return false;
567 }
568 
570  // SiPMParameter defined for each DetId the following quantities:
571  // SiPM type, PhotoElectronToAnalog, Dark Current, two auxiliary words
572  // These numbers come from some measurements done with SiPMs
573  // rule for type: cells with >4 layers use larger device (3.3mm diameter), otherwise 2.8mm
574  HcalSiPMType theType = HcalNoSiPM;
575  double thePe2fC = getParameters(fId).photoelectronsToAnalog();
576  double theDC = getParameters(fId).darkCurrent(0,intlumi);
578  if(useHBUpgrade_) {
579  HcalDetId hid(fId);
580  int nLayersInDepth = getLayersInDepth(hid.ietaAbs(),hid.depth(),topo);
581  if(nLayersInDepth > 4) {
582  theType = HcalHBHamamatsu2;
583  theDC = getParameters(fId).darkCurrent(1,intlumi);
584  }
585  else {
586  theType = HcalHBHamamatsu1;
587  theDC = getParameters(fId).darkCurrent(0,intlumi);
588  }
589  }
590  else theType = HcalHPD;
591  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap) {
592  if(useHEUpgrade_ || (testHEPlan1_ && isHEPlan1(fId))) {
593  HcalDetId hid(fId);
594  int nLayersInDepth = getLayersInDepth(hid.ietaAbs(),hid.depth(),topo);
595  if(nLayersInDepth > 4) {
596  theType = HcalHEHamamatsu2;
597  theDC = getParameters(fId).darkCurrent(1,intlumi);
598  }
599  else {
600  theType = HcalHEHamamatsu1;
601  theDC = getParameters(fId).darkCurrent(0,intlumi);
602  }
603  }
604  else theType = HcalHPD;
605  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
606  if(useHOUpgrade_) theType = HcalHOHamamatsu;
607  else theType = HcalHPD;
608  }
609 
610  return HcalSiPMParameter(fId.rawId(), theType, thePe2fC, theDC, 0, 0);
611 }
612 
614  // SiPMCharacteristics are constants for each type of SiPM:
615  // Type, # of pixels, 3 parameters for non-linearity, cross talk parameter, ..
616  // Obtained from data sheet and measurements
617  // types (in order): HcalHOZecotek=1, HcalHOHamamatsu, HcalHEHamamatsu1, HcalHEHamamatsu2, HcalHBHamamatsu1, HcalHBHamamatsu2, HcalHPD
618  for(unsigned ip = 0; ip < theSiPMCharacteristics_.size(); ++ip){
619  auto& ps = theSiPMCharacteristics_[ip];
620  sipm.loadObject(ip+1,
621  ps.getParameter<int>("pixels"),
622  ps.getParameter<double>("nonlin1"),
623  ps.getParameter<double>("nonlin2"),
624  ps.getParameter<double>("nonlin3"),
625  ps.getParameter<double>("crosstalk"),
626  0,0
627  );
628  }
629 }
630 
632  // For each detId parameters for trigger primitive
633  // mask for channel validity and self trigger information, fine grain
634  // bit information and auxiliary words
635  uint32_t bitInfo = ((44 << 16) | 30);
636  return HcalTPChannelParameter(fId.rawId(), 0, bitInfo, 0, 0);
637 }
638 
640  // Parameters for a given TP algorithm:
641  // FineGrain Algorithm Version for HBHE, ADC threshold fof TDC mask of HF,
642  // TDC mask for HF, Self Trigger bits, auxiliary words
643  tppar.loadObject(0,0,0xFFFFFFFFFFFFFFFF,0,0,0);
644 }
const double pedestalWidth() const
HcalGainWidth makeGainWidth(HcalGenericDetId fId)
HcalHardcodeParameters theHOParameters_
void getDepthSegmentation(const unsigned ring, std::vector< int > &readoutDepths, const bool flag=false) const
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
const int recoShape() const
bool mapGeomId2DcsId(HcalDetId fId, HcalDcsDetId fDcsId)
Definition: HcalDcsMap.cc:235
std::vector< edm::ParameterSet > theSiPMCharacteristics_
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:93
HcalRecoParam makeRecoParam(HcalGenericDetId fId)
HcalQIECoder makeQIECoder(HcalGenericDetId fId)
bool mapEId2tId(HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
HcalMCParam makeMCParam(HcalGenericDetId fId)
void makeHardcodeSiPMCharacteristics(HcalSiPMCharacteristics &sipm)
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGainWidth.h:21
HcalHardcodeParameters theDefaultParameters_
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId)
const double gainWidth(unsigned index) const
HcalCalibrationQIECoder makeCalibrationQIECoder(HcalGenericDetId fId)
const double photoelectronsToAnalog() const
HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HcalHardcodeParameters theHEUpgradeParameters_
void makeHardcodeFrontEndMap(HcalFrontEndMap &emap, const std::vector< HcalGenericDetId > &cells)
HcalTPChannelParameter makeHardcodeTPChannelParameter(HcalGenericDetId fId)
int depth() const
get the tower depth
Definition: HcalDetId.cc:108
void makeHardcodeMap(HcalElectronicsMap &emap, const std::vector< HcalGenericDetId > &cells)
HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear=false)
HcalHardcodeParameters theHBUpgradeParameters_
bool loadObject(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1=0, float auxi2=0)
HcalTimingParam makeTimingParam(HcalGenericDetId fId)
HcalQIEType makeQIEType(HcalGenericDetId fId)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalQIEShape makeQIEShape()
HcalSubdetector
Definition: HcalAssistant.h:31
HcalSiPMType
Definition: HcalSiPMType.h:4
double f[11][100]
void makeHardcodeDcsMap(HcalDcsMap &dcs_map)
HcalQIENum
Definition: HcalQIENum.h:4
Definition: value.py:1
const double pedestal() const
HcalHardcodeParameters theHBParameters_
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
bool isHcalDetId() const
int k[5][pyjets_maxn]
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.cc:98
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
void makeHardcodeTPParameters(HcalTPParameters &tppar)
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
const double darkCurrent(unsigned index, double intlumi) const
void loadObject(int version, int adcCut, uint64_t tdcMask, uint32_t tbits, int auxi1, int auxi2)
const double gain(unsigned index) const
bool loadObject(DetId fId, int rm, std::string rbx)
load a new entry
static std::atomic< unsigned int > counter
int getLayersInDepth(int ieta, int depth, const HcalTopology *topo)
HcalHardcodeParameters theHFParameters_
HcalGain makeGain(HcalGenericDetId fId, bool fSmear=false)
const int getGainIndex(HcalGenericDetId fId)
bool isHEPlan1(HcalGenericDetId fId)
HcalHardcodeParameters theHEParameters_
HcalSiPMParameter makeHardcodeSiPMParameter(HcalGenericDetId fId, const HcalTopology *topo, double intlumi)
HcalGenericSubdetector genericSubdet() const
std::map< std::pair< int, int >, int > theLayersInDepths_
Readout chain identification for Hcal.
HcalHardcodeParameters theHFUpgradeParameters_