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 
15 
18 
22 
24 
25 // class decleration
26 //
27 
28 using namespace cms;
29 
30 namespace {
31 
32  std::vector<HcalGenericDetId> allCells (const HcalTopology& hcaltopology) {
33  static std::vector<HcalGenericDetId> result;
34  int maxDepthHB=hcaltopology.maxDepthHB();
35  int maxDepthHE=hcaltopology.maxDepthHE();
36 
37  /*
38  std::cout << std::endl << "HcalHardcodeCalibrations: maxDepthHB, maxDepthHE = "
39  << maxDepthHB << ", " << maxDepthHE << std::endl;
40  */
41 
42  if (result.size () <= 0) {
43  for (int eta = -50; eta < 50; eta++) {
44  for (int phi = 0; phi < 100; phi++) {
45  for (int depth = 1; depth < maxDepthHB + maxDepthHE; depth++) {
46  for (int det = 1; det < 5; det++) {
47  HcalDetId cell ((HcalSubdetector) det, eta, phi, depth);
48  if (hcaltopology.valid(cell)) result.push_back (cell);
49 
50  /*
51  if (hcaltopology.valid(cell))
52  std::cout << " HcalHardcodedCalibrations: det, eta, phi, depth = "
53  << det << ", " << eta << ", " << phi << " , "
54  << depth << std::endl;
55  */
56  }
57  }
58  }
59  }
60  ZdcTopology zdctopology;
61  HcalZDCDetId zcell;
63  for(int depth= 1; depth < 6; depth++){
64  zcell = HcalZDCDetId(section, true, depth);
65  if(zdctopology.valid(zcell)) result.push_back(zcell);
66  zcell = HcalZDCDetId(section, false, depth);
67  if(zdctopology.valid(zcell)) result.push_back(zcell);
68  }
69  section = HcalZDCDetId::HAD;
70  for(int depth= 1; depth < 5; depth++){
71  zcell = HcalZDCDetId(section, true, depth);
72  if(zdctopology.valid(zcell)) result.push_back(zcell);
73  zcell = HcalZDCDetId(section, false, depth);
74  if(zdctopology.valid(zcell)) result.push_back(zcell);
75  }
76  section = HcalZDCDetId::LUM;
77  for(int depth= 1; depth < 3; depth++){
78  zcell = HcalZDCDetId(section, true, depth);
79  if(zdctopology.valid(zcell)) result.push_back(zcell);
80  zcell = HcalZDCDetId(section, false, depth);
81  if(zdctopology.valid(zcell)) result.push_back(zcell);
82  }
83 
84  // HcalGenTriggerTower (HcalGenericSubdetector = 5)
85  // NASTY HACK !!!
86  // - As no valid(cell) check found for HcalTrigTowerDetId
87  // to create HT cells (ieta=1-28, iphi=1-72)&(ieta=29-32, iphi=1,5,... 69)
88 
89  for (int eta = -32; eta <= 32; eta++) {
90  if(abs(eta) <= 28 && (eta != 0)) {
91  for (int phi = 1; phi <= 72; phi++) {
92  HcalTrigTowerDetId cell(eta, phi);
93  result.push_back (cell);
94  }
95  }
96  else if (abs(eta) > 28) {
97  for (int phi = 1; phi <= 69;) {
98  HcalTrigTowerDetId cell(eta, phi);
99  result.push_back (cell);
100  phi += 4;
101  }
102  }
103  }
104  }
105  return result;
106  }
107 
108 }
109 
110 HcalHardcodeCalibrations::HcalHardcodeCalibrations ( const edm::ParameterSet& iConfig ): he_recalibration(0), hf_recalibration(0), setHEdsegm(false), setHBdsegm(false), SipmLumi(0.0) {
111  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
112 
113  if ( iConfig.exists("GainWidthsForTrigPrims") )
114  switchGainWidthsForTrigPrims = iConfig.getParameter<bool>("GainWidthsForTrigPrims");
115  else switchGainWidthsForTrigPrims = false;
116 
117 
118  // HE and HF recalibration preparation
119  iLumi = 0.;
120  if ( iConfig.exists("iLumi") )
121  iLumi=iConfig.getParameter<double>("iLumi");
122 
123  if( iLumi > 0.0 ) {
124  bool he_recalib = iConfig.getParameter<bool>("HERecalibration");
125  bool hf_recalib = iConfig.getParameter<bool>("HFRecalibration");
126  if(he_recalib) {
127  double cutoff = iConfig.getParameter<double>("HEreCalibCutoff");
128  he_recalibration = new HERecalibration(iLumi,cutoff);
129  }
130  if(hf_recalib) hf_recalibration = new HFRecalibration();
131 
132  // std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl;
133  }
134 
135  std::vector <std::string> toGet = iConfig.getUntrackedParameter <std::vector <std::string> > ("toGet");
136  for(std::vector <std::string>::iterator objectName = toGet.begin(); objectName != toGet.end(); ++objectName ) {
137  bool all = *objectName == "all";
138  if ((*objectName == "Pedestals") || all) {
140  findingRecord <HcalPedestalsRcd> ();
141  }
142  if ((*objectName == "PedestalWidths") || all) {
144  findingRecord <HcalPedestalWidthsRcd> ();
145  }
146  if ((*objectName == "Gains") || all) {
148  findingRecord <HcalGainsRcd> ();
149  }
150  if ((*objectName == "GainWidths") || all) {
152  findingRecord <HcalGainWidthsRcd> ();
153  }
154  if ((*objectName == "QIEData") || all) {
156  findingRecord <HcalQIEDataRcd> ();
157  }
158  if ((*objectName == "ChannelQuality") || (*objectName == "channelQuality") || all) {
160  findingRecord <HcalChannelQualityRcd> ();
161  }
162  if ((*objectName == "ElectronicsMap") || (*objectName == "electronicsMap") || all) {
164  findingRecord <HcalElectronicsMapRcd> ();
165  }
166  if ((*objectName == "ZSThresholds") || (*objectName == "zsThresholds") || all) {
168  findingRecord <HcalZSThresholdsRcd> ();
169  }
170  if ((*objectName == "RespCorrs") || (*objectName == "ResponseCorrection") || all) {
172  findingRecord <HcalRespCorrsRcd> ();
173  }
174  if ((*objectName == "LUTCorrs") || (*objectName == "LUTCorrection") || all) {
176  findingRecord <HcalLUTCorrsRcd> ();
177  }
178  if ((*objectName == "PFCorrs") || (*objectName == "PFCorrection") || all) {
180  findingRecord <HcalPFCorrsRcd> ();
181  }
182  if ((*objectName == "TimeCorrs") || (*objectName == "TimeCorrection") || all) {
184  findingRecord <HcalTimeCorrsRcd> ();
185  }
186  if ((*objectName == "L1TriggerObjects") || (*objectName == "L1Trigger") || all) {
188  findingRecord <HcalL1TriggerObjectsRcd> ();
189  }
190  if ((*objectName == "ValidationCorrs") || (*objectName == "ValidationCorrection") || all) {
192  findingRecord <HcalValidationCorrsRcd> ();
193  }
194  if ((*objectName == "LutMetadata") || (*objectName == "lutMetadata") || all) {
196  findingRecord <HcalLutMetadataRcd> ();
197  }
198  if ((*objectName == "DcsValues") || all) {
200  findingRecord <HcalDcsRcd> ();
201  }
202  if ((*objectName == "DcsMap") || (*objectName == "dcsMap") || all) {
204  findingRecord <HcalDcsMapRcd> ();
205  }
206  if ((*objectName == "RecoParams") || all) {
208  findingRecord <HcalRecoParamsRcd> ();
209  }
210  if ((*objectName == "LongRecoParams") || all) {
212  findingRecord <HcalLongRecoParamsRcd> ();
213  }
214  if ((*objectName == "ZDCLowGainFractions") || all) {
216  findingRecord <HcalZDCLowGainFractionsRcd> ();
217  }
218  if ((*objectName == "MCParams") || all) {
220  findingRecord <HcalMCParamsRcd> ();
221  }
222  if ((*objectName == "FlagHFDigiTimeParams") || all) {
224  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
225  }
226  if ((*objectName == "CholeskyMatrices") || all) {
228  findingRecord <HcalCholeskyMatricesRcd> ();
229  }
230  if ((*objectName == "CovarianceMatrices") || all) {
232  findingRecord <HcalCovarianceMatricesRcd> ();
233  }
234  }
235 }
236 
237 
239 {
240  if (he_recalibration != 0 ) delete he_recalibration;
241  if (hf_recalibration != 0 ) delete hf_recalibration;
242 }
243 
244 //
245 // member functions
246 //
247 void
249  std::string record = iKey.name ();
250  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
252 }
253 
254 std::auto_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec) {
255  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestals-> ...";
257  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
258  const HcalTopology* topo=&(*htopo);
259 
260  std::auto_ptr<HcalPedestals> result (new HcalPedestals (topo,false));
261  std::vector <HcalGenericDetId> cells = allCells(*topo);
262  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
263  HcalPedestal item = HcalDbHardcode::makePedestal (*cell, false, iLumi);
264  result->addValues(item);
265  }
266  return result;
267 }
268 
269 std::auto_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec) {
270  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestalWidths-> ...";
272  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
273  const HcalTopology* topo=&(*htopo);
274 
275  std::auto_ptr<HcalPedestalWidths> result (new HcalPedestalWidths (topo,false));
276  std::vector <HcalGenericDetId> cells = allCells(*htopo);
277  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
279  result->addValues(item);
280  }
281  return result;
282 }
283 
284 std::auto_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
285  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
287  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
288  const HcalTopology* topo=&(*htopo);
289 
290  std::auto_ptr<HcalGains> result (new HcalGains (topo));
291  std::vector <HcalGenericDetId> cells = allCells(*topo);
292  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
293  HcalGain item = HcalDbHardcode::makeGain (*cell);
294  result->addValues(item);
295  }
296  return result;
297 }
298 
299 std::auto_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
300  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
302  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
303  const HcalTopology* topo=&(*htopo);
304 
305  std::auto_ptr<HcalGainWidths> result (new HcalGainWidths (topo));
306  std::vector <HcalGenericDetId> cells = allCells(*topo);
307  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
308 
309  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
312  result->addValues(item);
313  } else if (!cell->isHcalTrigTowerDetId()) {
315  result->addValues(item);
316  }
317  }
318  return result;
319 }
320 
321 std::auto_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
322  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
323 
324  /*
325  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
326  << std::endl;
327  */
328 
330  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
331  const HcalTopology* topo=&(*htopo);
332 
333  std::auto_ptr<HcalQIEData> result (new HcalQIEData (topo));
334  std::vector <HcalGenericDetId> cells = allCells(*topo);
335  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
337  result->addCoder (coder);
338  }
339  return result;
340 }
341 
342 std::auto_ptr<HcalChannelQuality> HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) {
343  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ...";
345  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
346  const HcalTopology* topo=&(*htopo);
347 
348  std::auto_ptr<HcalChannelQuality> result (new HcalChannelQuality (topo));
349  std::vector <HcalGenericDetId> cells = allCells(*topo);
350  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
351  HcalChannelStatus item(cell->rawId(),0);
352  result->addValues(item);
353  }
354  return result;
355 }
356 
357 
358 std::auto_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) {
359  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ...";
361  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
362  const HcalTopology* topo=&(*htopo);
363 
364  //set depth segmentation for HB/HE recalib - only happens once
365 // if((he_recalibration && !setHEdsegm) || (hb_recalibration && !setHBdsegm)){
366  if((he_recalibration && !setHEdsegm)) {
367  std::vector<std::vector<int>> m_segmentation;
368  int maxEta = topo->lastHERing();
369  m_segmentation.resize(maxEta);
370  for (int i = 0; i < maxEta; i++) {
371  topo->getDepthSegmentation(i+1,m_segmentation[i]);
372  }
374  he_recalibration->setDsegm(m_segmentation);
375  setHEdsegm = true;
376  }
377  /*
378  if(hb_recalibration && !setHBdsegm){
379  hb_recalibration->setDsegm(m_segmentation);
380  setHBdsegm = true;
381  }
382  */
383  }
384 
385  std::auto_ptr<HcalRespCorrs> result (new HcalRespCorrs (topo));
386  std::vector <HcalGenericDetId> cells = allCells(*topo);
387  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
388 
389  double corr = 1.0;
390 
391  if ((he_recalibration != 0 ) &&
392  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
393 
394  int depth_ = HcalDetId(*cell).depth();
395  int ieta_ = HcalDetId(*cell).ieta();
396  corr = he_recalibration->getCorr(ieta_, depth_);
397 
398  /*
399  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_
400  << " corr = " << corr << std::endl;
401  */
402 
403  }
404  else if ((hf_recalibration != 0 ) &&
405  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenForward)) {
406  int depth_ = HcalDetId(*cell).depth();
407  int ieta_ = HcalDetId(*cell).ieta();
408  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
409 
410  /*
411  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_
412  << " corr = " << corr << std::endl;
413  */
414 
415  }
416 
417  HcalRespCorr item(cell->rawId(),corr);
418  result->addValues(item);
419  }
420  return result;
421 }
422 
423 std::auto_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
424  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
426  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
427  const HcalTopology* topo=&(*htopo);
428 
429  std::auto_ptr<HcalLUTCorrs> result (new HcalLUTCorrs (topo));
430  std::vector <HcalGenericDetId> cells = allCells(*topo);
431  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
432  HcalLUTCorr item(cell->rawId(),1.0);
433  result->addValues(item);
434  }
435  return result;
436 }
437 
438 std::auto_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
439  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
441  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
442  const HcalTopology* topo=&(*htopo);
443 
444  std::auto_ptr<HcalPFCorrs> result (new HcalPFCorrs (topo));
445  std::vector <HcalGenericDetId> cells = allCells(*topo);
446  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
447  HcalPFCorr item(cell->rawId(),1.0);
448  result->addValues(item);
449  }
450  return result;
451 }
452 
453 std::auto_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
454  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
456  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
457  const HcalTopology* topo=&(*htopo);
458 
459  std::auto_ptr<HcalTimeCorrs> result (new HcalTimeCorrs (topo));
460  std::vector <HcalGenericDetId> cells = allCells(*topo);
461  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
462  HcalTimeCorr item(cell->rawId(),0.0);
463  result->addValues(item);
464  }
465  return result;
466 }
467 
468 std::auto_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
469  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
471  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
472  const HcalTopology* topo=&(*htopo);
473 
474  std::auto_ptr<HcalZSThresholds> result (new HcalZSThresholds (topo));
475  std::vector <HcalGenericDetId> cells = allCells(*topo);
476  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
477  HcalZSThreshold item(cell->rawId(),0);
478  result->addValues(item);
479  }
480  return result;
481 }
482 
483 
484 std::auto_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
485  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
487  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
488  const HcalTopology* topo=&(*htopo);
489 
490  std::auto_ptr<HcalL1TriggerObjects> result (new HcalL1TriggerObjects (topo));
491  std::vector <HcalGenericDetId> cells = allCells(*topo);
492  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
493  HcalL1TriggerObject item(cell->rawId(),0., 1., 0);
494  result->addValues(item);
495  }
496  // add tag and algo values
497  result->setTagString("hardcoded");
498  result->setAlgoString("hardcoded");
499  return result;
500 }
501 
502 
503 
504 
505 std::auto_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
506  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
507 
508  std::auto_ptr<HcalElectronicsMap> result (new HcalElectronicsMap ());
510  return result;
511 }
512 
513 std::auto_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
514  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
516  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
517  const HcalTopology* topo=&(*htopo);
518 
519  std::auto_ptr<HcalValidationCorrs> result (new HcalValidationCorrs (topo));
520  std::vector <HcalGenericDetId> cells = allCells(*topo);
521  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
522  HcalValidationCorr item(cell->rawId(),1.0);
523  result->addValues(item);
524  }
525  return result;
526 }
527 
528 std::auto_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
529  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
531  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
532  const HcalTopology* topo=&(*htopo);
533 
534  std::auto_ptr<HcalLutMetadata> result (new HcalLutMetadata (topo));
535 
536  result->setRctLsb( 0.5 );
537  result->setNominalGain(0.003333); // for HBHE SiPMs
538 
539  std::vector <HcalGenericDetId> cells = allCells(*topo);
540  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
541 
542  /*
543  if (cell->isHcalTrigTowerDetId()) {
544  HcalTrigTowerDetId ht = HcalTrigTowerDetId(*cell);
545  int ieta = ht.ieta();
546  int iphi = ht.iphi();
547  std::cout << " HcalTrigTower cell (ieta,iphi) = "
548  << ieta << ", " << iphi << std::endl;
549  }
550  */
551 
552  HcalLutMetadatum item(cell->rawId(),1.0,1,1);
553  result->addValues(item);
554  }
555 
556  return result;
557 }
558 
559 std::auto_ptr<HcalDcsValues>
561  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
562  std::auto_ptr<HcalDcsValues> result(new HcalDcsValues);
563  return result;
564 }
565 
566 std::auto_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
567  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
568 
569  std::auto_ptr<HcalDcsMap> result (new HcalDcsMap ());
571  return result;
572 }
573 
574 std::auto_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
575  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
577  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
578  const HcalTopology* topo=&(*htopo);
579 
580  std::auto_ptr<HcalRecoParams> result (new HcalRecoParams (topo));
581  std::vector <HcalGenericDetId> cells = allCells(*topo);
582  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
584  result->addValues(item);
585  }
586  return result;
587 }
588 std::auto_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
589  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
591  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
592  const HcalTopology* topo=&(*htopo);
593 
594  std::auto_ptr<HcalTimingParams> result (new HcalTimingParams (topo));
595  std::vector <HcalGenericDetId> cells = allCells(*topo);
596  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
598  result->addValues(item);
599  }
600  return result;
601 }
602 std::auto_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
603  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
605  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
606  const HcalTopology* topo=&(*htopo);
607 
608  std::auto_ptr<HcalLongRecoParams> result (new HcalLongRecoParams (topo));
609  std::vector <HcalGenericDetId> cells = allCells(*topo);
610  std::vector <unsigned int> mSignal;
611  mSignal.push_back(4);
612  mSignal.push_back(5);
613  mSignal.push_back(6);
614  std::vector <unsigned int> mNoise;
615  mNoise.push_back(1);
616  mNoise.push_back(2);
617  mNoise.push_back(3);
618  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
619  if (cell->isHcalZDCDetId())
620  {
621  HcalLongRecoParam item(cell->rawId(),mSignal,mNoise);
622  result->addValues(item);
623  }
624  }
625  return result;
626 }
627 
628 std::auto_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
629  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
631  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
632  const HcalTopology* topo=&(*htopo);
633 
634  std::auto_ptr<HcalZDCLowGainFractions> result (new HcalZDCLowGainFractions (topo));
635  std::vector <HcalGenericDetId> cells = allCells(*topo);
636  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
637  HcalZDCLowGainFraction item(cell->rawId(),0.0);
638  result->addValues(item);
639  }
640  return result;
641 }
642 
643 std::auto_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
644 
645 
646  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
647 
648  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
650  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
651  const HcalTopology* topo=&(*htopo);
652  std::auto_ptr<HcalMCParams> result (new HcalMCParams (topo));
653  std::vector <HcalGenericDetId> cells = allCells(*topo);
654  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
655 
656  // HcalMCParam item(cell->rawId(),0);
658  result->addValues(item);
659  }
660  return result;
661 }
662 
663 
664 std::auto_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
665  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
667  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
668  const HcalTopology* topo=&(*htopo);
669 
670  std::auto_ptr<HcalFlagHFDigiTimeParams> result (new HcalFlagHFDigiTimeParams (topo));
671  std::vector <HcalGenericDetId> cells = allCells(*topo);
672 
673  std::vector<double> coef;
674  coef.push_back(0.93);
675  coef.push_back(-0.38275);
676  coef.push_back(-0.012667);
677 
678  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
679  HcalFlagHFDigiTimeParam item(cell->rawId(),
680  1, //firstsample
681  3, // samplestoadd
682  2, //expectedpeak
683  40., // min energy threshold
684  coef // coefficients
685  );
686  result->addValues(item);
687  }
688  return result;
689 }
690 
691 
692 std::auto_ptr<HcalCholeskyMatrices> HcalHardcodeCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rec) {
693 
695  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
696  const HcalTopology* topo=&(*htopo);
697  std::auto_ptr<HcalCholeskyMatrices> result (new HcalCholeskyMatrices (topo));
698 
699  std::vector <HcalGenericDetId> cells = allCells(*topo);
700  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
701 
702  int sub = cell->genericSubdet();
703 
704  if (sub == HcalGenericDetId::HcalGenBarrel ||
708  HcalCholeskyMatrix item(cell->rawId());
709  result->addValues(item);
710  }
711  }
712  return result;
713 
714 }
715 std::auto_ptr<HcalCovarianceMatrices> HcalHardcodeCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rec) {
716 
718  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
719  const HcalTopology* topo=&(*htopo);
720  std::auto_ptr<HcalCovarianceMatrices> result (new HcalCovarianceMatrices (topo));
721  std::vector <HcalGenericDetId> cells = allCells(*topo);
722  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
723 
724  HcalCovarianceMatrix item(cell->rawId());
725  result->addValues(item);
726  }
727  return result;
728 }
std::auto_ptr< HcalZDCLowGainFractions > produceZDCLowGainFractions(const HcalZDCLowGainFractionsRcd &rcd)
std::auto_ptr< HcalPedestalWidths > producePedestalWidths(const HcalPedestalWidthsRcd &rcd)
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)
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.h:55
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:51
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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)
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)
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)
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
const Timestamp & time() const
Definition: IOVSyncValue.h:44
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)