CMS 3D CMS Logo

HcalHardcodeCalibrations.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Original Author: Fedor Ratnikov
3 //
4 //
5 
6 #include <memory>
7 #include <iostream>
8 #include <string>
9 #include <vector>
10 
19 
22 
26 
28 
29 //#define DebugLog
30 
31 // class decleration
32 //
33 
34 using namespace cms;
35 
36 namespace {
37 
38  const std::vector<HcalGenericDetId>& allCells (const HcalTopology& hcaltopology, bool killHE = false) {
39  static std::vector<HcalGenericDetId> result;
40  int maxDepth=hcaltopology.maxDepth();
41 
42 #ifdef DebugLog
43  std::cout << std::endl << "HcalHardcodeCalibrations: maxDepth = "
44  << maxDepth << std::endl;
45 #endif
46 
47  if (result.empty()) {
48  for (int eta = -HcalDetId::kHcalEtaMask2;
50  for (unsigned int phi = 0; phi <= HcalDetId::kHcalPhiMask2; phi++) {
51  for (int depth = 1; depth <= maxDepth; depth++) {
52  for (int det = 1; det <= HcalForward; det++) {
53  HcalDetId cell ((HcalSubdetector) det, eta, phi, depth);
54  if( killHE && HcalEndcap == cell.subdetId() ) continue;
55  if (hcaltopology.valid(cell)) {
56  result.push_back (cell);
57 #ifdef DebugLog
58  std::cout << " HcalHardcodedCalibrations: det|eta|phi|depth = "
59  << det << "|" << eta << "|" << phi << "|"
60  << depth << std::endl;
61 #endif
62  }
63  }
64  }
65  }
66  }
67  ZdcTopology zdctopology;
68  HcalZDCDetId zcell;
70  for(int depth= 1; depth < 6; depth++){
71  zcell = HcalZDCDetId(section, true, depth);
72  if(zdctopology.valid(zcell)) result.push_back(zcell);
73  zcell = HcalZDCDetId(section, false, depth);
74  if(zdctopology.valid(zcell)) result.push_back(zcell);
75  }
76  section = HcalZDCDetId::HAD;
77  for(int depth= 1; depth < 5; depth++){
78  zcell = HcalZDCDetId(section, true, depth);
79  if(zdctopology.valid(zcell)) result.push_back(zcell);
80  zcell = HcalZDCDetId(section, false, depth);
81  if(zdctopology.valid(zcell)) result.push_back(zcell);
82  }
83  section = HcalZDCDetId::LUM;
84  for(int depth= 1; depth < 3; depth++){
85  zcell = HcalZDCDetId(section, true, depth);
86  if(zdctopology.valid(zcell)) result.push_back(zcell);
87  zcell = HcalZDCDetId(section, false, depth);
88  if(zdctopology.valid(zcell)) result.push_back(zcell);
89  }
90  section = HcalZDCDetId::RPD;
91  for(int depth= 1; depth < 17; depth++){
92  zcell = HcalZDCDetId(section, true, depth);
93  if(zdctopology.valid(zcell)) result.push_back(zcell);
94  zcell = HcalZDCDetId(section, false, depth);
95  if(zdctopology.valid(zcell)) result.push_back(zcell);
96  }
97 
98  // HcalGenTriggerTower (HcalGenericSubdetector = 5)
99  // NASTY HACK !!!
100  // - As no valid(cell) check found for HcalTrigTowerDetId
101  // to create HT cells (ieta=1-28, iphi=1-72)&(ieta=29-32, iphi=1,5,... 69)
102 
103  for (int vers=0; vers<=HcalTrigTowerDetId::kHcalVersMask; ++vers) {
107  for (int phi = 1; phi <= HcalTrigTowerDetId::kHcalPhiMask; phi++) {
108  HcalTrigTowerDetId cell(eta, phi,depth,vers);
109  if (hcaltopology.validHT(cell)) {
110  result.push_back (cell);
111 #ifdef DebugLog
112  std::cout << " HcalHardcodedCalibrations: eta|phi|depth|vers = "
113  << eta << "|" << phi << "|" << depth << "|" << vers
114  << std::endl;
115 #endif
116  }
117  }
118  }
119  }
120  }
121  }
122  return result;
123  }
124 
125 }
126 
128  hb_recalibration(nullptr), he_recalibration(nullptr), hf_recalibration(nullptr), setHEdsegm(false), setHBdsegm(false)
129 {
130  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
131 
132  if ( iConfig.exists("GainWidthsForTrigPrims") )
133  switchGainWidthsForTrigPrims = iConfig.getParameter<bool>("GainWidthsForTrigPrims");
134  else switchGainWidthsForTrigPrims = false;
135 
136  //DB helper preparation
144  dbHardcode.useHBUpgrade(iConfig.getParameter<bool>("useHBUpgrade"));
145  dbHardcode.useHEUpgrade(iConfig.getParameter<bool>("useHEUpgrade"));
146  dbHardcode.useHFUpgrade(iConfig.getParameter<bool>("useHFUpgrade"));
147  dbHardcode.useHOUpgrade(iConfig.getParameter<bool>("useHOUpgrade"));
148  dbHardcode.testHFQIE10(iConfig.getParameter<bool>("testHFQIE10"));
149  dbHardcode.testHEPlan1(iConfig.getParameter<bool>("testHEPlan1"));
150  dbHardcode.setKillHE(iConfig.getParameter<bool>("killHE"));
151  dbHardcode.setSiPMCharacteristics(iConfig.getParameter<std::vector<edm::ParameterSet>>("SiPMCharacteristics"));
152 
153  useLayer0Weight = iConfig.getParameter<bool>("useLayer0Weight");
154  useIeta18depth1 = iConfig.getParameter<bool>("useIeta18depth1");
155  testHEPlan1 = iConfig.getParameter<bool>("testHEPlan1");
156  // HB, HE, HF recalibration preparation
157  iLumi=iConfig.getParameter<double>("iLumi");
158 
159  if( iLumi > 0.0 ) {
160  bool hb_recalib = iConfig.getParameter<bool>("HBRecalibration");
161  bool he_recalib = iConfig.getParameter<bool>("HERecalibration");
162  bool hf_recalib = iConfig.getParameter<bool>("HFRecalibration");
163  if(hb_recalib) {
164  hb_recalibration.reset(
165  new HBHERecalibration(
166  iLumi,
167  iConfig.getParameter<double>("HBreCalibCutoff"),
168  iConfig.getParameter<edm::FileInPath>("HBmeanenergies").fullPath()
169  )
170  );
171  }
172  if(he_recalib) {
173  he_recalibration.reset(
174  new HBHERecalibration(
175  iLumi,
176  iConfig.getParameter<double>("HEreCalibCutoff"),
177  iConfig.getParameter<edm::FileInPath>("HEmeanenergies").fullPath()
178  )
179  );
180  }
181  if(hf_recalib && !iConfig.getParameter<edm::ParameterSet>("HFRecalParameterBlock").empty()) hf_recalibration.reset(new HFRecalibration(iConfig.getParameter<edm::ParameterSet>("HFRecalParameterBlock")));
182 
183 #ifdef DebugLog
184  std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl;
185 #endif
186  }
187 
188  std::vector <std::string> toGet = iConfig.getUntrackedParameter <std::vector <std::string> > ("toGet");
189  for(auto& objectName : toGet){
190  bool all = objectName == "all";
191 #ifdef DebugLog
192  std::cout << "Load parameters for " << objectName << std::endl;
193 #endif
194  if ((objectName == "Pedestals") || all) {
196  findingRecord <HcalPedestalsRcd> ();
197  }
198  if ((objectName == "PedestalWidths") || all) {
200  findingRecord <HcalPedestalWidthsRcd> ();
201  }
202  if ((objectName == "EffectivePedestals") || all) {
204  findingRecord <HcalPedestalsRcd> ();
205  }
206  if ((objectName == "EffectivePedestalWidths") || all) {
208  findingRecord <HcalPedestalWidthsRcd> ();
209  }
210  if ((objectName == "Gains") || all) {
212  findingRecord <HcalGainsRcd> ();
213  }
214  if ((objectName == "GainWidths") || all) {
216  findingRecord <HcalGainWidthsRcd> ();
217  }
218  if ((objectName == "QIEData") || all) {
220  findingRecord <HcalQIEDataRcd> ();
221  }
222  if ((objectName == "QIETypes") || all) {
224  findingRecord <HcalQIETypesRcd> ();
225  }
226  if ((objectName == "ChannelQuality") || (objectName == "channelQuality") || all) {
228  findingRecord <HcalChannelQualityRcd> ();
229  }
230  if ((objectName == "ElectronicsMap") || (objectName == "electronicsMap") || all) {
232  findingRecord <HcalElectronicsMapRcd> ();
233  }
234  if ((objectName == "ZSThresholds") || (objectName == "zsThresholds") || all) {
236  findingRecord <HcalZSThresholdsRcd> ();
237  }
238  if ((objectName == "RespCorrs") || (objectName == "ResponseCorrection") || all) {
240  findingRecord <HcalRespCorrsRcd> ();
241  }
242  if ((objectName == "LUTCorrs") || (objectName == "LUTCorrection") || all) {
244  findingRecord <HcalLUTCorrsRcd> ();
245  }
246  if ((objectName == "PFCorrs") || (objectName == "PFCorrection") || all) {
248  findingRecord <HcalPFCorrsRcd> ();
249  }
250  if ((objectName == "TimeCorrs") || (objectName == "TimeCorrection") || all) {
252  findingRecord <HcalTimeCorrsRcd> ();
253  }
254  if ((objectName == "L1TriggerObjects") || (objectName == "L1Trigger") || all) {
256  findingRecord <HcalL1TriggerObjectsRcd> ();
257  }
258  if ((objectName == "ValidationCorrs") || (objectName == "ValidationCorrection") || all) {
260  findingRecord <HcalValidationCorrsRcd> ();
261  }
262  if ((objectName == "LutMetadata") || (objectName == "lutMetadata") || all) {
264  findingRecord <HcalLutMetadataRcd> ();
265  }
266  if ((objectName == "DcsValues") || all) {
268  findingRecord <HcalDcsRcd> ();
269  }
270  if ((objectName == "DcsMap") || (objectName == "dcsMap") || all) {
272  findingRecord <HcalDcsMapRcd> ();
273  }
274  if ((objectName == "RecoParams") || all) {
276  findingRecord <HcalRecoParamsRcd> ();
277  }
278  if ((objectName == "LongRecoParams") || all) {
280  findingRecord <HcalLongRecoParamsRcd> ();
281  }
282  if ((objectName == "ZDCLowGainFractions") || all) {
284  findingRecord <HcalZDCLowGainFractionsRcd> ();
285  }
286  if ((objectName == "MCParams") || all) {
288  findingRecord <HcalMCParamsRcd> ();
289  }
290  if ((objectName == "FlagHFDigiTimeParams") || all) {
292  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
293  }
294  if ((objectName == "FrontEndMap") || (objectName == "frontEndMap") || all) {
296  findingRecord <HcalFrontEndMapRcd> ();
297  }
298  if ((objectName == "SiPMParameters") || all) {
300  findingRecord <HcalSiPMParametersRcd> ();
301  }
302  if ((objectName == "SiPMCharacteristics") || all) {
304  findingRecord <HcalSiPMCharacteristicsRcd> ();
305  }
306  if ((objectName == "TPChannelParameters") || all) {
308  findingRecord <HcalTPChannelParametersRcd> ();
309  }
310  if ((objectName == "TPParameters") || all) {
312  findingRecord <HcalTPParametersRcd> ();
313  }
314  }
315 }
316 
317 
319 {
320 }
321 
322 //
323 // member functions
324 //
325 void
327  std::string record = iKey.name ();
328  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
330 }
331 
332 std::unique_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals_ (const HcalPedestalsRcd& rec, bool eff) {
333  std::string seff = eff ? "Effective" : "";
334  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produce" << seff << "Pedestals-> ...";
336  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
337  const HcalTopology* topo=&(*htopo);
338 
339  auto result = std::make_unique<HcalPedestals>(topo,false);
340  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
341  for (auto cell : cells) {
342  HcalPedestal item = dbHardcode.makePedestal (cell, false, eff, topo, iLumi);
343  result->addValues(item);
344  }
345  return result;
346 }
347 
348 std::unique_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths_ (const HcalPedestalWidthsRcd& rec, bool eff) {
349  std::string seff = eff ? "Effective" : "";
350  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produce" << seff << "PedestalWidths-> ...";
352  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
353  const HcalTopology* topo=&(*htopo);
354 
355  auto result = std::make_unique<HcalPedestalWidths>(topo,false);
356  const std::vector <HcalGenericDetId>& cells = allCells(*htopo, dbHardcode.killHE());
357  for (auto cell : cells) {
358  HcalPedestalWidth item = dbHardcode.makePedestalWidth (cell, eff, topo, iLumi);
359  result->addValues(item);
360  }
361  return result;
362 }
363 
364 std::unique_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec){
365  return producePedestals_(rec,false);
366 }
367 
368 std::unique_ptr<HcalPedestals> HcalHardcodeCalibrations::produceEffectivePedestals (const HcalPedestalsRcd& rec){
369  return producePedestals_(rec,true);
370 }
371 
372 std::unique_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec){
373  return producePedestalWidths_(rec,false);
374 }
375 
377  return producePedestalWidths_(rec,true);
378 }
379 
380 std::unique_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
381  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
383  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
384  const HcalTopology* topo=&(*htopo);
385 
386  auto result = std::make_unique<HcalGains>(topo);
387  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
388  for (auto cell : cells) {
389  HcalGain item = dbHardcode.makeGain (cell);
390  result->addValues(item);
391  }
392  return result;
393 }
394 
395 std::unique_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
396  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
398  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
399  const HcalTopology* topo=&(*htopo);
400 
401  auto result = std::make_unique<HcalGainWidths>(topo);
402  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
403  for (auto cell : cells) {
404 
405  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
407  HcalGainWidth item = dbHardcode.makeGainWidth (cell);
408  result->addValues(item);
409  } else if (!cell.isHcalTrigTowerDetId()) {
410  HcalGainWidth item = dbHardcode.makeGainWidth (cell);
411  result->addValues(item);
412  }
413  }
414  return result;
415 }
416 
417 std::unique_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
418  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
419 
420  /*
421  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
422  << std::endl;
423  */
424 
426  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
427  const HcalTopology* topo=&(*htopo);
428 
429  auto result = std::make_unique<HcalQIEData>(topo);
430  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
431  for (auto cell : cells) {
432  HcalQIECoder coder = dbHardcode.makeQIECoder (cell);
433  result->addCoder (coder);
434  }
435  return result;
436 }
437 
438 std::unique_ptr<HcalQIETypes> HcalHardcodeCalibrations::produceQIETypes (const HcalQIETypesRcd& rcd) {
439  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIETypes-> ...";
441  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
442  const HcalTopology* topo=&(*htopo);
443 
444  auto result = std::make_unique<HcalQIETypes>(topo);
445  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
446  for (auto cell : cells) {
447  HcalQIEType item = dbHardcode.makeQIEType(cell);
448  result->addValues(item);
449  }
450  return result;
451 }
452 
453 std::unique_ptr<HcalChannelQuality> HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) {
454  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ...";
456  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
457  const HcalTopology* topo=&(*htopo);
458 
459  auto result = std::make_unique<HcalChannelQuality>(topo);
460  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
461  for (auto cell : cells) {
462  // Special: removal of (non-instrumented) layer "-1"("nose") = depth 1
463  // from Upgrade HE, either from
464  // (i) HEP17 sector in 2017 or
465  // (ii) the entire HE rin=18 from 2018 through Run 3.
466  // May require a revision by 2021.
467 
468  uint32_t status = 0;
469 
470  if ( !(cell.isHcalZDCDetId())) {
471 
472  HcalDetId hid = HcalDetId(cell);
473  int iphi = hid.iphi();
474  int ieta = hid.ieta();
475  int absieta = hid.ietaAbs();
476  int depth = hid.depth();
477 
478  // specific HEP17 sector (2017 only)
479  bool isHEP17 = (iphi >= 63) && (iphi <= 66) && (ieta > 0);
480  // |ieta|=18, depth=1
481  bool is18d1 = (absieta == 18) && (depth ==1);
482 
483  if( (!useIeta18depth1 && is18d1 ) &&
484  ((testHEPlan1 && isHEP17) || (!testHEPlan1))) {
485  status = 0x8002; // dead cell
486  }
487  }
488 
489  HcalChannelStatus item(cell.rawId(),status);
490  result->addValues(item);
491  }
492 
493 
494 
495  return result;
496 }
497 
498 
499 std::unique_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) {
500  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ...";
502  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
503  const HcalTopology* topo=&(*htopo);
504 
505  //set depth segmentation for HB/HE recalib - only happens once
507  std::vector<std::vector<int>> m_segmentation;
508  int maxEta = std::max(topo->lastHERing(),topo->lastHBRing());
509  m_segmentation.resize(maxEta);
510  for (int i = 0; i < maxEta; i++) {
511  topo->getDepthSegmentation(i+1,m_segmentation[i]);
512  }
515  rcd.getRecord<HBHEDarkeningRecord>().get("HE",hdark);
516  he_recalibration->setup(m_segmentation,&*hdark);
517  setHEdsegm = true;
518  }
521  rcd.getRecord<HBHEDarkeningRecord>().get("HB",hdark);
522  hb_recalibration->setup(m_segmentation,&*hdark);
523  setHBdsegm = true;
524  }
525  }
526 
527  auto result = std::make_unique<HcalRespCorrs>(topo);
528  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
529  for (const auto& cell : cells) {
530 
531  double corr = 1.0;
532 
533  //check for layer 0 reweighting: when depth 1 has only one layer, it is layer 0
534  if( useLayer0Weight &&
535  ((cell.genericSubdet() == HcalGenericDetId::HcalGenEndcap) || (cell.genericSubdet() == HcalGenericDetId::HcalGenBarrel)) &&
536  (HcalDetId(cell).depth()==1 && dbHardcode.getLayersInDepth(HcalDetId(cell).ietaAbs(),HcalDetId(cell).depth(),topo)==1) )
537  {
538  //layer 0 is thicker than other layers (9mm vs 3.7mm) and brighter (Bicron vs SCSN81)
539  //in Run1/Run2 (pre-2017 for HE), ODU for layer 0 had neutral density filter attached
540  //NDF was simulated as weight of 0.5 applied to Geant energy deposits
541  //for Phase1, NDF is removed - simulated as weight of 1.2 applied to Geant energy deposits
542  //to maintain RECO calibrations, move the layer 0 energy scale back to its previous state using respcorrs
543  corr = 0.5/1.2;
544  }
545 
546  if ((hb_recalibration != nullptr ) && (cell.genericSubdet() == HcalGenericDetId::HcalGenBarrel)) {
547  int depth_ = HcalDetId(cell).depth();
548  int ieta_ = HcalDetId(cell).ieta();
549  corr *= hb_recalibration->getCorr(ieta_, depth_);
550 #ifdef DebugLog
551  std::cout << "HB ieta, depth = " << ieta_ << ", " << depth_ << " corr = " << corr << std::endl;
552 #endif
553  }
554  else if ((he_recalibration != nullptr ) && (cell.genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
555  int depth_ = HcalDetId(cell).depth();
556  int ieta_ = HcalDetId(cell).ieta();
557  corr *= he_recalibration->getCorr(ieta_, depth_);
558 #ifdef DebugLog
559  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_ << " corr = " << corr << std::endl;
560 #endif
561  }
562  else if ((hf_recalibration != nullptr ) && (cell.genericSubdet() == HcalGenericDetId::HcalGenForward)) {
563  int depth_ = HcalDetId(cell).depth();
564  int ieta_ = HcalDetId(cell).ieta();
565  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
566 #ifdef DebugLog
567  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_ << " corr = " << corr << std::endl;
568 #endif
569  }
570 
571  HcalRespCorr item(cell.rawId(),corr);
572  result->addValues(item);
573  }
574  return result;
575 }
576 
577 std::unique_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
578  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
580  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
581  const HcalTopology* topo=&(*htopo);
582 
583  auto result = std::make_unique<HcalLUTCorrs>(topo);
584  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
585  for (auto cell : cells) {
586  HcalLUTCorr item(cell.rawId(),1.0);
587  result->addValues(item);
588  }
589  return result;
590 }
591 
592 std::unique_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
593  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
595  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
596  const HcalTopology* topo=&(*htopo);
597 
598  auto result = std::make_unique<HcalPFCorrs>(topo);
599  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
600  for (auto cell : cells) {
601  HcalPFCorr item(cell.rawId(),1.0);
602  result->addValues(item);
603  }
604  return result;
605 }
606 
607 std::unique_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
608  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
610  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
611  const HcalTopology* topo=&(*htopo);
612 
613  auto result = std::make_unique<HcalTimeCorrs>(topo);
614  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
615  for (auto cell : cells) {
616  HcalTimeCorr item(cell.rawId(),0.0);
617  result->addValues(item);
618  }
619  return result;
620 }
621 
622 std::unique_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
623  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
625  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
626  const HcalTopology* topo=&(*htopo);
627 
628  auto result = std::make_unique<HcalZSThresholds>(topo);
629  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
630  for (auto cell : cells) {
632  result->addValues(item);
633  }
634  return result;
635 }
636 
637 
638 std::unique_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
639  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
641  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
642  const HcalTopology* topo=&(*htopo);
643 
644  auto result = std::make_unique<HcalL1TriggerObjects>(topo);
645  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
646  for (auto cell : cells) {
647  HcalL1TriggerObject item(cell.rawId(),0., 1., 0);
648  result->addValues(item);
649  }
650  // add tag and algo values
651  result->setTagString("hardcoded");
652  result->setAlgoString("hardcoded");
653  return result;
654 }
655 
656 
657 std::unique_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
658  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
660  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
661  const HcalTopology* topo=&(*htopo);
662 
663  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
664  return dbHardcode.makeHardcodeMap(cells);
665 }
666 
667 std::unique_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
668  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
670  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
671  const HcalTopology* topo=&(*htopo);
672 
673  auto result = std::make_unique<HcalValidationCorrs>(topo);
674  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
675  for (auto cell : cells) {
676  HcalValidationCorr item(cell.rawId(),1.0);
677  result->addValues(item);
678  }
679  return result;
680 }
681 
682 std::unique_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
683  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
685  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
686  const HcalTopology* topo=&(*htopo);
687 
688  auto result = std::make_unique<HcalLutMetadata>(topo);
689 
690  result->setRctLsb( 0.5 );
691  result->setNominalGain(0.177); // for HBHE SiPMs
692 
693  const std::vector <HcalGenericDetId>& cells = allCells(*topo,dbHardcode.killHE());
694  for (const auto& cell: cells) {
695  float rcalib = 1.;
696  int granularity = 1;
697  int threshold = 0;
698 
699  if (cell.isHcalTrigTowerDetId()) {
700  rcalib = 0.;
701  }
702 
703  HcalLutMetadatum item(cell.rawId(), rcalib, granularity, threshold);
704  result->addValues(item);
705  }
706 
707  return result;
708 }
709 
710 std::unique_ptr<HcalDcsValues> HcalHardcodeCalibrations::produceDcsValues (const HcalDcsRcd& rcd) {
711  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
712  auto result = std::make_unique<HcalDcsValues>();
713  return result;
714 }
715 
716 std::unique_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
717  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
718 
720 }
721 
722 std::unique_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
723  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
725  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
726  const HcalTopology* topo=&(*htopo);
727 
728  auto result = std::make_unique<HcalRecoParams>(topo);
729  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
730  for (auto cell : cells) {
731  HcalRecoParam item = dbHardcode.makeRecoParam (cell);
732  result->addValues(item);
733  }
734  return result;
735 }
736 
737 std::unique_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
738  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
740  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
741  const HcalTopology* topo=&(*htopo);
742 
743  auto result = std::make_unique<HcalTimingParams>(topo);
744  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
745  for (auto cell : cells) {
747  result->addValues(item);
748  }
749  return result;
750 }
751 
752 std::unique_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
753  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
755  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
756  const HcalTopology* topo=&(*htopo);
757 
758  auto result = std::make_unique<HcalLongRecoParams>(topo);
759  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
760  std::vector <unsigned int> mSignal;
761  mSignal.push_back(4);
762  mSignal.push_back(5);
763  mSignal.push_back(6);
764  std::vector <unsigned int> mNoise;
765  mNoise.push_back(1);
766  mNoise.push_back(2);
767  mNoise.push_back(3);
768  for (auto cell : cells) {
769  if (cell.isHcalZDCDetId())
770  {
771  HcalLongRecoParam item(cell.rawId(),mSignal,mNoise);
772  result->addValues(item);
773  }
774  }
775  return result;
776 }
777 
778 std::unique_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
779  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
781  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
782  const HcalTopology* topo=&(*htopo);
783 
784  auto result = std::make_unique<HcalZDCLowGainFractions>(topo);
785  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
786  for (auto cell : cells) {
787  HcalZDCLowGainFraction item(cell.rawId(),0.0);
788  result->addValues(item);
789  }
790  return result;
791 }
792 
793 std::unique_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
794 
795 
796  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
797 
798  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
800  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
801  const HcalTopology* topo=&(*htopo);
802  auto result = std::make_unique<HcalMCParams>(topo);
803  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
804  for (auto cell : cells) {
805  HcalMCParam item = dbHardcode.makeMCParam (cell);
806  result->addValues(item);
807  }
808  return result;
809 }
810 
811 
812 std::unique_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
813  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
815  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
816  const HcalTopology* topo=&(*htopo);
817 
818  auto result = std::make_unique<HcalFlagHFDigiTimeParams>(topo);
819  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
820 
821  std::vector<double> coef;
822  coef.push_back(0.93);
823  coef.push_back(-0.38275);
824  coef.push_back(-0.012667);
825 
826  for (auto cell : cells) {
827  HcalFlagHFDigiTimeParam item(cell.rawId(),
828  1, //firstsample
829  3, // samplestoadd
830  2, //expectedpeak
831  40., // min energy threshold
832  coef // coefficients
833  );
834  result->addValues(item);
835  }
836  return result;
837 }
838 
839 
840 std::unique_ptr<HcalFrontEndMap> HcalHardcodeCalibrations::produceFrontEndMap (const HcalFrontEndMapRcd& rec) {
841  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFrontEndMap-> ...";
843  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
844  const HcalTopology* topo=&(*htopo);
845  const std::vector <HcalGenericDetId>& cells = allCells(*topo, dbHardcode.killHE());
846 
847  return dbHardcode.makeHardcodeFrontEndMap(cells);
848 }
849 
850 
851 std::unique_ptr<HcalSiPMParameters> HcalHardcodeCalibrations::produceSiPMParameters (const HcalSiPMParametersRcd& rec) {
852  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceSiPMParameters-> ...";
854  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
855  const HcalTopology* topo=&(*htopo);
856 
857  auto result = std::make_unique<HcalSiPMParameters>(topo);
858  const std::vector <HcalGenericDetId>& cells = allCells(*htopo, dbHardcode.killHE());
859  for (auto cell : cells) {
861  result->addValues(item);
862  }
863  return result;
864 }
865 
866 std::unique_ptr<HcalSiPMCharacteristics> HcalHardcodeCalibrations::produceSiPMCharacteristics (const HcalSiPMCharacteristicsRcd& rcd) {
867  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceSiPMCharacteristics-> ...";
868 
870 }
871 
872 
873 std::unique_ptr<HcalTPChannelParameters> HcalHardcodeCalibrations::produceTPChannelParameters (const HcalTPChannelParametersRcd& rec) {
874  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTPChannelParameters-> ...";
876  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
877  const HcalTopology* topo=&(*htopo);
878 
879  auto result = std::make_unique<HcalTPChannelParameters>(topo);
880  const std::vector <HcalGenericDetId>& cells = allCells(*htopo, dbHardcode.killHE());
881  for (auto cell : cells) {
883  result->addValues(item);
884  }
885  return result;
886 }
887 
888 std::unique_ptr<HcalTPParameters> HcalHardcodeCalibrations::produceTPParameters (const HcalTPParametersRcd& rcd) {
889  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTPParameters-> ...";
890 
891  auto result = std::make_unique<HcalTPParameters>();
893  return result;
894 }
895 
898  desc.add<double>("iLumi",-1.);
899  desc.add<bool>("HBRecalibration",false);
900  desc.add<double>("HBreCalibCutoff",20.);
901  desc.add<edm::FileInPath>("HBmeanenergies",edm::FileInPath("CalibCalorimetry/HcalPlugins/data/meanenergiesHB.txt"));
902  desc.add<bool>("HERecalibration",false);
903  desc.add<double>("HEreCalibCutoff",20.);
904  desc.add<edm::FileInPath>("HEmeanenergies",edm::FileInPath("CalibCalorimetry/HcalPlugins/data/meanenergiesHE.txt"));
905  desc.add<bool>("HFRecalibration",false);
906  desc.add<bool>("GainWidthsForTrigPrims",false);
907  desc.add<bool>("useHBUpgrade",false);
908  desc.add<bool>("useHEUpgrade",false);
909  desc.add<bool>("useHFUpgrade",false);
910  desc.add<bool>("useHOUpgrade",true);
911  desc.add<bool>("testHFQIE10",false);
912  desc.add<bool>("testHEPlan1",false);
913  desc.add<bool>("killHE",false);
914  desc.add<bool>("useLayer0Weight",false);
915  desc.add<bool>("useIeta18depth1",true);
916  desc.addUntracked<std::vector<std::string> >("toGet",std::vector<std::string>());
917  desc.addUntracked<bool>("fromDDD",false);
918 
920  desc_hb.add<std::vector<double>>("gain", std::vector<double>({0.19}));
921  desc_hb.add<std::vector<double>>("gainWidth", std::vector<double>({0.0}));
922  desc_hb.add<double>("pedestal", 3.0);
923  desc_hb.add<double>("pedestalWidth", 0.55);
924  desc_hb.add<int>("zsThreshold", 8);
925  desc_hb.add<std::vector<double>>("qieOffset", std::vector<double>({-0.49, 1.8, 7.2, 37.9}));
926  desc_hb.add<std::vector<double>>("qieSlope", std::vector<double>({0.912, 0.917, 0.922, 0.923}));
927  desc_hb.add<int>("qieType", 0);
928  desc_hb.add<int>("mcShape",125);
929  desc_hb.add<int>("recoShape",105);
930  desc_hb.add<double>("photoelectronsToAnalog",0.0);
931  desc_hb.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
932  desc_hb.add<bool>("doRadiationDamage", false);
933  desc.add<edm::ParameterSetDescription>("hb", desc_hb);
934 
935  edm::ParameterSetDescription desc_hbRaddam;
936  desc_hbRaddam.add<double>("temperatureBase",20.0);
937  desc_hbRaddam.add<double>("temperatureNew",-5.0);
938  desc_hbRaddam.add<double>("intlumiOffset",150);
939  desc_hbRaddam.add<double>("depVsTemp",0.0631);
940  desc_hbRaddam.add<double>("intlumiToNeutrons",3.67e8);
941  desc_hbRaddam.add<std::vector<double>>("depVsNeutrons",{5.69e-11,7.90e-11});
942 
943  edm::ParameterSetDescription desc_hbUpgrade;
944  desc_hbUpgrade.add<std::vector<double>>("gain", std::vector<double>({0.00111111111111}));
945  desc_hbUpgrade.add<std::vector<double>>("gainWidth", std::vector<double>({0}));
946  desc_hbUpgrade.add<double>("pedestal", 18.0);
947  desc_hbUpgrade.add<double>("pedestalWidth", 5.0);
948  desc_hbUpgrade.add<int>("zsThreshold", 3);
949  desc_hbUpgrade.add<std::vector<double>>("qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
950  desc_hbUpgrade.add<std::vector<double>>("qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
951  desc_hbUpgrade.add<int>("qieType", 2);
952  desc_hbUpgrade.add<int>("mcShape",206);
953  desc_hbUpgrade.add<int>("recoShape",206);
954  desc_hbUpgrade.add<double>("photoelectronsToAnalog",57.5);
955  desc_hbUpgrade.add<std::vector<double>>("darkCurrent", std::vector<double>({0.055}));
956  desc_hbUpgrade.add<bool>("doRadiationDamage", true);
957  desc_hbUpgrade.add<edm::ParameterSetDescription>("radiationDamage", desc_hbRaddam);
958  desc.add<edm::ParameterSetDescription>("hbUpgrade", desc_hbUpgrade);
959 
961  desc_he.add<std::vector<double>>("gain", std::vector<double>({0.23}));
962  desc_he.add<std::vector<double>>("gainWidth", std::vector<double>({0}));
963  desc_he.add<double>("pedestal", 3.0);
964  desc_he.add<double>("pedestalWidth", 0.79);
965  desc_he.add<int>("zsThreshold", 9);
966  desc_he.add<std::vector<double>>("qieOffset", std::vector<double>({-0.38, 2.0, 7.6, 39.6}));
967  desc_he.add<std::vector<double>>("qieSlope", std::vector<double>({0.912, 0.916, 0.92, 0.922}));
968  desc_he.add<int>("qieType", 0);
969  desc_he.add<int>("mcShape",125);
970  desc_he.add<int>("recoShape",105);
971  desc_he.add<double>("photoelectronsToAnalog",0.0);
972  desc_he.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
973  desc_he.add<bool>("doRadiationDamage", false);
974  desc.add<edm::ParameterSetDescription>("he", desc_he);
975 
976  edm::ParameterSetDescription desc_heRaddam;
977  desc_heRaddam.add<double>("temperatureBase",20.0);
978  desc_heRaddam.add<double>("temperatureNew",5.0);
979  desc_heRaddam.add<double>("intlumiOffset",75);
980  desc_heRaddam.add<double>("depVsTemp",0.0631);
981  desc_heRaddam.add<double>("intlumiToNeutrons",2.92e8);
982  desc_heRaddam.add<std::vector<double>>("depVsNeutrons",{5.69e-11,7.90e-11});
983 
984  edm::ParameterSetDescription desc_heUpgrade;
985  desc_heUpgrade.add<std::vector<double>>("gain", std::vector<double>({0.00111111111111}));
986  desc_heUpgrade.add<std::vector<double>>("gainWidth", std::vector<double>({0}));
987  desc_heUpgrade.add<double>("pedestal", 18.0);
988  desc_heUpgrade.add<double>("pedestalWidth", 5.0);
989  desc_heUpgrade.add<int>("zsThreshold", 3);
990  desc_heUpgrade.add<std::vector<double>>("qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
991  desc_heUpgrade.add<std::vector<double>>("qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
992  desc_heUpgrade.add<int>("qieType", 2);
993  desc_heUpgrade.add<int>("mcShape",206);
994  desc_heUpgrade.add<int>("recoShape",206);
995  desc_heUpgrade.add<double>("photoelectronsToAnalog",57.5);
996  desc_heUpgrade.add<std::vector<double>>("darkCurrent", std::vector<double>({0.055}));
997  desc_heUpgrade.add<bool>("doRadiationDamage", true);
998  desc_heUpgrade.add<edm::ParameterSetDescription>("radiationDamage", desc_heRaddam);
999  desc.add<edm::ParameterSetDescription>("heUpgrade", desc_heUpgrade);
1000 
1002  desc_hf.add<std::vector<double>>("gain", std::vector<double>({0.14, 0.135}));
1003  desc_hf.add<std::vector<double>>("gainWidth", std::vector<double>({0.0, 0.0}));
1004  desc_hf.add<double>("pedestal", 3.0);
1005  desc_hf.add<double>("pedestalWidth", 0.84);
1006  desc_hf.add<int>("zsThreshold", -9999);
1007  desc_hf.add<std::vector<double>>("qieOffset", std::vector<double>({-0.87, 1.4, 7.8, -29.6}));
1008  desc_hf.add<std::vector<double>>("qieSlope", std::vector<double>({0.359, 0.358, 0.36, 0.367}));
1009  desc_hf.add<int>("qieType", 0);
1010  desc_hf.add<int>("mcShape",301);
1011  desc_hf.add<int>("recoShape",301);
1012  desc_hf.add<double>("photoelectronsToAnalog",0.0);
1013  desc_hf.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
1014  desc_hf.add<bool>("doRadiationDamage", false);
1015  desc.add<edm::ParameterSetDescription>("hf", desc_hf);
1016 
1017  edm::ParameterSetDescription desc_hfUpgrade;
1018  desc_hfUpgrade.add<std::vector<double>>("gain", std::vector<double>({0.14, 0.135}));
1019  desc_hfUpgrade.add<std::vector<double>>("gainWidth", std::vector<double>({0.0, 0.0}));
1020  desc_hfUpgrade.add<double>("pedestal", 13.33);
1021  desc_hfUpgrade.add<double>("pedestalWidth", 3.33);
1022  desc_hfUpgrade.add<int>("zsThreshold", -9999);
1023  desc_hfUpgrade.add<std::vector<double>>("qieOffset", std::vector<double>({0.0697, -0.7405, 12.38, -671.9}));
1024  desc_hfUpgrade.add<std::vector<double>>("qieSlope", std::vector<double>({0.297, 0.298, 0.298, 0.313}));
1025  desc_hfUpgrade.add<int>("qieType", 1);
1026  desc_hfUpgrade.add<int>("mcShape",301);
1027  desc_hfUpgrade.add<int>("recoShape",301);
1028  desc_hfUpgrade.add<double>("photoelectronsToAnalog",0.0);
1029  desc_hfUpgrade.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
1030  desc_hfUpgrade.add<bool>("doRadiationDamage", false);
1031  desc.add<edm::ParameterSetDescription>("hfUpgrade", desc_hfUpgrade);
1032 
1033  edm::ParameterSetDescription desc_hfrecal;
1034  desc_hfrecal.add<std::vector<double>>("HFdepthOneParameterA", std::vector<double>());
1035  desc_hfrecal.add<std::vector<double>>("HFdepthOneParameterB", std::vector<double>());
1036  desc_hfrecal.add<std::vector<double>>("HFdepthTwoParameterA", std::vector<double>());
1037  desc_hfrecal.add<std::vector<double>>("HFdepthTwoParameterB", std::vector<double>());
1038  desc.add<edm::ParameterSetDescription>("HFRecalParameterBlock", desc_hfrecal);
1039 
1041  desc_ho.add<std::vector<double>>("gain", std::vector<double>({0.006, 0.0087}));
1042  desc_ho.add<std::vector<double>>("gainWidth", std::vector<double>({0.0, 0.0}));
1043  desc_ho.add<double>("pedestal", 11.0);
1044  desc_ho.add<double>("pedestalWidth", 0.57);
1045  desc_ho.add<int>("zsThreshold", 24);
1046  desc_ho.add<std::vector<double>>("qieOffset", std::vector<double>({-0.44, 1.4, 7.1, 38.5}));
1047  desc_ho.add<std::vector<double>>("qieSlope", std::vector<double>({0.907, 0.915, 0.92, 0.921}));
1048  desc_ho.add<int>("qieType", 0);
1049  desc_ho.add<int>("mcShape",201);
1050  desc_ho.add<int>("recoShape",201);
1051  desc_ho.add<double>("photoelectronsToAnalog",4.0);
1052  desc_ho.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
1053  desc_ho.add<bool>("doRadiationDamage", false);
1054  desc.add<edm::ParameterSetDescription>("ho", desc_ho);
1055 
1056  edm::ParameterSetDescription validator_sipm;
1057  validator_sipm.add<int>("pixels",1);
1058  validator_sipm.add<double>("crosstalk",0);
1059  validator_sipm.add<double>("nonlin1",1);
1060  validator_sipm.add<double>("nonlin2",0);
1061  validator_sipm.add<double>("nonlin3",0);
1062  std::vector<edm::ParameterSet> default_sipm(1);
1063  desc.addVPSet("SiPMCharacteristics",validator_sipm,default_sipm);
1064 
1065  descriptions.addDefault(desc);
1066 }
std::unique_ptr< HcalPedestals > producePedestals(const HcalPedestalsRcd &rcd)
int maxDepth(void) const
static const int kHcalVersMask
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
HcalMCParam makeMCParam(HcalGenericDetId fId) const
bool empty() const
Definition: ParameterSet.h:191
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< HcalPedestals > producePedestals_(const HcalPedestalsRcd &rcd, bool eff)
std::unique_ptr< HcalGains > produceGains(const HcalGainsRcd &rcd)
void useHBUpgrade(bool b)
void getDepthSegmentation(const unsigned ring, std::vector< int > &readoutDepths, const bool flag=false) const
HcalHardcodeCalibrations(const edm::ParameterSet &)
const bool killHE() const
std::unique_ptr< HcalPedestalWidths > produceEffectivePedestalWidths(const HcalPedestalWidthsRcd &rcd)
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
std::unique_ptr< HcalPFCorrs > producePFCorrs(const HcalPFCorrsRcd &rcd)
std::unique_ptr< HcalQIEData > produceQIEData(const HcalQIEDataRcd &rcd)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void setHBUpgrade(HcalHardcodeParameters p)
const EventID & eventID() const
Definition: IOVSyncValue.h:40
bool valid(const DetId &id) const override
void testHEPlan1(bool b)
static uint32_t kHcalEtaMask2
Definition: HcalDetId.h:21
std::unique_ptr< HcalTimeCorrs > produceTimeCorrs(const HcalTimeCorrsRcd &rcd)
void useHFUpgrade(bool b)
std::unique_ptr< HcalLongRecoParams > produceLongRecoParams(const HcalLongRecoParamsRcd &rcd)
JetCorrectorParameters::Record record
Definition: classes.h:7
std::unique_ptr< HcalPedestals > produceEffectivePedestals(const HcalPedestalsRcd &rcd)
std::unique_ptr< HcalSiPMCharacteristics > produceSiPMCharacteristics(const HcalSiPMCharacteristicsRcd &rcd)
std::unique_ptr< HcalElectronicsMap > produceElectronicsMap(const HcalElectronicsMapRcd &rcd)
#define nullptr
std::unique_ptr< HcalElectronicsMap > makeHardcodeMap(const std::vector< HcalGenericDetId > &cells) const
void setHF(HcalHardcodeParameters p)
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
int lastHBRing() const
Definition: HcalTopology.h:88
std::unique_ptr< HcalPedestalWidths > producePedestalWidths_(const HcalPedestalWidthsRcd &rcd, bool eff)
double maxEta
std::unique_ptr< HcalDcsValues > produceDcsValues(const HcalDcsRcd &rcd)
static const int kHcalEtaMask
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
std::unique_ptr< HcalPedestalWidths > producePedestalWidths(const HcalPedestalWidthsRcd &rcd)
HcalTimingParam makeTimingParam(HcalGenericDetId fId) const
HcalRecoParam makeRecoParam(HcalGenericDetId fId) const
int depth() const
get the tower depth
Definition: HcalDetId.h:166
void makeHardcodeFrontEndMap(HcalFrontEndMap &emap, const std::vector< HcalGenericDetId > &cells) const
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:29
void addDefault(ParameterSetDescription const &psetDescription)
std::unique_ptr< HFRecalibration > hf_recalibration
std::unique_ptr< HcalRespCorrs > produceRespCorrs(const HcalRespCorrsRcd &rcd)
HcalQIECoder makeQIECoder(HcalGenericDetId fId) const
std::unique_ptr< HcalLutMetadata > produceLutMetadata(const HcalLutMetadataRcd &rcd)
void setHO(HcalHardcodeParameters p)
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
void setHFUpgrade(HcalHardcodeParameters p)
void setHE(HcalHardcodeParameters p)
std::unique_ptr< HcalDcsMap > makeHardcodeDcsMap() const
void setKillHE(bool b)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
std::unique_ptr< HcalFlagHFDigiTimeParams > produceFlagHFDigiTimeParams(const HcalFlagHFDigiTimeParamsRcd &rcd)
std::unique_ptr< HcalFrontEndMap > produceFrontEndMap(const HcalFrontEndMapRcd &rcd)
HcalSubdetector
Definition: HcalAssistant.h:31
void makeHardcodeTPParameters(HcalTPParameters &tppar) const
std::unique_ptr< HBHERecalibration > hb_recalibration
static const int kHcalDepthMask
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void useHOUpgrade(bool b)
std::unique_ptr< HcalSiPMParameters > produceSiPMParameters(const HcalSiPMParametersRcd &rcd)
std::unique_ptr< HBHERecalibration > he_recalibration
JetCorrectorParameters corr
Definition: classes.h:5
static const int kHcalPhiMask
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:154
Namespace of DDCMS conversion namespace.
HcalTPChannelParameter makeHardcodeTPChannelParameter(HcalGenericDetId fId) const
std::unique_ptr< HcalRecoParams > produceRecoParams(const HcalRecoParamsRcd &rcd)
void setHB(HcalHardcodeParameters p)
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
std::unique_ptr< HcalTPParameters > produceTPParameters(const HcalTPParametersRcd &rcd)
HcalGainWidth makeGainWidth(HcalGenericDetId fId) const
std::unique_ptr< HcalSiPMCharacteristics > makeHardcodeSiPMCharacteristics() const
HcalGain makeGain(HcalGenericDetId fId, bool fSmear=false) const
static uint32_t kHcalPhiMask2
Definition: HcalDetId.h:17
std::unique_ptr< HcalGainWidths > produceGainWidths(const HcalGainWidthsRcd &rcd)
std::unique_ptr< HcalTPChannelParameters > produceTPChannelParameters(const HcalTPChannelParametersRcd &rcd)
std::unique_ptr< HcalL1TriggerObjects > produceL1TriggerObjects(const HcalL1TriggerObjectsRcd &rcd)
std::unique_ptr< HcalZSThresholds > produceZSThresholds(const HcalZSThresholdsRcd &rcd)
HcalQIEType makeQIEType(HcalGenericDetId fId) const
std::unique_ptr< HcalZDCLowGainFractions > produceZDCLowGainFractions(const HcalZDCLowGainFractionsRcd &rcd)
void setSiPMCharacteristics(std::vector< edm::ParameterSet > vps)
std::unique_ptr< HcalMCParams > produceMCParams(const HcalMCParamsRcd &rcd)
void useHEUpgrade(bool b)
std::unique_ptr< HcalTimingParams > produceTimingParams(const HcalTimingParamsRcd &rcd)
std::unique_ptr< HcalQIETypes > produceQIETypes(const HcalQIETypesRcd &rcd)
int getLayersInDepth(int ieta, int depth, const HcalTopology *topo)
std::unique_ptr< HcalChannelQuality > produceChannelQuality(const HcalChannelQualityRcd &rcd)
HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear, bool eff, const HcalTopology *topo, double intlumi)
std::string fullPath() const
Definition: FileInPath.cc:163
const Timestamp & time() const
Definition: IOVSyncValue.h:42
HcalSiPMParameter makeHardcodeSiPMParameter(HcalGenericDetId fId, const HcalTopology *topo, double intlumi)
void setHEUpgrade(HcalHardcodeParameters p)
std::unique_ptr< HcalDcsMap > produceDcsMap(const HcalDcsMapRcd &rcd)
TimeValue_t value() const
Definition: Timestamp.h:56
HcalZSThreshold makeZSThreshold(HcalGenericDetId fId) const
std::unique_ptr< HcalLUTCorrs > produceLUTCorrs(const HcalLUTCorrsRcd &rcd)
int lastHERing() const
Definition: HcalTopology.h:90
void testHFQIE10(bool b)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId, bool eff, const HcalTopology *topo, double intlumi)
std::unique_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)
bool validHT(const HcalTrigTowerDetId &id) const