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 
17 
20 
24 
26 
27 //#define DebugLog
28 
29 // class decleration
30 //
31 
32 using namespace cms;
33 
34 namespace {
35 
36  std::vector<HcalGenericDetId> allCells (const HcalTopology& hcaltopology) {
37  static std::vector<HcalGenericDetId> result;
38  int maxDepthHB=hcaltopology.maxDepthHB();
39  int maxDepthHE=hcaltopology.maxDepthHE();
40 
41 #ifdef DebugLog
42  std::cout << std::endl << "HcalHardcodeCalibrations: maxDepthHB, maxDepthHE = "
43  << maxDepthHB << ", " << maxDepthHE << std::endl;
44 #endif
45 
46  if (result.size () <= 0) {
47  for (int eta = -HcalDetId::kHcalEtaMask2;
49  for (int phi = 0; phi <= HcalDetId::kHcalPhiMask2; phi++) {
50  for (int depth = 1; depth < maxDepthHB + maxDepthHE; depth++) {
51  for (int det = 1; det <= HcalForward; det++) {
52  HcalDetId cell ((HcalSubdetector) det, eta, phi, depth);
53  if (hcaltopology.valid(cell)) {
54  result.push_back (cell);
55 #ifdef DebugLog
56  std::cout << " HcalHardcodedCalibrations: det|eta|phi|depth = "
57  << det << "|" << eta << "|" << phi << "|"
58  << depth << std::endl;
59 #endif
60  }
61  }
62  }
63  }
64  }
65  ZdcTopology zdctopology;
66  HcalZDCDetId zcell;
68  for(int depth= 1; depth < 6; depth++){
69  zcell = HcalZDCDetId(section, true, depth);
70  if(zdctopology.valid(zcell)) result.push_back(zcell);
71  zcell = HcalZDCDetId(section, false, depth);
72  if(zdctopology.valid(zcell)) result.push_back(zcell);
73  }
74  section = HcalZDCDetId::HAD;
75  for(int depth= 1; depth < 5; depth++){
76  zcell = HcalZDCDetId(section, true, depth);
77  if(zdctopology.valid(zcell)) result.push_back(zcell);
78  zcell = HcalZDCDetId(section, false, depth);
79  if(zdctopology.valid(zcell)) result.push_back(zcell);
80  }
81  section = HcalZDCDetId::LUM;
82  for(int depth= 1; depth < 3; depth++){
83  zcell = HcalZDCDetId(section, true, depth);
84  if(zdctopology.valid(zcell)) result.push_back(zcell);
85  zcell = HcalZDCDetId(section, false, depth);
86  if(zdctopology.valid(zcell)) result.push_back(zcell);
87  }
88 
89  // HcalGenTriggerTower (HcalGenericSubdetector = 5)
90  // NASTY HACK !!!
91  // - As no valid(cell) check found for HcalTrigTowerDetId
92  // to create HT cells (ieta=1-28, iphi=1-72)&(ieta=29-32, iphi=1,5,... 69)
93 
94  for (int vers=0; vers<=HcalTrigTowerDetId::kHcalVersMask; ++vers) {
98  for (int phi = 1; phi <= HcalTrigTowerDetId::kHcalPhiMask; phi++) {
99  HcalTrigTowerDetId cell(eta, phi,depth,vers);
100  if (hcaltopology.validHT(cell)) {
101  result.push_back (cell);
102 #ifdef DebugLog
103  std::cout << " HcalHardcodedCalibrations: eta|phi|depth|vers = "
104  << eta << "|" << phi << "|" << depth << "|" << vers
105  << std::endl;
106 #endif
107  }
108  }
109  }
110  }
111  }
112  }
113  return result;
114  }
115 
116 }
117 
119  he_recalibration(0), hf_recalibration(0), setHEdsegm(false), setHBdsegm(false), SipmLumi(0.0), testHFQIE10(iConfig.getParameter<bool>("testHFQIE10"))
120 {
121  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::HcalHardcodeCalibrations->...";
122 
123  if ( iConfig.exists("GainWidthsForTrigPrims") )
124  switchGainWidthsForTrigPrims = iConfig.getParameter<bool>("GainWidthsForTrigPrims");
125  else switchGainWidthsForTrigPrims = false;
126 
127 
128  // HE and HF recalibration preparation
129  iLumi = 0.;
130  if ( iConfig.exists("iLumi") )
131  iLumi=iConfig.getParameter<double>("iLumi");
132 
133  if( iLumi > 0.0 ) {
134  bool he_recalib = iConfig.getParameter<bool>("HERecalibration");
135  bool hf_recalib = iConfig.getParameter<bool>("HFRecalibration");
136  if(he_recalib) {
137  double cutoff = iConfig.getParameter<double>("HEreCalibCutoff");
138  he_recalibration = new HERecalibration(iLumi,cutoff);
139  }
140  if(hf_recalib) hf_recalibration = new HFRecalibration();
141 
142 #ifdef DebugLog
143  std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl;
144 #endif
145  }
146 
147  std::vector <std::string> toGet = iConfig.getUntrackedParameter <std::vector <std::string> > ("toGet");
148  for(std::vector <std::string>::iterator objectName = toGet.begin(); objectName != toGet.end(); ++objectName ) {
149  bool all = *objectName == "all";
150 #ifdef DebugLog
151  std::cout << "Load parameters for " << *objectName << std::endl;
152 #endif
153  if ((*objectName == "Pedestals") || all) {
155  findingRecord <HcalPedestalsRcd> ();
156  }
157  if ((*objectName == "PedestalWidths") || all) {
159  findingRecord <HcalPedestalWidthsRcd> ();
160  }
161  if ((*objectName == "Gains") || all) {
163  findingRecord <HcalGainsRcd> ();
164  }
165  if ((*objectName == "GainWidths") || all) {
167  findingRecord <HcalGainWidthsRcd> ();
168  }
169  if ((*objectName == "QIEData") || all) {
171  findingRecord <HcalQIEDataRcd> ();
172  }
173  if ((*objectName == "QIETypes") || all) {
175  findingRecord <HcalQIETypesRcd> ();
176  }
177  if ((*objectName == "ChannelQuality") || (*objectName == "channelQuality") || all) {
179  findingRecord <HcalChannelQualityRcd> ();
180  }
181  if ((*objectName == "ElectronicsMap") || (*objectName == "electronicsMap") || all) {
183  findingRecord <HcalElectronicsMapRcd> ();
184  }
185  if ((*objectName == "ZSThresholds") || (*objectName == "zsThresholds") || all) {
187  findingRecord <HcalZSThresholdsRcd> ();
188  }
189  if ((*objectName == "RespCorrs") || (*objectName == "ResponseCorrection") || all) {
191  findingRecord <HcalRespCorrsRcd> ();
192  }
193  if ((*objectName == "LUTCorrs") || (*objectName == "LUTCorrection") || all) {
195  findingRecord <HcalLUTCorrsRcd> ();
196  }
197  if ((*objectName == "PFCorrs") || (*objectName == "PFCorrection") || all) {
199  findingRecord <HcalPFCorrsRcd> ();
200  }
201  if ((*objectName == "TimeCorrs") || (*objectName == "TimeCorrection") || all) {
203  findingRecord <HcalTimeCorrsRcd> ();
204  }
205  if ((*objectName == "L1TriggerObjects") || (*objectName == "L1Trigger") || all) {
207  findingRecord <HcalL1TriggerObjectsRcd> ();
208  }
209  if ((*objectName == "ValidationCorrs") || (*objectName == "ValidationCorrection") || all) {
211  findingRecord <HcalValidationCorrsRcd> ();
212  }
213  if ((*objectName == "LutMetadata") || (*objectName == "lutMetadata") || all) {
215  findingRecord <HcalLutMetadataRcd> ();
216  }
217  if ((*objectName == "DcsValues") || all) {
219  findingRecord <HcalDcsRcd> ();
220  }
221  if ((*objectName == "DcsMap") || (*objectName == "dcsMap") || all) {
223  findingRecord <HcalDcsMapRcd> ();
224  }
225  if ((*objectName == "RecoParams") || all) {
227  findingRecord <HcalRecoParamsRcd> ();
228  }
229  if ((*objectName == "LongRecoParams") || all) {
231  findingRecord <HcalLongRecoParamsRcd> ();
232  }
233  if ((*objectName == "ZDCLowGainFractions") || all) {
235  findingRecord <HcalZDCLowGainFractionsRcd> ();
236  }
237  if ((*objectName == "MCParams") || all) {
239  findingRecord <HcalMCParamsRcd> ();
240  }
241  if ((*objectName == "FlagHFDigiTimeParams") || all) {
243  findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
244  }
245  if ((*objectName == "CholeskyMatrices") || all) {
247  findingRecord <HcalCholeskyMatricesRcd> ();
248  }
249  if ((*objectName == "CovarianceMatrices") || all) {
251  findingRecord <HcalCovarianceMatricesRcd> ();
252  }
253  }
254 }
255 
256 
258 {
259  if (he_recalibration != 0 ) delete he_recalibration;
260  if (hf_recalibration != 0 ) delete hf_recalibration;
261 }
262 
263 //
264 // member functions
265 //
266 void
268  std::string record = iKey.name ();
269  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::setIntervalFor-> key: " << record << " time: " << iTime.eventID() << '/' << iTime.time ().value ();
271 }
272 
273 std::auto_ptr<HcalPedestals> HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec) {
274  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestals-> ...";
276  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
277  const HcalTopology* topo=&(*htopo);
278 
279  std::auto_ptr<HcalPedestals> result (new HcalPedestals (topo,false));
280  std::vector <HcalGenericDetId> cells = allCells(*topo);
281  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
282  HcalPedestal item = HcalDbHardcode::makePedestal (*cell, false, iLumi);
283  result->addValues(item);
284  }
285  return result;
286 }
287 
288 std::auto_ptr<HcalPedestalWidths> HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec) {
289  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestalWidths-> ...";
291  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
292  const HcalTopology* topo=&(*htopo);
293 
294  std::auto_ptr<HcalPedestalWidths> result (new HcalPedestalWidths (topo,false));
295  std::vector <HcalGenericDetId> cells = allCells(*htopo);
296  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
298  result->addValues(item);
299  }
300  return result;
301 }
302 
303 std::auto_ptr<HcalGains> HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) {
304  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ...";
306  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
307  const HcalTopology* topo=&(*htopo);
308 
309  std::auto_ptr<HcalGains> result (new HcalGains (topo));
310  std::vector <HcalGenericDetId> cells = allCells(*topo);
311  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
312  HcalGain item = HcalDbHardcode::makeGain (*cell);
313  result->addValues(item);
314  }
315  return result;
316 }
317 
318 std::auto_ptr<HcalGainWidths> HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) {
319  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ...";
321  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
322  const HcalTopology* topo=&(*htopo);
323 
324  std::auto_ptr<HcalGainWidths> result (new HcalGainWidths (topo));
325  std::vector <HcalGenericDetId> cells = allCells(*topo);
326  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
327 
328  // for Upgrade - include TrigPrims, for regular case - only HcalDetId
331  result->addValues(item);
332  } else if (!cell->isHcalTrigTowerDetId()) {
334  result->addValues(item);
335  }
336  }
337  return result;
338 }
339 
340 std::auto_ptr<HcalQIEData> HcalHardcodeCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) {
341  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIEData-> ...";
342 
343  /*
344  std::cout << std::endl << ">>> HcalHardcodeCalibrations::produceQIEData"
345  << std::endl;
346  */
347 
349  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
350  const HcalTopology* topo=&(*htopo);
351 
352  std::auto_ptr<HcalQIEData> result (new HcalQIEData (topo));
353  std::vector <HcalGenericDetId> cells = allCells(*topo);
354  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
356  result->addCoder (coder);
357  }
358  return result;
359 }
360 
361 std::auto_ptr<HcalQIETypes> HcalHardcodeCalibrations::produceQIETypes (const HcalQIETypesRcd& rcd) {
362  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceQIETypes-> ...";
364  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
365  const HcalTopology* topo=&(*htopo);
366 
367  std::auto_ptr<HcalQIETypes> result (new HcalQIETypes (topo));
368  std::vector <HcalGenericDetId> cells = allCells(*topo);
369  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
371  result->addValues(item);
372  }
373  return result;
374 }
375 
376 std::auto_ptr<HcalChannelQuality> HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) {
377  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ...";
379  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
380  const HcalTopology* topo=&(*htopo);
381 
382  std::auto_ptr<HcalChannelQuality> result (new HcalChannelQuality (topo));
383  std::vector <HcalGenericDetId> cells = allCells(*topo);
384  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
385  HcalChannelStatus item(cell->rawId(),0);
386  result->addValues(item);
387  }
388  return result;
389 }
390 
391 
392 std::auto_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) {
393  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ...";
395  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
396  const HcalTopology* topo=&(*htopo);
397 
398  //set depth segmentation for HB/HE recalib - only happens once
399 // if((he_recalibration && !setHEdsegm) || (hb_recalibration && !setHBdsegm)){
400  if((he_recalibration && !setHEdsegm)) {
401  std::vector<std::vector<int>> m_segmentation;
402  int maxEta = topo->lastHERing();
403  m_segmentation.resize(maxEta);
404  for (int i = 0; i < maxEta; i++) {
405  topo->getDepthSegmentation(i+1,m_segmentation[i]);
406  }
408  he_recalibration->setDsegm(m_segmentation);
409  setHEdsegm = true;
410  }
411  /*
412  if(hb_recalibration && !setHBdsegm){
413  hb_recalibration->setDsegm(m_segmentation);
414  setHBdsegm = true;
415  }
416  */
417  }
418 
419  std::auto_ptr<HcalRespCorrs> result (new HcalRespCorrs (topo));
420  std::vector <HcalGenericDetId> cells = allCells(*topo);
421  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
422 
423  double corr = 1.0;
424 
425  if ((he_recalibration != 0 ) &&
426  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenEndcap)) {
427 
428  int depth_ = HcalDetId(*cell).depth();
429  int ieta_ = HcalDetId(*cell).ieta();
430  corr = he_recalibration->getCorr(ieta_, depth_);
431 
432  /*
433  std::cout << "HE ieta, depth = " << ieta_ << ", " << depth_
434  << " corr = " << corr << std::endl;
435  */
436 
437  }
438  else if ((hf_recalibration != 0 ) &&
439  ((*cell).genericSubdet() == HcalGenericDetId::HcalGenForward)) {
440  int depth_ = HcalDetId(*cell).depth();
441  int ieta_ = HcalDetId(*cell).ieta();
442  corr = hf_recalibration->getCorr(ieta_, depth_, iLumi);
443 
444  /*
445  std::cout << "HF ieta, depth = " << ieta_ << ", " << depth_
446  << " corr = " << corr << std::endl;
447  */
448 
449  }
450 
451  HcalRespCorr item(cell->rawId(),corr);
452  result->addValues(item);
453  }
454  return result;
455 }
456 
457 std::auto_ptr<HcalLUTCorrs> HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) {
458  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ...";
460  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
461  const HcalTopology* topo=&(*htopo);
462 
463  std::auto_ptr<HcalLUTCorrs> result (new HcalLUTCorrs (topo));
464  std::vector <HcalGenericDetId> cells = allCells(*topo);
465  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
466  HcalLUTCorr item(cell->rawId(),1.0);
467  result->addValues(item);
468  }
469  return result;
470 }
471 
472 std::auto_ptr<HcalPFCorrs> HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) {
473  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ...";
475  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
476  const HcalTopology* topo=&(*htopo);
477 
478  std::auto_ptr<HcalPFCorrs> result (new HcalPFCorrs (topo));
479  std::vector <HcalGenericDetId> cells = allCells(*topo);
480  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
481  HcalPFCorr item(cell->rawId(),1.0);
482  result->addValues(item);
483  }
484  return result;
485 }
486 
487 std::auto_ptr<HcalTimeCorrs> HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) {
488  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ...";
490  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
491  const HcalTopology* topo=&(*htopo);
492 
493  std::auto_ptr<HcalTimeCorrs> result (new HcalTimeCorrs (topo));
494  std::vector <HcalGenericDetId> cells = allCells(*topo);
495  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
496  HcalTimeCorr item(cell->rawId(),0.0);
497  result->addValues(item);
498  }
499  return result;
500 }
501 
502 std::auto_ptr<HcalZSThresholds> HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) {
503  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ...";
505  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
506  const HcalTopology* topo=&(*htopo);
507 
508  std::auto_ptr<HcalZSThresholds> result (new HcalZSThresholds (topo));
509  std::vector <HcalGenericDetId> cells = allCells(*topo);
510  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
511  HcalZSThreshold item(cell->rawId(),0);
512  result->addValues(item);
513  }
514  return result;
515 }
516 
517 
518 std::auto_ptr<HcalL1TriggerObjects> HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) {
519  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ...";
521  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
522  const HcalTopology* topo=&(*htopo);
523 
524  std::auto_ptr<HcalL1TriggerObjects> result (new HcalL1TriggerObjects (topo));
525  std::vector <HcalGenericDetId> cells = allCells(*topo);
526  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
527  HcalL1TriggerObject item(cell->rawId(),0., 1., 0);
528  result->addValues(item);
529  }
530  // add tag and algo values
531  result->setTagString("hardcoded");
532  result->setAlgoString("hardcoded");
533  return result;
534 }
535 
536 
537 
538 
539 std::auto_ptr<HcalElectronicsMap> HcalHardcodeCalibrations::produceElectronicsMap (const HcalElectronicsMapRcd& rcd) {
540  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceElectronicsMap-> ...";
541 
542  std::auto_ptr<HcalElectronicsMap> result (new HcalElectronicsMap ());
544  return result;
545 }
546 
547 std::auto_ptr<HcalValidationCorrs> HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) {
548  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ...";
550  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
551  const HcalTopology* topo=&(*htopo);
552 
553  std::auto_ptr<HcalValidationCorrs> result (new HcalValidationCorrs (topo));
554  std::vector <HcalGenericDetId> cells = allCells(*topo);
555  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
556  HcalValidationCorr item(cell->rawId(),1.0);
557  result->addValues(item);
558  }
559  return result;
560 }
561 
562 std::auto_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) {
563  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ...";
565  rcd.getRecord<HcalRecNumberingRecord>().get(htopo);
566  const HcalTopology* topo=&(*htopo);
567 
568  std::auto_ptr<HcalLutMetadata> result (new HcalLutMetadata (topo));
569 
570  result->setRctLsb( 0.5 );
571  result->setNominalGain(0.003333); // for HBHE SiPMs
572 
573  std::vector <HcalGenericDetId> cells = allCells(*topo);
574  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
575 
576  /*
577  if (cell->isHcalTrigTowerDetId()) {
578  HcalTrigTowerDetId ht = HcalTrigTowerDetId(*cell);
579  int ieta = ht.ieta();
580  int iphi = ht.iphi();
581  std::cout << " HcalTrigTower cell (ieta,iphi) = "
582  << ieta << ", " << iphi << std::endl;
583  }
584  */
585 
586  HcalLutMetadatum item(cell->rawId(),1.0,1,1);
587  result->addValues(item);
588  }
589 
590  return result;
591 }
592 
593 std::auto_ptr<HcalDcsValues>
595  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsValues-> ...";
596  std::auto_ptr<HcalDcsValues> result(new HcalDcsValues);
597  return result;
598 }
599 
600 std::auto_ptr<HcalDcsMap> HcalHardcodeCalibrations::produceDcsMap (const HcalDcsMapRcd& rcd) {
601  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceDcsMap-> ...";
602 
603  std::auto_ptr<HcalDcsMap> result (new HcalDcsMap ());
605  return result;
606 }
607 
608 std::auto_ptr<HcalRecoParams> HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) {
609  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ...";
611  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
612  const HcalTopology* topo=&(*htopo);
613 
614  std::auto_ptr<HcalRecoParams> result (new HcalRecoParams (topo));
615  std::vector <HcalGenericDetId> cells = allCells(*topo);
616  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
618  result->addValues(item);
619  }
620  return result;
621 }
622 std::auto_ptr<HcalTimingParams> HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) {
623  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ...";
625  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
626  const HcalTopology* topo=&(*htopo);
627 
628  std::auto_ptr<HcalTimingParams> result (new HcalTimingParams (topo));
629  std::vector <HcalGenericDetId> cells = allCells(*topo);
630  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
632  result->addValues(item);
633  }
634  return result;
635 }
636 std::auto_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) {
637  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ...";
639  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
640  const HcalTopology* topo=&(*htopo);
641 
642  std::auto_ptr<HcalLongRecoParams> result (new HcalLongRecoParams (topo));
643  std::vector <HcalGenericDetId> cells = allCells(*topo);
644  std::vector <unsigned int> mSignal;
645  mSignal.push_back(4);
646  mSignal.push_back(5);
647  mSignal.push_back(6);
648  std::vector <unsigned int> mNoise;
649  mNoise.push_back(1);
650  mNoise.push_back(2);
651  mNoise.push_back(3);
652  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
653  if (cell->isHcalZDCDetId())
654  {
655  HcalLongRecoParam item(cell->rawId(),mSignal,mNoise);
656  result->addValues(item);
657  }
658  }
659  return result;
660 }
661 
662 std::auto_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
663  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
665  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
666  const HcalTopology* topo=&(*htopo);
667 
668  std::auto_ptr<HcalZDCLowGainFractions> result (new HcalZDCLowGainFractions (topo));
669  std::vector <HcalGenericDetId> cells = allCells(*topo);
670  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
671  HcalZDCLowGainFraction item(cell->rawId(),0.0);
672  result->addValues(item);
673  }
674  return result;
675 }
676 
677 std::auto_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {
678 
679 
680  // std::cout << std::endl << " .... HcalHardcodeCalibrations::produceMCParams ->"<< std::endl;
681 
682  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ...";
684  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
685  const HcalTopology* topo=&(*htopo);
686  std::auto_ptr<HcalMCParams> result (new HcalMCParams (topo));
687  std::vector <HcalGenericDetId> cells = allCells(*topo);
688  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
689 
690  // HcalMCParam item(cell->rawId(),0);
692  result->addValues(item);
693  }
694  return result;
695 }
696 
697 
698 std::auto_ptr<HcalFlagHFDigiTimeParams> HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) {
699  edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ...";
701  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
702  const HcalTopology* topo=&(*htopo);
703 
704  std::auto_ptr<HcalFlagHFDigiTimeParams> result (new HcalFlagHFDigiTimeParams (topo));
705  std::vector <HcalGenericDetId> cells = allCells(*topo);
706 
707  std::vector<double> coef;
708  coef.push_back(0.93);
709  coef.push_back(-0.38275);
710  coef.push_back(-0.012667);
711 
712  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
713  HcalFlagHFDigiTimeParam item(cell->rawId(),
714  1, //firstsample
715  3, // samplestoadd
716  2, //expectedpeak
717  40., // min energy threshold
718  coef // coefficients
719  );
720  result->addValues(item);
721  }
722  return result;
723 }
724 
725 
726 std::auto_ptr<HcalCholeskyMatrices> HcalHardcodeCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rec) {
727 
729  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
730  const HcalTopology* topo=&(*htopo);
731  std::auto_ptr<HcalCholeskyMatrices> result (new HcalCholeskyMatrices (topo));
732 
733  std::vector <HcalGenericDetId> cells = allCells(*topo);
734  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
735 
736  int sub = cell->genericSubdet();
737 
738  if (sub == HcalGenericDetId::HcalGenBarrel ||
742  HcalCholeskyMatrix item(cell->rawId());
743  result->addValues(item);
744  }
745  }
746  return result;
747 
748 }
749 std::auto_ptr<HcalCovarianceMatrices> HcalHardcodeCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rec) {
750 
752  rec.getRecord<HcalRecNumberingRecord>().get(htopo);
753  const HcalTopology* topo=&(*htopo);
754  std::auto_ptr<HcalCovarianceMatrices> result (new HcalCovarianceMatrices (topo));
755  std::vector <HcalGenericDetId> cells = allCells(*topo);
756  for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {
757 
758  HcalCovarianceMatrix item(cell->rawId());
759  result->addValues(item);
760  }
761  return result;
762 }
763 
766  desc.add<double>("iLumi",-1.);
767  desc.add<bool>("HERecalibration",false);
768  desc.add<double>("HEreCalibCutoff",20.);
769  desc.add<bool>("HFRecalibration",false);
770  desc.add<bool>("GainWidthsForTrigPrims",false);
771  desc.add<bool>("testHFQIE10",false);
772  desc.addUntracked<std::vector<std::string>>("toGet",std::vector<std::string>());
773  desc.addUntracked<bool>("fromDDD",false);
774 
775  descriptions.addDefault(desc);
776 }
std::auto_ptr< HcalZDCLowGainFractions > produceZDCLowGainFractions(const HcalZDCLowGainFractionsRcd &rcd)
std::auto_ptr< HcalPedestalWidths > producePedestalWidths(const HcalPedestalWidthsRcd &rcd)
static const int kHcalVersMask
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
HcalHardcodeCalibrations(const edm::ParameterSet &)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
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
HcalQIEType makeQIEType(HcalGenericDetId fId, bool testHFQIE10)
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::auto_ptr< HcalLutMetadata > produceLutMetadata(const HcalLutMetadataRcd &rcd)
double maxEta
std::auto_ptr< HcalZSThresholds > produceZSThresholds(const HcalZSThresholdsRcd &rcd)
double getCorr(int ieta, int idepth)
static const int kHcalEtaMask
void makeHardcodeMap(HcalElectronicsMap &emap)
std::auto_ptr< HcalDcsValues > produceDcsValues(const HcalDcsRcd &rcd)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
tuple result
Definition: mps_fire.py:83
HcalQIECoder makeQIECoder(HcalGenericDetId fId)
HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId)
std::auto_ptr< HcalChannelQuality > produceChannelQuality(const HcalChannelQualityRcd &rcd)
std::auto_ptr< HcalTimeCorrs > produceTimeCorrs(const HcalTimeCorrsRcd &rcd)
void makeHardcodeDcsMap(HcalDcsMap &dcs_map)
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
std::auto_ptr< HcalTimingParams > produceTimingParams(const HcalTimingParamsRcd &rcd)
std::auto_ptr< HcalRecoParams > produceRecoParams(const HcalRecoParamsRcd &rcd)
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:25
void addDefault(ParameterSetDescription const &psetDescription)
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()
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalDepthMask
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HcalRecoParam makeRecoParam(HcalGenericDetId fId)
std::auto_ptr< HcalRespCorrs > produceRespCorrs(const HcalRespCorrsRcd &rcd)
JetCorrectorParameters corr
Definition: classes.h:5
std::auto_ptr< HcalLongRecoParams > produceLongRecoParams(const HcalLongRecoParamsRcd &rcd)
static const int kHcalPhiMask
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
void getDepthSegmentation(unsigned ring, std::vector< int > &readoutDepths) const
std::auto_ptr< HcalElectronicsMap > produceElectronicsMap(const HcalElectronicsMapRcd &rcd)
std::auto_ptr< HcalPFCorrs > producePFCorrs(const HcalPFCorrsRcd &rcd)
std::auto_ptr< HcalQIETypes > produceQIETypes(const HcalQIETypesRcd &rcd)
virtual bool valid(const DetId &id) const
std::auto_ptr< HcalCovarianceMatrices > produceCovarianceMatrices(const HcalCovarianceMatricesRcd &rcd)
Geom::Phi< T > phi() const
HcalGainWidth makeGainWidth(HcalGenericDetId fId)
int maxDepthHB() const
Definition: HcalTopology.h:128
std::auto_ptr< HcalMCParams > produceMCParams(const HcalMCParamsRcd &rcd)
static const int kHcalEtaMask2
Definition: HcalDetId.h:20
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
const Timestamp & time() const
Definition: IOVSyncValue.h:44
tuple cout
Definition: gather_cfg.py:145
std::auto_ptr< HcalFlagHFDigiTimeParams > produceFlagHFDigiTimeParams(const HcalFlagHFDigiTimeParamsRcd &rcd)
std::auto_ptr< HcalCholeskyMatrices > produceCholeskyMatrices(const HcalCholeskyMatricesRcd &rcd)
std::auto_ptr< HcalGainWidths > produceGainWidths(const HcalGainWidthsRcd &rcd)
volatile std::atomic< bool > shutdown_flag false
std::auto_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)
HcalMCParam makeMCParam(HcalGenericDetId fId)
TimeValue_t value() const
Definition: Timestamp.h:56
int lastHERing() const
Definition: HcalTopology.h:86
HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear=false)
std::auto_ptr< HcalPedestals > producePedestals(const HcalPedestalsRcd &rcd)
std::auto_ptr< HcalL1TriggerObjects > produceL1TriggerObjects(const HcalL1TriggerObjectsRcd &rcd)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool validHT(const HcalTrigTowerDetId &id) const