CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
17 
20 
24 
26 
27 //#define DebugLog
28 
29 // class decleration
30 //
31 
32 using namespace cms;
33 
34 namespace {
35 
36  std::vector<HcalGenericDetId> allCells (const HcalTopology& hcaltopology) {
37  static std::vector<HcalGenericDetId> result;
38  int maxDepthHB=hcaltopology.maxDepthHB();
39  int maxDepthHE=hcaltopology.maxDepthHE();
40 
41 #ifdef DebugLog
42  std::cout << std::endl << "HcalHardcodeCalibrations: maxDepthHB, maxDepthHE = "
43  << maxDepthHB << ", " << maxDepthHE << std::endl;
44 #endif
45 
46  if (result.size () <= 0) {
47  for (int eta = -HcalDetId::kHcalEtaMask2;
49  for (int phi = 0; phi <= HcalDetId::kHcalPhiMask2; phi++) {
50  for (int depth = 1; depth < maxDepthHB + maxDepthHE; depth++) {
51  for (int det = 1; det <= HcalForward; det++) {
52  HcalDetId cell ((HcalSubdetector) det, eta, phi, depth);
53  if (hcaltopology.valid(cell)) {
54  result.push_back (cell);
55 #ifdef DebugLog
56  std::cout << " HcalHardcodedCalibrations: det|eta|phi|depth = "
57  << det << "|" << eta << "|" << phi << "|"
58  << depth << std::endl;
59 #endif
60  }
61  }
62  }
63  }
64  }
65  ZdcTopology zdctopology;
66  HcalZDCDetId zcell;
68  for(int depth= 1; depth < 6; depth++){
69  zcell = HcalZDCDetId(section, true, depth);
70  if(zdctopology.valid(zcell)) result.push_back(zcell);
71  zcell = HcalZDCDetId(section, false, depth);
72  if(zdctopology.valid(zcell)) result.push_back(zcell);
73  }
74  section = HcalZDCDetId::HAD;
75  for(int depth= 1; depth < 5; depth++){
76  zcell = HcalZDCDetId(section, true, depth);
77  if(zdctopology.valid(zcell)) result.push_back(zcell);
78  zcell = HcalZDCDetId(section, false, depth);
79  if(zdctopology.valid(zcell)) result.push_back(zcell);
80  }
81  section = HcalZDCDetId::LUM;
82  for(int depth= 1; depth < 3; depth++){
83  zcell = HcalZDCDetId(section, true, depth);
84  if(zdctopology.valid(zcell)) result.push_back(zcell);
85  zcell = HcalZDCDetId(section, false, depth);
86  if(zdctopology.valid(zcell)) result.push_back(zcell);
87  }
88  section = HcalZDCDetId::RPD;
89  for(int depth= 1; depth < 17; depth++){
90  zcell = HcalZDCDetId(section, true, depth);
91  if(zdctopology.valid(zcell)) result.push_back(zcell);
92  zcell = HcalZDCDetId(section, false, depth);
93  if(zdctopology.valid(zcell)) result.push_back(zcell);
94  }
95 
96  // HcalGenTriggerTower (HcalGenericSubdetector = 5)
97  // NASTY HACK !!!
98  // - As no valid(cell) check found for HcalTrigTowerDetId
99  // to create HT cells (ieta=1-28, iphi=1-72)&(ieta=29-32, iphi=1,5,... 69)
100 
101  for (int vers=0; vers<=HcalTrigTowerDetId::kHcalVersMask; ++vers) {
105  for (int phi = 1; phi <= HcalTrigTowerDetId::kHcalPhiMask; phi++) {
106  HcalTrigTowerDetId cell(eta, phi,depth,vers);
107  if (hcaltopology.validHT(cell)) {
108  result.push_back (cell);
109 #ifdef DebugLog
110  std::cout << " HcalHardcodedCalibrations: eta|phi|depth|vers = "
111  << eta << "|" << phi << "|" << depth << "|" << vers
112  << std::endl;
113 #endif
114  }
115  }
116  }
117  }
118  }
119  }
120  return result;
121  }
122 
123 }
124 
126  he_recalibration(0), hf_recalibration(0), setHEdsegm(false), setHBdsegm(false), SipmLumi(0.0), testHFQIE10(iConfig.getParameter<bool>("testHFQIE10"))
127 {
128  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
129 
130  if ( iConfig.exists("GainWidthsForTrigPrims") )
131  switchGainWidthsForTrigPrims = iConfig.getParameter<bool>("GainWidthsForTrigPrims");
132  else switchGainWidthsForTrigPrims = false;
133 
134 
135  // HE and HF recalibration preparation
136  iLumi = 0.;
137  if ( iConfig.exists("iLumi") )
138  iLumi=iConfig.getParameter<double>("iLumi");
139 
140  if( iLumi > 0.0 ) {
141  bool he_recalib = iConfig.getParameter<bool>("HERecalibration");
142  bool hf_recalib = iConfig.getParameter<bool>("HFRecalibration");
143  if(he_recalib) {
144  double cutoff = iConfig.getParameter<double>("HEreCalibCutoff");
145  he_recalibration = new HERecalibration(iLumi,cutoff);
146  }
147  if(hf_recalib) hf_recalibration = new HFRecalibration();
148 
149 #ifdef DebugLog
150  std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl;
151 #endif
152  }
153 
154  std::vector <std::string> toGet = iConfig.getUntrackedParameter <std::vector <std::string> > ("toGet");
155  for(std::vector <std::string>::iterator objectName = toGet.begin(); objectName != toGet.end(); ++objectName ) {
156  bool all = *objectName == "all";
157 #ifdef DebugLog
158  std::cout << "Load parameters for " << *objectName << std::endl;
159 #endif
160  if ((*objectName == "Pedestals") || all) {
162  findingRecord <HcalPedestalsRcd> ();
163  }
164  if ((*objectName == "PedestalWidths") || all) {
166  findingRecord <HcalPedestalWidthsRcd> ();
167  }
168  if ((*objectName == "Gains") || all) {
170  findingRecord <HcalGainsRcd> ();
171  }
172  if ((*objectName == "GainWidths") || all) {
174  findingRecord <HcalGainWidthsRcd> ();
175  }
176  if ((*objectName == "QIEData") || all) {
178  findingRecord <HcalQIEDataRcd> ();
179  }
180  if ((*objectName == "QIETypes") || all) {
182  findingRecord <HcalQIETypesRcd> ();
183  }
184  if ((*objectName == "ChannelQuality") || (*objectName == "channelQuality") || all) {
186  findingRecord <HcalChannelQualityRcd> ();
187  }
188  if ((*objectName == "ElectronicsMap") || (*objectName == "electronicsMap") || all) {
190  findingRecord <HcalElectronicsMapRcd> ();
191  }
192  if ((*objectName == "ZSThresholds") || (*objectName == "zsThresholds") || all) {
194  findingRecord <HcalZSThresholdsRcd> ();
195  }
196  if ((*objectName == "RespCorrs") || (*objectName == "ResponseCorrection") || all) {
198  findingRecord <HcalRespCorrsRcd> ();
199  }
200  if ((*objectName == "LUTCorrs") || (*objectName == "LUTCorrection") || all) {
202  findingRecord <HcalLUTCorrsRcd> ();
203  }
204  if ((*objectName == "PFCorrs") || (*objectName == "PFCorrection") || all) {
206  findingRecord <HcalPFCorrsRcd> ();
207  }
208  if ((*objectName == "TimeCorrs") || (*objectName == "TimeCorrection") || all) {
210  findingRecord <HcalTimeCorrsRcd> ();
211  }
212  if ((*objectName == "L1TriggerObjects") || (*objectName == "L1Trigger") || all) {
214  findingRecord <HcalL1TriggerObjectsRcd> ();
215  }
216  if ((*objectName == "ValidationCorrs") || (*objectName == "ValidationCorrection") || all) {
218  findingRecord <HcalValidationCorrsRcd> ();
219  }
220  if ((*objectName == "LutMetadata") || (*objectName == "lutMetadata") || all) {
222  findingRecord <HcalLutMetadataRcd> ();
223  }
224  if ((*objectName == "DcsValues") || all) {
226  findingRecord <HcalDcsRcd> ();
227  }
228  if ((*objectName == "DcsMap") || (*objectName == "dcsMap") || all) {
230  findingRecord <HcalDcsMapRcd> ();
231  }
232  if ((*objectName == "RecoParams") || all) {
234  findingRecord <HcalRecoParamsRcd> ();
235  }
236  if ((*objectName == "LongRecoParams") || all) {
238  findingRecord <HcalLongRecoParamsRcd> ();
239  }
240  if ((*objectName == "ZDCLowGainFractions") || all) {
242  findingRecord <HcalZDCLowGainFractionsRcd> ();
243  }
244  if ((*objectName == "MCParams") || all) {
246  findingRecord <HcalMCParamsRcd> ();
247  }
248  if ((*objectName == "FlagHFDigiTimeParams") || all) {
250  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
251  }
252  if ((*objectName == "CholeskyMatrices") || all) {
254  findingRecord <HcalCholeskyMatricesRcd> ();
255  }
256  if ((*objectName == "CovarianceMatrices") || all) {
258  findingRecord <HcalCovarianceMatricesRcd> ();
259  }
260  }
261 }
262 
263 
265 {
266  if (he_recalibration != 0 ) delete he_recalibration;
267  if (hf_recalibration != 0 ) delete hf_recalibration;
268 }
269 
270 //
271 // member functions
272 //
273 void
275  std::string record = iKey.name ();
276  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
278 }
279 
280 std::auto_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec) {
281  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestals-> ...";
283  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
284  const HcalTopology* topo=&(*htopo);
285 
286  std::auto_ptr<HcalPedestals> result (new HcalPedestals (topo,false));
287  std::vector <HcalGenericDetId> cells = allCells(*topo);
288  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
289  HcalPedestal item = HcalDbHardcode::makePedestal (*cell, false, iLumi);
290  result->addValues(item);
291  }
292  return result;
293 }
294 
295 std::auto_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec) {
296  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestalWidths-> ...";
298  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
299  const HcalTopology* topo=&(*htopo);
300 
301  std::auto_ptr<HcalPedestalWidths> result (new HcalPedestalWidths (topo,false));
302  std::vector <HcalGenericDetId> cells = allCells(*htopo);
303  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
305  result->addValues(item);
306  }
307  return result;
308 }
309 
310 std::auto_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
311  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
313  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
314  const HcalTopology* topo=&(*htopo);
315 
316  std::auto_ptr<HcalGains> result (new HcalGains (topo));
317  std::vector <HcalGenericDetId> cells = allCells(*topo);
318  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
319  HcalGain item = HcalDbHardcode::makeGain (*cell);
320  result->addValues(item);
321  }
322  return result;
323 }
324 
325 std::auto_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
326  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
328  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
329  const HcalTopology* topo=&(*htopo);
330 
331  std::auto_ptr<HcalGainWidths> result (new HcalGainWidths (topo));
332  std::vector <HcalGenericDetId> cells = allCells(*topo);
333  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
334 
335  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
338  result->addValues(item);
339  } else if (!cell->isHcalTrigTowerDetId()) {
341  result->addValues(item);
342  }
343  }
344  return result;
345 }
346 
347 std::auto_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
348  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
349 
350  /*
351  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
352  << std::endl;
353  */
354 
356  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
357  const HcalTopology* topo=&(*htopo);
358 
359  std::auto_ptr<HcalQIEData> result (new HcalQIEData (topo));
360  std::vector <HcalGenericDetId> cells = allCells(*topo);
361  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
363  result->addCoder (coder);
364  }
365  return result;
366 }
367 
368 std::auto_ptr<HcalQIETypes> HcalHardcodeCalibrations::produceQIETypes (const HcalQIETypesRcd& rcd) {
369  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIETypes-> ...";
371  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
372  const HcalTopology* topo=&(*htopo);
373 
374  std::auto_ptr<HcalQIETypes> result (new HcalQIETypes (topo));
375  std::vector <HcalGenericDetId> cells = allCells(*topo);
376  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
378  result->addValues(item);
379  }
380  return result;
381 }
382 
383 std::auto_ptr<HcalChannelQuality> HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) {
384  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ...";
386  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
387  const HcalTopology* topo=&(*htopo);
388 
389  std::auto_ptr<HcalChannelQuality> result (new HcalChannelQuality (topo));
390  std::vector <HcalGenericDetId> cells = allCells(*topo);
391  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
392  HcalChannelStatus item(cell->rawId(),0);
393  result->addValues(item);
394  }
395  return result;
396 }
397 
398 
399 std::auto_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) {
400  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ...";
402  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
403  const HcalTopology* topo=&(*htopo);
404 
405  //set depth segmentation for HB/HE recalib - only happens once
406 // if((he_recalibration && !setHEdsegm) || (hb_recalibration && !setHBdsegm)){
407  if((he_recalibration && !setHEdsegm)) {
408  std::vector<std::vector<int>> m_segmentation;
409  int maxEta = topo->lastHERing();
410  m_segmentation.resize(maxEta);
411  for (int i = 0; i < maxEta; i++) {
412  topo->getDepthSegmentation(i+1,m_segmentation[i]);
413  }
415  he_recalibration->setDsegm(m_segmentation);
416  setHEdsegm = true;
417  }
418  /*
419  if(hb_recalibration && !setHBdsegm){
420  hb_recalibration->setDsegm(m_segmentation);
421  setHBdsegm = true;
422  }
423  */
424  }
425 
426  std::auto_ptr<HcalRespCorrs> result (new HcalRespCorrs (topo));
427  std::vector <HcalGenericDetId> cells = allCells(*topo);
428  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
429 
430  double corr = 1.0;
431 
432  if ((he_recalibration != 0 ) &&
433  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
434 
435  int depth_ = HcalDetId(*cell).depth();
436  int ieta_ = HcalDetId(*cell).ieta();
437  corr = he_recalibration->getCorr(ieta_, depth_);
438 
439  /*
440  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_
441  << " corr = " << corr << std::endl;
442  */
443 
444  }
445  else if ((hf_recalibration != 0 ) &&
446  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenForward)) {
447  int depth_ = HcalDetId(*cell).depth();
448  int ieta_ = HcalDetId(*cell).ieta();
449  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
450 
451  /*
452  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_
453  << " corr = " << corr << std::endl;
454  */
455 
456  }
457 
458  HcalRespCorr item(cell->rawId(),corr);
459  result->addValues(item);
460  }
461  return result;
462 }
463 
464 std::auto_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
465  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
467  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
468  const HcalTopology* topo=&(*htopo);
469 
470  std::auto_ptr<HcalLUTCorrs> result (new HcalLUTCorrs (topo));
471  std::vector <HcalGenericDetId> cells = allCells(*topo);
472  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
473  HcalLUTCorr item(cell->rawId(),1.0);
474  result->addValues(item);
475  }
476  return result;
477 }
478 
479 std::auto_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
480  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
482  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
483  const HcalTopology* topo=&(*htopo);
484 
485  std::auto_ptr<HcalPFCorrs> result (new HcalPFCorrs (topo));
486  std::vector <HcalGenericDetId> cells = allCells(*topo);
487  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
488  HcalPFCorr item(cell->rawId(),1.0);
489  result->addValues(item);
490  }
491  return result;
492 }
493 
494 std::auto_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
495  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
497  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
498  const HcalTopology* topo=&(*htopo);
499 
500  std::auto_ptr<HcalTimeCorrs> result (new HcalTimeCorrs (topo));
501  std::vector <HcalGenericDetId> cells = allCells(*topo);
502  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
503  HcalTimeCorr item(cell->rawId(),0.0);
504  result->addValues(item);
505  }
506  return result;
507 }
508 
509 std::auto_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
510  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
512  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
513  const HcalTopology* topo=&(*htopo);
514 
515  std::auto_ptr<HcalZSThresholds> result (new HcalZSThresholds (topo));
516  std::vector <HcalGenericDetId> cells = allCells(*topo);
517  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
518  HcalZSThreshold item(cell->rawId(),0);
519  result->addValues(item);
520  }
521  return result;
522 }
523 
524 
525 std::auto_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
526  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
528  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
529  const HcalTopology* topo=&(*htopo);
530 
531  std::auto_ptr<HcalL1TriggerObjects> result (new HcalL1TriggerObjects (topo));
532  std::vector <HcalGenericDetId> cells = allCells(*topo);
533  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
534  HcalL1TriggerObject item(cell->rawId(),0., 1., 0);
535  result->addValues(item);
536  }
537  // add tag and algo values
538  result->setTagString("hardcoded");
539  result->setAlgoString("hardcoded");
540  return result;
541 }
542 
543 
544 
545 
546 std::auto_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
547  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
548 
549  std::auto_ptr<HcalElectronicsMap> result (new HcalElectronicsMap ());
551  return result;
552 }
553 
554 std::auto_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
555  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
557  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
558  const HcalTopology* topo=&(*htopo);
559 
560  std::auto_ptr<HcalValidationCorrs> result (new HcalValidationCorrs (topo));
561  std::vector <HcalGenericDetId> cells = allCells(*topo);
562  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
563  HcalValidationCorr item(cell->rawId(),1.0);
564  result->addValues(item);
565  }
566  return result;
567 }
568 
569 std::auto_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
570  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
572  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
573  const HcalTopology* topo=&(*htopo);
574 
575  std::auto_ptr<HcalLutMetadata> result (new HcalLutMetadata (topo));
576 
577  result->setRctLsb( 0.5 );
578  result->setNominalGain(0.003333); // for HBHE SiPMs
579 
580  std::vector <HcalGenericDetId> cells = allCells(*topo);
581  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
582 
583  /*
584  if (cell->isHcalTrigTowerDetId()) {
585  HcalTrigTowerDetId ht = HcalTrigTowerDetId(*cell);
586  int ieta = ht.ieta();
587  int iphi = ht.iphi();
588  std::cout << " HcalTrigTower cell (ieta,iphi) = "
589  << ieta << ", " << iphi << std::endl;
590  }
591  */
592 
593  HcalLutMetadatum item(cell->rawId(),1.0,1,1);
594  result->addValues(item);
595  }
596 
597  return result;
598 }
599 
600 std::auto_ptr<HcalDcsValues>
602  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
603  std::auto_ptr<HcalDcsValues> result(new HcalDcsValues);
604  return result;
605 }
606 
607 std::auto_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
608  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
609 
610  std::auto_ptr<HcalDcsMap> result (new HcalDcsMap ());
612  return result;
613 }
614 
615 std::auto_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
616  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
618  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
619  const HcalTopology* topo=&(*htopo);
620 
621  std::auto_ptr<HcalRecoParams> result (new HcalRecoParams (topo));
622  std::vector <HcalGenericDetId> cells = allCells(*topo);
623  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
625  result->addValues(item);
626  }
627  return result;
628 }
629 std::auto_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
630  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
632  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
633  const HcalTopology* topo=&(*htopo);
634 
635  std::auto_ptr<HcalTimingParams> result (new HcalTimingParams (topo));
636  std::vector <HcalGenericDetId> cells = allCells(*topo);
637  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
639  result->addValues(item);
640  }
641  return result;
642 }
643 std::auto_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
644  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
646  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
647  const HcalTopology* topo=&(*htopo);
648 
649  std::auto_ptr<HcalLongRecoParams> result (new HcalLongRecoParams (topo));
650  std::vector <HcalGenericDetId> cells = allCells(*topo);
651  std::vector <unsigned int> mSignal;
652  mSignal.push_back(4);
653  mSignal.push_back(5);
654  mSignal.push_back(6);
655  std::vector <unsigned int> mNoise;
656  mNoise.push_back(1);
657  mNoise.push_back(2);
658  mNoise.push_back(3);
659  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
660  if (cell->isHcalZDCDetId())
661  {
662  HcalLongRecoParam item(cell->rawId(),mSignal,mNoise);
663  result->addValues(item);
664  }
665  }
666  return result;
667 }
668 
669 std::auto_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
670  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
672  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
673  const HcalTopology* topo=&(*htopo);
674 
675  std::auto_ptr<HcalZDCLowGainFractions> result (new HcalZDCLowGainFractions (topo));
676  std::vector <HcalGenericDetId> cells = allCells(*topo);
677  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
678  HcalZDCLowGainFraction item(cell->rawId(),0.0);
679  result->addValues(item);
680  }
681  return result;
682 }
683 
684 std::auto_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
685 
686 
687  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
688 
689  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
691  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
692  const HcalTopology* topo=&(*htopo);
693  std::auto_ptr<HcalMCParams> result (new HcalMCParams (topo));
694  std::vector <HcalGenericDetId> cells = allCells(*topo);
695  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
696 
697  // HcalMCParam item(cell->rawId(),0);
699  result->addValues(item);
700  }
701  return result;
702 }
703 
704 
705 std::auto_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
706  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
708  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
709  const HcalTopology* topo=&(*htopo);
710 
711  std::auto_ptr<HcalFlagHFDigiTimeParams> result (new HcalFlagHFDigiTimeParams (topo));
712  std::vector <HcalGenericDetId> cells = allCells(*topo);
713 
714  std::vector<double> coef;
715  coef.push_back(0.93);
716  coef.push_back(-0.38275);
717  coef.push_back(-0.012667);
718 
719  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
720  HcalFlagHFDigiTimeParam item(cell->rawId(),
721  1, //firstsample
722  3, // samplestoadd
723  2, //expectedpeak
724  40., // min energy threshold
725  coef // coefficients
726  );
727  result->addValues(item);
728  }
729  return result;
730 }
731 
732 
733 std::auto_ptr<HcalCholeskyMatrices> HcalHardcodeCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rec) {
734 
736  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
737  const HcalTopology* topo=&(*htopo);
738  std::auto_ptr<HcalCholeskyMatrices> result (new HcalCholeskyMatrices (topo));
739 
740  std::vector <HcalGenericDetId> cells = allCells(*topo);
741  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
742 
743  int sub = cell->genericSubdet();
744 
745  if (sub == HcalGenericDetId::HcalGenBarrel ||
749  HcalCholeskyMatrix item(cell->rawId());
750  result->addValues(item);
751  }
752  }
753  return result;
754 
755 }
756 std::auto_ptr<HcalCovarianceMatrices> HcalHardcodeCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rec) {
757 
759  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
760  const HcalTopology* topo=&(*htopo);
761  std::auto_ptr<HcalCovarianceMatrices> result (new HcalCovarianceMatrices (topo));
762  std::vector <HcalGenericDetId> cells = allCells(*topo);
763  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
764 
765  HcalCovarianceMatrix item(cell->rawId());
766  result->addValues(item);
767  }
768  return result;
769 }
770 
773  desc.add<double>("iLumi",-1.);
774  desc.add<bool>("HERecalibration",false);
775  desc.add<double>("HEreCalibCutoff",20.);
776  desc.add<bool>("HFRecalibration",false);
777  desc.add<bool>("GainWidthsForTrigPrims",false);
778  desc.add<bool>("testHFQIE10",false);
779  desc.addUntracked<std::vector<std::string>>("toGet",std::vector<std::string>());
780  desc.addUntracked<bool>("fromDDD",false);
781 
782  descriptions.addDefault(desc);
783 }
std::auto_ptr< HcalZDCLowGainFractions > produceZDCLowGainFractions(const HcalZDCLowGainFractionsRcd &rcd)
std::auto_ptr< HcalPedestalWidths > producePedestalWidths(const HcalPedestalWidthsRcd &rcd)
static const int kHcalVersMask
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
HcalHardcodeCalibrations(const edm::ParameterSet &)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::auto_ptr< HcalLUTCorrs > produceLUTCorrs(const HcalLUTCorrsRcd &rcd)
std::auto_ptr< HcalDcsMap > produceDcsMap(const HcalDcsMapRcd &rcd)
const EventID & eventID() const
Definition: IOVSyncValue.h:42
JetCorrectorParameters::Record record
Definition: classes.h:7
HcalTimingParam makeTimingParam(HcalGenericDetId fId)
int maxDepthHE() const
Definition: HcalTopology.h:129
void setDsegm(const std::vector< std::vector< int > > &m_segmentation)
std::auto_ptr< HcalQIEData > produceQIEData(const HcalQIEDataRcd &rcd)
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
HcalQIEType makeQIEType(HcalGenericDetId fId, bool testHFQIE10)
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::auto_ptr< HcalLutMetadata > produceLutMetadata(const HcalLutMetadataRcd &rcd)
double maxEta
std::auto_ptr< HcalZSThresholds > produceZSThresholds(const HcalZSThresholdsRcd &rcd)
double getCorr(int ieta, int idepth)
static const int kHcalEtaMask
void makeHardcodeMap(HcalElectronicsMap &emap)
std::auto_ptr< HcalDcsValues > produceDcsValues(const HcalDcsRcd &rcd)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
tuple result
Definition: mps_fire.py:84
HcalQIECoder makeQIECoder(HcalGenericDetId fId)
HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId)
std::auto_ptr< HcalChannelQuality > produceChannelQuality(const HcalChannelQualityRcd &rcd)
std::auto_ptr< HcalTimeCorrs > produceTimeCorrs(const HcalTimeCorrsRcd &rcd)
void makeHardcodeDcsMap(HcalDcsMap &dcs_map)
int depth() const
get the tower depth
Definition: HcalDetId.cc:129
std::auto_ptr< HcalTimingParams > produceTimingParams(const HcalTimingParamsRcd &rcd)
std::auto_ptr< HcalRecoParams > produceRecoParams(const HcalRecoParamsRcd &rcd)
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:29
void addDefault(ParameterSetDescription const &psetDescription)
HcalGain makeGain(HcalGenericDetId fId, bool fSmear=false)
double getCorr(int ieta, int idepth, double lumi)
std::auto_ptr< HcalGains > produceGains(const HcalGainsRcd &rcd)
static const IOVSyncValue & beginOfTime()
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalDepthMask
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HcalRecoParam makeRecoParam(HcalGenericDetId fId)
std::auto_ptr< HcalRespCorrs > produceRespCorrs(const HcalRespCorrsRcd &rcd)
JetCorrectorParameters corr
Definition: classes.h:5
std::auto_ptr< HcalLongRecoParams > produceLongRecoParams(const HcalLongRecoParamsRcd &rcd)
static const int kHcalPhiMask
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
void getDepthSegmentation(unsigned ring, std::vector< int > &readoutDepths) const
std::auto_ptr< HcalElectronicsMap > produceElectronicsMap(const HcalElectronicsMapRcd &rcd)
std::auto_ptr< HcalPFCorrs > producePFCorrs(const HcalPFCorrsRcd &rcd)
std::auto_ptr< HcalQIETypes > produceQIETypes(const HcalQIETypesRcd &rcd)
virtual bool valid(const DetId &id) const
std::auto_ptr< HcalCovarianceMatrices > produceCovarianceMatrices(const HcalCovarianceMatricesRcd &rcd)
Geom::Phi< T > phi() const
HcalGainWidth makeGainWidth(HcalGenericDetId fId)
int maxDepthHB() const
Definition: HcalTopology.h:128
std::auto_ptr< HcalMCParams > produceMCParams(const HcalMCParamsRcd &rcd)
static const int kHcalEtaMask2
Definition: HcalDetId.h:20
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
const Timestamp & time() const
Definition: IOVSyncValue.h:44
tuple cout
Definition: gather_cfg.py:145
std::auto_ptr< HcalFlagHFDigiTimeParams > produceFlagHFDigiTimeParams(const HcalFlagHFDigiTimeParamsRcd &rcd)
std::auto_ptr< HcalCholeskyMatrices > produceCholeskyMatrices(const HcalCholeskyMatricesRcd &rcd)
std::auto_ptr< HcalGainWidths > produceGainWidths(const HcalGainWidthsRcd &rcd)
volatile std::atomic< bool > shutdown_flag false
std::auto_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)
HcalMCParam makeMCParam(HcalGenericDetId fId)
TimeValue_t value() const
Definition: Timestamp.h:56
int lastHERing() const
Definition: HcalTopology.h:86
HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear=false)
std::auto_ptr< HcalPedestals > producePedestals(const HcalPedestalsRcd &rcd)
std::auto_ptr< HcalL1TriggerObjects > produceL1TriggerObjects(const HcalL1TriggerObjectsRcd &rcd)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool validHT(const HcalTrigTowerDetId &id) const