test
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 == "MCParams") || all) {
252  findingRecord <HcalMCParamsRcd> ();
253  }
254  if ((*objectName == "FlagHFDigiTimeParams") || all) {
256  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
257  }
258  if ((*objectName == "CholeskyMatrices") || all) {
260  findingRecord <HcalCholeskyMatricesRcd> ();
261  }
262  if ((*objectName == "CovarianceMatrices") || all) {
264  findingRecord <HcalCovarianceMatricesRcd> ();
265  }
266  }
267 }
268 
269 
271 {
272  if (he_recalibration != 0 ) delete he_recalibration;
273  if (hf_recalibration != 0 ) delete hf_recalibration;
274 }
275 
276 //
277 // member functions
278 //
279 void
281  std::string record = iKey.name ();
282  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
284 }
285 
286 std::auto_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec) {
287  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestals-> ...";
289  rec.getRecord<IdealGeometryRecord>().get(htopo);
290  const HcalTopology* topo=&(*htopo);
291 
292  std::auto_ptr<HcalPedestals> result (new HcalPedestals (topo,false));
293  std::vector <HcalGenericDetId> cells = allCells(*topo);
294  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
295  HcalPedestal item = HcalDbHardcode::makePedestal (*cell, false, iLumi);
296  result->addValues(item);
297  }
298  return result;
299 }
300 
301 std::auto_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec) {
302  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestalWidths-> ...";
304  rec.getRecord<IdealGeometryRecord>().get(htopo);
305  const HcalTopology* topo=&(*htopo);
306 
307  std::auto_ptr<HcalPedestalWidths> result (new HcalPedestalWidths (topo,false));
308  std::vector <HcalGenericDetId> cells = allCells(*htopo);
309  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
311  result->addValues(item);
312  }
313  return result;
314 }
315 
316 std::auto_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
317  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
319  rec.getRecord<IdealGeometryRecord>().get(htopo);
320  const HcalTopology* topo=&(*htopo);
321 
322  std::auto_ptr<HcalGains> result (new HcalGains (topo));
323  std::vector <HcalGenericDetId> cells = allCells(*topo);
324  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
325  HcalGain item = HcalDbHardcode::makeGain (*cell);
326  result->addValues(item);
327  }
328  return result;
329 }
330 
331 std::auto_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
332  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
334  rec.getRecord<IdealGeometryRecord>().get(htopo);
335  const HcalTopology* topo=&(*htopo);
336 
337  std::auto_ptr<HcalGainWidths> result (new HcalGainWidths (topo));
338  std::vector <HcalGenericDetId> cells = allCells(*topo);
339  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
340 
341  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
344  result->addValues(item);
345  } else if (!cell->isHcalTrigTowerDetId()) {
347  result->addValues(item);
348  }
349  }
350  return result;
351 }
352 
353 std::auto_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
354  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
355 
356  /*
357  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
358  << std::endl;
359  */
360 
362  rcd.getRecord<IdealGeometryRecord>().get(htopo);
363  const HcalTopology* topo=&(*htopo);
364 
365  std::auto_ptr<HcalQIEData> result (new HcalQIEData (topo));
366  std::vector <HcalGenericDetId> cells = allCells(*topo);
367  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
369  result->addCoder (coder);
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<IdealGeometryRecord>().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<IdealGeometryRecord>().get(htopo);
394  const HcalTopology* topo=&(*htopo);
395 
396  std::auto_ptr<HcalRespCorrs> result (new HcalRespCorrs (topo));
397  std::vector <HcalGenericDetId> cells = allCells(*topo);
398  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
399 
400  double corr = 1.0;
401 
402  if ((he_recalibration != 0 ) &&
403  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
404 
405  int depth_ = HcalDetId(*cell).depth();
406  int ieta_ = HcalDetId(*cell).ieta();
407  corr = he_recalibration->getCorr(ieta_, depth_);
408 
409  /*
410  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_
411  << " corr = " << corr << std::endl;
412  */
413 
414  }
415  else if ((hf_recalibration != 0 ) &&
416  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenForward)) {
417  int depth_ = HcalDetId(*cell).depth();
418  int ieta_ = HcalDetId(*cell).ieta();
419  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
420 
421  /*
422  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_
423  << " corr = " << corr << std::endl;
424  */
425 
426  }
427 
428  HcalRespCorr item(cell->rawId(),corr);
429  result->addValues(item);
430  }
431  return result;
432 }
433 
434 std::auto_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
435  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
437  rcd.getRecord<IdealGeometryRecord>().get(htopo);
438  const HcalTopology* topo=&(*htopo);
439 
440  std::auto_ptr<HcalLUTCorrs> result (new HcalLUTCorrs (topo));
441  std::vector <HcalGenericDetId> cells = allCells(*topo);
442  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
443  HcalLUTCorr item(cell->rawId(),1.0);
444  result->addValues(item);
445  }
446  return result;
447 }
448 
449 std::auto_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
450  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
452  rcd.getRecord<IdealGeometryRecord>().get(htopo);
453  const HcalTopology* topo=&(*htopo);
454 
455  std::auto_ptr<HcalPFCorrs> result (new HcalPFCorrs (topo));
456  std::vector <HcalGenericDetId> cells = allCells(*topo);
457  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
458  HcalPFCorr item(cell->rawId(),1.0);
459  result->addValues(item);
460  }
461  return result;
462 }
463 
464 std::auto_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
465  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
467  rcd.getRecord<IdealGeometryRecord>().get(htopo);
468  const HcalTopology* topo=&(*htopo);
469 
470  std::auto_ptr<HcalTimeCorrs> result (new HcalTimeCorrs (topo));
471  std::vector <HcalGenericDetId> cells = allCells(*topo);
472  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
473  HcalTimeCorr item(cell->rawId(),0.0);
474  result->addValues(item);
475  }
476  return result;
477 }
478 
479 std::auto_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
480  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
482  rcd.getRecord<IdealGeometryRecord>().get(htopo);
483  const HcalTopology* topo=&(*htopo);
484 
485  std::auto_ptr<HcalZSThresholds> result (new HcalZSThresholds (topo));
486  std::vector <HcalGenericDetId> cells = allCells(*topo);
487  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
488  HcalZSThreshold item(cell->rawId(),0);
489  result->addValues(item);
490  }
491  return result;
492 }
493 
494 
495 std::auto_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
496  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
498  rcd.getRecord<IdealGeometryRecord>().get(htopo);
499  const HcalTopology* topo=&(*htopo);
500 
501  std::auto_ptr<HcalL1TriggerObjects> result (new HcalL1TriggerObjects (topo));
502  std::vector <HcalGenericDetId> cells = allCells(*topo);
503  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
504  HcalL1TriggerObject item(cell->rawId(),0., 1., 0);
505  result->addValues(item);
506  }
507  // add tag and algo values
508  result->setTagString("hardcoded");
509  result->setAlgoString("hardcoded");
510  return result;
511 }
512 
513 
514 
515 
516 std::auto_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
517  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
518 
519  std::auto_ptr<HcalElectronicsMap> result (new HcalElectronicsMap ());
521  return result;
522 }
523 
524 std::auto_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
525  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
527  rcd.getRecord<IdealGeometryRecord>().get(htopo);
528  const HcalTopology* topo=&(*htopo);
529 
530  std::auto_ptr<HcalValidationCorrs> result (new HcalValidationCorrs (topo));
531  std::vector <HcalGenericDetId> cells = allCells(*topo);
532  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
533  HcalValidationCorr item(cell->rawId(),1.0);
534  result->addValues(item);
535  }
536  return result;
537 }
538 
539 std::auto_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
540  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
542  rcd.getRecord<IdealGeometryRecord>().get(htopo);
543  const HcalTopology* topo=&(*htopo);
544 
545  std::auto_ptr<HcalLutMetadata> result (new HcalLutMetadata (topo));
546 
547  result->setRctLsb( 0.5 );
548  result->setNominalGain(0.003333); // for HBHE SiPMs
549 
550  std::vector <HcalGenericDetId> cells = allCells(*topo);
551  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
552 
553  /*
554  if (cell->isHcalTrigTowerDetId()) {
555  HcalTrigTowerDetId ht = HcalTrigTowerDetId(*cell);
556  int ieta = ht.ieta();
557  int iphi = ht.iphi();
558  std::cout << " HcalTrigTower cell (ieta,iphi) = "
559  << ieta << ", " << iphi << std::endl;
560  }
561  */
562 
563  HcalLutMetadatum item(cell->rawId(),1.0,1,1);
564  result->addValues(item);
565  }
566 
567  return result;
568 }
569 
570 std::auto_ptr<HcalDcsValues>
572  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
573  std::auto_ptr<HcalDcsValues> result(new HcalDcsValues);
574  return result;
575 }
576 
577 std::auto_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
578  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
579 
580  std::auto_ptr<HcalDcsMap> result (new HcalDcsMap ());
582  return result;
583 }
584 
585 std::auto_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
586  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
588  rec.getRecord<IdealGeometryRecord>().get(htopo);
589  const HcalTopology* topo=&(*htopo);
590 
591  std::auto_ptr<HcalRecoParams> result (new HcalRecoParams (topo));
592  std::vector <HcalGenericDetId> cells = allCells(*topo);
593  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
595  result->addValues(item);
596  }
597  return result;
598 }
599 std::auto_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
600  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
602  rec.getRecord<IdealGeometryRecord>().get(htopo);
603  const HcalTopology* topo=&(*htopo);
604 
605  std::auto_ptr<HcalTimingParams> result (new HcalTimingParams (topo));
606  std::vector <HcalGenericDetId> cells = allCells(*topo);
607  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
609  result->addValues(item);
610  }
611  return result;
612 }
613 std::auto_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
614  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
616  rec.getRecord<IdealGeometryRecord>().get(htopo);
617  const HcalTopology* topo=&(*htopo);
618 
619  std::auto_ptr<HcalLongRecoParams> result (new HcalLongRecoParams (topo));
620  std::vector <HcalGenericDetId> cells = allCells(*topo);
621  std::vector <unsigned int> mSignal;
622  mSignal.push_back(4);
623  mSignal.push_back(5);
624  mSignal.push_back(6);
625  std::vector <unsigned int> mNoise;
626  mNoise.push_back(1);
627  mNoise.push_back(2);
628  mNoise.push_back(3);
629  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
630  if (cell->isHcalZDCDetId())
631  {
632  HcalLongRecoParam item(cell->rawId(),mSignal,mNoise);
633  result->addValues(item);
634  }
635  }
636  return result;
637 }
638 
639 std::auto_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
640 
641 
642  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
643 
644  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
646  rec.getRecord<IdealGeometryRecord>().get(htopo);
647  const HcalTopology* topo=&(*htopo);
648  std::auto_ptr<HcalMCParams> result (new HcalMCParams (topo));
649  std::vector <HcalGenericDetId> cells = allCells(*topo);
650  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
651 
652  // HcalMCParam item(cell->rawId(),0);
654  result->addValues(item);
655  }
656  return result;
657 }
658 
659 
660 std::auto_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
661  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
663  rec.getRecord<IdealGeometryRecord>().get(htopo);
664  const HcalTopology* topo=&(*htopo);
665 
666  std::auto_ptr<HcalFlagHFDigiTimeParams> result (new HcalFlagHFDigiTimeParams (topo));
667  std::vector <HcalGenericDetId> cells = allCells(*topo);
668 
669  std::vector<double> coef;
670  coef.push_back(0.93);
671  coef.push_back(-0.38275);
672  coef.push_back(-0.012667);
673 
674  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
675  HcalFlagHFDigiTimeParam item(cell->rawId(),
676  1, //firstsample
677  3, // samplestoadd
678  2, //expectedpeak
679  40., // min energy threshold
680  coef // coefficients
681  );
682  result->addValues(item);
683  }
684  return result;
685 }
686 
687 
688 std::auto_ptr<HcalCholeskyMatrices> HcalHardcodeCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rec) {
689 
691  rec.getRecord<IdealGeometryRecord>().get(htopo);
692  const HcalTopology* topo=&(*htopo);
693  std::auto_ptr<HcalCholeskyMatrices> result (new HcalCholeskyMatrices (topo));
694 
695  std::vector <HcalGenericDetId> cells = allCells(*topo);
696  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
697 
698  int sub = cell->genericSubdet();
699 
700  if (sub == HcalGenericDetId::HcalGenBarrel ||
704  HcalCholeskyMatrix item(cell->rawId());
705  result->addValues(item);
706  }
707  }
708  return result;
709 
710 }
711 std::auto_ptr<HcalCovarianceMatrices> HcalHardcodeCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rec) {
712 
714  rec.getRecord<IdealGeometryRecord>().get(htopo);
715  const HcalTopology* topo=&(*htopo);
716  std::auto_ptr<HcalCovarianceMatrices> result (new HcalCovarianceMatrices (topo));
717  std::vector <HcalGenericDetId> cells = allCells(*topo);
718  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
719 
720  HcalCovarianceMatrix item(cell->rawId());
721  result->addValues(item);
722  }
723  return result;
724 }
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)
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
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:40
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:36
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)
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)
Definition: DDAxes.h:10