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