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  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  // HB, HE, HF recalibration preparation
156  iLumi=iConfig.getParameter<double>("iLumi");
157 
158  if( iLumi > 0.0 ) {
159  bool hb_recalib = iConfig.getParameter<bool>("HBRecalibration");
160  bool he_recalib = iConfig.getParameter<bool>("HERecalibration");
161  bool hf_recalib = iConfig.getParameter<bool>("HFRecalibration");
162  if(hb_recalib) {
163  hb_recalibration.reset(
164  new HBHERecalibration(
165  iLumi,
166  iConfig.getParameter<double>("HBreCalibCutoff"),
167  iConfig.getParameter<edm::FileInPath>("HBmeanenergies").fullPath()
168  )
169  );
170  }
171  if(he_recalib) {
172  he_recalibration.reset(
173  new HBHERecalibration(
174  iLumi,
175  iConfig.getParameter<double>("HEreCalibCutoff"),
176  iConfig.getParameter<edm::FileInPath>("HEmeanenergies").fullPath()
177  )
178  );
179  }
180  if(hf_recalib && !iConfig.getParameter<edm::ParameterSet>("HFRecalParameterBlock").empty()) hf_recalibration.reset(new HFRecalibration(iConfig.getParameter<edm::ParameterSet>("HFRecalParameterBlock")));
181 
182 #ifdef DebugLog
183  std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl;
184 #endif
185  }
186 
187  std::vector <std::string> toGet = iConfig.getUntrackedParameter <std::vector <std::string> > ("toGet");
188  for(auto& objectName : toGet){
189  bool all = objectName == "all";
190 #ifdef DebugLog
191  std::cout << "Load parameters for " << objectName << std::endl;
192 #endif
193  if ((objectName == "Pedestals") || all) {
195  findingRecord <HcalPedestalsRcd> ();
196  }
197  if ((objectName == "PedestalWidths") || all) {
199  findingRecord <HcalPedestalWidthsRcd> ();
200  }
201  if ((objectName == "EffectivePedestals") || all) {
203  findingRecord <HcalPedestalsRcd> ();
204  }
205  if ((objectName == "EffectivePedestalWidths") || all) {
207  findingRecord <HcalPedestalWidthsRcd> ();
208  }
209  if ((objectName == "Gains") || all) {
211  findingRecord <HcalGainsRcd> ();
212  }
213  if ((objectName == "GainWidths") || all) {
215  findingRecord <HcalGainWidthsRcd> ();
216  }
217  if ((objectName == "QIEData") || all) {
219  findingRecord <HcalQIEDataRcd> ();
220  }
221  if ((objectName == "QIETypes") || all) {
223  findingRecord <HcalQIETypesRcd> ();
224  }
225  if ((objectName == "ChannelQuality") || (objectName == "channelQuality") || all) {
227  findingRecord <HcalChannelQualityRcd> ();
228  }
229  if ((objectName == "ElectronicsMap") || (objectName == "electronicsMap") || all) {
231  findingRecord <HcalElectronicsMapRcd> ();
232  }
233  if ((objectName == "ZSThresholds") || (objectName == "zsThresholds") || all) {
235  findingRecord <HcalZSThresholdsRcd> ();
236  }
237  if ((objectName == "RespCorrs") || (objectName == "ResponseCorrection") || all) {
239  findingRecord <HcalRespCorrsRcd> ();
240  }
241  if ((objectName == "LUTCorrs") || (objectName == "LUTCorrection") || all) {
243  findingRecord <HcalLUTCorrsRcd> ();
244  }
245  if ((objectName == "PFCorrs") || (objectName == "PFCorrection") || all) {
247  findingRecord <HcalPFCorrsRcd> ();
248  }
249  if ((objectName == "TimeCorrs") || (objectName == "TimeCorrection") || all) {
251  findingRecord <HcalTimeCorrsRcd> ();
252  }
253  if ((objectName == "L1TriggerObjects") || (objectName == "L1Trigger") || all) {
255  findingRecord <HcalL1TriggerObjectsRcd> ();
256  }
257  if ((objectName == "ValidationCorrs") || (objectName == "ValidationCorrection") || all) {
259  findingRecord <HcalValidationCorrsRcd> ();
260  }
261  if ((objectName == "LutMetadata") || (objectName == "lutMetadata") || all) {
263  findingRecord <HcalLutMetadataRcd> ();
264  }
265  if ((objectName == "DcsValues") || all) {
267  findingRecord <HcalDcsRcd> ();
268  }
269  if ((objectName == "DcsMap") || (objectName == "dcsMap") || all) {
271  findingRecord <HcalDcsMapRcd> ();
272  }
273  if ((objectName == "RecoParams") || all) {
275  findingRecord <HcalRecoParamsRcd> ();
276  }
277  if ((objectName == "LongRecoParams") || all) {
279  findingRecord <HcalLongRecoParamsRcd> ();
280  }
281  if ((objectName == "ZDCLowGainFractions") || all) {
283  findingRecord <HcalZDCLowGainFractionsRcd> ();
284  }
285  if ((objectName == "MCParams") || all) {
287  findingRecord <HcalMCParamsRcd> ();
288  }
289  if ((objectName == "FlagHFDigiTimeParams") || all) {
291  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
292  }
293  if ((objectName == "FrontEndMap") || (objectName == "frontEndMap") || all) {
295  findingRecord <HcalFrontEndMapRcd> ();
296  }
297  if ((objectName == "SiPMParameters") || all) {
299  findingRecord <HcalSiPMParametersRcd> ();
300  }
301  if ((objectName == "SiPMCharacteristics") || all) {
303  findingRecord <HcalSiPMCharacteristicsRcd> ();
304  }
305  if ((objectName == "TPChannelParameters") || all) {
307  findingRecord <HcalTPChannelParametersRcd> ();
308  }
309  if ((objectName == "TPParameters") || all) {
311  findingRecord <HcalTPParametersRcd> ();
312  }
313  }
314 }
315 
316 
318 {
319 }
320 
321 //
322 // member functions
323 //
324 void
326  std::string record = iKey.name ();
327  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
329 }
330 
331 std::unique_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals_ (const HcalPedestalsRcd& rec, bool eff) {
332  std::string seff = eff ? "Effective" : "";
333  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produce" << seff << "Pedestals-> ...";
335  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
336  const HcalTopology* topo=&(*htopo);
337 
338  auto result = std::make_unique<HcalPedestals>(topo,false);
339  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
340  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
341  HcalPedestal item = dbHardcode.makePedestal (*cell, false, eff, topo, iLumi);
342  result->addValues(item);
343  }
344  return result;
345 }
346 
347 std::unique_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths_ (const HcalPedestalWidthsRcd& rec, bool eff) {
348  std::string seff = eff ? "Effective" : "";
349  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produce" << seff << "PedestalWidths-> ...";
351  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
352  const HcalTopology* topo=&(*htopo);
353 
354  auto result = std::make_unique<HcalPedestalWidths>(topo,false);
355  std::vector <HcalGenericDetId> cells = allCells(*htopo, dbHardcode.killHE());
356  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
357  HcalPedestalWidth item = dbHardcode.makePedestalWidth (*cell, eff, topo, iLumi);
358  result->addValues(item);
359  }
360  return result;
361 }
362 
363 std::unique_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec){
364  return producePedestals_(rec,false);
365 }
366 
367 std::unique_ptr<HcalPedestals> HcalHardcodeCalibrations::produceEffectivePedestals (const HcalPedestalsRcd& rec){
368  return producePedestals_(rec,true);
369 }
370 
371 std::unique_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec){
372  return producePedestalWidths_(rec,false);
373 }
374 
376  return producePedestalWidths_(rec,true);
377 }
378 
379 std::unique_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
380  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
382  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
383  const HcalTopology* topo=&(*htopo);
384 
385  auto result = std::make_unique<HcalGains>(topo);
386  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
387  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
388  HcalGain item = dbHardcode.makeGain (*cell);
389  result->addValues(item);
390  }
391  return result;
392 }
393 
394 std::unique_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
395  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
397  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
398  const HcalTopology* topo=&(*htopo);
399 
400  auto result = std::make_unique<HcalGainWidths>(topo);
401  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
402  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
403 
404  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
406  HcalGainWidth item = dbHardcode.makeGainWidth (*cell);
407  result->addValues(item);
408  } else if (!cell->isHcalTrigTowerDetId()) {
409  HcalGainWidth item = dbHardcode.makeGainWidth (*cell);
410  result->addValues(item);
411  }
412  }
413  return result;
414 }
415 
416 std::unique_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
417  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
418 
419  /*
420  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
421  << std::endl;
422  */
423 
425  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
426  const HcalTopology* topo=&(*htopo);
427 
428  auto result = std::make_unique<HcalQIEData>(topo);
429  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
430  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
431  HcalQIECoder coder = dbHardcode.makeQIECoder (*cell);
432  result->addCoder (coder);
433  }
434  return result;
435 }
436 
437 std::unique_ptr<HcalQIETypes> HcalHardcodeCalibrations::produceQIETypes (const HcalQIETypesRcd& rcd) {
438  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIETypes-> ...";
440  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
441  const HcalTopology* topo=&(*htopo);
442 
443  auto result = std::make_unique<HcalQIETypes>(topo);
444  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
445  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
446  HcalQIEType item = dbHardcode.makeQIEType(*cell);
447  result->addValues(item);
448  }
449  return result;
450 }
451 
452 std::unique_ptr<HcalChannelQuality> HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) {
453  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ...";
455  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
456  const HcalTopology* topo=&(*htopo);
457 
458  auto result = std::make_unique<HcalChannelQuality>(topo);
459  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
460  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
461  HcalChannelStatus item(cell->rawId(),0);
462  result->addValues(item);
463  }
464  return result;
465 }
466 
467 
468 std::unique_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) {
469  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ...";
471  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
472  const HcalTopology* topo=&(*htopo);
473 
474  //set depth segmentation for HB/HE recalib - only happens once
476  std::vector<std::vector<int>> m_segmentation;
477  int maxEta = topo->lastHERing();
478  m_segmentation.resize(maxEta);
479  for (int i = 0; i < maxEta; i++) {
480  topo->getDepthSegmentation(i+1,m_segmentation[i]);
481  }
484  rcd.getRecord<HBHEDarkeningRecord>().get("HE",hdark);
485  he_recalibration->setup(m_segmentation,&*hdark);
486  setHEdsegm = true;
487  }
490  rcd.getRecord<HBHEDarkeningRecord>().get("HB",hdark);
491  hb_recalibration->setup(m_segmentation,&*hdark);
492  setHBdsegm = true;
493  }
494  }
495 
496  auto result = std::make_unique<HcalRespCorrs>(topo);
497  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
498  for (const auto& cell : cells) {
499 
500  double corr = 1.0;
501 
502  //check for layer 0 reweighting: when depth 1 has only one layer, it is layer 0
503  if( useLayer0Weight &&
504  ((cell.genericSubdet() == HcalGenericDetId::HcalGenEndcap) || (cell.genericSubdet() == HcalGenericDetId::HcalGenBarrel)) &&
505  (HcalDetId(cell).depth()==1 && dbHardcode.getLayersInDepth(HcalDetId(cell).ietaAbs(),HcalDetId(cell).depth(),topo)==1) )
506  {
507  //layer 0 is thicker than other layers (9mm vs 3.7mm) and brighter (Bicron vs SCSN81)
508  //in Run1/Run2 (pre-2017 for HE), ODU for layer 0 had neutral density filter attached
509  //NDF was simulated as weight of 0.5 applied to Geant energy deposits
510  //for Phase1, NDF is removed - simulated as weight of 1.2 applied to Geant energy deposits
511  //to maintain RECO calibrations, move the layer 0 energy scale back to its previous state using respcorrs
512  corr = 0.5/1.2;
513  }
514 
515  if ((hb_recalibration != nullptr ) && (cell.genericSubdet() == HcalGenericDetId::HcalGenBarrel)) {
516  int depth_ = HcalDetId(cell).depth();
517  int ieta_ = HcalDetId(cell).ieta();
518  corr *= hb_recalibration->getCorr(ieta_, depth_);
519 #ifdef DebugLog
520  std::cout << "HB ieta, depth = " << ieta_ << ", " << depth_ << " corr = " << corr << std::endl;
521 #endif
522  }
523  else if ((he_recalibration != nullptr ) && (cell.genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
524  int depth_ = HcalDetId(cell).depth();
525  int ieta_ = HcalDetId(cell).ieta();
526  corr *= he_recalibration->getCorr(ieta_, depth_);
527 #ifdef DebugLog
528  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_ << " corr = " << corr << std::endl;
529 #endif
530  }
531  else if ((hf_recalibration != nullptr ) && (cell.genericSubdet() == HcalGenericDetId::HcalGenForward)) {
532  int depth_ = HcalDetId(cell).depth();
533  int ieta_ = HcalDetId(cell).ieta();
534  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
535 #ifdef DebugLog
536  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_ << " corr = " << corr << std::endl;
537 #endif
538  }
539 
540  HcalRespCorr item(cell.rawId(),corr);
541  result->addValues(item);
542  }
543  return result;
544 }
545 
546 std::unique_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
547  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
549  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
550  const HcalTopology* topo=&(*htopo);
551 
552  auto result = std::make_unique<HcalLUTCorrs>(topo);
553  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
554  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
555  HcalLUTCorr item(cell->rawId(),1.0);
556  result->addValues(item);
557  }
558  return result;
559 }
560 
561 std::unique_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
562  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
564  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
565  const HcalTopology* topo=&(*htopo);
566 
567  auto result = std::make_unique<HcalPFCorrs>(topo);
568  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
569  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
570  HcalPFCorr item(cell->rawId(),1.0);
571  result->addValues(item);
572  }
573  return result;
574 }
575 
576 std::unique_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
577  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
579  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
580  const HcalTopology* topo=&(*htopo);
581 
582  auto result = std::make_unique<HcalTimeCorrs>(topo);
583  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
584  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
585  HcalTimeCorr item(cell->rawId(),0.0);
586  result->addValues(item);
587  }
588  return result;
589 }
590 
591 std::unique_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
592  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
594  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
595  const HcalTopology* topo=&(*htopo);
596 
597  auto result = std::make_unique<HcalZSThresholds>(topo);
598  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
599  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
601  result->addValues(item);
602  }
603  return result;
604 }
605 
606 
607 std::unique_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
608  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
610  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
611  const HcalTopology* topo=&(*htopo);
612 
613  auto result = std::make_unique<HcalL1TriggerObjects>(topo);
614  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
615  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
616  HcalL1TriggerObject item(cell->rawId(),0., 1., 0);
617  result->addValues(item);
618  }
619  // add tag and algo values
620  result->setTagString("hardcoded");
621  result->setAlgoString("hardcoded");
622  return result;
623 }
624 
625 
626 std::unique_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
627  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
629  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
630  const HcalTopology* topo=&(*htopo);
631 
632  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
633  return dbHardcode.makeHardcodeMap(cells);
634 }
635 
636 std::unique_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
637  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
639  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
640  const HcalTopology* topo=&(*htopo);
641 
642  auto result = std::make_unique<HcalValidationCorrs>(topo);
643  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
644  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
645  HcalValidationCorr item(cell->rawId(),1.0);
646  result->addValues(item);
647  }
648  return result;
649 }
650 
651 std::unique_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
652  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
654  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
655  const HcalTopology* topo=&(*htopo);
656 
657  auto result = std::make_unique<HcalLutMetadata>(topo);
658 
659  result->setRctLsb( 0.5 );
660  result->setNominalGain(0.177); // for HBHE SiPMs
661 
662  std::vector <HcalGenericDetId> cells = allCells(*topo,dbHardcode.killHE());
663  for (const auto& cell: cells) {
664  float rcalib = 1.;
665  int granularity = 1;
666  int threshold = 0;
667 
669  // Use values from 2016 as starting conditions for 2017+. These are
670  // averaged over the subdetectors, with the last two HE towers split
671  // off due to diverging correction values.
672  switch (cell.genericSubdet()) {
674  rcalib = 1.128;
675  break;
677  {
678  HcalDetId id(cell);
679  if (id.ietaAbs() >= 28)
680  rcalib = 1.188;
681  else
682  rcalib = 1.117;
683  // granularity is equal to 1 only for |ieta| == 17
684  if(id.ietaAbs() >= 18 && id.ietaAbs() <= 26) granularity = 2;
685  else if(id.ietaAbs() >=27 && id.ietaAbs() <= 29) granularity = 5;
686  }
687  break;
689  rcalib = 1.02;
690  break;
691  default:
692  break;
693  }
694 
695  if (cell.isHcalTrigTowerDetId()) {
696  rcalib = 0.;
697  HcalTrigTowerDetId id(cell);
698  if(id.ietaAbs() <= 17) {
699  granularity = 1;
700  }
701  else if(id.ietaAbs() >= 18 && id.ietaAbs() <= 26) {
702  granularity = 2;
703  }
704  else if(id.ietaAbs() >= 27 && id.ietaAbs() <= 28) {
705  granularity = 5;
706  }
707  else {
708  granularity = 0;
709  }
710  }
711  }
712 
713  HcalLutMetadatum item(cell.rawId(), rcalib, granularity, threshold);
714  result->addValues(item);
715  }
716 
717  return result;
718 }
719 
720 std::unique_ptr<HcalDcsValues> HcalHardcodeCalibrations::produceDcsValues (const HcalDcsRcd& rcd) {
721  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
722  auto result = std::make_unique<HcalDcsValues>();
723  return result;
724 }
725 
726 std::unique_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
727  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
728 
730 }
731 
732 std::unique_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
733  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
735  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
736  const HcalTopology* topo=&(*htopo);
737 
738  auto result = std::make_unique<HcalRecoParams>(topo);
739  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
740  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
741  HcalRecoParam item = dbHardcode.makeRecoParam (*cell);
742  result->addValues(item);
743  }
744  return result;
745 }
746 
747 std::unique_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
748  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
750  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
751  const HcalTopology* topo=&(*htopo);
752 
753  auto result = std::make_unique<HcalTimingParams>(topo);
754  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
755  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
757  result->addValues(item);
758  }
759  return result;
760 }
761 
762 std::unique_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
763  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
765  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
766  const HcalTopology* topo=&(*htopo);
767 
768  auto result = std::make_unique<HcalLongRecoParams>(topo);
769  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
770  std::vector <unsigned int> mSignal;
771  mSignal.push_back(4);
772  mSignal.push_back(5);
773  mSignal.push_back(6);
774  std::vector <unsigned int> mNoise;
775  mNoise.push_back(1);
776  mNoise.push_back(2);
777  mNoise.push_back(3);
778  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
779  if (cell->isHcalZDCDetId())
780  {
781  HcalLongRecoParam item(cell->rawId(),mSignal,mNoise);
782  result->addValues(item);
783  }
784  }
785  return result;
786 }
787 
788 std::unique_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
789  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
791  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
792  const HcalTopology* topo=&(*htopo);
793 
794  auto result = std::make_unique<HcalZDCLowGainFractions>(topo);
795  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
796  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
797  HcalZDCLowGainFraction item(cell->rawId(),0.0);
798  result->addValues(item);
799  }
800  return result;
801 }
802 
803 std::unique_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
804 
805 
806  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
807 
808  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
810  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
811  const HcalTopology* topo=&(*htopo);
812  auto result = std::make_unique<HcalMCParams>(topo);
813  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
814  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
815 
816  // HcalMCParam item(cell->rawId(),0);
817  HcalMCParam item = dbHardcode.makeMCParam (*cell);
818  result->addValues(item);
819  }
820  return result;
821 }
822 
823 
824 std::unique_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
825  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
827  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
828  const HcalTopology* topo=&(*htopo);
829 
830  auto result = std::make_unique<HcalFlagHFDigiTimeParams>(topo);
831  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
832 
833  std::vector<double> coef;
834  coef.push_back(0.93);
835  coef.push_back(-0.38275);
836  coef.push_back(-0.012667);
837 
838  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
839  HcalFlagHFDigiTimeParam item(cell->rawId(),
840  1, //firstsample
841  3, // samplestoadd
842  2, //expectedpeak
843  40., // min energy threshold
844  coef // coefficients
845  );
846  result->addValues(item);
847  }
848  return result;
849 }
850 
851 
852 std::unique_ptr<HcalFrontEndMap> HcalHardcodeCalibrations::produceFrontEndMap (const HcalFrontEndMapRcd& rec) {
853  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFrontEndMap-> ...";
855  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
856  const HcalTopology* topo=&(*htopo);
857  std::vector <HcalGenericDetId> cells = allCells(*topo, dbHardcode.killHE());
858 
859  return dbHardcode.makeHardcodeFrontEndMap(cells);
860 }
861 
862 
863 std::unique_ptr<HcalSiPMParameters> HcalHardcodeCalibrations::produceSiPMParameters (const HcalSiPMParametersRcd& rec) {
864  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceSiPMParameters-> ...";
866  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
867  const HcalTopology* topo=&(*htopo);
868 
869  auto result = std::make_unique<HcalSiPMParameters>(topo);
870  std::vector <HcalGenericDetId> cells = allCells(*htopo, dbHardcode.killHE());
871  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
873  result->addValues(item);
874  }
875  return result;
876 }
877 
878 std::unique_ptr<HcalSiPMCharacteristics> HcalHardcodeCalibrations::produceSiPMCharacteristics (const HcalSiPMCharacteristicsRcd& rcd) {
879  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceSiPMCharacteristics-> ...";
880 
882 }
883 
884 
885 std::unique_ptr<HcalTPChannelParameters> HcalHardcodeCalibrations::produceTPChannelParameters (const HcalTPChannelParametersRcd& rec) {
886  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTPChannelParameters-> ...";
888  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
889  const HcalTopology* topo=&(*htopo);
890 
891  auto result = std::make_unique<HcalTPChannelParameters>(topo);
892  std::vector <HcalGenericDetId> cells = allCells(*htopo, dbHardcode.killHE());
893  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
895  result->addValues(item);
896  }
897  return result;
898 }
899 
900 std::unique_ptr<HcalTPParameters> HcalHardcodeCalibrations::produceTPParameters (const HcalTPParametersRcd& rcd) {
901  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTPParameters-> ...";
902 
903  auto result = std::make_unique<HcalTPParameters>();
905  return result;
906 }
907 
910  desc.add<double>("iLumi",-1.);
911  desc.add<bool>("HBRecalibration",false);
912  desc.add<double>("HBreCalibCutoff",20.);
913  desc.add<edm::FileInPath>("HBmeanenergies",edm::FileInPath("CalibCalorimetry/HcalPlugins/data/meanenergiesHB.txt"));
914  desc.add<bool>("HERecalibration",false);
915  desc.add<double>("HEreCalibCutoff",20.);
916  desc.add<edm::FileInPath>("HEmeanenergies",edm::FileInPath("CalibCalorimetry/HcalPlugins/data/meanenergiesHE.txt"));
917  desc.add<bool>("HFRecalibration",false);
918  desc.add<bool>("GainWidthsForTrigPrims",false);
919  desc.add<bool>("useHBUpgrade",false);
920  desc.add<bool>("useHEUpgrade",false);
921  desc.add<bool>("useHFUpgrade",false);
922  desc.add<bool>("useHOUpgrade",true);
923  desc.add<bool>("testHFQIE10",false);
924  desc.add<bool>("testHEPlan1",false);
925  desc.add<bool>("killHE",false);
926  desc.add<bool>("useLayer0Weight",false);
927  desc.addUntracked<std::vector<std::string> >("toGet",std::vector<std::string>());
928  desc.addUntracked<bool>("fromDDD",false);
929 
931  desc_hb.add<std::vector<double>>("gain", std::vector<double>({0.19}));
932  desc_hb.add<std::vector<double>>("gainWidth", std::vector<double>({0.0}));
933  desc_hb.add<double>("pedestal", 3.0);
934  desc_hb.add<double>("pedestalWidth", 0.55);
935  desc_hb.add<int>("zsThreshold", 8);
936  desc_hb.add<std::vector<double>>("qieOffset", std::vector<double>({-0.49, 1.8, 7.2, 37.9}));
937  desc_hb.add<std::vector<double>>("qieSlope", std::vector<double>({0.912, 0.917, 0.922, 0.923}));
938  desc_hb.add<int>("qieType", 0);
939  desc_hb.add<int>("mcShape",125);
940  desc_hb.add<int>("recoShape",105);
941  desc_hb.add<double>("photoelectronsToAnalog",0.0);
942  desc_hb.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
943  desc_hb.add<bool>("doRadiationDamage", false);
944  desc.add<edm::ParameterSetDescription>("hb", desc_hb);
945 
946  edm::ParameterSetDescription desc_hbRaddam;
947  desc_hbRaddam.add<double>("temperatureBase",20.0);
948  desc_hbRaddam.add<double>("temperatureNew",-5.0);
949  desc_hbRaddam.add<double>("intlumiOffset",150);
950  desc_hbRaddam.add<double>("depVsTemp",0.0631);
951  desc_hbRaddam.add<double>("intlumiToNeutrons",3.67e8);
952  desc_hbRaddam.add<std::vector<double>>("depVsNeutrons",{5.69e-11,7.90e-11});
953 
954  edm::ParameterSetDescription desc_hbUpgrade;
955  desc_hbUpgrade.add<std::vector<double>>("gain", std::vector<double>({0.00111111111111}));
956  desc_hbUpgrade.add<std::vector<double>>("gainWidth", std::vector<double>({0}));
957  desc_hbUpgrade.add<double>("pedestal", 18.0);
958  desc_hbUpgrade.add<double>("pedestalWidth", 5.0);
959  desc_hbUpgrade.add<int>("zsThreshold", 3);
960  desc_hbUpgrade.add<std::vector<double>>("qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
961  desc_hbUpgrade.add<std::vector<double>>("qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
962  desc_hbUpgrade.add<int>("qieType", 2);
963  desc_hbUpgrade.add<int>("mcShape",206);
964  desc_hbUpgrade.add<int>("recoShape",206);
965  desc_hbUpgrade.add<double>("photoelectronsToAnalog",57.5);
966  desc_hbUpgrade.add<std::vector<double>>("darkCurrent", std::vector<double>({0.055}));
967  desc_hbUpgrade.add<bool>("doRadiationDamage", true);
968  desc_hbUpgrade.add<edm::ParameterSetDescription>("radiationDamage", desc_hbRaddam);
969  desc.add<edm::ParameterSetDescription>("hbUpgrade", desc_hbUpgrade);
970 
972  desc_he.add<std::vector<double>>("gain", std::vector<double>({0.23}));
973  desc_he.add<std::vector<double>>("gainWidth", std::vector<double>({0}));
974  desc_he.add<double>("pedestal", 3.0);
975  desc_he.add<double>("pedestalWidth", 0.79);
976  desc_he.add<int>("zsThreshold", 9);
977  desc_he.add<std::vector<double>>("qieOffset", std::vector<double>({-0.38, 2.0, 7.6, 39.6}));
978  desc_he.add<std::vector<double>>("qieSlope", std::vector<double>({0.912, 0.916, 0.92, 0.922}));
979  desc_he.add<int>("qieType", 0);
980  desc_he.add<int>("mcShape",125);
981  desc_he.add<int>("recoShape",105);
982  desc_he.add<double>("photoelectronsToAnalog",0.0);
983  desc_he.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
984  desc_he.add<bool>("doRadiationDamage", false);
985  desc.add<edm::ParameterSetDescription>("he", desc_he);
986 
987  edm::ParameterSetDescription desc_heRaddam;
988  desc_heRaddam.add<double>("temperatureBase",20.0);
989  desc_heRaddam.add<double>("temperatureNew",5.0);
990  desc_heRaddam.add<double>("intlumiOffset",75);
991  desc_heRaddam.add<double>("depVsTemp",0.0631);
992  desc_heRaddam.add<double>("intlumiToNeutrons",2.92e8);
993  desc_heRaddam.add<std::vector<double>>("depVsNeutrons",{5.69e-11,7.90e-11});
994 
995  edm::ParameterSetDescription desc_heUpgrade;
996  desc_heUpgrade.add<std::vector<double>>("gain", std::vector<double>({0.00111111111111}));
997  desc_heUpgrade.add<std::vector<double>>("gainWidth", std::vector<double>({0}));
998  desc_heUpgrade.add<double>("pedestal", 18.0);
999  desc_heUpgrade.add<double>("pedestalWidth", 5.0);
1000  desc_heUpgrade.add<int>("zsThreshold", 3);
1001  desc_heUpgrade.add<std::vector<double>>("qieOffset", std::vector<double>({0.0, 0.0, 0.0, 0.0}));
1002  desc_heUpgrade.add<std::vector<double>>("qieSlope", std::vector<double>({0.333, 0.333, 0.333, 0.333}));
1003  desc_heUpgrade.add<int>("qieType", 2);
1004  desc_heUpgrade.add<int>("mcShape",206);
1005  desc_heUpgrade.add<int>("recoShape",206);
1006  desc_heUpgrade.add<double>("photoelectronsToAnalog",57.5);
1007  desc_heUpgrade.add<std::vector<double>>("darkCurrent", std::vector<double>({0.055}));
1008  desc_heUpgrade.add<bool>("doRadiationDamage", true);
1009  desc_heUpgrade.add<edm::ParameterSetDescription>("radiationDamage", desc_heRaddam);
1010  desc.add<edm::ParameterSetDescription>("heUpgrade", desc_heUpgrade);
1011 
1013  desc_hf.add<std::vector<double>>("gain", std::vector<double>({0.14, 0.135}));
1014  desc_hf.add<std::vector<double>>("gainWidth", std::vector<double>({0.0, 0.0}));
1015  desc_hf.add<double>("pedestal", 3.0);
1016  desc_hf.add<double>("pedestalWidth", 0.84);
1017  desc_hf.add<int>("zsThreshold", -9999);
1018  desc_hf.add<std::vector<double>>("qieOffset", std::vector<double>({-0.87, 1.4, 7.8, -29.6}));
1019  desc_hf.add<std::vector<double>>("qieSlope", std::vector<double>({0.359, 0.358, 0.36, 0.367}));
1020  desc_hf.add<int>("qieType", 0);
1021  desc_hf.add<int>("mcShape",301);
1022  desc_hf.add<int>("recoShape",301);
1023  desc_hf.add<double>("photoelectronsToAnalog",0.0);
1024  desc_hf.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
1025  desc_hf.add<bool>("doRadiationDamage", false);
1026  desc.add<edm::ParameterSetDescription>("hf", desc_hf);
1027 
1028  edm::ParameterSetDescription desc_hfUpgrade;
1029  desc_hfUpgrade.add<std::vector<double>>("gain", std::vector<double>({0.14, 0.135}));
1030  desc_hfUpgrade.add<std::vector<double>>("gainWidth", std::vector<double>({0.0, 0.0}));
1031  desc_hfUpgrade.add<double>("pedestal", 13.33);
1032  desc_hfUpgrade.add<double>("pedestalWidth", 3.33);
1033  desc_hfUpgrade.add<int>("zsThreshold", -9999);
1034  desc_hfUpgrade.add<std::vector<double>>("qieOffset", std::vector<double>({0.0697, -0.7405, 12.38, -671.9}));
1035  desc_hfUpgrade.add<std::vector<double>>("qieSlope", std::vector<double>({0.297, 0.298, 0.298, 0.313}));
1036  desc_hfUpgrade.add<int>("qieType", 1);
1037  desc_hfUpgrade.add<int>("mcShape",301);
1038  desc_hfUpgrade.add<int>("recoShape",301);
1039  desc_hfUpgrade.add<double>("photoelectronsToAnalog",0.0);
1040  desc_hfUpgrade.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
1041  desc_hfUpgrade.add<bool>("doRadiationDamage", false);
1042  desc.add<edm::ParameterSetDescription>("hfUpgrade", desc_hfUpgrade);
1043 
1044  edm::ParameterSetDescription desc_hfrecal;
1045  desc_hfrecal.add<std::vector<double>>("HFdepthOneParameterA", std::vector<double>());
1046  desc_hfrecal.add<std::vector<double>>("HFdepthOneParameterB", std::vector<double>());
1047  desc_hfrecal.add<std::vector<double>>("HFdepthTwoParameterA", std::vector<double>());
1048  desc_hfrecal.add<std::vector<double>>("HFdepthTwoParameterB", std::vector<double>());
1049  desc.add<edm::ParameterSetDescription>("HFRecalParameterBlock", desc_hfrecal);
1050 
1052  desc_ho.add<std::vector<double>>("gain", std::vector<double>({0.006, 0.0087}));
1053  desc_ho.add<std::vector<double>>("gainWidth", std::vector<double>({0.0, 0.0}));
1054  desc_ho.add<double>("pedestal", 11.0);
1055  desc_ho.add<double>("pedestalWidth", 0.57);
1056  desc_ho.add<int>("zsThreshold", 24);
1057  desc_ho.add<std::vector<double>>("qieOffset", std::vector<double>({-0.44, 1.4, 7.1, 38.5}));
1058  desc_ho.add<std::vector<double>>("qieSlope", std::vector<double>({0.907, 0.915, 0.92, 0.921}));
1059  desc_ho.add<int>("qieType", 0);
1060  desc_ho.add<int>("mcShape",201);
1061  desc_ho.add<int>("recoShape",201);
1062  desc_ho.add<double>("photoelectronsToAnalog",4.0);
1063  desc_ho.add<std::vector<double>>("darkCurrent",std::vector<double>({0.0}));
1064  desc_ho.add<bool>("doRadiationDamage", false);
1065  desc.add<edm::ParameterSetDescription>("ho", desc_ho);
1066 
1067  edm::ParameterSetDescription validator_sipm;
1068  validator_sipm.add<int>("pixels",1);
1069  validator_sipm.add<double>("crosstalk",0);
1070  validator_sipm.add<double>("nonlin1",1);
1071  validator_sipm.add<double>("nonlin2",0);
1072  validator_sipm.add<double>("nonlin3",0);
1073  std::vector<edm::ParameterSet> default_sipm(1);
1074  desc.addVPSet("SiPMCharacteristics",validator_sipm,default_sipm);
1075 
1076  descriptions.addDefault(desc);
1077 }
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.cc:108
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void setHE(HcalHardcodeParameters p)
std::unique_ptr< HcalDcsMap > makeHardcodeDcsMap() const
void setKillHE(bool b)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
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
HcalTPChannelParameter makeHardcodeTPChannelParameter(HcalGenericDetId fId) const
std::unique_ptr< HcalRecoParams > produceRecoParams(const HcalRecoParamsRcd &rcd)
void setHB(HcalHardcodeParameters p)
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
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:20
std::string fullPath() const
Definition: FileInPath.cc:184
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