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 
89  // HcalGenTriggerTower (HcalGenericSubdetector = 5)
90  // NASTY HACK !!!
91  // - As no valid(cell) check found for HcalTrigTowerDetId
92  // to create HT cells (ieta=1-28, iphi=1-72)&(ieta=29-32, iphi=1,5,... 69)
93 
94  for (int vers=0; vers<=HcalTrigTowerDetId::kHcalVersMask; ++vers) {
98  for (int phi = 1; phi <= HcalTrigTowerDetId::kHcalPhiMask; phi++) {
99  HcalTrigTowerDetId cell(eta, phi,depth,vers);
100  if (hcaltopology.validHT(cell)) {
101  result.push_back (cell);
102 #ifdef DebugLog
103  std::cout << " HcalHardcodedCalibrations: eta|phi|depth|vers = "
104  << eta << "|" << phi << "|" << depth << "|" << vers
105  << std::endl;
106 #endif
107  }
108  }
109  }
110  }
111  }
112  }
113  return result;
114  }
115 
116 }
117 
118 HcalHardcodeCalibrations::HcalHardcodeCalibrations ( const edm::ParameterSet& iConfig ): he_recalibration(0), hf_recalibration(0), setHEdsegm(false), setHBdsegm(false), SipmLumi(0.0) {
119  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
120 
121  if ( iConfig.exists("GainWidthsForTrigPrims") )
122  switchGainWidthsForTrigPrims = iConfig.getParameter<bool>("GainWidthsForTrigPrims");
123  else switchGainWidthsForTrigPrims = false;
124 
125 
126  // HE and HF recalibration preparation
127  iLumi = 0.;
128  if ( iConfig.exists("iLumi") )
129  iLumi=iConfig.getParameter<double>("iLumi");
130 
131  if( iLumi > 0.0 ) {
132  bool he_recalib = iConfig.getParameter<bool>("HERecalibration");
133  bool hf_recalib = iConfig.getParameter<bool>("HFRecalibration");
134  if(he_recalib) {
135  double cutoff = iConfig.getParameter<double>("HEreCalibCutoff");
136  he_recalibration = new HERecalibration(iLumi,cutoff);
137  }
138  if(hf_recalib) hf_recalibration = new HFRecalibration();
139 
140 #ifdef DebugLog
141  std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl;
142 #endif
143  }
144 
145  std::vector <std::string> toGet = iConfig.getUntrackedParameter <std::vector <std::string> > ("toGet");
146  for(std::vector <std::string>::iterator objectName = toGet.begin(); objectName != toGet.end(); ++objectName ) {
147  bool all = *objectName == "all";
148 #ifdef DebugLog
149  std::cout << "Load parameters for " << *objectName << std::endl;
150 #endif
151  if ((*objectName == "Pedestals") || all) {
153  findingRecord <HcalPedestalsRcd> ();
154  }
155  if ((*objectName == "PedestalWidths") || all) {
157  findingRecord <HcalPedestalWidthsRcd> ();
158  }
159  if ((*objectName == "Gains") || all) {
161  findingRecord <HcalGainsRcd> ();
162  }
163  if ((*objectName == "GainWidths") || all) {
165  findingRecord <HcalGainWidthsRcd> ();
166  }
167  if ((*objectName == "QIEData") || all) {
169  findingRecord <HcalQIEDataRcd> ();
170  }
171  if ((*objectName == "QIETypes") || all) {
173  findingRecord <HcalQIETypesRcd> ();
174  }
175  if ((*objectName == "ChannelQuality") || (*objectName == "channelQuality") || all) {
177  findingRecord <HcalChannelQualityRcd> ();
178  }
179  if ((*objectName == "ElectronicsMap") || (*objectName == "electronicsMap") || all) {
181  findingRecord <HcalElectronicsMapRcd> ();
182  }
183  if ((*objectName == "ZSThresholds") || (*objectName == "zsThresholds") || all) {
185  findingRecord <HcalZSThresholdsRcd> ();
186  }
187  if ((*objectName == "RespCorrs") || (*objectName == "ResponseCorrection") || all) {
189  findingRecord <HcalRespCorrsRcd> ();
190  }
191  if ((*objectName == "LUTCorrs") || (*objectName == "LUTCorrection") || all) {
193  findingRecord <HcalLUTCorrsRcd> ();
194  }
195  if ((*objectName == "PFCorrs") || (*objectName == "PFCorrection") || all) {
197  findingRecord <HcalPFCorrsRcd> ();
198  }
199  if ((*objectName == "TimeCorrs") || (*objectName == "TimeCorrection") || all) {
201  findingRecord <HcalTimeCorrsRcd> ();
202  }
203  if ((*objectName == "L1TriggerObjects") || (*objectName == "L1Trigger") || all) {
205  findingRecord <HcalL1TriggerObjectsRcd> ();
206  }
207  if ((*objectName == "ValidationCorrs") || (*objectName == "ValidationCorrection") || all) {
209  findingRecord <HcalValidationCorrsRcd> ();
210  }
211  if ((*objectName == "LutMetadata") || (*objectName == "lutMetadata") || all) {
213  findingRecord <HcalLutMetadataRcd> ();
214  }
215  if ((*objectName == "DcsValues") || all) {
217  findingRecord <HcalDcsRcd> ();
218  }
219  if ((*objectName == "DcsMap") || (*objectName == "dcsMap") || all) {
221  findingRecord <HcalDcsMapRcd> ();
222  }
223  if ((*objectName == "RecoParams") || all) {
225  findingRecord <HcalRecoParamsRcd> ();
226  }
227  if ((*objectName == "LongRecoParams") || all) {
229  findingRecord <HcalLongRecoParamsRcd> ();
230  }
231  if ((*objectName == "ZDCLowGainFractions") || all) {
233  findingRecord <HcalZDCLowGainFractionsRcd> ();
234  }
235  if ((*objectName == "MCParams") || all) {
237  findingRecord <HcalMCParamsRcd> ();
238  }
239  if ((*objectName == "FlagHFDigiTimeParams") || all) {
241  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
242  }
243  if ((*objectName == "CholeskyMatrices") || all) {
245  findingRecord <HcalCholeskyMatricesRcd> ();
246  }
247  if ((*objectName == "CovarianceMatrices") || all) {
249  findingRecord <HcalCovarianceMatricesRcd> ();
250  }
251  }
252 }
253 
254 
256 {
257  if (he_recalibration != 0 ) delete he_recalibration;
258  if (hf_recalibration != 0 ) delete hf_recalibration;
259 }
260 
261 //
262 // member functions
263 //
264 void
266  std::string record = iKey.name ();
267  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
269 }
270 
271 std::auto_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec) {
272  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestals-> ...";
274  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
275  const HcalTopology* topo=&(*htopo);
276 
277  std::auto_ptr<HcalPedestals> result (new HcalPedestals (topo,false));
278  std::vector <HcalGenericDetId> cells = allCells(*topo);
279  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
280  HcalPedestal item = HcalDbHardcode::makePedestal (*cell, false, iLumi);
281  result->addValues(item);
282  }
283  return result;
284 }
285 
286 std::auto_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec) {
287  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestalWidths-> ...";
289  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
290  const HcalTopology* topo=&(*htopo);
291 
292  std::auto_ptr<HcalPedestalWidths> result (new HcalPedestalWidths (topo,false));
293  std::vector <HcalGenericDetId> cells = allCells(*htopo);
294  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
296  result->addValues(item);
297  }
298  return result;
299 }
300 
301 std::auto_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
302  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
304  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
305  const HcalTopology* topo=&(*htopo);
306 
307  std::auto_ptr<HcalGains> result (new HcalGains (topo));
308  std::vector <HcalGenericDetId> cells = allCells(*topo);
309  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
310  HcalGain item = HcalDbHardcode::makeGain (*cell);
311  result->addValues(item);
312  }
313  return result;
314 }
315 
316 std::auto_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
317  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
319  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
320  const HcalTopology* topo=&(*htopo);
321 
322  std::auto_ptr<HcalGainWidths> result (new HcalGainWidths (topo));
323  std::vector <HcalGenericDetId> cells = allCells(*topo);
324  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
325 
326  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
329  result->addValues(item);
330  } else if (!cell->isHcalTrigTowerDetId()) {
332  result->addValues(item);
333  }
334  }
335  return result;
336 }
337 
338 std::auto_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
339  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
340 
341  /*
342  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
343  << std::endl;
344  */
345 
347  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
348  const HcalTopology* topo=&(*htopo);
349 
350  std::auto_ptr<HcalQIEData> result (new HcalQIEData (topo));
351  std::vector <HcalGenericDetId> cells = allCells(*topo);
352  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
354  result->addCoder (coder);
355  }
356  return result;
357 }
358 
359 std::auto_ptr<HcalQIETypes> HcalHardcodeCalibrations::produceQIETypes (const HcalQIETypesRcd& rcd) {
360  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIETypes-> ...";
362  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
363  const HcalTopology* topo=&(*htopo);
364 
365  std::auto_ptr<HcalQIETypes> result (new HcalQIETypes (topo));
366  std::vector <HcalGenericDetId> cells = allCells(*topo);
367  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
368  HcalQIEType item(cell->rawId(),0);
369  result->addValues(item);
370  }
371  return result;
372 }
373 
374 std::auto_ptr<HcalChannelQuality> HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) {
375  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ...";
377  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
378  const HcalTopology* topo=&(*htopo);
379 
380  std::auto_ptr<HcalChannelQuality> result (new HcalChannelQuality (topo));
381  std::vector <HcalGenericDetId> cells = allCells(*topo);
382  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
383  HcalChannelStatus item(cell->rawId(),0);
384  result->addValues(item);
385  }
386  return result;
387 }
388 
389 
390 std::auto_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) {
391  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ...";
393  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
394  const HcalTopology* topo=&(*htopo);
395 
396  //set depth segmentation for HB/HE recalib - only happens once
397 // if((he_recalibration && !setHEdsegm) || (hb_recalibration && !setHBdsegm)){
398  if((he_recalibration && !setHEdsegm)) {
399  std::vector<std::vector<int>> m_segmentation;
400  int maxEta = topo->lastHERing();
401  m_segmentation.resize(maxEta);
402  for (int i = 0; i < maxEta; i++) {
403  topo->getDepthSegmentation(i+1,m_segmentation[i]);
404  }
406  he_recalibration->setDsegm(m_segmentation);
407  setHEdsegm = true;
408  }
409  /*
410  if(hb_recalibration && !setHBdsegm){
411  hb_recalibration->setDsegm(m_segmentation);
412  setHBdsegm = true;
413  }
414  */
415  }
416 
417  std::auto_ptr<HcalRespCorrs> result (new HcalRespCorrs (topo));
418  std::vector <HcalGenericDetId> cells = allCells(*topo);
419  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
420 
421  double corr = 1.0;
422 
423  if ((he_recalibration != 0 ) &&
424  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
425 
426  int depth_ = HcalDetId(*cell).depth();
427  int ieta_ = HcalDetId(*cell).ieta();
428  corr = he_recalibration->getCorr(ieta_, depth_);
429 
430  /*
431  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_
432  << " corr = " << corr << std::endl;
433  */
434 
435  }
436  else if ((hf_recalibration != 0 ) &&
437  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenForward)) {
438  int depth_ = HcalDetId(*cell).depth();
439  int ieta_ = HcalDetId(*cell).ieta();
440  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
441 
442  /*
443  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_
444  << " corr = " << corr << std::endl;
445  */
446 
447  }
448 
449  HcalRespCorr item(cell->rawId(),corr);
450  result->addValues(item);
451  }
452  return result;
453 }
454 
455 std::auto_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
456  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
458  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
459  const HcalTopology* topo=&(*htopo);
460 
461  std::auto_ptr<HcalLUTCorrs> result (new HcalLUTCorrs (topo));
462  std::vector <HcalGenericDetId> cells = allCells(*topo);
463  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
464  HcalLUTCorr item(cell->rawId(),1.0);
465  result->addValues(item);
466  }
467  return result;
468 }
469 
470 std::auto_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
471  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
473  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
474  const HcalTopology* topo=&(*htopo);
475 
476  std::auto_ptr<HcalPFCorrs> result (new HcalPFCorrs (topo));
477  std::vector <HcalGenericDetId> cells = allCells(*topo);
478  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
479  HcalPFCorr item(cell->rawId(),1.0);
480  result->addValues(item);
481  }
482  return result;
483 }
484 
485 std::auto_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
486  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
488  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
489  const HcalTopology* topo=&(*htopo);
490 
491  std::auto_ptr<HcalTimeCorrs> result (new HcalTimeCorrs (topo));
492  std::vector <HcalGenericDetId> cells = allCells(*topo);
493  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
494  HcalTimeCorr item(cell->rawId(),0.0);
495  result->addValues(item);
496  }
497  return result;
498 }
499 
500 std::auto_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
501  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
503  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
504  const HcalTopology* topo=&(*htopo);
505 
506  std::auto_ptr<HcalZSThresholds> result (new HcalZSThresholds (topo));
507  std::vector <HcalGenericDetId> cells = allCells(*topo);
508  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
509  HcalZSThreshold item(cell->rawId(),0);
510  result->addValues(item);
511  }
512  return result;
513 }
514 
515 
516 std::auto_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
517  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
519  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
520  const HcalTopology* topo=&(*htopo);
521 
522  std::auto_ptr<HcalL1TriggerObjects> result (new HcalL1TriggerObjects (topo));
523  std::vector <HcalGenericDetId> cells = allCells(*topo);
524  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
525  HcalL1TriggerObject item(cell->rawId(),0., 1., 0);
526  result->addValues(item);
527  }
528  // add tag and algo values
529  result->setTagString("hardcoded");
530  result->setAlgoString("hardcoded");
531  return result;
532 }
533 
534 
535 
536 
537 std::auto_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
538  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
539 
540  std::auto_ptr<HcalElectronicsMap> result (new HcalElectronicsMap ());
542  return result;
543 }
544 
545 std::auto_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
546  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
548  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
549  const HcalTopology* topo=&(*htopo);
550 
551  std::auto_ptr<HcalValidationCorrs> result (new HcalValidationCorrs (topo));
552  std::vector <HcalGenericDetId> cells = allCells(*topo);
553  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
554  HcalValidationCorr item(cell->rawId(),1.0);
555  result->addValues(item);
556  }
557  return result;
558 }
559 
560 std::auto_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
561  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
563  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
564  const HcalTopology* topo=&(*htopo);
565 
566  std::auto_ptr<HcalLutMetadata> result (new HcalLutMetadata (topo));
567 
568  result->setRctLsb( 0.5 );
569  result->setNominalGain(0.003333); // for HBHE SiPMs
570 
571  std::vector <HcalGenericDetId> cells = allCells(*topo);
572  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
573 
574  /*
575  if (cell->isHcalTrigTowerDetId()) {
576  HcalTrigTowerDetId ht = HcalTrigTowerDetId(*cell);
577  int ieta = ht.ieta();
578  int iphi = ht.iphi();
579  std::cout << " HcalTrigTower cell (ieta,iphi) = "
580  << ieta << ", " << iphi << std::endl;
581  }
582  */
583 
584  HcalLutMetadatum item(cell->rawId(),1.0,1,1);
585  result->addValues(item);
586  }
587 
588  return result;
589 }
590 
591 std::auto_ptr<HcalDcsValues>
593  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
594  std::auto_ptr<HcalDcsValues> result(new HcalDcsValues);
595  return result;
596 }
597 
598 std::auto_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
599  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
600 
601  std::auto_ptr<HcalDcsMap> result (new HcalDcsMap ());
603  return result;
604 }
605 
606 std::auto_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
607  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
609  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
610  const HcalTopology* topo=&(*htopo);
611 
612  std::auto_ptr<HcalRecoParams> result (new HcalRecoParams (topo));
613  std::vector <HcalGenericDetId> cells = allCells(*topo);
614  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
616  result->addValues(item);
617  }
618  return result;
619 }
620 std::auto_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
621  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
623  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
624  const HcalTopology* topo=&(*htopo);
625 
626  std::auto_ptr<HcalTimingParams> result (new HcalTimingParams (topo));
627  std::vector <HcalGenericDetId> cells = allCells(*topo);
628  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
630  result->addValues(item);
631  }
632  return result;
633 }
634 std::auto_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
635  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
637  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
638  const HcalTopology* topo=&(*htopo);
639 
640  std::auto_ptr<HcalLongRecoParams> result (new HcalLongRecoParams (topo));
641  std::vector <HcalGenericDetId> cells = allCells(*topo);
642  std::vector <unsigned int> mSignal;
643  mSignal.push_back(4);
644  mSignal.push_back(5);
645  mSignal.push_back(6);
646  std::vector <unsigned int> mNoise;
647  mNoise.push_back(1);
648  mNoise.push_back(2);
649  mNoise.push_back(3);
650  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
651  if (cell->isHcalZDCDetId())
652  {
653  HcalLongRecoParam item(cell->rawId(),mSignal,mNoise);
654  result->addValues(item);
655  }
656  }
657  return result;
658 }
659 
660 std::auto_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
661  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
663  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
664  const HcalTopology* topo=&(*htopo);
665 
666  std::auto_ptr<HcalZDCLowGainFractions> result (new HcalZDCLowGainFractions (topo));
667  std::vector <HcalGenericDetId> cells = allCells(*topo);
668  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
669  HcalZDCLowGainFraction item(cell->rawId(),0.0);
670  result->addValues(item);
671  }
672  return result;
673 }
674 
675 std::auto_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
676 
677 
678  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
679 
680  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
682  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
683  const HcalTopology* topo=&(*htopo);
684  std::auto_ptr<HcalMCParams> result (new HcalMCParams (topo));
685  std::vector <HcalGenericDetId> cells = allCells(*topo);
686  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
687 
688  // HcalMCParam item(cell->rawId(),0);
690  result->addValues(item);
691  }
692  return result;
693 }
694 
695 
696 std::auto_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
697  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
699  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
700  const HcalTopology* topo=&(*htopo);
701 
702  std::auto_ptr<HcalFlagHFDigiTimeParams> result (new HcalFlagHFDigiTimeParams (topo));
703  std::vector <HcalGenericDetId> cells = allCells(*topo);
704 
705  std::vector<double> coef;
706  coef.push_back(0.93);
707  coef.push_back(-0.38275);
708  coef.push_back(-0.012667);
709 
710  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
711  HcalFlagHFDigiTimeParam item(cell->rawId(),
712  1, //firstsample
713  3, // samplestoadd
714  2, //expectedpeak
715  40., // min energy threshold
716  coef // coefficients
717  );
718  result->addValues(item);
719  }
720  return result;
721 }
722 
723 
724 std::auto_ptr<HcalCholeskyMatrices> HcalHardcodeCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rec) {
725 
727  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
728  const HcalTopology* topo=&(*htopo);
729  std::auto_ptr<HcalCholeskyMatrices> result (new HcalCholeskyMatrices (topo));
730 
731  std::vector <HcalGenericDetId> cells = allCells(*topo);
732  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
733 
734  int sub = cell->genericSubdet();
735 
736  if (sub == HcalGenericDetId::HcalGenBarrel ||
740  HcalCholeskyMatrix item(cell->rawId());
741  result->addValues(item);
742  }
743  }
744  return result;
745 
746 }
747 std::auto_ptr<HcalCovarianceMatrices> HcalHardcodeCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rec) {
748 
750  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
751  const HcalTopology* topo=&(*htopo);
752  std::auto_ptr<HcalCovarianceMatrices> result (new HcalCovarianceMatrices (topo));
753  std::vector <HcalGenericDetId> cells = allCells(*topo);
754  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
755 
756  HcalCovarianceMatrix item(cell->rawId());
757  result->addValues(item);
758  }
759  return result;
760 }
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 &)
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
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
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:106
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:25
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()
tuple result
Definition: query.py:137
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalDepthMask
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)
bool validHT(const HcalTrigTowerDetId &id) const