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