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)
111 {
112  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
113 
114  if ( iConfig.exists("GainWidthsForTrigPrims") )
115  switchGainWidthsForTrigPrims = iConfig.getParameter<bool>("GainWidthsForTrigPrims");
116  else switchGainWidthsForTrigPrims = false;
117 
118 
119  // HE and HF recalibration preparation
120  iLumi = 0.;
121  if ( iConfig.exists("iLumi") )
122  iLumi=iConfig.getParameter<double>("iLumi");
123 
124  if( iLumi > 0.0 ) {
125  bool he_recalib = iConfig.getParameter<bool>("HERecalibration");
126  bool hf_recalib = iConfig.getParameter<bool>("HFRecalibration");
127  if(he_recalib) {
128  double cutoff = iConfig.getParameter<double>("HEreCalibCutoff");
129  he_recalibration = new HERecalibration(iLumi,cutoff);
130  }
131  if(hf_recalib) hf_recalibration = new HFRecalibration();
132 
133  // std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl;
134  }
135 
136  bool relabel_=false;
137  edm::ParameterSet ps0;
138  if ( iConfig.exists("HcalReLabel") ) {
139  ps0 = iConfig.getParameter<edm::ParameterSet>("HcalReLabel");
140  relabel_= ps0.getUntrackedParameter<bool>("RelabelHits",false);
141  }
142 
143  if (relabel_) {
144  std::vector<std::vector<int>> m_segmentation;
145  m_segmentation.resize(29);
146  edm::ParameterSet ps1 = ps0.getUntrackedParameter<edm::ParameterSet>("RelabelRules");
147  for (int i = 0; i < 29; i++) {
148  char name[10];
149  snprintf(name,10,"Eta%d",i+1);
150  if (i > 0) {
151  m_segmentation[i]=
152  ps1.getUntrackedParameter<std::vector<int>>(name,m_segmentation[i-1]);
153  } else {
154  m_segmentation[i]=ps1.getUntrackedParameter<std::vector<int> >(name);
155  }
156 
157  /*
158  std::cout << name;
159  for (unsigned int k=0; k<m_segmentation[i].size(); k++) {
160  std::cout << " [" << k << "] " << m_segmentation[i][k];
161  }
162  std::cout << std::endl;
163  */
164 
165  }
166 
167  if(he_recalibration !=0) he_recalibration->setDsegm(m_segmentation);
168  }
169 
170 
171  std::vector <std::string> toGet = iConfig.getUntrackedParameter <std::vector <std::string> > ("toGet");
172  for(std::vector <std::string>::iterator objectName = toGet.begin(); objectName != toGet.end(); ++objectName ) {
173  bool all = *objectName == "all";
174  if ((*objectName == "Pedestals") || all) {
176  findingRecord <HcalPedestalsRcd> ();
177  }
178  if ((*objectName == "PedestalWidths") || all) {
180  findingRecord <HcalPedestalWidthsRcd> ();
181  }
182  if ((*objectName == "Gains") || all) {
184  findingRecord <HcalGainsRcd> ();
185  }
186  if ((*objectName == "GainWidths") || all) {
188  findingRecord <HcalGainWidthsRcd> ();
189  }
190  if ((*objectName == "QIEData") || all) {
192  findingRecord <HcalQIEDataRcd> ();
193  }
194  if ((*objectName == "ChannelQuality") || (*objectName == "channelQuality") || all) {
196  findingRecord <HcalChannelQualityRcd> ();
197  }
198  if ((*objectName == "ElectronicsMap") || (*objectName == "electronicsMap") || all) {
200  findingRecord <HcalElectronicsMapRcd> ();
201  }
202  if ((*objectName == "ZSThresholds") || (*objectName == "zsThresholds") || all) {
204  findingRecord <HcalZSThresholdsRcd> ();
205  }
206  if ((*objectName == "RespCorrs") || (*objectName == "ResponseCorrection") || all) {
208  findingRecord <HcalRespCorrsRcd> ();
209  }
210  if ((*objectName == "LUTCorrs") || (*objectName == "LUTCorrection") || all) {
212  findingRecord <HcalLUTCorrsRcd> ();
213  }
214  if ((*objectName == "PFCorrs") || (*objectName == "PFCorrection") || all) {
216  findingRecord <HcalPFCorrsRcd> ();
217  }
218  if ((*objectName == "TimeCorrs") || (*objectName == "TimeCorrection") || all) {
220  findingRecord <HcalTimeCorrsRcd> ();
221  }
222  if ((*objectName == "L1TriggerObjects") || (*objectName == "L1Trigger") || all) {
224  findingRecord <HcalL1TriggerObjectsRcd> ();
225  }
226  if ((*objectName == "ValidationCorrs") || (*objectName == "ValidationCorrection") || all) {
228  findingRecord <HcalValidationCorrsRcd> ();
229  }
230  if ((*objectName == "LutMetadata") || (*objectName == "lutMetadata") || all) {
232  findingRecord <HcalLutMetadataRcd> ();
233  }
234  if ((*objectName == "DcsValues") || all) {
236  findingRecord <HcalDcsRcd> ();
237  }
238  if ((*objectName == "DcsMap") || (*objectName == "dcsMap") || all) {
240  findingRecord <HcalDcsMapRcd> ();
241  }
242  if ((*objectName == "RecoParams") || all) {
244  findingRecord <HcalRecoParamsRcd> ();
245  }
246  if ((*objectName == "LongRecoParams") || all) {
248  findingRecord <HcalLongRecoParamsRcd> ();
249  }
250  if ((*objectName == "ZDCLowGainFractions") || all) {
252  findingRecord <HcalZDCLowGainFractionsRcd> ();
253  }
254  if ((*objectName == "MCParams") || all) {
256  findingRecord <HcalMCParamsRcd> ();
257  }
258  if ((*objectName == "FlagHFDigiTimeParams") || all) {
260  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
261  }
262  if ((*objectName == "CholeskyMatrices") || all) {
264  findingRecord <HcalCholeskyMatricesRcd> ();
265  }
266  if ((*objectName == "CovarianceMatrices") || all) {
268  findingRecord <HcalCovarianceMatricesRcd> ();
269  }
270  }
271 }
272 
273 
275 {
276  if (he_recalibration != 0 ) delete he_recalibration;
277  if (hf_recalibration != 0 ) delete hf_recalibration;
278 }
279 
280 //
281 // member functions
282 //
283 void
285  std::string record = iKey.name ();
286  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
288 }
289 
290 std::auto_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec) {
291  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestals-> ...";
293  rec.getRecord<IdealGeometryRecord>().get(htopo);
294  const HcalTopology* topo=&(*htopo);
295 
296  std::auto_ptr<HcalPedestals> result (new HcalPedestals (topo,false));
297  std::vector <HcalGenericDetId> cells = allCells(*topo);
298  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
299  HcalPedestal item = HcalDbHardcode::makePedestal (*cell, false, iLumi);
300  result->addValues(item);
301  }
302  return result;
303 }
304 
305 std::auto_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec) {
306  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestalWidths-> ...";
308  rec.getRecord<IdealGeometryRecord>().get(htopo);
309  const HcalTopology* topo=&(*htopo);
310 
311  std::auto_ptr<HcalPedestalWidths> result (new HcalPedestalWidths (topo,false));
312  std::vector <HcalGenericDetId> cells = allCells(*htopo);
313  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
315  result->addValues(item);
316  }
317  return result;
318 }
319 
320 std::auto_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
321  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
323  rec.getRecord<IdealGeometryRecord>().get(htopo);
324  const HcalTopology* topo=&(*htopo);
325 
326  std::auto_ptr<HcalGains> result (new HcalGains (topo));
327  std::vector <HcalGenericDetId> cells = allCells(*topo);
328  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
329  HcalGain item = HcalDbHardcode::makeGain (*cell);
330  result->addValues(item);
331  }
332  return result;
333 }
334 
335 std::auto_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
336  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
338  rec.getRecord<IdealGeometryRecord>().get(htopo);
339  const HcalTopology* topo=&(*htopo);
340 
341  std::auto_ptr<HcalGainWidths> result (new HcalGainWidths (topo));
342  std::vector <HcalGenericDetId> cells = allCells(*topo);
343  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
344 
345  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
348  result->addValues(item);
349  } else if (!cell->isHcalTrigTowerDetId()) {
351  result->addValues(item);
352  }
353  }
354  return result;
355 }
356 
357 std::auto_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
358  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
359 
360  /*
361  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
362  << std::endl;
363  */
364 
366  rcd.getRecord<IdealGeometryRecord>().get(htopo);
367  const HcalTopology* topo=&(*htopo);
368 
369  std::auto_ptr<HcalQIEData> result (new HcalQIEData (topo));
370  std::vector <HcalGenericDetId> cells = allCells(*topo);
371  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
373  result->addCoder (coder);
374  }
375  return result;
376 }
377 
378 std::auto_ptr<HcalChannelQuality> HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) {
379  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ...";
381  rcd.getRecord<IdealGeometryRecord>().get(htopo);
382  const HcalTopology* topo=&(*htopo);
383 
384  std::auto_ptr<HcalChannelQuality> result (new HcalChannelQuality (topo));
385  std::vector <HcalGenericDetId> cells = allCells(*topo);
386  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
387  HcalChannelStatus item(cell->rawId(),0);
388  result->addValues(item);
389  }
390  return result;
391 }
392 
393 
394 std::auto_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) {
395  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ...";
397  rcd.getRecord<IdealGeometryRecord>().get(htopo);
398  const HcalTopology* topo=&(*htopo);
399 
400  std::auto_ptr<HcalRespCorrs> result (new HcalRespCorrs (topo));
401  std::vector <HcalGenericDetId> cells = allCells(*topo);
402  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
403 
404  double corr = 1.0;
405 
406  if ((he_recalibration != 0 ) &&
407  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
408 
409  int depth_ = HcalDetId(*cell).depth();
410  int ieta_ = HcalDetId(*cell).ieta();
411  corr = he_recalibration->getCorr(ieta_, depth_);
412 
413  /*
414  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_
415  << " corr = " << corr << std::endl;
416  */
417 
418  }
419  else if ((hf_recalibration != 0 ) &&
420  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenForward)) {
421  int depth_ = HcalDetId(*cell).depth();
422  int ieta_ = HcalDetId(*cell).ieta();
423  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
424 
425  /*
426  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_
427  << " corr = " << corr << std::endl;
428  */
429 
430  }
431 
432  HcalRespCorr item(cell->rawId(),corr);
433  result->addValues(item);
434  }
435  return result;
436 }
437 
438 std::auto_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
439  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
441  rcd.getRecord<IdealGeometryRecord>().get(htopo);
442  const HcalTopology* topo=&(*htopo);
443 
444  std::auto_ptr<HcalLUTCorrs> result (new HcalLUTCorrs (topo));
445  std::vector <HcalGenericDetId> cells = allCells(*topo);
446  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
447  HcalLUTCorr item(cell->rawId(),1.0);
448  result->addValues(item);
449  }
450  return result;
451 }
452 
453 std::auto_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
454  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
456  rcd.getRecord<IdealGeometryRecord>().get(htopo);
457  const HcalTopology* topo=&(*htopo);
458 
459  std::auto_ptr<HcalPFCorrs> result (new HcalPFCorrs (topo));
460  std::vector <HcalGenericDetId> cells = allCells(*topo);
461  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
462  HcalPFCorr item(cell->rawId(),1.0);
463  result->addValues(item);
464  }
465  return result;
466 }
467 
468 std::auto_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
469  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
471  rcd.getRecord<IdealGeometryRecord>().get(htopo);
472  const HcalTopology* topo=&(*htopo);
473 
474  std::auto_ptr<HcalTimeCorrs> result (new HcalTimeCorrs (topo));
475  std::vector <HcalGenericDetId> cells = allCells(*topo);
476  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
477  HcalTimeCorr item(cell->rawId(),0.0);
478  result->addValues(item);
479  }
480  return result;
481 }
482 
483 std::auto_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
484  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
486  rcd.getRecord<IdealGeometryRecord>().get(htopo);
487  const HcalTopology* topo=&(*htopo);
488 
489  std::auto_ptr<HcalZSThresholds> result (new HcalZSThresholds (topo));
490  std::vector <HcalGenericDetId> cells = allCells(*topo);
491  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
492  HcalZSThreshold item(cell->rawId(),0);
493  result->addValues(item);
494  }
495  return result;
496 }
497 
498 
499 std::auto_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
500  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
502  rcd.getRecord<IdealGeometryRecord>().get(htopo);
503  const HcalTopology* topo=&(*htopo);
504 
505  std::auto_ptr<HcalL1TriggerObjects> result (new HcalL1TriggerObjects (topo));
506  std::vector <HcalGenericDetId> cells = allCells(*topo);
507  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
508  HcalL1TriggerObject item(cell->rawId(),0., 1., 0);
509  result->addValues(item);
510  }
511  // add tag and algo values
512  result->setTagString("hardcoded");
513  result->setAlgoString("hardcoded");
514  return result;
515 }
516 
517 
518 
519 
520 std::auto_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
521  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
522 
523  std::auto_ptr<HcalElectronicsMap> result (new HcalElectronicsMap ());
525  return result;
526 }
527 
528 std::auto_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
529  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
531  rcd.getRecord<IdealGeometryRecord>().get(htopo);
532  const HcalTopology* topo=&(*htopo);
533 
534  std::auto_ptr<HcalValidationCorrs> result (new HcalValidationCorrs (topo));
535  std::vector <HcalGenericDetId> cells = allCells(*topo);
536  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
537  HcalValidationCorr item(cell->rawId(),1.0);
538  result->addValues(item);
539  }
540  return result;
541 }
542 
543 std::auto_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
544  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
546  rcd.getRecord<IdealGeometryRecord>().get(htopo);
547  const HcalTopology* topo=&(*htopo);
548 
549  std::auto_ptr<HcalLutMetadata> result (new HcalLutMetadata (topo));
550 
551  result->setRctLsb( 0.5 );
552  result->setNominalGain(0.003333); // for HBHE SiPMs
553 
554  std::vector <HcalGenericDetId> cells = allCells(*topo);
555  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
556 
557  /*
558  if (cell->isHcalTrigTowerDetId()) {
559  HcalTrigTowerDetId ht = HcalTrigTowerDetId(*cell);
560  int ieta = ht.ieta();
561  int iphi = ht.iphi();
562  std::cout << " HcalTrigTower cell (ieta,iphi) = "
563  << ieta << ", " << iphi << std::endl;
564  }
565  */
566 
567  HcalLutMetadatum item(cell->rawId(),1.0,1,1);
568  result->addValues(item);
569  }
570 
571  return result;
572 }
573 
574 std::auto_ptr<HcalDcsValues>
576  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
577  std::auto_ptr<HcalDcsValues> result(new HcalDcsValues);
578  return result;
579 }
580 
581 std::auto_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
582  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
583 
584  std::auto_ptr<HcalDcsMap> result (new HcalDcsMap ());
586  return result;
587 }
588 
589 std::auto_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
590  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
592  rec.getRecord<IdealGeometryRecord>().get(htopo);
593  const HcalTopology* topo=&(*htopo);
594 
595  std::auto_ptr<HcalRecoParams> result (new HcalRecoParams (topo));
596  std::vector <HcalGenericDetId> cells = allCells(*topo);
597  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
599  result->addValues(item);
600  }
601  return result;
602 }
603 std::auto_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
604  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
606  rec.getRecord<IdealGeometryRecord>().get(htopo);
607  const HcalTopology* topo=&(*htopo);
608 
609  std::auto_ptr<HcalTimingParams> result (new HcalTimingParams (topo));
610  std::vector <HcalGenericDetId> cells = allCells(*topo);
611  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
613  result->addValues(item);
614  }
615  return result;
616 }
617 std::auto_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
618  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
620  rec.getRecord<IdealGeometryRecord>().get(htopo);
621  const HcalTopology* topo=&(*htopo);
622 
623  std::auto_ptr<HcalLongRecoParams> result (new HcalLongRecoParams (topo));
624  std::vector <HcalGenericDetId> cells = allCells(*topo);
625  std::vector <unsigned int> mSignal;
626  mSignal.push_back(4);
627  mSignal.push_back(5);
628  mSignal.push_back(6);
629  std::vector <unsigned int> mNoise;
630  mNoise.push_back(1);
631  mNoise.push_back(2);
632  mNoise.push_back(3);
633  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
634  if (cell->isHcalZDCDetId())
635  {
636  HcalLongRecoParam item(cell->rawId(),mSignal,mNoise);
637  result->addValues(item);
638  }
639  }
640  return result;
641 }
642 
643 std::auto_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
644  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
646  rec.getRecord<IdealGeometryRecord>().get(htopo);
647  const HcalTopology* topo=&(*htopo);
648 
649  std::auto_ptr<HcalZDCLowGainFractions> result (new HcalZDCLowGainFractions (topo));
650  std::vector <HcalGenericDetId> cells = allCells(*topo);
651  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
652  HcalZDCLowGainFraction item(cell->rawId(),0.0);
653  result->addValues(item);
654  }
655  return result;
656 }
657 
658 std::auto_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
659 
660 
661  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
662 
663  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
665  rec.getRecord<IdealGeometryRecord>().get(htopo);
666  const HcalTopology* topo=&(*htopo);
667  std::auto_ptr<HcalMCParams> result (new HcalMCParams (topo));
668  std::vector <HcalGenericDetId> cells = allCells(*topo);
669  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
670 
671  // HcalMCParam item(cell->rawId(),0);
673  result->addValues(item);
674  }
675  return result;
676 }
677 
678 
679 std::auto_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
680  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
682  rec.getRecord<IdealGeometryRecord>().get(htopo);
683  const HcalTopology* topo=&(*htopo);
684 
685  std::auto_ptr<HcalFlagHFDigiTimeParams> result (new HcalFlagHFDigiTimeParams (topo));
686  std::vector <HcalGenericDetId> cells = allCells(*topo);
687 
688  std::vector<double> coef;
689  coef.push_back(0.93);
690  coef.push_back(-0.38275);
691  coef.push_back(-0.012667);
692 
693  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
694  HcalFlagHFDigiTimeParam item(cell->rawId(),
695  1, //firstsample
696  3, // samplestoadd
697  2, //expectedpeak
698  40., // min energy threshold
699  coef // coefficients
700  );
701  result->addValues(item);
702  }
703  return result;
704 }
705 
706 
707 std::auto_ptr<HcalCholeskyMatrices> HcalHardcodeCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rec) {
708 
710  rec.getRecord<IdealGeometryRecord>().get(htopo);
711  const HcalTopology* topo=&(*htopo);
712  std::auto_ptr<HcalCholeskyMatrices> result (new HcalCholeskyMatrices (topo));
713 
714  std::vector <HcalGenericDetId> cells = allCells(*topo);
715  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
716 
717  int sub = cell->genericSubdet();
718 
719  if (sub == HcalGenericDetId::HcalGenBarrel ||
723  HcalCholeskyMatrix item(cell->rawId());
724  result->addValues(item);
725  }
726  }
727  return result;
728 
729 }
730 std::auto_ptr<HcalCovarianceMatrices> HcalHardcodeCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rec) {
731 
733  rec.getRecord<IdealGeometryRecord>().get(htopo);
734  const HcalTopology* topo=&(*htopo);
735  std::auto_ptr<HcalCovarianceMatrices> result (new HcalCovarianceMatrices (topo));
736  std::vector <HcalGenericDetId> cells = allCells(*topo);
737  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
738 
739  HcalCovarianceMatrix item(cell->rawId());
740  result->addValues(item);
741  }
742  return result;
743 }
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:119
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)
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)
std::auto_ptr< HcalElectronicsMap > produceElectronicsMap(const HcalElectronicsMapRcd &rcd)
std::auto_ptr< HcalPFCorrs > producePFCorrs(const HcalPFCorrsRcd &rcd)
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
std::auto_ptr< HcalCovarianceMatrices > produceCovarianceMatrices(const HcalCovarianceMatricesRcd &rcd)
Geom::Phi< T > phi() const
HcalGainWidth makeGainWidth(HcalGenericDetId fId)
int maxDepthHB() const
Definition: HcalTopology.h:118
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)
std::auto_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)
HcalMCParam makeMCParam(HcalGenericDetId fId)
TimeValue_t value() const
Definition: Timestamp.h:56
HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear=false)
std::auto_ptr< HcalPedestals > producePedestals(const HcalPedestalsRcd &rcd)
std::auto_ptr< HcalL1TriggerObjects > produceL1TriggerObjects(const HcalL1TriggerObjectsRcd &rcd)