CMS 3D CMS Logo

EcalTrivialConditionRetriever.cc
Go to the documentation of this file.
1 //
2 // Created: 2 Mar 2006
3 // Shahram Rahatlou, University of Rome & INFN
4 //
5 #include <iostream>
6 #include <fstream>
7 #include "TRandom3.h"
8 
13 
20 
21 //#include "DataFormats/Provenance/interface/Timestamp.h"
22 
26 
27 using namespace edm;
28 
30  std::string path = "CalibCalorimetry/EcalTrivialCondModules/data/";
31 
32  /*since CMSSW_10_6_0, this path points to https://github.com/cms-data/CalibCalorimetry-EcalTrivialCondModules (extra package).
33 To modify the default values :
34 $ git clone https://github.com/cms-data/CalibCalorimetry-EcalTrivialCondModules.git
35 $ cd CalibCalorimetry-EcalTrivialCondModules
36 $ modify what you want
37 $ git commit -a
38 $ git remote add ModifyCalibCalorimetryExtraPackage git@github.com:yourName/CalibCalorimetry-EcalTrivialCondModules
39 $ git push ModifyCalibCalorimetryExtraPackage master:building-calibCalorimetry-extra-package
40 
41 other solution : change this path name to work directly in afs, ex. :
42 
43  std::string path="CalibCalorimetry/EcalTrivialCondModules/data_test/";
44 
45  */
46 
47  // initialize parameters used to produce cond DB objects
48  totLumi_ = ps.getUntrackedParameter<double>("TotLumi", 0.0);
49  instLumi_ = ps.getUntrackedParameter<double>("InstLumi", 0.0);
50 
51  // initilize parameters used to produce cond DB objects
52  adcToGeVEBConstant_ = ps.getUntrackedParameter<double>("adcToGeVEBConstant", 0.035);
53  adcToGeVEEConstant_ = ps.getUntrackedParameter<double>("adcToGeVEEConstant", 0.060);
54 
55  intercalibConstantMeanMC_ = ps.getUntrackedParameter<double>("intercalibConstantMeanMC", 1.0);
56  intercalibConstantSigmaMC_ = ps.getUntrackedParameter<double>("intercalibConstantSigmaMC", 0.0);
57 
58  linCorrMean_ = ps.getUntrackedParameter<double>("linCorrMean", 1.0);
59  linCorrSigma_ = ps.getUntrackedParameter<double>("linCorrSigma", 0.0);
60 
61  linearTime1_ = (unsigned long)atoi(ps.getUntrackedParameter<std::string>("linearTime1", "1").c_str());
62  linearTime2_ = (unsigned long)atoi(ps.getUntrackedParameter<std::string>("linearTime2", "0").c_str());
63  linearTime3_ = (unsigned long)atoi(ps.getUntrackedParameter<std::string>("linearTime3", "0").c_str());
64 
65  intercalibConstantMean_ = ps.getUntrackedParameter<double>("intercalibConstantMean", 1.0);
66  intercalibConstantSigma_ = ps.getUntrackedParameter<double>("intercalibConstantSigma", 0.0);
67  intercalibErrorMean_ = ps.getUntrackedParameter<double>("IntercalibErrorMean", 0.0);
68 
69  timeCalibConstantMean_ = ps.getUntrackedParameter<double>("timeCalibConstantMean", 0.0);
70  timeCalibConstantSigma_ = ps.getUntrackedParameter<double>("timeCalibConstantSigma", 0.0);
71  timeCalibErrorMean_ = ps.getUntrackedParameter<double>("timeCalibErrorMean", 0.0);
72 
73  timeOffsetEBConstant_ = ps.getUntrackedParameter<double>("timeOffsetEBConstant", 0.0);
74  timeOffsetEEConstant_ = ps.getUntrackedParameter<double>("timeOffsetEEConstant", 0.0);
75 
76  laserAlphaMean_ = ps.getUntrackedParameter<double>("laserAlphaMean", 1.55);
77  laserAlphaSigma_ = ps.getUntrackedParameter<double>("laserAlphaSigma", 0);
78 
79  laserAPDPNTime1_ = (unsigned long)atoi(ps.getUntrackedParameter<std::string>("laserAPDPNTime1", "1").c_str());
80  laserAPDPNTime2_ = (unsigned long)atoi(ps.getUntrackedParameter<std::string>("laserAPDPNTime2", "0").c_str());
81  laserAPDPNTime3_ = (unsigned long)atoi(ps.getUntrackedParameter<std::string>("laserAPDPNTime3", "0").c_str());
82 
83  laserAPDPNRefMean_ = ps.getUntrackedParameter<double>("laserAPDPNRefMean", 1.0);
84  laserAPDPNRefSigma_ = ps.getUntrackedParameter<double>("laserAPDPNRefSigma", 0.0);
85 
86  laserAPDPNMean_ = ps.getUntrackedParameter<double>("laserAPDPNMean", 1.0);
87  laserAPDPNSigma_ = ps.getUntrackedParameter<double>("laserAPDPNSigma", 0.0);
88 
89  pfRecHitThresholdsNSigmas_ = ps.getUntrackedParameter<double>("EcalPFRecHitThresholdNSigmas", 1.0);
90  pfRecHitThresholdsNSigmasHEta_ = ps.getUntrackedParameter<double>("EcalPFRecHitThresholdNSigmasHEta", 1.0);
91  pfRecHitThresholdsEB_ = ps.getUntrackedParameter<double>("EcalPFRecHitThresholdEB", 0.0);
92  pfRecHitThresholdsEE_ = ps.getUntrackedParameter<double>("EcalPFRecHitThresholdEE", 0.0);
93 
94  localContCorrParameters_ =
95  ps.getUntrackedParameter<std::vector<double> >("localContCorrParameters", std::vector<double>(0));
96  crackCorrParameters_ = ps.getUntrackedParameter<std::vector<double> >("crackCorrParameters", std::vector<double>(0));
97  energyCorrectionParameters_ =
98  ps.getUntrackedParameter<std::vector<double> >("energyCorrectionParameters", std::vector<double>(0));
99  energyUncertaintyParameters_ =
100  ps.getUntrackedParameter<std::vector<double> >("energyUncertaintyParameters", std::vector<double>(0));
101  energyCorrectionObjectSpecificParameters_ = ps.getUntrackedParameter<std::vector<double> >(
102  "energyCorrectionObjectSpecificParameters", std::vector<double>(0));
103 
104  EBpedMeanX12_ = ps.getUntrackedParameter<double>("EBpedMeanX12", 200.);
105  EBpedRMSX12_ = ps.getUntrackedParameter<double>("EBpedRMSX12", 1.10);
106  EBpedMeanX6_ = ps.getUntrackedParameter<double>("EBpedMeanX6", 200.);
107  EBpedRMSX6_ = ps.getUntrackedParameter<double>("EBpedRMSX6", 0.90);
108  EBpedMeanX1_ = ps.getUntrackedParameter<double>("EBpedMeanX1", 200.);
109  EBpedRMSX1_ = ps.getUntrackedParameter<double>("EBpedRMSX1", 0.62);
110 
111  EEpedMeanX12_ = ps.getUntrackedParameter<double>("EEpedMeanX12", 200.);
112  EEpedRMSX12_ = ps.getUntrackedParameter<double>("EEpedRMSX12", 2.50);
113  EEpedMeanX6_ = ps.getUntrackedParameter<double>("EEpedMeanX6", 200.);
114  EEpedRMSX6_ = ps.getUntrackedParameter<double>("EEpedRMSX6", 2.00);
115  EEpedMeanX1_ = ps.getUntrackedParameter<double>("EEpedMeanX1", 200.);
116  EEpedRMSX1_ = ps.getUntrackedParameter<double>("EEpedRMSX1", 1.40);
117 
118  gainRatio12over6_ = ps.getUntrackedParameter<double>("gainRatio12over6", 2.0);
119  gainRatio6over1_ = ps.getUntrackedParameter<double>("gainRatio6over1", 6.0);
120 
121  getWeightsFromFile_ = ps.getUntrackedParameter<bool>("getWeightsFromFile", false);
122 
123  sampleMaskEB_ = ps.getUntrackedParameter<unsigned int>("sampleMaskEB", 1023);
124  sampleMaskEE_ = ps.getUntrackedParameter<unsigned int>("sampleMaskEB", 1023);
125 
126  EBtimeCorrAmplitudeBins_ =
127  ps.getUntrackedParameter<std::vector<double> >("EBtimeCorrAmplitudeBins", std::vector<double>());
128  EBtimeCorrShiftBins_ = ps.getUntrackedParameter<std::vector<double> >("EBtimeCorrShiftBins", std::vector<double>());
129  EEtimeCorrAmplitudeBins_ =
130  ps.getUntrackedParameter<std::vector<double> >("EEtimeCorrAmplitudeBins", std::vector<double>());
131  EEtimeCorrShiftBins_ = ps.getUntrackedParameter<std::vector<double> >("EEtimeCorrShiftBins", std::vector<double>());
132 
133  EBG12samplesCorrelation_ =
134  ps.getUntrackedParameter<std::vector<double> >("EBG12samplesCorrelation", std::vector<double>());
135  EBG6samplesCorrelation_ =
136  ps.getUntrackedParameter<std::vector<double> >("EBG6samplesCorrelation", std::vector<double>());
137  EBG1samplesCorrelation_ =
138  ps.getUntrackedParameter<std::vector<double> >("EBG1samplesCorrelation", std::vector<double>());
139  EEG12samplesCorrelation_ =
140  ps.getUntrackedParameter<std::vector<double> >("EEG12samplesCorrelation", std::vector<double>());
141  EEG6samplesCorrelation_ =
142  ps.getUntrackedParameter<std::vector<double> >("EEG6samplesCorrelation", std::vector<double>());
143  EEG1samplesCorrelation_ =
144  ps.getUntrackedParameter<std::vector<double> >("EEG1samplesCorrelation", std::vector<double>());
145 
146  sim_pulse_shape_EB_thresh_ = ps.getParameter<double>("sim_pulse_shape_EB_thresh");
147  sim_pulse_shape_EE_thresh_ = ps.getParameter<double>("sim_pulse_shape_EE_thresh");
148  sim_pulse_shape_APD_thresh_ = ps.getParameter<double>("sim_pulse_shape_APD_thresh");
149 
150  sim_pulse_shape_TI_ = ps.getUntrackedParameter<double>("sim_pulse_shape_TI", 1.0);
151 
152  nTDCbins_ = 1;
153 
154  weightsForAsynchronousRunning_ = ps.getUntrackedParameter<bool>("weightsForTB", false);
155 
156  edm::LogInfo(" EcalTrivialConditionRetriever ");
157 
158  if (totLumi_ > 0) {
159  edm::LogInfo(" EcalTrivialConditionRetriever going to create conditions based on the damage due to ")
160  << totLumi_ << " fb-1 integrated luminosity";
161  }
162 
163  if (weightsForAsynchronousRunning_) {
164  getWeightsFromFile_ = true; //override user request
165  //nTDCbins_ = 25;
166  nTDCbins_ = 50; //modif Alex-21-07-2006
167  }
168 
169  std::string weightType;
170  std::ostringstream str;
171 
172  if (!weightsForAsynchronousRunning_)
173  str << "_CMS.txt";
174  else
175  str << "_TB.txt";
176 
177  weightType = str.str();
178 
179  amplWeightsFile_ = ps.getUntrackedParameter<std::string>("amplWeightsFile", path + "ampWeights" + weightType);
180  amplWeightsAftFile_ =
181  ps.getUntrackedParameter<std::string>("amplWeightsAftFile", path + "ampWeightsAfterGainSwitch" + weightType);
182  pedWeightsFile_ = ps.getUntrackedParameter<std::string>("pedWeightsFile", path + "pedWeights" + weightType);
183  pedWeightsAftFile_ =
184  ps.getUntrackedParameter<std::string>("pedWeightsAftFile", path + "pedWeightsAfterGainSwitch" + weightType);
185  jittWeightsFile_ = ps.getUntrackedParameter<std::string>("jittWeightsFile", path + "timeWeights" + weightType);
186  jittWeightsAftFile_ =
187  ps.getUntrackedParameter<std::string>("jittWeightsAftFile", path + "timeWeightsAfterGainSwitch" + weightType);
188  chi2MatrixFile_ = ps.getUntrackedParameter<std::string>("chi2MatrixFile", path + "chi2Matrix" + weightType);
189  chi2MatrixAftFile_ =
190  ps.getUntrackedParameter<std::string>("chi2MatrixAftFile", path + "chi2MatrixAfterGainSwitch" + weightType);
191 
192  amplWeights_.resize(nTDCbins_);
193  amplWeightsAft_.resize(nTDCbins_);
194  pedWeights_.resize(nTDCbins_);
195  pedWeightsAft_.resize(nTDCbins_);
196  jittWeights_.resize(nTDCbins_);
197  jittWeightsAft_.resize(nTDCbins_);
198  chi2Matrix_.resize(nTDCbins_);
199  chi2MatrixAft_.resize(nTDCbins_);
200 
201  // default weights for MGPA shape after pedestal subtraction
202  getWeightsFromConfiguration(ps);
203 
204  producedEcalPedestals_ = ps.getUntrackedParameter<bool>("producedEcalPedestals", true);
205  producedEcalWeights_ = ps.getUntrackedParameter<bool>("producedEcalWeights", true);
206 
207  producedEcalGainRatios_ = ps.getUntrackedParameter<bool>("producedEcalGainRatios", true);
208  producedEcalADCToGeVConstant_ = ps.getUntrackedParameter<bool>("producedEcalADCToGeVConstant", true);
209 
210  producedEcalMappingElectronics_ = ps.getUntrackedParameter<bool>("producedEcalMappingElectronics", true);
211  mappingFile_ = ps.getUntrackedParameter<std::string>("mappingFile", "");
212 
213  if (producedEcalMappingElectronics_) {
214  if (!mappingFile_.empty()) { // if file provided read channel map
216  } else {
218  }
219  findingRecord<EcalMappingElectronicsRcd>();
220  }
221  // Alignment from file
222  getEBAlignmentFromFile_ = ps.getUntrackedParameter<bool>("getEBAlignmentFromFile", false);
223  if (getEBAlignmentFromFile_) {
224  EBAlignmentFile_ = ps.getUntrackedParameter<std::string>("EBAlignmentFile", path + "EBAlignment.txt");
225  }
226 
227  getEEAlignmentFromFile_ = ps.getUntrackedParameter<bool>("getEEAlignmentFromFile", false);
228  if (getEEAlignmentFromFile_) {
229  EEAlignmentFile_ = ps.getUntrackedParameter<std::string>("EEAlignmentFile", path + "EEAlignment.txt");
230  }
231 
232  getESAlignmentFromFile_ = ps.getUntrackedParameter<bool>("getESAlignmentFromFile", false);
233  if (getESAlignmentFromFile_)
234  ESAlignmentFile_ = ps.getUntrackedParameter<std::string>("ESAlignmentFile", path + "ESAlignment.txt");
235 
236  verbose_ = ps.getUntrackedParameter<int>("verbose", 0);
237 
238  //Tell Producer what we produce
239  //setWhatproduce(this);
240  if (producedEcalPedestals_)
242 
243  if (producedEcalWeights_) {
246  }
247 
248  if (producedEcalGainRatios_)
250 
251  if (producedEcalADCToGeVConstant_)
253 
254  // TimeOffsetConstant
255  producedEcalTimeOffsetConstant_ = ps.getUntrackedParameter<bool>("producedEcalTimeOffsetConstant", true);
256  //std::cout << " EcalTrivialConditionRetriever : producedEcalTimeOffsetConstant_" << producedEcalTimeOffsetConstant_ << std::endl;
257  if (producedEcalTimeOffsetConstant_) {
259  findingRecord<EcalTimeOffsetConstantRcd>();
260  }
261 
262  // linear corrections
263  producedEcalLinearCorrections_ = ps.getUntrackedParameter<bool>("producedEcalLinearCorrections", true);
264  linearCorrectionsFile_ = ps.getUntrackedParameter<std::string>("linearCorrectionsFile", "");
265 
266  if (producedEcalLinearCorrections_) { // user asks to produce constants
267  if (!linearCorrectionsFile_.empty()) { // if file provided read constants
269  } else { // set all constants to 1. or smear as specified by user
271  }
272  findingRecord<EcalLinearCorrectionsRcd>();
273  }
274 
275  // intercalibration constants
276  producedEcalIntercalibConstants_ = ps.getUntrackedParameter<bool>("producedEcalIntercalibConstants", true);
277  intercalibConstantsFile_ = ps.getUntrackedParameter<std::string>("intercalibConstantsFile", "");
278 
279  intercalibConstantsMCFile_ = ps.getUntrackedParameter<std::string>("intercalibConstantsMCFile", "");
280 
281  if (producedEcalIntercalibConstants_) { // user asks to produce constants
282  if (!intercalibConstantsFile_.empty()) { // if file provided read constants
284  } else { // set all constants to 1. or smear as specified by user
286  }
287  findingRecord<EcalIntercalibConstantsRcd>();
288  }
289  // MC intercalibrations
290  producedEcalIntercalibConstantsMC_ = ps.getUntrackedParameter<bool>("producedEcalIntercalibConstantsMC", true);
291 
292  if (producedEcalIntercalibConstantsMC_) { // user asks to produce constants
293  if (!intercalibConstantsMCFile_.empty()) { // if file provided read constants
295  } else { // set all constants to 1. or smear as specified by user
297  }
298  findingRecord<EcalIntercalibConstantsMCRcd>();
299  }
300 
301  // intercalibration constants
302  producedEcalIntercalibErrors_ = ps.getUntrackedParameter<bool>("producedEcalIntercalibErrors", true);
303  intercalibErrorsFile_ = ps.getUntrackedParameter<std::string>("intercalibErrorsFile", "");
304 
305  if (producedEcalIntercalibErrors_) { // user asks to produce constants
306  if (!intercalibErrorsFile_.empty()) { // if file provided read constants
308  } else { // set all constants to 1. or smear as specified by user
310  }
311  findingRecord<EcalIntercalibErrorsRcd>();
312  }
313 
314  // time calibration constants
315  producedEcalTimeCalibConstants_ = ps.getUntrackedParameter<bool>("producedEcalTimeCalibConstants", true);
316  timeCalibConstantsFile_ = ps.getUntrackedParameter<std::string>("timeCalibConstantsFile", "");
317 
318  if (producedEcalTimeCalibConstants_) { // user asks to produce constants
319  if (!timeCalibConstantsFile_.empty()) { // if file provided read constants
321  } else { // set all constants to 1. or smear as specified by user
323  }
324  findingRecord<EcalTimeCalibConstantsRcd>();
325  }
326 
327  // time calibration constants
328  producedEcalTimeCalibErrors_ = ps.getUntrackedParameter<bool>("producedEcalTimeCalibErrors", true);
329  timeCalibErrorsFile_ = ps.getUntrackedParameter<std::string>("timeCalibErrorsFile", "");
330 
331  if (producedEcalTimeCalibErrors_) { // user asks to produce constants
332  if (!timeCalibErrorsFile_.empty()) { // if file provided read constants
334  } else { // set all constants to 1. or smear as specified by user
336  }
337  findingRecord<EcalTimeCalibErrorsRcd>();
338  }
339 
340  // sim pulse shape
341  getSimPulseShapeFromFile_ = ps.getUntrackedParameter<bool>("getSimPulseShapeFromFile", false);
342  producedEcalSimPulseShape_ = ps.getUntrackedParameter<bool>("producedEcalSimPulseShape", true);
343  EBSimPulseShapeFile_ = ps.getUntrackedParameter<std::string>("EBSimPulseShapeFile", "");
344  EESimPulseShapeFile_ = ps.getUntrackedParameter<std::string>("EESimPulseShapeFile", "");
345  APDSimPulseShapeFile_ = ps.getUntrackedParameter<std::string>("APDSimPulseShapeFile", "");
346 
347  if (producedEcalSimPulseShape_) { // user asks to produce constants
349  findingRecord<EcalSimPulseShapeRcd>();
350  }
351 
352  producedEcalPFRecHitThresholds_ = ps.getUntrackedParameter<bool>("producedEcalPFRecHitThresholds", false);
353 
354  // new for PFRecHit Thresholds
355  pfRecHitFile_ = ps.getUntrackedParameter<std::string>("pFRecHitFile", path + "EB_thresholds_-1.txt");
356  pfRecHitFileEE_ = ps.getUntrackedParameter<std::string>("pFRecHitFileEE", path + "EE_thresholds_-1.txt");
357 
358  if (producedEcalPFRecHitThresholds_) { // user asks to produce constants
359  if (!pfRecHitFile_.empty()) { // if file provided read constants
361  } else { // set all constants to 0
363  }
364  findingRecord<EcalPFRecHitThresholdsRcd>();
365  }
366 
367  // cluster corrections
368  producedEcalClusterLocalContCorrParameters_ =
369  ps.getUntrackedParameter<bool>("producedEcalClusterLocalContCorrParameters", false);
370  producedEcalClusterCrackCorrParameters_ =
371  ps.getUntrackedParameter<bool>("producedEcalClusterCrackCorrParameters", false);
372  producedEcalClusterEnergyCorrectionParameters_ =
373  ps.getUntrackedParameter<bool>("producedEcalClusterEnergyCorrectionParameters", false);
374  producedEcalClusterEnergyUncertaintyParameters_ =
375  ps.getUntrackedParameter<bool>("producedEcalClusterEnergyUncertaintyParameters", false);
376  producedEcalClusterEnergyCorrectionObjectSpecificParameters_ =
377  ps.getUntrackedParameter<bool>("producedEcalClusterEnergyCorrectionObjectSpecificParameters", false);
378  if (producedEcalClusterLocalContCorrParameters_) {
380  findingRecord<EcalClusterLocalContCorrParametersRcd>();
381  }
382  if (producedEcalClusterCrackCorrParameters_) {
384  findingRecord<EcalClusterCrackCorrParametersRcd>();
385  }
386  if (producedEcalClusterEnergyCorrectionParameters_) {
388  findingRecord<EcalClusterEnergyCorrectionParametersRcd>();
389  }
390  if (producedEcalClusterEnergyUncertaintyParameters_) {
392  findingRecord<EcalClusterEnergyUncertaintyParametersRcd>();
393  }
394  if (producedEcalClusterEnergyCorrectionObjectSpecificParameters_) {
396  findingRecord<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>();
397  }
398 
399  // laser correction
400  producedEcalLaserCorrection_ = ps.getUntrackedParameter<bool>("producedEcalLaserCorrection", false);
401  if (producedEcalLaserCorrection_) { // user asks to produce constants
402  // set all constants to 1. or smear as specified by user
404  findingRecord<EcalLaserAlphasRcd>();
405  getLaserAlphaFromFileEB_ = ps.getUntrackedParameter<bool>("getLaserAlphaFromFileEB", false);
406  getLaserAlphaFromFileEE_ = ps.getUntrackedParameter<bool>("getLaserAlphaFromFileEE", false);
407  getLaserAlphaFromTypeEB_ = ps.getUntrackedParameter<bool>("getLaserAlphaFromTypeEB", false);
408  getLaserAlphaFromTypeEE_ = ps.getUntrackedParameter<bool>("getLaserAlphaFromTypeEE", false);
409  edm::LogInfo(" getLaserAlphaFromFileEB_ ") << getLaserAlphaFromFileEB_;
410  edm::LogInfo(" getLaserAlphaFromFileEE_ ") << getLaserAlphaFromFileEE_;
411  edm::LogInfo(" getLaserAlphaFromTypeEB_ ") << getLaserAlphaFromTypeEB_;
412  edm::LogInfo(" getLaserAlphaFromTypeEE_ ") << getLaserAlphaFromTypeEE_;
413  if (getLaserAlphaFromFileEB_) {
414  EBLaserAlphaFile_ = ps.getUntrackedParameter<std::string>(
415  "EBLaserAlphaFile", path + "EBLaserAlpha.txt"); // file is used to read the alphas
416  }
417  if (getLaserAlphaFromFileEE_) {
418  EELaserAlphaFile_ = ps.getUntrackedParameter<std::string>(
419  "EELaserAlphaFile", path + "EELaserAlpha.txt"); // file is used to read the alphas
420  }
421  if (getLaserAlphaFromTypeEB_) {
422  laserAlphaMeanEBR_ = ps.getUntrackedParameter<double>("laserAlphaMeanEBR", 1.55); // alpha russian crystals in EB
423  laserAlphaMeanEBC_ = ps.getUntrackedParameter<double>("laserAlphaMeanEBC", 1.00); // alpha chinese crystals in EB
424  EBLaserAlphaFile_ = ps.getUntrackedParameter<std::string>(
425  "EBLaserAlphaFile", path + "EBLaserAlpha.txt"); // file to find out which one is russian/chinese
426  }
427  if (getLaserAlphaFromTypeEE_) {
428  laserAlphaMeanEEC_higheta_ = ps.getUntrackedParameter<double>("laserAlphaMeanEEC_higheta",
429  1.00); // alpha chinese crystals in EE for eta>2.5
430  laserAlphaMeanEER_higheta_ = ps.getUntrackedParameter<double>("laserAlphaMeanEER_higheta",
431  1.16); // alpha russian crystals in EE for eta>2
432  laserAlphaMeanEER_ = ps.getUntrackedParameter<double>("laserAlphaMeanEER", 1.16); // alpha russian crystals in EE
433  laserAlphaMeanEEC_ = ps.getUntrackedParameter<double>("laserAlphaMeanEEC", 1.00); // alpha chinese crystals in EE
434  EELaserAlphaFile_ = ps.getUntrackedParameter<std::string>(
435  "EELaserAlphaFile", path + "EELaserAlpha.txt"); // file is used to find out which one is russian or chinese
436  EELaserAlphaFile2_ = ps.getUntrackedParameter<std::string>(
437  "EELaserAlphaFile2", path + "EELaserAlpha2.txt"); // file is used to read the alphas
438  }
440  findingRecord<EcalLaserAPDPNRatiosRefRcd>();
442  findingRecord<EcalLaserAPDPNRatiosRcd>();
443  }
444 
445  // channel status
446  producedEcalChannelStatus_ = ps.getUntrackedParameter<bool>("producedEcalChannelStatus", true);
447  channelStatusFile_ = ps.getUntrackedParameter<std::string>("channelStatusFile", "");
448 
449  if (producedEcalChannelStatus_) {
450  if (!channelStatusFile_.empty()) { // if file provided read channel map
452  } else { // set all channels to working -- FIXME might be changed
454  }
455  findingRecord<EcalChannelStatusRcd>();
456  }
457  // DQM channel status
458  producedEcalDQMChannelStatus_ = ps.getUntrackedParameter<bool>("producedEcalDQMChannelStatus", true);
459  if (producedEcalDQMChannelStatus_) {
461  findingRecord<EcalDQMChannelStatusRcd>();
462  }
463  // DCS Tower status
464  producedEcalDCSTowerStatus_ = ps.getUntrackedParameter<bool>("producedEcalDCSTowerStatus", true);
465  if (producedEcalDCSTowerStatus_) {
467  findingRecord<EcalDCSTowerStatusRcd>();
468  }
469  // DAQ Tower status
470  producedEcalDAQTowerStatus_ = ps.getUntrackedParameter<bool>("producedEcalDAQTowerStatus", true);
471  if (producedEcalDAQTowerStatus_) {
473  findingRecord<EcalDAQTowerStatusRcd>();
474  }
475  // DQM Tower status
476  producedEcalDQMTowerStatus_ = ps.getUntrackedParameter<bool>("producedEcalDQMTowerStatus", true);
477  if (producedEcalDQMTowerStatus_) {
479  findingRecord<EcalDQMTowerStatusRcd>();
480  }
481 
482  // trigger channel status
483  producedEcalTrgChannelStatus_ = ps.getUntrackedParameter<bool>("producedEcalTrgChannelStatus", true);
484  trgChannelStatusFile_ = ps.getUntrackedParameter<std::string>("trgChannelStatusFile", "");
485 
486  if (producedEcalTrgChannelStatus_) {
487  if (!trgChannelStatusFile_.empty()) { // if file provided read channel map
489  } else { // set all channels to working -- FIXME might be changed
491  }
492  findingRecord<EcalTPGCrystalStatusRcd>();
493  }
494 
495  // Alignment
496  producedEcalAlignmentEB_ = ps.getUntrackedParameter<bool>("producedEcalAlignmentEB", true);
497  if (producedEcalAlignmentEB_) {
499  findingRecord<EBAlignmentRcd>();
500  }
501  producedEcalAlignmentEE_ = ps.getUntrackedParameter<bool>("producedEcalAlignmentEE", true);
502  if (producedEcalAlignmentEE_) {
504  findingRecord<EEAlignmentRcd>();
505  }
506  producedEcalAlignmentES_ = ps.getUntrackedParameter<bool>("producedEcalAlignmentES", true);
507  if (producedEcalAlignmentES_) {
509  findingRecord<ESAlignmentRcd>();
510  }
511  //Tell Finder what records we find
512  if (producedEcalPedestals_)
513  findingRecord<EcalPedestalsRcd>();
514 
515  if (producedEcalWeights_) {
516  findingRecord<EcalWeightXtalGroupsRcd>();
517  findingRecord<EcalTBWeightsRcd>();
518  }
519 
520  if (producedEcalGainRatios_)
521  findingRecord<EcalGainRatiosRcd>();
522 
523  if (producedEcalADCToGeVConstant_)
524  findingRecord<EcalADCToGeVConstantRcd>();
525 
526  producedEcalSampleMask_ = ps.getUntrackedParameter<bool>("producedEcalSampleMask", true);
527  if (producedEcalSampleMask_) {
529  findingRecord<EcalSampleMaskRcd>();
530  }
531  producedEcalTimeBiasCorrections_ = ps.getUntrackedParameter<bool>("producedEcalTimeBiasCorrections", false);
532  if (producedEcalTimeBiasCorrections_) {
534  findingRecord<EcalTimeBiasCorrectionsRcd>();
535  }
536  producedEcalSamplesCorrelation_ = ps.getUntrackedParameter<bool>("producedEcalSamplesCorrelation", false);
537  if (producedEcalSamplesCorrelation_) {
539  findingRecord<EcalSamplesCorrelationRcd>();
540  getSamplesCorrelationFromFile_ = ps.getUntrackedParameter<bool>("getSamplesCorrelationFromFile", false);
541  if (getSamplesCorrelationFromFile_) {
542  SamplesCorrelationFile_ =
543  ps.getUntrackedParameter<std::string>("SamplesCorrelationFile", "EcalSamplesCorrelation.txt");
544  }
545  }
546 }
547 
549 
550 //
551 // member functions
552 //
554  const edm::IOVSyncValue& iTime,
555  edm::ValidityInterval& oValidity) {
556  if (verbose_ >= 1)
557  edm::LogInfo("EcalTrivialConditionRetriever::setIntervalFor(): record key = ")
558  << rk.name() << "\ttime: " << iTime.time().value();
559  //For right now, we will just use an infinite interval of validity
561 }
562 
563 //produce methods
565  auto peds = std::make_unique<EcalPedestals>();
566  EcalPedestals::Item EBitem;
567  EcalPedestals::Item EEitem;
568 
569  EBitem.mean_x1 = EBpedMeanX1_;
570  EBitem.rms_x1 = EBpedRMSX1_;
571  EBitem.mean_x6 = EBpedMeanX6_;
572  EBitem.rms_x6 = EBpedRMSX6_;
573  EBitem.mean_x12 = EBpedMeanX12_;
574  EBitem.rms_x12 = EBpedRMSX12_;
575 
576  EEitem.mean_x1 = EEpedMeanX1_;
577  EEitem.rms_x1 = EEpedRMSX1_;
578  EEitem.mean_x6 = EEpedMeanX6_;
579  EEitem.rms_x6 = EEpedRMSX6_;
580  EEitem.mean_x12 = EEpedMeanX12_;
581  EEitem.rms_x12 = EEpedRMSX12_;
582 
583  for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) {
584  if (iEta == 0)
585  continue;
586 
587  if (totLumi_ > 0) {
588  double eta = EBDetId::approxEta(EBDetId(iEta, 1));
589 
590  EnergyResolutionVsLumi ageing;
591  ageing.setLumi(totLumi_);
592  ageing.setInstLumi(instLumi_);
593  eta = fabs(eta);
594  double noisefactor = ageing.calcnoiseIncreaseADC(eta);
595 
596  EBitem.rms_x1 = EBpedRMSX1_ * noisefactor;
597  EBitem.rms_x6 = EBpedRMSX6_ * noisefactor;
598  EBitem.rms_x12 = EBpedRMSX12_ * noisefactor;
599  edm::LogInfo("rms ped at eta:") << eta << " =" << EBitem.rms_x12;
600  }
601 
602  for (int iPhi = EBDetId::MIN_IPHI; iPhi <= EBDetId::MAX_IPHI; ++iPhi) {
603  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
604  if (EBDetId::validDetId(iEta, iPhi)) {
605  EBDetId ebdetid(iEta, iPhi);
606  peds->insert(std::make_pair(ebdetid.rawId(), EBitem));
607  }
608  }
609  }
610 
611  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
612  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
613  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
614  if (EEDetId::validDetId(iX, iY, 1)) {
615  EEDetId eedetidpos(iX, iY, 1);
616  peds->insert(std::make_pair(eedetidpos.rawId(), EEitem));
617  }
618  if (EEDetId::validDetId(iX, iY, -1)) {
619  EEDetId eedetidneg(iX, iY, -1);
620  peds->insert(std::make_pair(eedetidneg.rawId(), EEitem));
621  }
622  }
623  }
624 
625  //return std::unique_ptr<EcalPedestals>( peds );
626  return peds;
627 }
628 
630  const EcalWeightXtalGroupsRcd&) {
631  auto xtalGroups = std::make_unique<EcalWeightXtalGroups>();
632  EcalXtalGroupId defaultGroupId(1);
633  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
634  if (ieta == 0)
635  continue;
636  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
637  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
638  if (EBDetId::validDetId(ieta, iphi)) {
639  EBDetId ebid(ieta, iphi);
640  // xtalGroups->setValue(ebid.rawId(), EcalXtalGroupId(ieta) ); // define rings in eta
641  xtalGroups->setValue(ebid.rawId(), defaultGroupId); // define rings in eta
642  }
643  }
644  }
645 
646  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
647  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
648  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
649  if (EEDetId::validDetId(iX, iY, 1)) {
650  EEDetId eedetidpos(iX, iY, 1);
651  xtalGroups->setValue(eedetidpos.rawId(), defaultGroupId);
652  }
653  if (EEDetId::validDetId(iX, iY, -1)) {
654  EEDetId eedetidneg(iX, iY, -1);
655  xtalGroups->setValue(eedetidneg.rawId(), defaultGroupId);
656  }
657  }
658  }
659  return xtalGroups;
660 }
661 
662 std::unique_ptr<EcalLinearCorrections> EcalTrivialConditionRetriever::produceEcalLinearCorrections(
663  const EcalLinearCorrectionsRcd&) {
664  auto ical = std::make_unique<EcalLinearCorrections>();
665 
666  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
667  if (ieta == 0)
668  continue;
669  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
670  if (EBDetId::validDetId(ieta, iphi)) {
671  EBDetId ebid(ieta, iphi);
672  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
673 
675  pairAPDPN.p1 = linCorrMean_ + r * linCorrSigma_;
676  pairAPDPN.p2 = linCorrMean_ + r * linCorrSigma_;
677  pairAPDPN.p3 = linCorrMean_ + r * linCorrSigma_;
678  ical->setValue(ebid, pairAPDPN);
679  }
680  }
681  }
682 
683  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
684  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
685  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
686  if (EEDetId::validDetId(iX, iY, 1)) {
687  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
688  EEDetId eedetidpos(iX, iY, 1);
689 
691  pairAPDPN.p1 = linCorrMean_ + r * linCorrSigma_;
692  pairAPDPN.p2 = linCorrMean_ + r * linCorrSigma_;
693  pairAPDPN.p3 = linCorrMean_ + r * linCorrSigma_;
694 
695  ical->setValue(eedetidpos, pairAPDPN);
696  }
697 
698  if (EEDetId::validDetId(iX, iY, -1)) {
699  double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
700  EEDetId eedetidneg(iX, iY, -1);
701 
703  pairAPDPN.p1 = linCorrMean_ + r1 * linCorrSigma_;
704  pairAPDPN.p2 = linCorrMean_ + r1 * linCorrSigma_;
705  pairAPDPN.p3 = linCorrMean_ + r1 * linCorrSigma_;
706 
707  ical->setValue(eedetidneg, pairAPDPN);
708  }
709  }
710  }
711 
713  // for(int i=1; i<=92; i++){
714  for (int i = 0; i < 92; i++) {
715  TimeStamp.t1 = Timestamp(linearTime1_);
716  if (linearTime2_ == 0) {
717  TimeStamp.t2 = Timestamp(edm::Timestamp::endOfTime().value());
718  } else {
719  TimeStamp.t2 = Timestamp(linearTime2_);
720  }
721  if (linearTime3_ == 0) {
722  TimeStamp.t3 = Timestamp(edm::Timestamp::endOfTime().value());
723  } else {
724  TimeStamp.t3 = Timestamp(linearTime3_);
725  }
726 
727  ical->setTime(i, TimeStamp);
728  }
729 
730  return ical;
731 }
732 
733 // new for the PF Rec Hit Thresholds
734 
735 std::unique_ptr<EcalPFRecHitThresholds> EcalTrivialConditionRetriever::produceEcalPFRecHitThresholds(
736  const EcalPFRecHitThresholdsRcd&) {
737  auto ical = std::make_unique<EcalPFRecHitThresholds>();
738 
739  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
740  if (ieta == 0)
741  continue;
742  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
743  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
744  if (EBDetId::validDetId(ieta, iphi)) {
745  EBDetId ebid(ieta, iphi);
746  ical->setValue(ebid.rawId(), pfRecHitThresholdsEB_);
747  }
748  }
749  }
750 
751  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
752  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
753  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
754  if (EEDetId::validDetId(iX, iY, 1)) {
755  EEDetId eedetidpos(iX, iY, 1);
756  ical->setValue(eedetidpos.rawId(), pfRecHitThresholdsEE_);
757  }
758  if (EEDetId::validDetId(iX, iY, -1)) {
759  EEDetId eedetidneg(iX, iY, -1);
760  ical->setValue(eedetidneg.rawId(), pfRecHitThresholdsEE_);
761  }
762  }
763  }
764 
765  return ical;
766 }
767 
768 //------------------------------
769 
770 std::unique_ptr<EcalIntercalibConstants> EcalTrivialConditionRetriever::produceEcalIntercalibConstants(
772  auto ical = std::make_unique<EcalIntercalibConstants>();
773 
774  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
775  if (ieta == 0)
776  continue;
777  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
778  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
779  if (EBDetId::validDetId(ieta, iphi)) {
780  EBDetId ebid(ieta, iphi);
781  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
782  ical->setValue(ebid.rawId(), intercalibConstantMean_ + r * intercalibConstantSigma_);
783  }
784  }
785  }
786 
787  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
788  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
789  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
790  if (EEDetId::validDetId(iX, iY, 1)) {
791  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
792  EEDetId eedetidpos(iX, iY, 1);
793  ical->setValue(eedetidpos.rawId(), intercalibConstantMean_ + r * intercalibConstantSigma_);
794  }
795  if (EEDetId::validDetId(iX, iY, -1)) {
796  double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
797  EEDetId eedetidneg(iX, iY, -1);
798  ical->setValue(eedetidneg.rawId(), intercalibConstantMean_ + r1 * intercalibConstantSigma_);
799  }
800  }
801  }
802 
803  return ical;
804 }
805 
806 std::unique_ptr<EcalIntercalibConstantsMC> EcalTrivialConditionRetriever::produceEcalIntercalibConstantsMC(
808  auto ical = std::make_unique<EcalIntercalibConstantsMC>();
809 
810  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
811  if (ieta == 0)
812  continue;
813  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
814  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
815  if (EBDetId::validDetId(ieta, iphi)) {
816  EBDetId ebid(ieta, iphi);
817  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
818  ical->setValue(ebid.rawId(), intercalibConstantMeanMC_ + r * intercalibConstantSigmaMC_);
819  }
820  }
821  }
822 
823  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
824  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
825  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
826  if (EEDetId::validDetId(iX, iY, 1)) {
827  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
828  EEDetId eedetidpos(iX, iY, 1);
829  ical->setValue(eedetidpos.rawId(), intercalibConstantMeanMC_ + r * intercalibConstantSigmaMC_);
830  }
831  if (EEDetId::validDetId(iX, iY, -1)) {
832  double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
833  EEDetId eedetidneg(iX, iY, -1);
834  ical->setValue(eedetidneg.rawId(), intercalibConstantMeanMC_ + r1 * intercalibConstantSigmaMC_);
835  }
836  }
837  }
838 
839  return ical;
840 }
841 
843  const EcalIntercalibErrorsRcd&) {
844  auto ical = std::make_unique<EcalIntercalibErrors>();
845 
846  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
847  if (ieta == 0)
848  continue;
849  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
850  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
851  if (EBDetId::validDetId(ieta, iphi)) {
852  EBDetId ebid(ieta, iphi);
853  ical->setValue(ebid.rawId(), intercalibErrorMean_);
854  }
855  }
856  }
857 
858  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
859  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
860  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
861  if (EEDetId::validDetId(iX, iY, 1)) {
862  EEDetId eedetidpos(iX, iY, 1);
863  ical->setValue(eedetidpos.rawId(), intercalibErrorMean_);
864  }
865  if (EEDetId::validDetId(iX, iY, -1)) {
866  EEDetId eedetidneg(iX, iY, -1);
867  ical->setValue(eedetidneg.rawId(), intercalibErrorMean_);
868  }
869  }
870  }
871 
872  return ical;
873 }
874 
875 std::unique_ptr<EcalTimeCalibConstants> EcalTrivialConditionRetriever::produceEcalTimeCalibConstants(
876  const EcalTimeCalibConstantsRcd&) {
877  auto ical = std::make_unique<EcalTimeCalibConstants>();
878 
879  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
880  if (ieta == 0)
881  continue;
882  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
883  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
884  if (EBDetId::validDetId(ieta, iphi)) {
885  EBDetId ebid(ieta, iphi);
886  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
887  ical->setValue(ebid.rawId(), timeCalibConstantMean_ + r * timeCalibConstantSigma_);
888  }
889  }
890  }
891 
892  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
893  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
894  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
895  if (EEDetId::validDetId(iX, iY, 1)) {
896  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
897  EEDetId eedetidpos(iX, iY, 1);
898  ical->setValue(eedetidpos.rawId(), timeCalibConstantMean_ + r * timeCalibConstantSigma_);
899  }
900  if (EEDetId::validDetId(iX, iY, -1)) {
901  double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
902  EEDetId eedetidneg(iX, iY, -1);
903  ical->setValue(eedetidneg.rawId(), timeCalibConstantMean_ + r1 * timeCalibConstantSigma_);
904  }
905  }
906  }
907 
908  return ical;
909 }
910 
912  const EcalTimeCalibErrorsRcd&) {
913  auto ical = std::make_unique<EcalTimeCalibErrors>();
914 
915  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
916  if (ieta == 0)
917  continue;
918  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
919  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
920  if (EBDetId::validDetId(ieta, iphi)) {
921  EBDetId ebid(ieta, iphi);
922  ical->setValue(ebid.rawId(), timeCalibErrorMean_);
923  }
924  }
925  }
926 
927  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
928  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
929  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
930  if (EEDetId::validDetId(iX, iY, 1)) {
931  EEDetId eedetidpos(iX, iY, 1);
932  ical->setValue(eedetidpos.rawId(), timeCalibErrorMean_);
933  }
934  if (EEDetId::validDetId(iX, iY, -1)) {
935  EEDetId eedetidneg(iX, iY, -1);
936  ical->setValue(eedetidneg.rawId(), timeCalibErrorMean_);
937  }
938  }
939  }
940 
941  return ical;
942 }
943 
944 std::unique_ptr<EcalTimeOffsetConstant> EcalTrivialConditionRetriever::produceEcalTimeOffsetConstant(
945  const EcalTimeOffsetConstantRcd&) {
946  edm::LogInfo(" produceEcalTimeOffsetConstant: ");
947  edm::LogInfo(" EB ") << timeOffsetEBConstant_ << " EE " << timeOffsetEEConstant_;
948  return std::make_unique<EcalTimeOffsetConstant>(timeOffsetEBConstant_, timeOffsetEEConstant_);
949 }
950 
952  auto gratio = std::make_unique<EcalGainRatios>();
954  gr.setGain12Over6(gainRatio12over6_);
955  gr.setGain6Over1(gainRatio6over1_);
956 
957  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
958  if (ieta == 0)
959  continue;
960  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
961  if (EBDetId::validDetId(ieta, iphi)) {
962  EBDetId ebid(ieta, iphi);
963  gratio->setValue(ebid.rawId(), gr);
964  }
965  }
966  }
967 
968  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
969  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
970  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
971  if (EEDetId::validDetId(iX, iY, 1)) {
972  EEDetId eedetidpos(iX, iY, 1);
973  gratio->setValue(eedetidpos.rawId(), gr);
974  }
975  if (EEDetId::validDetId(iX, iY, -1)) {
976  EEDetId eedetidneg(iX, iY, -1);
977  gratio->setValue(eedetidneg.rawId(), gr);
978  }
979  }
980  }
981 
982  return gratio;
983 }
984 
986  const EcalADCToGeVConstantRcd&) {
987  return std::make_unique<EcalADCToGeVConstant>(adcToGeVEBConstant_, adcToGeVEEConstant_);
988 }
989 
991  // create weights for the test-beam
992  auto tbwgt = std::make_unique<EcalTBWeights>();
993 
994  // create weights for each distinct group ID
995  // int nMaxTDC = 10;
996  // for(int igrp=-EBDetId::MAX_IETA; igrp<=EBDetId::MAX_IETA; ++igrp) {
997  // if(igrp==0) continue;
998  int igrp = 1;
999  for (int itdc = 1; itdc <= nTDCbins_; ++itdc) {
1000  // generate random number
1001  // double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
1002 
1003  // make a new set of weights
1004  EcalWeightSet wgt;
1005  //typedef std::vector< std::vector<EcalWeight> > EcalWeightSet::EcalWeightMatrix;
1008 
1009  // if(verbose_>=1) {
1010  // std::cout << "initial size of mat1: " << mat1.size() << std::endl;
1011  // std::cout << "initial size of mat2: " << mat2.size() << std::endl;
1012  // }
1013 
1014  // generate random numbers to use as weights
1029  // use values provided by user
1030  mat1.Place_in_row(amplWeights_[itdc - 1], 0, 0);
1031  mat1.Place_in_row(pedWeights_[itdc - 1], 1, 0);
1032  mat1.Place_in_row(jittWeights_[itdc - 1], 2, 0);
1033 
1034  // wdights after gain switch
1035  mat2.Place_in_row(amplWeightsAft_[itdc - 1], 0, 0);
1036  mat2.Place_in_row(pedWeightsAft_[itdc - 1], 1, 0);
1037  mat2.Place_in_row(jittWeightsAft_[itdc - 1], 2, 0);
1038 
1039  // fill the chi2 matrcies with random numbers
1040  // r = (double)std::rand()/( double(RAND_MAX)+double(1) );
1043  mat3 = chi2Matrix_[itdc - 1];
1044  mat4 = chi2MatrixAft_[itdc - 1];
1045 
1046  // for(size_t i=0; i<10; ++i)
1047  // {
1048  // mat3.push_back(chi2Matrix_[itdc-1][i]);
1049  // mat4.push_back(chi2MatrixAft_[itdc-1][i]);
1050  // }
1051  // std::vector<EcalWeight> tv1, tv2;
1052  // for(size_t j=0; j<10; ++j) {
1053  // double ww = igrp*itdc*r + i*10. + j;
1054  // tv1.push_back( EcalWeight(1000+ww) );
1055  // tv2.push_back( EcalWeight(1000+100+ww) );
1056  // }
1057 
1058  // if(verbose_>=1) {
1059  // std::cout << "group: " << igrp << " TDC: " << itdc
1060  // << " mat1: " << mat1.size() << " mat2: " << mat2.size()
1061  // << " mat3: " << mat3.size() << " mat4: " << mat4.size()
1062  // << std::endl;
1063  // }
1064 
1065  // put the weight in the container
1066  tbwgt->setValue(std::make_pair(igrp, itdc), wgt);
1067  }
1068  // }
1069  return tbwgt;
1070 }
1071 
1072 // cluster functions/corrections
1073 std::unique_ptr<EcalClusterLocalContCorrParameters>
1075  auto ipar = std::make_unique<EcalClusterLocalContCorrParameters>();
1076  for (size_t i = 0; i < localContCorrParameters_.size(); ++i) {
1077  ipar->params().push_back(localContCorrParameters_[i]);
1078  }
1079  return ipar;
1080 }
1081 std::unique_ptr<EcalClusterCrackCorrParameters> EcalTrivialConditionRetriever::produceEcalClusterCrackCorrParameters(
1083  auto ipar = std::make_unique<EcalClusterCrackCorrParameters>();
1084  for (size_t i = 0; i < crackCorrParameters_.size(); ++i) {
1085  ipar->params().push_back(crackCorrParameters_[i]);
1086  }
1087  return ipar;
1088 }
1089 std::unique_ptr<EcalClusterEnergyCorrectionParameters>
1092  auto ipar = std::make_unique<EcalClusterEnergyCorrectionParameters>();
1093  for (size_t i = 0; i < energyCorrectionParameters_.size(); ++i) {
1094  ipar->params().push_back(energyCorrectionParameters_[i]);
1095  }
1096  return ipar;
1097 }
1098 std::unique_ptr<EcalClusterEnergyUncertaintyParameters>
1101  auto ipar = std::make_unique<EcalClusterEnergyUncertaintyParameters>();
1102  for (size_t i = 0; i < energyUncertaintyParameters_.size(); ++i) {
1103  ipar->params().push_back(energyUncertaintyParameters_[i]);
1104  }
1105  return ipar;
1106 }
1107 std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
1110  auto ipar = std::make_unique<EcalClusterEnergyCorrectionObjectSpecificParameters>();
1111  for (size_t i = 0; i < energyCorrectionObjectSpecificParameters_.size(); ++i) {
1112  ipar->params().push_back(energyCorrectionObjectSpecificParameters_[i]);
1113  }
1114  return ipar;
1115 }
1116 
1117 /*
1118 // laser records
1119 std::unique_ptr<EcalLaserAlphas>
1120 EcalTrivialConditionRetriever::produceEcalLaserAlphas( const EcalLaserAlphasRcd& )
1121 {
1122 
1123  std::cout << " produceEcalLaserAlphas " << std::endl;
1124  auto ical = std::make_unique<EcalLaserAlphas>();
1125 
1126  // get Barrel alpha from type
1127  if(getLaserAlphaFromTypeEB_) {
1128  std::ifstream fEB(edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1129  int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1130  15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1131  // check!
1132  int SMCal[36] = {12,17,10, 1, 8, 4,27,20,23,25, 6,34,35,15,18,30,21, 9,
1133  24,22,13,31,26,16, 2,11, 5, 0,29,28,14,33,32, 3, 7,19};
1134 
1135  for(int SMcons = 0; SMcons < 36; SMcons++) {
1136  int SM = SMpos[SMcons];
1137  if(SM < 0) SM = 17 + abs(SM);
1138  else SM--;
1139  if(SMCal[SM] != SMcons)
1140  std::cout << " SM pb : read SM " << SMcons<< " SMpos " << SM
1141  << " SMCal " << SMCal[SM] << std::endl;
1142  }
1143 
1144  std::string type, batch;
1145  int readSM, pos, bar, bar2;
1146  float alpha = 0;
1147  for(int SMcons = 0; SMcons < 36; SMcons++) {
1148  int SM = SMpos[SMcons];
1149  for(int ic = 0; ic < 1700; ic++) {
1150  fEB >> readSM >> pos >> bar >> bar2 >> type >> batch;
1151 
1152  if(readSM != SMcons || pos != ic + 1)
1153  std::cout << " barrel read pb read SM " << readSM << " const SM " << SMcons
1154  << " read pos " << pos << " ic " << ic << std::endl;
1155  if(SM < 0) SM = 18 + abs(SM);
1156  EBDetId ebdetid(SM, pos, EBDetId::SMCRYSTALMODE);
1157  if(bar == 33101 || bar == 30301 )
1158  alpha = laserAlphaMeanEBR_;
1159  else if(bar == 33106) {
1160  if(bar2 <= 2000)
1161  alpha = laserAlphaMeanEBC_;
1162  else {
1163  std::cout << " problem with barcode first " << bar << " last " << bar2
1164  << " read SM " << readSM << " read pos " << pos << std::endl;
1165  alpha = laserAlphaMeanEBR_;
1166  }
1167  }
1168  ical->setValue( ebdetid, alpha );
1169 
1170  if( ic==1650 ){
1171  std::cout << " ic/alpha "<<ic<<"/"<<alpha<<std::endl;
1172  }
1173 
1174  }
1175  } // loop over SMcons
1176  fEB.close();
1177  // end laserAlpha from type
1178  } else if(getLaserAlphaFromFileEB_) {
1179  // laser alpha from file
1180  std::cout <<"Laser alpha for EB will be taken from File"<<std::endl;
1181  int ieta, iphi;
1182  float alpha;
1183  std::ifstream fEB(edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1184  // std::ifstream fEB(EBLaserAlphaFile_.c_str());
1185  for(int ic = 0; ic < 61200; ic++) {
1186  fEB >> ieta>> iphi>>alpha;
1187 
1188  if (EBDetId::validDetId(ieta,iphi)) {
1189  EBDetId ebid(ieta,iphi);
1190  ical->setValue( ebid, alpha );
1191  std::cout << " ieta/iphi/alpha "<<ieta<<"/"<<iphi<<"/"<<alpha<<std::endl;
1192  }
1193  if( ieta==10 ){
1194  std::cout << "I will print some alphas from the file... ieta/iphi/alpha "<<ieta<<"/"<<iphi<<"/"<<alpha<<std::endl;
1195  }
1196  }
1197  fEB.close();
1198 
1199  } else {
1200  // laser alpha from mean and smearing
1201  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
1202  if(ieta==0) continue;
1203  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId::MAX_IPHI; ++iphi) {
1204  if (EBDetId::validDetId(ieta,iphi)) {
1205  EBDetId ebid(ieta,iphi);
1206  double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
1207  ical->setValue( ebid, laserAlphaMean_ + r*laserAlphaSigma_ );
1208  }
1209  } // loop over iphi
1210  } // loop over ieta
1211  } // do not read a file
1212 
1213  std::cout << " produceEcalLaserAlphas EE" << std::endl;
1214  if(getLaserAlphaFromTypeEE_) {
1215  std::ifstream fEE(edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1216 
1217  for(int crystal = 0; crystal < 14648; crystal++) {
1218  int x, y ,z, bid, bar, bar2;
1219  float LY, alpha = 0;
1220  fEE >> z >> x >> y >> LY >> bid >> bar >> bar2;
1221  if(x < 1 || x > 100 || y < 1 || y > 100)
1222  std::cout << " wrong coordinates for barcode " << bar
1223  << " x " << x << " y " << y << " z " << z << std::endl;
1224  else {
1225  if(bar == 33201 || (bar == 30399 && bar2 < 568))
1226  alpha = laserAlphaMeanEER_;
1227  else if((bar == 33106 && bar2 > 2000 && bar2 < 4669)
1228  || (bar == 30399 && bar2 > 567))
1229  alpha = laserAlphaMeanEEC_;
1230  else {
1231  std::cout << " problem with barcode " << bar << " " << bar2
1232  << " x " << x << " y " << y << " z " << z << std::endl;
1233  alpha = laserAlphaMeanEER_;
1234  }
1235  }
1236  if (EEDetId::validDetId(x, y, z)) {
1237  EEDetId eedetidpos(x, y, z);
1238  ical->setValue( eedetidpos, alpha );
1239  }
1240  else // should not occur
1241  std::cout << " problem with EEDetId " << " x " << x << " y " << y << " z " << z << std::endl;
1242  }
1243  fEE.close();
1244 
1245  // end laserAlpha from type EE
1246 
1247  } else if (getLaserAlphaFromFileEE_) {
1248 
1249  std::ifstream fEE(edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1250 
1251  for(int crystal = 0; crystal < 14648; crystal++) {
1252  int x, y ,z;
1253  float alpha = 1;
1254  fEE >> z >> x >> y >> alpha;
1255  if(x < 1 || x > 100 || y < 1 || y > 100 || z==0 || z>1 || z<-1 ) {
1256  std::cout << "ERROR: wrong coordinates for crystal "
1257  << " x " << x << " y " << y << " z " << z << std::endl;
1258  std::cout << " the format of the file should be z x y alpha " << std::endl;
1259  } else {
1260  if (EEDetId::validDetId(x, y, z)) {
1261  EEDetId eedetidpos(x, y, z);
1262  ical->setValue( eedetidpos, alpha );
1263  }
1264  else // should not occur
1265  std::cout << " problem with EEDetId " << " x " << x << " y " << y << " z " << z << std::endl;
1266  }
1267  }
1268  fEE.close();
1269 
1270  // end laser alpha from file EE
1271  } else {
1272  // alphas from python config file
1273  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
1274  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
1275  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
1276  if (EEDetId::validDetId(iX,iY,1)) {
1277  double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
1278  EEDetId eedetidpos(iX,iY,1);
1279  ical->setValue( eedetidpos, laserAlphaMean_ + r*laserAlphaSigma_ );
1280  }
1281  if (EEDetId::validDetId(iX,iY,-1)) {
1282  double r1 = (double)std::rand()/( double(RAND_MAX)+double(1) );
1283  EEDetId eedetidneg(iX,iY,-1);
1284  ical->setValue( eedetidneg, laserAlphaMean_ + r1*laserAlphaSigma_ );
1285  }
1286  } // loop over iY
1287  } // loop over iX
1288  }
1289 
1290  return ical;
1291 }
1292 */
1293 
1294 // laser alphas
1296  edm::LogInfo(" produceEcalLaserAlphas ");
1297  auto ical = std::make_unique<EcalLaserAlphas>();
1298 
1299  // get Barrel alpha from type
1300  if (getLaserAlphaFromTypeEB_) {
1301  std::ifstream fEB(edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1302  int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1303  15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1304  // check!
1305  int SMCal[36] = {12, 17, 10, 1, 8, 4, 27, 20, 23, 25, 6, 34, 35, 15, 18, 30, 21, 9,
1306  24, 22, 13, 31, 26, 16, 2, 11, 5, 0, 29, 28, 14, 33, 32, 3, 7, 19};
1307 
1308  for (int SMcons = 0; SMcons < 36; SMcons++) {
1309  int SM = SMpos[SMcons];
1310  if (SM < 0)
1311  SM = 17 + abs(SM);
1312  else
1313  SM--;
1314  if (SMCal[SM] != SMcons)
1315  edm::LogInfo(" SM pb : read SM ") << SMcons << " SMpos " << SM << " SMCal " << SMCal[SM];
1316  }
1317 
1319  int readSM, pos, bar, bar2;
1320  float alpha = 0;
1321  for (int SMcons = 0; SMcons < 36; SMcons++) {
1322  int SM = SMpos[SMcons];
1323  for (int ic = 0; ic < 1700; ic++) {
1324  fEB >> readSM >> pos >> bar >> bar2 >> type >> batch;
1325 
1326  if (readSM != SMcons || pos != ic + 1)
1327  edm::LogInfo(" barrel read pb read SM ")
1328  << readSM << " const SM " << SMcons << " read pos " << pos << " ic " << ic;
1329  if (SM < 0)
1330  SM = 18 + abs(SM);
1331  EBDetId ebdetid(SM, pos, EBDetId::SMCRYSTALMODE);
1332  if (bar == 33101 || bar == 30301)
1333  alpha = laserAlphaMeanEBR_;
1334  else if (bar == 33106) {
1335  if (bar2 <= 2000)
1336  alpha = laserAlphaMeanEBC_;
1337  else {
1338  edm::LogInfo(" problem with barcode first ")
1339  << bar << " last " << bar2 << " read SM " << readSM << " read pos " << pos;
1340  alpha = laserAlphaMeanEBR_;
1341  }
1342  }
1343  ical->setValue(ebdetid, alpha);
1344 
1345  if (ic == 1650) {
1346  edm::LogInfo(" ic/alpha ") << ic << "/" << alpha;
1347  }
1348  }
1349  } // loop over SMcons
1350  fEB.close();
1351  // end laserAlpha from type
1352  } else if (getLaserAlphaFromFileEB_) {
1353  // laser alpha from file
1354  edm::LogInfo("Laser alpha for EB will be taken from File");
1355  int ieta, iphi;
1356  float alpha;
1357  std::ifstream fEB(edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1358  // std::ifstream fEB(EBLaserAlphaFile_.c_str());
1359  for (int ic = 0; ic < 61200; ic++) {
1360  fEB >> ieta >> iphi >> alpha;
1361 
1362  if (EBDetId::validDetId(ieta, iphi)) {
1363  EBDetId ebid(ieta, iphi);
1364  ical->setValue(ebid, alpha);
1365  //std::cout << " ieta/iphi/alpha "<<ieta<<"/"<<iphi<<"/"<<alpha<<std::endl;
1366  }
1367  if (ieta == 10) {
1368  edm::LogInfo("I will print some alphas from the file... ieta/iphi/alpha ")
1369  << ieta << "/" << iphi << "/" << alpha;
1370  }
1371  }
1372  fEB.close();
1373 
1374  } else {
1375  edm::LogInfo("laser alphas from default values");
1376 
1377  // laser alpha from mean and smearing
1378  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
1379  if (ieta == 0)
1380  continue;
1381  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
1382  if (EBDetId::validDetId(ieta, iphi)) {
1383  EBDetId ebid(ieta, iphi);
1384  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1385  ical->setValue(ebid, laserAlphaMean_ + r * laserAlphaSigma_);
1386  }
1387  } // loop over iphi
1388  } // loop over ieta
1389  } // do not read a file
1390 
1391  edm::LogInfo(" produceEcalLaserAlphas EE");
1392  // read mean laser per ring per year
1393 
1394  int itype, iring, iyear;
1395  float laser = 0;
1396  float las[2][140][6];
1397 
1398  if (getLaserAlphaFromTypeEE_) {
1399  edm::LogInfo(" EE laser alphas from type");
1400 
1401  std::ifstream fRing(edm::FileInPath(EELaserAlphaFile2_).fullPath().c_str());
1402  for (int i = 0; i < 1681; i++) {
1403  fRing >> itype >> iring >> iyear >> laser;
1404  edm::LogInfo(" ") << itype << " " << iring << " " << iyear << " " << laser << std::endl;
1405  las[itype][iring][iyear] = laser;
1406  }
1407  fRing.close();
1408 
1409  std::ifstream fEE(edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1410  int nxt = 0;
1411  for (int crystal = 0; crystal < 14648; crystal++) {
1412  int x, y, z, bid, bar, bar2;
1413  float LY, alpha = 0;
1414  fEE >> z >> x >> y >> LY >> bid >> bar >> bar2;
1415  if (x < 1 || x > 100 || y < 1 || y > 100)
1416  edm::LogInfo(" wrong coordinates for barcode ") << bar << " x " << x << " y " << y << " z " << z;
1417  else {
1418  int iyear = 4;
1419  int iring = (int)(sqrt(((float)x - 50.5) * ((float)x - 50.5) + ((float)y - 50.5) * ((float)y - 50.5)) + 85);
1420 
1421  double eta = -log(tan(0.5 * atan(sqrt((x - 50.5) * (x - 50.5) + (y - 50.5) * (y - 50.5)) * 2.98 / 328.)));
1422 
1423  if (bar == 33201 || (bar == 30399 && bar2 < 568)) {
1424  // russian
1425  alpha = laserAlphaMeanEER_;
1426 
1427  double raggio = 50.5 - sqrt(((float)x - 50.5) * ((float)x - 50.5) + ((float)y - 50.5) * ((float)y - 50.5));
1428 
1429  if (raggio >= 25) {
1430  alpha = 1.07;
1431  }
1432  /*
1433  if(raggio>=34){
1434 
1435  if(eta>2.0) {
1436  itype=0;
1437  if(las[itype][iring][iyear]!=999){
1438  alpha=0.8044+0.3555*las[itype][iring][iyear];
1439  }
1440  }
1441 
1442  }
1443  */
1444 
1445  if (x == 50)
1446  edm::LogInfo("R=") << raggio << " x " << x << " y " << y << " z " << z << "eta=" << eta
1447  << " alpha=" << alpha << " R";
1448 
1449  } else if ((bar == 33106 && bar2 > 2000 && bar2 < 4669) || (bar == 30399 && bar2 > 567)) {
1450  // SIC
1451  itype = 1;
1452  alpha = laserAlphaMeanEEC_;
1453 
1454  double raggio = 50.5 - sqrt(((float)x - 50.5) * ((float)x - 50.5) + ((float)y - 50.5) * ((float)y - 50.5));
1455 
1456  if (raggio >= 25) {
1457  alpha = 0.80;
1458  }
1459  if (raggio >= 34) {
1460  float r = sqrt((x - 50.5) * (x - 50.5) + (y - 50.5) * (y - 50.5));
1461  if (r < 21) {
1462  nxt = nxt + 1;
1463  // inner SIC crystals
1464 
1465  if (las[itype][iring][iyear] != 999) {
1466  alpha = 0.7312 + 0.2688 * las[itype][iring][iyear];
1467  }
1468  }
1469  }
1470  if (x == 50)
1471  edm::LogInfo("R=") << raggio << " x " << x << " y " << y << " z " << z << "eta=" << eta
1472  << " alpha=" << alpha << " C";
1473 
1474  } else {
1475  edm::LogInfo(" problem with barcode ") << bar << " " << bar2 << " x " << x << " y " << y << " z " << z;
1476  alpha = laserAlphaMeanEER_;
1477  }
1478  }
1479 
1480  if (EEDetId::validDetId(x, y, z)) {
1481  EEDetId eedetidpos(x, y, z);
1482  ical->setValue(eedetidpos, alpha);
1483  if (x == 50)
1484  edm::LogInfo(" x ") << x << " y " << y << " alpha " << alpha;
1485  } else // should not occur
1486  edm::LogInfo(" problem with EEDetId ") << " x " << x << " y " << y << " z " << z;
1487  }
1488  fEE.close();
1489  edm::LogInfo("Number of inner SIC crystals with different alpha= ") << nxt;
1490  // end laserAlpha from type EE
1491 
1492  } else if (getLaserAlphaFromFileEE_) {
1493  edm::LogInfo(" EE laser alphas from file");
1494 
1495  std::ifstream fEE(edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1496 
1497  for (int crystal = 0; crystal < 14648; crystal++) {
1498  int x, y, z;
1499  float alpha = 1;
1500  fEE >> z >> x >> y >> alpha;
1501  if (x < 1 || x > 100 || y < 1 || y > 100 || z == 0 || z > 1 || z < -1) {
1502  edm::LogInfo("ERROR: wrong coordinates for crystal ") << " x " << x << " y " << y << " z " << z;
1503  edm::LogInfo(" the format of the file should be z x y alpha ");
1504  } else {
1505  if (EEDetId::validDetId(x, y, z)) {
1506  EEDetId eedetidpos(x, y, z);
1507  ical->setValue(eedetidpos, alpha);
1508  } else // should not occur
1509  edm::LogInfo(" problem with EEDetId ") << " x " << x << " y " << y << " z " << z;
1510  }
1511  }
1512  fEE.close();
1513 
1514  // end laser alpha from file EE
1515  } else {
1516  // alphas from python config file
1517  edm::LogInfo(" EE laser alphas from default values");
1518  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
1519  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
1520  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
1521  if (EEDetId::validDetId(iX, iY, 1)) {
1522  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1523  EEDetId eedetidpos(iX, iY, 1);
1524  ical->setValue(eedetidpos, laserAlphaMean_ + r * laserAlphaSigma_);
1525  }
1526  if (EEDetId::validDetId(iX, iY, -1)) {
1527  double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1528  EEDetId eedetidneg(iX, iY, -1);
1529  ical->setValue(eedetidneg, laserAlphaMean_ + r1 * laserAlphaSigma_);
1530  }
1531  } // loop over iY
1532  } // loop over iX
1533  }
1534 
1535  return ical;
1536 }
1537 
1538 std::unique_ptr<EcalLaserAPDPNRatiosRef> EcalTrivialConditionRetriever::produceEcalLaserAPDPNRatiosRef(
1539  const EcalLaserAPDPNRatiosRefRcd&) {
1540  auto ical = std::make_unique<EcalLaserAPDPNRatiosRef>();
1541  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
1542  if (ieta == 0)
1543  continue;
1544  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
1545  if (EBDetId::validDetId(ieta, iphi)) {
1546  EBDetId ebid(ieta, iphi);
1547  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1548  ical->setValue(ebid, laserAPDPNRefMean_ + r * laserAPDPNRefSigma_);
1549  }
1550  }
1551  }
1552 
1553  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
1554  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
1555  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
1556  if (EEDetId::validDetId(iX, iY, 1)) {
1557  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1558  EEDetId eedetidpos(iX, iY, 1);
1559  ical->setValue(eedetidpos, laserAPDPNRefMean_ + r * laserAPDPNRefSigma_);
1560  }
1561 
1562  if (EEDetId::validDetId(iX, iY, -1)) {
1563  double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1564  EEDetId eedetidneg(iX, iY, -1);
1565  ical->setValue(eedetidneg, laserAPDPNRefMean_ + r1 * laserAPDPNRefSigma_);
1566  }
1567  }
1568  }
1569 
1570  return ical;
1571 }
1572 
1574  const EcalLaserAPDPNRatiosRcd&) {
1575  EnergyResolutionVsLumi ageing;
1576  ageing.setLumi(totLumi_);
1577  ageing.setInstLumi(instLumi_);
1578 
1579  auto ical = std::make_unique<EcalLaserAPDPNRatios>();
1580  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
1581  if (ieta == 0)
1582  continue;
1583 
1584  double eta = EBDetId::approxEta(EBDetId(ieta, 1));
1585 
1586  eta = fabs(eta);
1587  double drop = ageing.calcampDropTotal(eta);
1588  // edm::LogInfo("EB at eta=")<<eta<<" dropping by "<<drop;
1589 
1590  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
1591  if (EBDetId::validDetId(ieta, iphi)) {
1592  EBDetId ebid(ieta, iphi);
1593  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1594 
1596  pairAPDPN.p1 = laserAPDPNMean_ * drop + r * laserAPDPNSigma_;
1597  pairAPDPN.p2 = laserAPDPNMean_ * drop + r * laserAPDPNSigma_;
1598  pairAPDPN.p3 = laserAPDPNMean_ * drop + r * laserAPDPNSigma_;
1599  ical->setValue(ebid, pairAPDPN);
1600  }
1601  }
1602  }
1603 
1604  edm::LogInfo("----- EE -----");
1605 
1606  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
1607  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
1608  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
1609 
1610  if (EEDetId::validDetId(iX, iY, 1)) {
1611  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1612  EEDetId eedetidpos(iX, iY, 1);
1613 
1614  double eta = -log(tan(0.5 * atan(sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1615  eta = fabs(eta);
1616  double drop = ageing.calcampDropTotal(eta);
1617  // if(iX==50) edm::LogInfo("EE at eta=")<<eta<<" dropping by "<<drop;
1618 
1620  pairAPDPN.p1 = laserAPDPNMean_ * drop + r * laserAPDPNSigma_;
1621  pairAPDPN.p2 = laserAPDPNMean_ * drop + r * laserAPDPNSigma_;
1622  pairAPDPN.p3 = laserAPDPNMean_ * drop + r * laserAPDPNSigma_;
1623  ical->setValue(eedetidpos, pairAPDPN);
1624  }
1625 
1626  if (EEDetId::validDetId(iX, iY, -1)) {
1627  double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1628  EEDetId eedetidneg(iX, iY, -1);
1629 
1630  double eta = -log(tan(0.5 * atan(sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1631  eta = fabs(eta);
1632  double drop = ageing.calcampDropTotal(eta);
1633  // if(iX==50) edm::LogInfo("EE at eta=")<<eta<<" dropping by "<<drop;
1634 
1636  pairAPDPN.p1 = laserAPDPNMean_ * drop + r1 * laserAPDPNSigma_;
1637  pairAPDPN.p2 = laserAPDPNMean_ * drop + r1 * laserAPDPNSigma_;
1638  pairAPDPN.p3 = laserAPDPNMean_ * drop + r1 * laserAPDPNSigma_;
1639  ical->setValue(eedetidneg, pairAPDPN);
1640  }
1641  }
1642  }
1643 
1645  // for(int i=1; i<=92; i++){
1646  for (int i = 0; i < 92; i++) {
1647  TimeStamp.t1 = Timestamp(laserAPDPNTime1_);
1648  if (laserAPDPNTime2_ == 0) {
1649  TimeStamp.t2 = Timestamp(edm::Timestamp::endOfTime().value());
1650  } else {
1651  TimeStamp.t2 = Timestamp(laserAPDPNTime2_);
1652  }
1653  if (laserAPDPNTime3_ == 0) {
1654  TimeStamp.t3 = Timestamp(edm::Timestamp::endOfTime().value());
1655  } else {
1656  TimeStamp.t3 = Timestamp(laserAPDPNTime3_);
1657  }
1658 
1659  ical->setTime(i, TimeStamp);
1660  }
1661 
1662  return ical;
1663 }
1664 
1666  std::vector<std::vector<double> > amplwgtv(nTDCbins_);
1667 
1668  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1669  std::vector<double> vampl;
1670  //As default using simple 3+1 weights
1671  vampl.push_back(-0.33333);
1672  vampl.push_back(-0.33333);
1673  vampl.push_back(-0.33333);
1674  vampl.push_back(0.);
1675  vampl.push_back(0.);
1676  vampl.push_back(1.);
1677  vampl.push_back(0.);
1678  vampl.push_back(0.);
1679  vampl.push_back(0.);
1680  vampl.push_back(0.);
1681  amplwgtv[0] = ps.getUntrackedParameter<std::vector<double> >("amplWeights", vampl);
1682  } else if (getWeightsFromFile_) {
1683  edm::LogInfo("EcalTrivialConditionRetriever")
1684  << "Reading amplitude weights from file " << edm::FileInPath(amplWeightsFile_).fullPath().c_str();
1685  std::ifstream amplFile(edm::FileInPath(amplWeightsFile_).fullPath().c_str());
1686  int tdcBin = 0;
1687  while (!amplFile.eof() && tdcBin < nTDCbins_) {
1688  for (int j = 0; j < 10; ++j) {
1689  float ww;
1690  amplFile >> ww;
1691  amplwgtv[tdcBin].push_back(ww);
1692  }
1693  ++tdcBin;
1694  }
1695  assert(tdcBin == nTDCbins_);
1696  //Read from file
1697  } else {
1698  //Not supported
1699  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
1700  throw cms::Exception("WrongConfig");
1701  }
1702 
1703  for (int i = 0; i < nTDCbins_; i++) {
1704  assert(amplwgtv[i].size() == 10);
1705  int j = 0;
1706  for (std::vector<double>::const_iterator it = amplwgtv[i].begin(); it != amplwgtv[i].end(); ++it) {
1707  (amplWeights_[i])[j] = *it;
1708  j++;
1709  }
1710  }
1711 
1712  std::vector<std::vector<double> > amplwgtvAftGain(nTDCbins_);
1713 
1714  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1715  std::vector<double> vamplAftGain;
1716  vamplAftGain.push_back(0.);
1717  vamplAftGain.push_back(0.);
1718  vamplAftGain.push_back(0.);
1719  vamplAftGain.push_back(0.);
1720  vamplAftGain.push_back(0.);
1721  vamplAftGain.push_back(1.);
1722  vamplAftGain.push_back(0.);
1723  vamplAftGain.push_back(0.);
1724  vamplAftGain.push_back(0.);
1725  vamplAftGain.push_back(0.);
1726  amplwgtvAftGain[0] = ps.getUntrackedParameter<std::vector<double> >("amplWeightsAftGain", vamplAftGain);
1727  } else if (getWeightsFromFile_) {
1728  //Read from file
1729  edm::LogInfo("EcalTrivialConditionRetriever") << "Reading amplitude weights aftre gain switch from file "
1730  << edm::FileInPath(amplWeightsAftFile_).fullPath().c_str();
1731  std::ifstream amplFile(edm::FileInPath(amplWeightsAftFile_).fullPath().c_str());
1732  int tdcBin = 0;
1733  while (!amplFile.eof() && tdcBin < nTDCbins_) {
1734  for (int j = 0; j < 10; ++j) {
1735  float ww;
1736  amplFile >> ww;
1737  amplwgtvAftGain[tdcBin].push_back(ww);
1738  }
1739  ++tdcBin;
1740  }
1741  assert(tdcBin == nTDCbins_);
1742  } else {
1743  //Not supported
1744  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
1745  throw cms::Exception("WrongConfig");
1746  }
1747 
1748  for (int i = 0; i < nTDCbins_; i++) {
1749  assert(amplwgtvAftGain[i].size() == 10);
1750  int j = 0;
1751  for (std::vector<double>::const_iterator it = amplwgtvAftGain[i].begin(); it != amplwgtvAftGain[i].end(); ++it) {
1752  (amplWeightsAft_[i])[j] = *it;
1753  j++;
1754  }
1755  }
1756 
1757  // default weights to reco amplitude w/o pedestal subtraction
1758 
1759  std::vector<std::vector<double> > pedwgtv(nTDCbins_);
1760 
1761  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1762  std::vector<double> vped;
1763  vped.push_back(0.33333);
1764  vped.push_back(0.33333);
1765  vped.push_back(0.33333);
1766  vped.push_back(0.);
1767  vped.push_back(0.);
1768  vped.push_back(0.);
1769  vped.push_back(0.);
1770  vped.push_back(0.);
1771  vped.push_back(0.);
1772  vped.push_back(0.);
1773  pedwgtv[0] = ps.getUntrackedParameter<std::vector<double> >("pedWeights", vped);
1774  } else if (getWeightsFromFile_) {
1775  //Read from file
1776  edm::LogInfo("EcalTrivialConditionRetriever")
1777  << "Reading pedestal weights from file " << edm::FileInPath(pedWeightsFile_).fullPath().c_str();
1778  std::ifstream pedFile(edm::FileInPath(pedWeightsFile_).fullPath().c_str());
1779  int tdcBin = 0;
1780  while (!pedFile.eof() && tdcBin < nTDCbins_) {
1781  for (int j = 0; j < 10; ++j) {
1782  float ww;
1783  pedFile >> ww;
1784  pedwgtv[tdcBin].push_back(ww);
1785  }
1786  ++tdcBin;
1787  }
1788  assert(tdcBin == nTDCbins_);
1789  } else {
1790  //Not supported
1791  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
1792  throw cms::Exception("WrongConfig");
1793  }
1794 
1795  for (int i = 0; i < nTDCbins_; i++) {
1796  assert(pedwgtv[i].size() == 10);
1797  int j = 0;
1798  for (std::vector<double>::const_iterator it = pedwgtv[i].begin(); it != pedwgtv[i].end(); ++it) {
1799  (pedWeights_[i])[j] = *it;
1800  j++;
1801  }
1802  }
1803 
1804  std::vector<std::vector<double> > pedwgtvaft(nTDCbins_);
1805 
1806  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1807  std::vector<double> vped;
1808  vped.push_back(0.);
1809  vped.push_back(0.);
1810  vped.push_back(0.);
1811  vped.push_back(0.);
1812  vped.push_back(0.);
1813  vped.push_back(0.);
1814  vped.push_back(0.);
1815  vped.push_back(0.);
1816  vped.push_back(0.);
1817  vped.push_back(0.);
1818  pedwgtvaft[0] = ps.getUntrackedParameter<std::vector<double> >("pedWeightsAft", vped);
1819  } else if (getWeightsFromFile_) {
1820  //Read from file
1821  edm::LogInfo("EcalTrivialConditionRetriever") << "Reading pedestal after gain switch weights from file "
1822  << edm::FileInPath(pedWeightsAftFile_).fullPath().c_str();
1823  std::ifstream pedFile(edm::FileInPath(pedWeightsAftFile_).fullPath().c_str());
1824  int tdcBin = 0;
1825  while (!pedFile.eof() && tdcBin < nTDCbins_) {
1826  for (int j = 0; j < 10; ++j) {
1827  float ww;
1828  pedFile >> ww;
1829  pedwgtvaft[tdcBin].push_back(ww);
1830  }
1831  ++tdcBin;
1832  }
1833  assert(tdcBin == nTDCbins_);
1834  } else {
1835  //Not supported
1836  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
1837  throw cms::Exception("WrongConfig");
1838  }
1839 
1840  for (int i = 0; i < nTDCbins_; i++) {
1841  assert(pedwgtvaft[i].size() == 10);
1842  int j = 0;
1843  for (std::vector<double>::const_iterator it = pedwgtvaft[i].begin(); it != pedwgtvaft[i].end(); ++it) {
1844  (pedWeightsAft_[i])[j] = *it;
1845  j++;
1846  }
1847  }
1848 
1849  // default weights to reco jitter
1850 
1851  std::vector<std::vector<double> > jittwgtv(nTDCbins_);
1852 
1853  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1854  std::vector<double> vjitt;
1855  vjitt.push_back(0.04066309);
1856  vjitt.push_back(0.04066309);
1857  vjitt.push_back(0.04066309);
1858  vjitt.push_back(0.000);
1859  vjitt.push_back(1.325176);
1860  vjitt.push_back(-0.04997078);
1861  vjitt.push_back(-0.504338);
1862  vjitt.push_back(-0.5024844);
1863  vjitt.push_back(-0.3903718);
1864  vjitt.push_back(0.000);
1865  jittwgtv[0] = ps.getUntrackedParameter<std::vector<double> >("jittWeights", vjitt);
1866  } else if (getWeightsFromFile_) {
1867  //Read from file
1868  edm::LogInfo("EcalTrivialConditionRetriever")
1869  << "Reading jitter weights from file " << edm::FileInPath(jittWeightsFile_).fullPath().c_str();
1870  std::ifstream jittFile(edm::FileInPath(jittWeightsFile_).fullPath().c_str());
1871  int tdcBin = 0;
1872  while (!jittFile.eof() && tdcBin < nTDCbins_) {
1873  for (int j = 0; j < 10; ++j) {
1874  float ww;
1875  jittFile >> ww;
1876  jittwgtv[tdcBin].push_back(ww);
1877  }
1878  ++tdcBin;
1879  }
1880  assert(tdcBin == nTDCbins_);
1881  } else {
1882  //Not supported
1883  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
1884  throw cms::Exception("WrongConfig");
1885  }
1886 
1887  for (int i = 0; i < nTDCbins_; i++) {
1888  assert(jittwgtv[i].size() == 10);
1889  int j = 0;
1890  for (std::vector<double>::const_iterator it = jittwgtv[i].begin(); it != jittwgtv[i].end(); ++it) {
1891  (jittWeights_[i])[j] = *it;
1892  j++;
1893  }
1894  }
1895 
1896  std::vector<std::vector<double> > jittwgtvaft(nTDCbins_);
1897 
1898  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1899  std::vector<double> vjitt;
1900  vjitt.push_back(0.);
1901  vjitt.push_back(0.);
1902  vjitt.push_back(0.);
1903  vjitt.push_back(0.);
1904  vjitt.push_back(1.097871);
1905  vjitt.push_back(-0.04551035);
1906  vjitt.push_back(-0.4159156);
1907  vjitt.push_back(-0.4185352);
1908  vjitt.push_back(-0.3367127);
1909  vjitt.push_back(0.);
1910  jittwgtvaft[0] = ps.getUntrackedParameter<std::vector<double> >("jittWeightsAft", vjitt);
1911  } else if (getWeightsFromFile_) {
1912  //Read from file
1913  edm::LogInfo("EcalTrivialConditionRetriever") << "Reading jitter after gain switch weights from file "
1914  << edm::FileInPath(jittWeightsAftFile_).fullPath().c_str();
1915  std::ifstream jittFile(edm::FileInPath(jittWeightsAftFile_).fullPath().c_str());
1916  int tdcBin = 0;
1917  while (!jittFile.eof() && tdcBin < nTDCbins_) {
1918  for (int j = 0; j < 10; ++j) {
1919  float ww;
1920  jittFile >> ww;
1921  jittwgtvaft[tdcBin].push_back(ww);
1922  }
1923  ++tdcBin;
1924  }
1925  assert(tdcBin == nTDCbins_);
1926  } else {
1927  //Not supported
1928  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
1929  throw cms::Exception("WrongConfig");
1930  }
1931 
1932  for (int i = 0; i < nTDCbins_; i++) {
1933  assert(jittwgtvaft[i].size() == 10);
1934  int j = 0;
1935  for (std::vector<double>::const_iterator it = jittwgtvaft[i].begin(); it != jittwgtvaft[i].end(); ++it) {
1936  (jittWeightsAft_[i])[j] = *it;
1937  j++;
1938  }
1939  }
1940 
1941  std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2Matrix(nTDCbins_);
1942  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1943  // chi2Matrix[0].resize(10);
1944  // for (int i=0;i<10;i++)
1945  // chi2Matrix[0][i].resize(10);
1946 
1947  chi2Matrix[0](0, 0) = 0.694371;
1948  chi2Matrix[0](0, 1) = -0.305629;
1949  chi2Matrix[0](0, 2) = -0.305629;
1950  chi2Matrix[0](0, 3) = 0.;
1951  chi2Matrix[0](0, 4) = 0.;
1952  chi2Matrix[0](0, 5) = 0.;
1953  chi2Matrix[0](0, 6) = 0.;
1954  chi2Matrix[0](0, 7) = 0.;
1955  chi2Matrix[0](0, 8) = 0.;
1956  chi2Matrix[0](0, 9) = 0.;
1957  chi2Matrix[0](1, 0) = -0.305629;
1958  chi2Matrix[0](1, 1) = 0.694371;
1959  chi2Matrix[0](1, 2) = -0.305629;
1960  chi2Matrix[0](1, 3) = 0.;
1961  chi2Matrix[0](1, 4) = 0.;
1962  chi2Matrix[0](1, 5) = 0.;
1963  chi2Matrix[0](1, 6) = 0.;
1964  chi2Matrix[0](1, 7) = 0.;
1965  chi2Matrix[0](1, 8) = 0.;
1966  chi2Matrix[0](1, 9) = 0.;
1967  chi2Matrix[0](2, 0) = -0.305629;
1968  chi2Matrix[0](2, 1) = -0.305629;
1969  chi2Matrix[0](2, 2) = 0.694371;
1970  chi2Matrix[0](2, 3) = 0.;
1971  chi2Matrix[0](2, 4) = 0.;
1972  chi2Matrix[0](2, 5) = 0.;
1973  chi2Matrix[0](2, 6) = 0.;
1974  chi2Matrix[0](2, 7) = 0.;
1975  chi2Matrix[0](2, 8) = 0.;
1976  chi2Matrix[0](2, 9) = 0.;
1977  chi2Matrix[0](3, 0) = 0.;
1978  chi2Matrix[0](3, 1) = 0.;
1979  chi2Matrix[0](3, 2) = 0.;
1980  chi2Matrix[0](3, 3) = 0.;
1981  chi2Matrix[0](3, 4) = 0.;
1982  chi2Matrix[0](3, 5) = 0.;
1983  chi2Matrix[0](3, 6) = 0.;
1984  chi2Matrix[0](3, 7) = 0.;
1985  chi2Matrix[0](3, 8) = 0.;
1986  chi2Matrix[0](3, 9) = 0.;
1987  chi2Matrix[0](4, 0) = 0.;
1988  chi2Matrix[0](4, 1) = 0.;
1989  chi2Matrix[0](4, 2) = 0.;
1990  chi2Matrix[0](4, 3) = 0.;
1991  chi2Matrix[0](4, 4) = 0.8027116;
1992  chi2Matrix[0](4, 5) = -0.2517103;
1993  chi2Matrix[0](4, 6) = -0.2232882;
1994  chi2Matrix[0](4, 7) = -0.1716192;
1995  chi2Matrix[0](4, 8) = -0.1239006;
1996  chi2Matrix[0](4, 9) = 0.;
1997  chi2Matrix[0](5, 0) = 0.;
1998  chi2Matrix[0](5, 1) = 0.;
1999  chi2Matrix[0](5, 2) = 0.;
2000  chi2Matrix[0](5, 3) = 0.;
2001  chi2Matrix[0](5, 4) = -0.2517103;
2002  chi2Matrix[0](5, 5) = 0.6528964;
2003  chi2Matrix[0](5, 6) = -0.2972839;
2004  chi2Matrix[0](5, 7) = -0.2067162;
2005  chi2Matrix[0](5, 8) = -0.1230729;
2006  chi2Matrix[0](5, 9) = 0.;
2007  chi2Matrix[0](6, 0) = 0.;
2008  chi2Matrix[0](6, 1) = 0.;
2009  chi2Matrix[0](6, 2) = 0.;
2010  chi2Matrix[0](6, 3) = 0.;
2011  chi2Matrix[0](6, 4) = -0.2232882;
2012  chi2Matrix[0](6, 5) = -0.2972839;
2013  chi2Matrix[0](6, 6) = 0.7413607;
2014  chi2Matrix[0](6, 7) = -0.1883866;
2015  chi2Matrix[0](6, 8) = -0.1235052;
2016  chi2Matrix[0](6, 9) = 0.;
2017  chi2Matrix[0](7, 0) = 0.;
2018  chi2Matrix[0](7, 1) = 0.;
2019  chi2Matrix[0](7, 2) = 0.;
2020  chi2Matrix[0](7, 3) = 0.;
2021  chi2Matrix[0](7, 4) = -0.1716192;
2022  chi2Matrix[0](7, 5) = -0.2067162;
2023  chi2Matrix[0](7, 6) = -0.1883866;
2024  chi2Matrix[0](7, 7) = 0.844935;
2025  chi2Matrix[0](7, 8) = -0.124291;
2026  chi2Matrix[0](7, 9) = 0.;
2027  chi2Matrix[0](8, 0) = 0.;
2028  chi2Matrix[0](8, 1) = 0.;
2029  chi2Matrix[0](8, 2) = 0.;
2030  chi2Matrix[0](8, 3) = 0.;
2031  chi2Matrix[0](8, 4) = -0.1239006;
2032  chi2Matrix[0](8, 5) = -0.1230729;
2033  chi2Matrix[0](8, 6) = -0.1235052;
2034  chi2Matrix[0](8, 7) = -0.124291;
2035  chi2Matrix[0](8, 8) = 0.8749833;
2036  chi2Matrix[0](8, 9) = 0.;
2037  chi2Matrix[0](9, 0) = 0.;
2038  chi2Matrix[0](9, 1) = 0.;
2039  chi2Matrix[0](9, 2) = 0.;
2040  chi2Matrix[0](9, 3) = 0.;
2041  chi2Matrix[0](9, 4) = 0.;
2042  chi2Matrix[0](9, 5) = 0.;
2043  chi2Matrix[0](9, 6) = 0.;
2044  chi2Matrix[0](9, 7) = 0.;
2045  chi2Matrix[0](9, 8) = 0.;
2046  chi2Matrix[0](9, 9) = 0.;
2047  } else if (getWeightsFromFile_) {
2048  //Read from file
2049  edm::LogInfo("EcalTrivialConditionRetriever")
2050  << "Reading chi2Matrix from file " << edm::FileInPath(chi2MatrixFile_).fullPath().c_str();
2051  std::ifstream chi2MatrixFile(edm::FileInPath(chi2MatrixFile_).fullPath().c_str());
2052  int tdcBin = 0;
2053  while (!chi2MatrixFile.eof() && tdcBin < nTDCbins_) {
2054  // chi2Matrix[tdcBin].resize(10);
2055  for (int j = 0; j < 10; ++j) {
2056  for (int l = 0; l < 10; ++l) {
2057  float ww;
2058  chi2MatrixFile >> ww;
2059  chi2Matrix[tdcBin](j, l) = ww;
2060  }
2061  }
2062  ++tdcBin;
2063  }
2064  assert(tdcBin == nTDCbins_);
2065  } else {
2066  //Not supported
2067  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
2068  throw cms::Exception("WrongConfig");
2069  }
2070 
2071  // for (int i=0;i<nTDCbins_;i++)
2072  // {
2073  // assert(chi2Matrix[i].size() == 10);
2074  chi2Matrix_ = chi2Matrix;
2075  // }
2076 
2077  std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2MatrixAft(nTDCbins_);
2078  if (!getWeightsFromFile_ && nTDCbins_ == 1) {
2079  // chi2MatrixAft[0].resize(10);
2080  // for (int i=0;i<10;i++)
2081  // chi2MatrixAft[0][i].resize(10);
2082 
2083  chi2MatrixAft[0](0, 0) = 0.;
2084  chi2MatrixAft[0](0, 1) = 0.;
2085  chi2MatrixAft[0](0, 2) = 0.;
2086  chi2MatrixAft[0](0, 3) = 0.;
2087  chi2MatrixAft[0](0, 4) = 0.;
2088  chi2MatrixAft[0](0, 5) = 0.;
2089  chi2MatrixAft[0](0, 6) = 0.;
2090  chi2MatrixAft[0](0, 7) = 0.;
2091  chi2MatrixAft[0](0, 8) = 0.;
2092  chi2MatrixAft[0](0, 9) = 0.;
2093  chi2MatrixAft[0](1, 0) = 0.;
2094  chi2MatrixAft[0](1, 1) = 0.;
2095  chi2MatrixAft[0](1, 2) = 0.;
2096  chi2MatrixAft[0](1, 3) = 0.;
2097  chi2MatrixAft[0](1, 4) = 0.;
2098  chi2MatrixAft[0](1, 5) = 0.;
2099  chi2MatrixAft[0](1, 6) = 0.;
2100  chi2MatrixAft[0](1, 7) = 0.;
2101  chi2MatrixAft[0](1, 8) = 0.;
2102  chi2MatrixAft[0](1, 9) = 0.;
2103  chi2MatrixAft[0](2, 0) = 0.;
2104  chi2MatrixAft[0](2, 1) = 0.;
2105  chi2MatrixAft[0](2, 2) = 0.;
2106  chi2MatrixAft[0](2, 3) = 0.;
2107  chi2MatrixAft[0](2, 4) = 0.;
2108  chi2MatrixAft[0](2, 5) = 0.;
2109  chi2MatrixAft[0](2, 6) = 0.;
2110  chi2MatrixAft[0](2, 7) = 0.;
2111  chi2MatrixAft[0](2, 8) = 0.;
2112  chi2MatrixAft[0](2, 9) = 0.;
2113  chi2MatrixAft[0](3, 0) = 0.;
2114  chi2MatrixAft[0](3, 1) = 0.;
2115  chi2MatrixAft[0](3, 2) = 0.;
2116  chi2MatrixAft[0](3, 3) = 0.;
2117  chi2MatrixAft[0](3, 4) = 0.;
2118  chi2MatrixAft[0](3, 5) = 0.;
2119  chi2MatrixAft[0](3, 6) = 0.;
2120  chi2MatrixAft[0](3, 7) = 0.;
2121  chi2MatrixAft[0](3, 8) = 0.;
2122  chi2MatrixAft[0](3, 9) = 0.;
2123  chi2MatrixAft[0](4, 0) = 0.;
2124  chi2MatrixAft[0](4, 1) = 0.;
2125  chi2MatrixAft[0](4, 2) = 0.;
2126  chi2MatrixAft[0](4, 3) = 0.;
2127  chi2MatrixAft[0](4, 4) = 0.8030884;
2128  chi2MatrixAft[0](4, 5) = -0.2543541;
2129  chi2MatrixAft[0](4, 6) = -0.2243544;
2130  chi2MatrixAft[0](4, 7) = -0.1698177;
2131  chi2MatrixAft[0](4, 8) = -0.1194506;
2132  chi2MatrixAft[0](4, 9) = 0.;
2133  chi2MatrixAft[0](5, 0) = 0.;
2134  chi2MatrixAft[0](5, 1) = 0.;
2135  chi2MatrixAft[0](5, 2) = 0.;
2136  chi2MatrixAft[0](5, 3) = 0.;
2137  chi2MatrixAft[0](5, 4) = -0.2543541;
2138  chi2MatrixAft[0](5, 5) = 0.6714465;
2139  chi2MatrixAft[0](5, 6) = -0.2898025;
2140  chi2MatrixAft[0](5, 7) = -0.2193564;
2141  chi2MatrixAft[0](5, 8) = -0.1542964;
2142  chi2MatrixAft[0](5, 9) = 0.;
2143  chi2MatrixAft[0](6, 0) = 0.;
2144  chi2MatrixAft[0](6, 1) = 0.;
2145  chi2MatrixAft[0](6, 2) = 0.;
2146  chi2MatrixAft[0](6, 3) = 0.;
2147  chi2MatrixAft[0](6, 4) = -0.2243544;
2148  chi2MatrixAft[0](6, 5) = -0.2898025;
2149  chi2MatrixAft[0](6, 6) = 0.7443781;
2150  chi2MatrixAft[0](6, 7) = -0.1934846;
2151  chi2MatrixAft[0](6, 8) = -0.136098;
2152  chi2MatrixAft[0](6, 9) = 0.;
2153  chi2MatrixAft[0](7, 0) = 0.;
2154  chi2MatrixAft[0](7, 1) = 0.;
2155  chi2MatrixAft[0](7, 2) = 0.;
2156  chi2MatrixAft[0](7, 3) = 0.;
2157  chi2MatrixAft[0](7, 4) = -0.1698177;
2158  chi2MatrixAft[0](7, 5) = -0.2193564;
2159  chi2MatrixAft[0](7, 6) = -0.1934846;
2160  chi2MatrixAft[0](7, 7) = 0.8535482;
2161  chi2MatrixAft[0](7, 8) = -0.1030149;
2162  chi2MatrixAft[0](7, 9) = 0.;
2163  chi2MatrixAft[0](8, 0) = 0.;
2164  chi2MatrixAft[0](8, 1) = 0.;
2165  chi2MatrixAft[0](8, 2) = 0.;
2166  chi2MatrixAft[0](8, 3) = 0.;
2167  chi2MatrixAft[0](8, 4) = -0.1194506;
2168  chi2MatrixAft[0](8, 5) = -0.1542964;
2169  chi2MatrixAft[0](8, 6) = -0.136098;
2170  chi2MatrixAft[0](8, 7) = -0.1030149;
2171  chi2MatrixAft[0](8, 8) = 0.9275388;
2172  chi2MatrixAft[0](8, 9) = 0.;
2173  chi2MatrixAft[0](9, 0) = 0.;
2174  chi2MatrixAft[0](9, 1) = 0.;
2175  chi2MatrixAft[0](9, 2) = 0.;
2176  chi2MatrixAft[0](9, 3) = 0.;
2177  chi2MatrixAft[0](9, 4) = 0.;
2178  chi2MatrixAft[0](9, 5) = 0.;
2179  chi2MatrixAft[0](9, 6) = 0.;
2180  chi2MatrixAft[0](9, 7) = 0.;
2181  chi2MatrixAft[0](9, 8) = 0.;
2182  chi2MatrixAft[0](9, 9) = 0.;
2183  } else if (getWeightsFromFile_) {
2184  //Read from file
2185  edm::LogInfo("EcalTrivialConditionRetriever")
2186  << "Reading chi2MatrixAft from file " << edm::FileInPath(chi2MatrixAftFile_).fullPath().c_str();
2187  std::ifstream chi2MatrixAftFile(edm::FileInPath(chi2MatrixAftFile_).fullPath().c_str());
2188  int tdcBin = 0;
2189  while (!chi2MatrixAftFile.eof() && tdcBin < nTDCbins_) {
2190  // chi2MatrixAft[tdcBin].resize(10);
2191  for (int j = 0; j < 10; ++j) {
2192  for (int l = 0; l < 10; ++l) {
2193  float ww;
2194  chi2MatrixAftFile >> ww;
2195  chi2MatrixAft[tdcBin](j, l) = ww;
2196  }
2197  }
2198  ++tdcBin;
2199  }
2200  assert(tdcBin == nTDCbins_);
2201  } else {
2202  //Not supported
2203  edm::LogError("EcalTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
2204  throw cms::Exception("WrongConfig");
2205  }
2206 
2207  // for (int i=0;i<nTDCbins_;i++)
2208  // {
2209  // assert(chi2MatrixAft[i].size() == 10);
2210  chi2MatrixAft_ = chi2MatrixAft;
2211  // }
2212 }
2213 
2214 // --------------------------------------------------------------------------------
2215 
2217  const EcalChannelStatusRcd&) {
2218  auto ecalStatus = std::make_unique<EcalChannelStatus>();
2219 
2220  // start by setting all statuses to 0
2221 
2222  // barrel
2223  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
2224  if (ieta == 0)
2225  continue;
2226  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
2227  if (EBDetId::validDetId(ieta, iphi)) {
2228  EBDetId ebid(ieta, iphi);
2229  ecalStatus->setValue(ebid, 0);
2230  }
2231  }
2232  }
2233  // endcap
2234  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
2235  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
2236  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
2237  if (EEDetId::validDetId(iX, iY, 1)) {
2238  EEDetId eedetidpos(iX, iY, 1);
2239  ecalStatus->setValue(eedetidpos, 0);
2240  }
2241  if (EEDetId::validDetId(iX, iY, -1)) {
2242  EEDetId eedetidneg(iX, iY, -1);
2243  ecalStatus->setValue(eedetidneg, 0);
2244  }
2245  }
2246  }
2247 
2248  // overwrite the statuses which are in the file
2249 
2250  edm::LogInfo("EcalTrivialConditionRetriever")
2251  << "Reading channel statuses from file " << edm::FileInPath(channelStatusFile_).fullPath().c_str();
2252  std::ifstream statusFile(edm::FileInPath(channelStatusFile_).fullPath().c_str());
2253  if (!statusFile.good()) {
2254  edm::LogError("EcalTrivialConditionRetriever") << "*** Problems opening file: " << channelStatusFile_;
2255  throw cms::Exception("Cannot open ECAL channel status file");
2256  }
2257 
2258  std::string EcalSubDet;
2259  std::string str;
2260  int hashIndex(0);
2261  int status(0);
2262 
2263  while (!statusFile.eof()) {
2264  statusFile >> EcalSubDet;
2265  if (EcalSubDet != std::string("EB") && EcalSubDet != std::string("EE")) {
2266  std::getline(statusFile, str);
2267  continue;
2268  } else {
2269  statusFile >> hashIndex >> status;
2270  }
2271  // std::cout << EcalSubDet << " " << hashIndex << " " << status;
2272 
2273  if (EcalSubDet == std::string("EB")) {
2274  EBDetId ebid = EBDetId::unhashIndex(hashIndex);
2275  ecalStatus->setValue(ebid, status);
2276  } else if (EcalSubDet == std::string("EE")) {
2277  EEDetId eedetid = EEDetId::unhashIndex(hashIndex);
2278  ecalStatus->setValue(eedetid, status);
2279  } else {
2280  edm::LogError("EcalTrivialConditionRetriever") << " *** " << EcalSubDet << " is neither EB nor EE ";
2281  }
2282  }
2283  // the file is supposed to be in the form -- FIXME
2284 
2285  statusFile.close();
2286  return ecalStatus;
2287 }
2288 
2290  auto ical = std::make_unique<EcalChannelStatus>();
2291  // barrel
2292  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
2293  if (ieta == 0)
2294  continue;
2295  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
2296  if (EBDetId::validDetId(ieta, iphi)) {
2297  EBDetId ebid(ieta, iphi);
2298  ical->setValue(ebid, 0);
2299  }
2300  }
2301  }
2302  // endcap
2303  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
2304  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
2305  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
2306  if (EEDetId::validDetId(iX, iY, 1)) {
2307  EEDetId eedetidpos(iX, iY, 1);
2308  ical->setValue(eedetidpos, 0);
2309  }
2310  if (EEDetId::validDetId(iX, iY, -1)) {
2311  EEDetId eedetidneg(iX, iY, -1);
2312  ical->setValue(eedetidneg, 0);
2313  }
2314  }
2315  }
2316  return ical;
2317 }
2318 
2319 // --------------------------------------------------------------------------------
2321  const EcalDQMChannelStatusRcd&) {
2322  uint32_t sta(0);
2323 
2324  auto ical = std::make_unique<EcalDQMChannelStatus>();
2325  // barrel
2326  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
2327  if (ieta == 0)
2328  continue;
2329  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
2330  if (EBDetId::validDetId(ieta, iphi)) {
2331  EBDetId ebid(ieta, iphi);
2332  ical->setValue(ebid, sta);
2333  }
2334  }
2335  }
2336  // endcap
2337  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
2338  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
2339  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
2340  if (EEDetId::validDetId(iX, iY, 1)) {
2341  EEDetId eedetidpos(iX, iY, 1);
2342  ical->setValue(eedetidpos, sta);
2343  }
2344  if (EEDetId::validDetId(iX, iY, -1)) {
2345  EEDetId eedetidneg(iX, iY, -1);
2346  ical->setValue(eedetidneg, sta);
2347  }
2348  }
2349  }
2350  return ical;
2351 }
2352 // --------------------------------------------------------------------------------
2353 
2355  const EcalDQMTowerStatusRcd&) {
2356  auto ical = std::make_unique<EcalDQMTowerStatus>();
2357 
2358  uint32_t sta(0);
2359 
2360  // barrel
2361  int iz = 0;
2362  for (int k = 0; k < 2; k++) {
2363  if (k == 0)
2364  iz = -1;
2365  if (k == 1)
2366  iz = +1;
2367  for (int i = 1; i < 73; i++) {
2368  for (int j = 1; j < 18; j++) {
2370  EcalTrigTowerDetId ebid(iz, EcalBarrel, j, i);
2371 
2372  ical->setValue(ebid, sta);
2373  }
2374  }
2375  }
2376  }
2377 
2378  // endcap
2379  for (int k = 0; k < 2; k++) {
2380  if (k == 0)
2381  iz = -1;
2382  if (k == 1)
2383  iz = +1;
2384  for (int i = 1; i < 21; i++) {
2385  for (int j = 1; j < 21; j++) {
2386  if (EcalScDetId::validDetId(i, j, iz)) {
2387  EcalScDetId eeid(i, j, iz);
2388  ical->setValue(eeid, sta);
2389  }
2390  }
2391  }
2392  }
2393 
2394  return ical;
2395 }
2396 
2397 // --------------------------------------------------------------------------------
2399  const EcalDCSTowerStatusRcd&) {
2400  auto ical = std::make_unique<EcalDCSTowerStatus>();
2401 
2402  int status(0);
2403 
2404  // barrel
2405  int iz = 0;
2406  for (int k = 0; k < 2; k++) {
2407  if (k == 0)
2408  iz = -1;
2409  if (k == 1)
2410  iz = +1;
2411  for (int i = 1; i < 73; i++) {
2412  for (int j = 1; j < 18; j++) {
2414  EcalTrigTowerDetId ebid(iz, EcalBarrel, j, i);
2415 
2416  ical->setValue(ebid, status);
2417  }
2418  }
2419  }
2420  }
2421 
2422  // endcap
2423  for (int k = 0; k < 2; k++) {
2424  if (k == 0)
2425  iz = -1;
2426  if (k == 1)
2427  iz = +1;
2428  for (int i = 1; i < 21; i++) {
2429  for (int j = 1; j < 21; j++) {
2430  if (EcalScDetId::validDetId(i, j, iz)) {
2431  EcalScDetId eeid(i, j, iz);
2432  ical->setValue(eeid, status);
2433  }
2434  }
2435  }
2436  }
2437 
2438  return ical;
2439 }
2440 // --------------------------------------------------------------------------------
2441 
2443  const EcalDAQTowerStatusRcd&) {
2444  auto ical = std::make_unique<EcalDAQTowerStatus>();
2445 
2446  int status(0);
2447 
2448  // barrel
2449  int iz = 0;
2450  for (int k = 0; k < 2; k++) {
2451  if (k == 0)
2452  iz = -1;
2453  if (k == 1)
2454  iz = +1;
2455  for (int i = 1; i < 73; i++) {
2456  for (int j = 1; j < 18; j++) {
2458  EcalTrigTowerDetId ebid(iz, EcalBarrel, j, i);
2459 
2460  ical->setValue(ebid, status);
2461  }
2462  }
2463  }
2464  }
2465 
2466  // endcap
2467  for (int k = 0; k < 2; k++) {
2468  if (k == 0)
2469  iz = -1;
2470  if (k == 1)
2471  iz = +1;
2472  for (int i = 1; i < 21; i++) {
2473  for (int j = 1; j < 21; j++) {
2474  if (EcalScDetId::validDetId(i, j, iz)) {
2475  EcalScDetId eeid(i, j, iz);
2476  ical->setValue(eeid, status);
2477  }
2478  }
2479  }
2480  }
2481 
2482  return ical;
2483 }
2484 // --------------------------------------------------------------------------------
2485 
2487  const EcalTPGCrystalStatusRcd&) {
2488  auto ecalStatus = std::make_unique<EcalTPGCrystalStatus>();
2489 
2490  // start by setting all statuses to 0
2491 
2492  // barrel
2493  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
2494  if (ieta == 0)
2495  continue;
2496  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
2497  if (EBDetId::validDetId(ieta, iphi)) {
2498  EBDetId ebid(ieta, iphi);
2499  ecalStatus->setValue(ebid, 0);
2500  }
2501  }
2502  }
2503  // endcap
2504  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
2505  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
2506  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
2507  if (EEDetId::validDetId(iX, iY, 1)) {
2508  EEDetId eedetidpos(iX, iY, 1);
2509  ecalStatus->setValue(eedetidpos, 0);
2510  }
2511  if (EEDetId::validDetId(iX, iY, -1)) {
2512  EEDetId eedetidneg(iX, iY, -1);
2513  ecalStatus->setValue(eedetidneg, 0);
2514  }
2515  }
2516  }
2517 
2518  // overwrite the statuses which are in the file
2519 
2520  edm::LogInfo("EcalTrivialConditionRetriever")
2521  << "Reading channel statuses from file " << edm::FileInPath(channelStatusFile_).fullPath().c_str();
2522  std::ifstream statusFile(edm::FileInPath(channelStatusFile_).fullPath().c_str());
2523  if (!statusFile.good()) {
2524  edm::LogError("EcalTrivialConditionRetriever") << "*** Problems opening file: " << channelStatusFile_;
2525  throw cms::Exception("Cannot open ECAL channel status file");
2526  }
2527 
2528  std::string EcalSubDet;
2529  std::string str;
2530  int hashIndex(0);
2531  int status(0);
2532 
2533  while (!statusFile.eof()) {
2534  statusFile >> EcalSubDet;
2535  if (EcalSubDet != std::string("EB") && EcalSubDet != std::string("EE")) {
2536  std::getline(statusFile, str);
2537  continue;
2538  } else {
2539  statusFile >> hashIndex >> status;
2540  }
2541  // std::cout << EcalSubDet << " " << hashIndex << " " << status;
2542 
2543  if (EcalSubDet == std::string("EB")) {
2544  EBDetId ebid = EBDetId::unhashIndex(hashIndex);
2545  ecalStatus->setValue(ebid, status);
2546  } else if (EcalSubDet == std::string("EE")) {
2547  EEDetId eedetid = EEDetId::unhashIndex(hashIndex);
2548  ecalStatus->setValue(eedetid, status);
2549  } else {
2550  edm::LogError("EcalTrivialConditionRetriever") << " *** " << EcalSubDet << " is neither EB nor EE ";
2551  }
2552  }
2553  // the file is supposed to be in the form -- FIXME
2554 
2555  statusFile.close();
2556  return ecalStatus;
2557 }
2558 
2560  const EcalTPGCrystalStatusRcd&) {
2561  auto ical = std::make_unique<EcalTPGCrystalStatus>();
2562  // barrel
2563  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
2564  if (ieta == 0)
2565  continue;
2566  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
2567  if (EBDetId::validDetId(ieta, iphi)) {
2568  EBDetId ebid(ieta, iphi);
2569  ical->setValue(ebid, 0);
2570  }
2571  }
2572  }
2573  // endcap
2574  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
2575  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
2576  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
2577  if (EEDetId::validDetId(iX, iY, 1)) {
2578  EEDetId eedetidpos(iX, iY, 1);
2579  ical->setValue(eedetidpos, 0);
2580  }
2581  if (EEDetId::validDetId(iX, iY, -1)) {
2582  EEDetId eedetidneg(iX, iY, -1);
2583  ical->setValue(eedetidneg, 0);
2584  }
2585  }
2586  }
2587  return ical;
2588 }
2589 
2591  const EcalIntercalibConstantsRcd&) {
2592  std::unique_ptr<EcalIntercalibConstants> ical;
2593  // std::make_unique<EcalIntercalibConstants>();
2594 
2595  // Read the values from a txt file
2596  // -------------------------------
2597 
2598  edm::LogInfo("EcalTrivialConditionRetriever")
2599  << "Reading intercalibration constants from file " << intercalibConstantsFile_.c_str();
2600 
2601  if (intercalibConstantsFile_.find(".xml") != std::string::npos) {
2602  edm::LogInfo("generating Intercalib from xml file");
2603 
2604  EcalCondHeader h;
2606  EcalIntercalibConstantsXMLTranslator::readXML(intercalibConstantsFile_, h, *rcd);
2607 
2608  if (totLumi_ != 0 || instLumi_ != 0) {
2609  edm::LogInfo("implementing ageing for intercalib");
2610 
2612 
2613  if (intercalibConstantsMCFile_.find(".xml") != std::string::npos) {
2614  edm::LogInfo("generating IntercalibMC from xml file");
2615 
2616  EcalCondHeader h;
2617  EcalIntercalibConstantsMCXMLTranslator::readXML(intercalibConstantsMCFile_, h, *rcdMC);
2618 
2619  } else {
2620  edm::LogInfo("please provide the xml file of the EcalIntercalibConstantsMC");
2621  }
2622 
2623  TRandom3* gRandom = new TRandom3();
2624 
2625  EnergyResolutionVsLumi ageing;
2626  ageing.setLumi(totLumi_);
2627  ageing.setInstLumi(instLumi_);
2628 
2629  const EcalIntercalibConstantMap& mymap = rcd->getMap();
2630  const EcalIntercalibConstantMCMap& mymapMC = rcdMC->getMap();
2631 
2632  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
2633  if (ieta == 0)
2634  continue;
2635 
2636  double eta = EBDetId::approxEta(EBDetId(ieta, 1));
2637  eta = fabs(eta);
2638  double constantTerm = ageing.calcresolutitonConstantTerm(eta);
2639  edm::LogInfo("EB at eta=") << eta << " constant term is " << constantTerm;
2640 
2641  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
2642  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
2643  if (EBDetId::validDetId(ieta, iphi)) {
2644  EBDetId ebid(ieta, iphi);
2645  EcalIntercalibConstants::const_iterator idref = mymap.find(ebid);
2646  EcalIntercalibConstant icalconstant = 1;
2647  if (idref != mymap.end())
2648  icalconstant = (*idref);
2649 
2650  EcalIntercalibConstantsMC::const_iterator idrefMC = mymapMC.find(ebid);
2651  EcalIntercalibConstantMC icalconstantMC = 1;
2652  if (idrefMC != mymapMC.end())
2653  icalconstantMC = (*idrefMC);
2654 
2655  double r = gRandom->Gaus(0, constantTerm);
2656 
2657  if (iphi == 10)
2658  edm::LogInfo("EB at eta=") << eta << " IC=" << icalconstant << " ICMC=" << icalconstantMC
2659  << " smear=" << r << " ";
2660 
2661  icalconstant = icalconstant + r * 1.29 * icalconstantMC;
2662  rcd->setValue(ebid.rawId(), icalconstant);
2663 
2664  if (iphi == 10)
2665  edm::LogInfo("newIC=") << icalconstant;
2666 
2667  EcalIntercalibConstant icalconstant2 = (*idref);
2668  if (icalconstant != icalconstant2)
2669  edm::LogInfo(">>>> error in smearing intercalib");
2670  }
2671  }
2672  }
2673 
2674  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
2675  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
2676  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
2677  if (EEDetId::validDetId(iX, iY, 1)) {
2678  EEDetId eedetidpos(iX, iY, 1);
2679  double eta =
2680  -log(tan(0.5 * atan(sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2681  eta = fabs(eta);
2682  double constantTerm = ageing.calcresolutitonConstantTerm(eta);
2683  if (iX == 50)
2684  edm::LogInfo("EE at eta=") << eta << " constant term is " << constantTerm;
2685 
2686  EcalIntercalibConstants::const_iterator idref = mymap.find(eedetidpos);
2687  EcalIntercalibConstant icalconstant = 1;
2688  if (idref != mymap.end())
2689  icalconstant = (*idref);
2690 
2691  EcalIntercalibConstantsMC::const_iterator idrefMC = mymapMC.find(eedetidpos);
2692  EcalIntercalibConstantMC icalconstantMC = 1;
2693  if (idrefMC != mymapMC.end())
2694  icalconstantMC = (*idrefMC);
2695 
2696  double r = gRandom->Gaus(0, constantTerm);
2697 
2698  if (iX == 10)
2699  edm::LogInfo("EE at eta=") << eta << " IC=" << icalconstant << " ICMC=" << icalconstantMC
2700  << " smear=" << r << " ";
2701  icalconstant = icalconstant + r * 1.29 * icalconstantMC;
2702  rcd->setValue(eedetidpos.rawId(), icalconstant);
2703  if (iX == 10)
2704  edm::LogInfo("newIC=") << icalconstant;
2705  }
2706  if (EEDetId::validDetId(iX, iY, -1)) {
2707  EEDetId eedetidneg(iX, iY, -1);
2708  double eta =
2709  -log(tan(0.5 * atan(sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2710  eta = fabs(eta);
2711  double constantTerm = ageing.calcresolutitonConstantTerm(eta);
2712  EcalIntercalibConstant icalconstant = 1;
2713 
2714  EcalIntercalibConstantsMC::const_iterator idrefMC = mymapMC.find(eedetidneg);
2715  EcalIntercalibConstantMC icalconstantMC = 1;
2716  if (idrefMC != mymapMC.end())
2717  icalconstantMC = (*idrefMC);
2718 
2719  double r = gRandom->Gaus(0, constantTerm);
2720  icalconstant = icalconstant + r * 1.29 * icalconstantMC;
2721  rcd->setValue(eedetidneg.rawId(), icalconstant);
2722  }
2723  }
2724  }
2725 
2726  ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2727 
2728  delete gRandom;
2729  }
2730 
2731  } else {
2732  ical = std::make_unique<EcalIntercalibConstants>();
2733 
2734  FILE* inpFile;
2735  inpFile = fopen(intercalibConstantsFile_.c_str(), "r");
2736  if (!inpFile) {
2737  edm::LogError("EcalTrivialConditionRetriever") << "*** Can not open file: " << intercalibConstantsFile_;
2738  throw cms::Exception("Cannot open inter-calibration coefficients txt file");
2739  }
2740 
2741  char line[256];
2742  std::ostringstream str;
2743  fgets(line, 255, inpFile);
2744  int sm_number = atoi(line);
2745  str << "sm: " << sm_number;
2746 
2747  fgets(line, 255, inpFile);
2748  //int nevents=atoi (line) ; // not necessary here just for online conddb
2749 
2750  fgets(line, 255, inpFile);
2751  std::string gen_tag = line;
2752  str << "gen tag: " << gen_tag; // should I use this?
2753 
2754  fgets(line, 255, inpFile);
2755  std::string cali_method = line;
2756  str << "cali method: " << cali_method << std::endl; // not important
2757 
2758  fgets(line, 255, inpFile);
2759  std::string cali_version = line;
2760  str << "cali version: " << cali_version << std::endl; // not important
2761 
2762  fgets(line, 255, inpFile);
2763  std::string cali_type = line;
2764  str << "cali type: " << cali_type; // not important
2765 
2766  edm::LogInfo("EcalTrivialConditionRetriever") << "[PIETRO] Intercalibration file - " << str.str();
2767 
2768  float calib[1700] = {1};
2769  int calib_status[1700] = {0};
2770 
2771  int ii = 0;
2772 
2773  while (fgets(line, 255, inpFile)) {
2774  ii++;
2775  int dmy_num = 0;
2776  float dmy_calib = 0.;
2777  float dmy_RMS = 0.;
2778  int dmy_events = 0;
2779  int dmy_status = 0;
2780  sscanf(line, "%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
2781  assert(dmy_num >= 1);
2782  assert(dmy_num <= 1700);
2783  calib[dmy_num - 1] = dmy_calib;
2784  calib_status[dmy_num - 1] = dmy_status;
2785 
2786  // edm::LogInfo ("EcalTrivialConditionRetriever")
2787  // << "[PIETRO] cry = " << dmy_num
2788  // << " calib = " << calib[dmy_num-1]
2789  // << " RMS = " << dmy_RMS
2790  // << " events = " << dmy_events
2791  // << " status = " << calib_status[dmy_num-1]
2792  // << std::endl ;
2793  }
2794 
2795  fclose(inpFile); // close inp. file
2796  edm::LogInfo("EcalTrivialConditionRetriever") << "Read intercalibrations for " << ii << " xtals ";
2797  if (ii != 1700)
2798  edm::LogWarning("StoreEcalCondition") << "Some crystals missing, set to 1" << std::endl;
2799 
2800  // Transfer the data to the inter-calibration coefficients container
2801  // -----------------------------------------------------------------
2802 
2803  // DB supermodule always set to 1 for the TestBeam FIXME
2804  int sm_db = 1;
2805  // loop over channels
2806  for (int i = 0; i < 1700; i++) {
2807  //if (EBDetId::validDetId(iEta,iPhi)) {
2808  // CANNOT be used -- validDetId only checks ETA PHI method
2809  // doing a check by hand, here is the only place in CMSSW
2810  // outside TB code and EcalRawToDigi where needed
2811  // => no need for changing the DetId interface
2812  //
2813  // checking only sm_db -- guess can change with the above FIXME
2814  if (sm_db >= EBDetId::MIN_SM && sm_db <= EBDetId::MAX_SM) {
2815  EBDetId ebid(sm_db, i + 1, EBDetId::SMCRYSTALMODE);
2816  if (calib_status[i])
2817  ical->setValue(ebid.rawId(), calib[i]);
2818  else
2819  ical->setValue(ebid.rawId(), 1.);
2820  }
2821  //}
2822  } // loop over channels
2823  }
2824 
2825  return ical;
2826 }
2827 
2828 // new for the PF rec hit thresholds
2829 
2831  const EcalPFRecHitThresholdsRcd&) {
2832  std::unique_ptr<EcalPFRecHitThresholds> ical;
2833 
2834  // Reads the values from a txt file
2835  edm::LogInfo("EcalTrivialConditionRetriever")
2836  << "Reading PF RecHit Thresholds from file " << edm::FileInPath(pfRecHitFile_).fullPath().c_str();
2837 
2838  std::ifstream PFRecHitsFile(edm::FileInPath(pfRecHitFile_).fullPath().c_str());
2839 
2840  ical = std::make_unique<EcalPFRecHitThresholds>();
2841 
2842  // char line[50];
2843 
2844  int nxt = 0;
2845 
2846  edm::LogInfo("Going to multiply the sigmas by ") << pfRecHitThresholdsNSigmas_;
2847  edm::LogInfo("We will print some values ");
2848 
2849  while (!PFRecHitsFile.eof()) {
2850  // while (fgets(line,50,inpFile)) {
2851  float thresh;
2852  int eta = 0;
2853  int phi = 0;
2854  int zeta = 0;
2855  PFRecHitsFile >> eta >> phi >> zeta >> thresh;
2856  // sscanf(line, "%d %d %d %f", &eta, &phi, &zeta, &thresh);
2857 
2858  thresh = thresh * pfRecHitThresholdsNSigmas_;
2859 
2860  if (phi == 50)
2861  edm::LogInfo("EB ") << std::dec << eta << "/" << std::dec << phi << "/" << std::dec << zeta
2862  << " thresh: " << thresh;
2863  nxt = nxt + 1;
2864 
2865  EBDetId ebid(eta, phi);
2866  ical->setValue(ebid, thresh);
2867  }
2868  PFRecHitsFile.close();
2869  // fclose(inpFile);
2870 
2871  edm::LogInfo("Read number of EB crystals: ") << nxt;
2872 
2873  //******************************************************
2874  edm::LogInfo("Now reading the EE file ... ");
2875  edm::LogInfo("We will multiply the sigma in EE by ") << pfRecHitThresholdsNSigmas_;
2876  edm::LogInfo("We will multiply the sigma in EE at high eta by") << pfRecHitThresholdsNSigmasHEta_;
2877  edm::LogInfo("We will print some values ");
2878 
2879  edm::LogInfo("EcalTrivialConditionRetriever")
2880  << "Reading PF RecHit Thresholds EE from file " << edm::FileInPath(pfRecHitFileEE_).fullPath().c_str();
2881  std::ifstream PFRecHitsFileEE(edm::FileInPath(pfRecHitFileEE_).fullPath().c_str());
2882 
2883  nxt = 0;
2884 
2885  while (!PFRecHitsFileEE.eof()) {
2886  // while (fgets(line,40,inpFileEE)) {
2887  float thresh;
2888  int ix = 0;
2889  int iy = 0;
2890  int iz = 0;
2891  PFRecHitsFileEE >> ix >> iy >> iz >> thresh;
2892  // sscanf(line, "%d %d %d %f", &ix, &iy,&iz, &thresh);
2893 
2894  double eta =
2895  -log(tan(0.5 * atan(sqrt((ix - 50.5) * (ix - 50.5) + (iy - 50.5) * (iy - 50.5)) * 2.98 / 328.))); // approx eta
2896 
2897  if (eta > 2.5) {
2898  thresh = thresh * pfRecHitThresholdsNSigmasHEta_;
2899  } else {
2900  thresh = thresh * pfRecHitThresholdsNSigmas_;
2901  }
2902 
2903  if (ix == 50)
2904  edm::LogInfo("EE ") << std::dec << ix << "/" << std::dec << iy << "/" << std::dec << iz << " thresh: " << thresh
2905  << " eta=" << eta;
2906 
2907  EEDetId eeid(ix, iy, iz);
2908  ical->setValue(eeid, thresh);
2909  nxt = nxt + 1;
2910  }
2911 
2912  PFRecHitsFileEE.close();
2913  // fclose(inpFileEE);
2914  edm::LogInfo("Read number of EE crystals: ") << nxt;
2915  edm::LogInfo("end PF Rec Hits ... ");
2916 
2917  return ical;
2918 }
2919 
2922  std::unique_ptr<EcalIntercalibConstantsMC> ical;
2923  // std::make_unique<EcalIntercalibConstants>();
2924 
2925  // Read the values from a xml file
2926  // -------------------------------
2927 
2928  edm::LogInfo("EcalTrivialConditionRetriever")
2929  << "Reading intercalibration constants MC from file " << intercalibConstantsMCFile_.c_str();
2930 
2931  if (intercalibConstantsMCFile_.find(".xml") != std::string::npos) {
2932  edm::LogInfo("generating Intercalib MC from xml file");
2933 
2934  EcalCondHeader h;
2936  EcalIntercalibConstantsMCXMLTranslator::readXML(intercalibConstantsMCFile_, h, *rcd);
2937 
2938  ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2939 
2940  } else {
2941  edm::LogInfo("ERROR>>> please provide a xml file");
2942  }
2943 
2944  return ical;
2945 }
2946 
2948  const EcalIntercalibErrorsRcd&) {
2949  auto ical = std::make_unique<EcalIntercalibErrors>();
2950 
2951  // Read the values from a txt file
2952  // -------------------------------
2953 
2954  edm::LogInfo("EcalTrivialConditionRetriever")
2955  << "Reading intercalibration constants from file " << intercalibErrorsFile_.c_str();
2956 
2957  FILE* inpFile;
2958  inpFile = fopen(intercalibErrorsFile_.c_str(), "r");
2959  if (!inpFile) {
2960  edm::LogError("EcalTrivialConditionRetriever") << "*** Can not open file: " << intercalibErrorsFile_;
2961  throw cms::Exception("Cannot open inter-calibration coefficients txt file");
2962  }
2963 
2964  char line[256];
2965  std::ostringstream str;
2966  fgets(line, 255, inpFile);
2967  int sm_number = atoi(line);
2968  str << "sm: " << sm_number;
2969 
2970  fgets(line, 255, inpFile);
2971  //int nevents=atoi (line) ; // not necessary here just for online conddb
2972 
2973  fgets(line, 255, inpFile);
2974  std::string gen_tag = line;
2975  str << "gen tag: " << gen_tag; // should I use this?
2976 
2977  fgets(line, 255, inpFile);
2978  std::string cali_method = line;
2979  str << "cali method: " << cali_method << std::endl; // not important
2980 
2981  fgets(line, 255, inpFile);
2982  std::string cali_version = line;
2983  str << "cali version: " << cali_version << std::endl; // not important
2984 
2985  fgets(line, 255, inpFile);
2986  std::string cali_type = line;
2987  str << "cali type: " << cali_type; // not important
2988 
2989  edm::LogInfo("EcalTrivialConditionRetriever") << "[PIETRO] Intercalibration file - " << str.str() << std::endl;
2990 
2991  float calib[1700] = {1};
2992  int calib_status[1700] = {0};
2993 
2994  int ii = 0;
2995 
2996  while (fgets(line, 255, inpFile)) {
2997  ii++;
2998  int dmy_num = 0;
2999  float dmy_calib = 0.;
3000  float dmy_RMS = 0.;
3001  int dmy_events = 0;
3002  int dmy_status = 0;
3003  sscanf(line, "%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3004  assert(dmy_num >= 1);
3005  assert(dmy_num <= 1700);
3006  calib[dmy_num - 1] = dmy_calib;
3007  calib_status[dmy_num - 1] = dmy_status;
3008 
3009  // edm::LogInfo ("EcalTrivialConditionRetriever")
3010  // << "[PIETRO] cry = " << dmy_num
3011  // << " calib = " << calib[dmy_num-1]
3012  // << " RMS = " << dmy_RMS
3013  // << " events = " << dmy_events
3014  // << " status = " << calib_status[dmy_num-1]
3015  // << std::endl ;
3016  }
3017 
3018  fclose(inpFile); // close inp. file
3019  edm::LogInfo("EcalTrivialConditionRetriever") << "Read intercalibrations for " << ii << " xtals ";
3020  if (ii != 1700)
3021  edm::LogWarning("StoreEcalCondition") << "Some crystals missing, set to 1" << std::endl;
3022 
3023  // Transfer the data to the inter-calibration coefficients container
3024  // -----------------------------------------------------------------
3025 
3026  // DB supermodule always set to 1 for the TestBeam FIXME
3027  int sm_db = 1;
3028  // loop over channels
3029  for (int i = 0; i < 1700; i++) {
3030  //if (EBDetId::validDetId(iEta,iPhi)) {
3031  // CANNOT be used -- validDetId only checks ETA PHI method
3032  // doing a check by hand, here is the only place in CMSSW
3033  // outside TB code and EcalRawToDigi where needed
3034  // => no need for changing the DetId interface
3035  //
3036  // checking only sm_db -- guess can change with the above FIXME
3037  if (sm_db >= EBDetId::MIN_SM && sm_db <= EBDetId::MAX_SM) {
3038  EBDetId ebid(sm_db, i + 1, EBDetId::SMCRYSTALMODE);
3039  if (calib_status[i])
3040  ical->setValue(ebid.rawId(), calib[i]);
3041  else
3042  ical->setValue(ebid.rawId(), 1.);
3043  }
3044  //}
3045  } // loop over channels
3046 
3047  // edm::LogInfo ("EcalTrivialConditionRetriever") << "INTERCALIBRATION DONE" ;
3048  return ical;
3049 }
3050 
3051 // --------------------------------------------------------------------------------
3052 
3054  const EcalTimeCalibConstantsRcd&) {
3055  auto ical = std::make_unique<EcalTimeCalibConstants>();
3056 
3057  // Read the values from a txt file
3058  // -------------------------------
3059 
3060  edm::LogInfo("EcalTrivialConditionRetriever")
3061  << "Reading time calibration constants from file " << timeCalibConstantsFile_.c_str();
3062 
3063  FILE* inpFile;
3064  inpFile = fopen(timeCalibConstantsFile_.c_str(), "r");
3065  if (!inpFile) {
3066  edm::LogError("EcalTrivialConditionRetriever") << "*** Can not open file: " << timeCalibConstantsFile_;
3067  throw cms::Exception("Cannot open inter-calibration coefficients txt file");
3068  }
3069 
3070  char line[256];
3071  std::ostringstream str;
3072  fgets(line, 255, inpFile);
3073  int sm_number = atoi(line);
3074  str << "sm: " << sm_number;
3075 
3076  fgets(line, 255, inpFile);
3077  //int nevents=atoi (line) ; // not necessary here just for online conddb
3078 
3079  fgets(line, 255, inpFile);
3080  std::string gen_tag = line;
3081  str << "gen tag: " << gen_tag; // should I use this?
3082 
3083  fgets(line, 255, inpFile);
3084  std::string cali_method = line;
3085  str << "cali method: " << cali_method << std::endl; // not important
3086 
3087  fgets(line, 255, inpFile);
3088  std::string cali_version = line;
3089  str << "cali version: " << cali_version << std::endl; // not important
3090 
3091  fgets(line, 255, inpFile);
3092  std::string cali_type = line;
3093  str << "cali type: " << cali_type; // not important
3094 
3095  edm::LogInfo("EcalTrivialConditionRetriever") << "TimeCalibration file - " << str.str() << std::endl;
3096 
3097  float calib[1700] = {1};
3098  int calib_status[1700] = {0};
3099 
3100  int ii = 0;
3101 
3102  while (fgets(line, 255, inpFile)) {
3103  ii++;
3104  int dmy_num = 0;
3105  float dmy_calib = 0.;
3106  float dmy_RMS = 0.;
3107  int dmy_events = 0;
3108  int dmy_status = 0;
3109  sscanf(line, "%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3110  assert(dmy_num >= 1);
3111  assert(dmy_num <= 1700);
3112  calib[dmy_num - 1] = dmy_calib;
3113  calib_status[dmy_num - 1] = dmy_status;
3114 
3115  // edm::LogInfo ("EcalTrivialConditionRetriever")
3116  // << "[PIETRO] cry = " << dmy_num
3117  // << " calib = " << calib[dmy_num-1]
3118  // << " RMS = " << dmy_RMS
3119  // << " events = " << dmy_events
3120  // << " status = " << calib_status[dmy_num-1]
3121  // << std::endl ;
3122  }
3123 
3124  fclose(inpFile); // close inp. file
3125  edm::LogInfo("EcalTrivialConditionRetriever") << "Read timeCalibrations for " << ii << " xtals ";
3126  if (ii != 1700)
3127  edm::LogWarning("StoreEcalCondition") << "Some crystals missing, set to 1" << std::endl;
3128 
3129  // Transfer the data to the inter-calibration coefficients container
3130  // -----------------------------------------------------------------
3131 
3132  // DB supermodule always set to 1 for the TestBeam FIXME
3133  int sm_db = 1;
3134  // loop over channels
3135  for (int i = 0; i < 1700; i++) {
3136  //if (EBDetId::validDetId(iEta,iPhi)) {
3137  // CANNOT be used -- validDetId only checks ETA PHI method
3138  // doing a check by hand, here is the only place in CMSSW
3139  // outside TB code and EcalRawToDigi where needed
3140  // => no need for changing the DetId interface
3141  //
3142  // checking only sm_db -- guess can change with the above FIXME
3143  if (sm_db >= EBDetId::MIN_SM && sm_db <= EBDetId::MAX_SM) {
3144  EBDetId ebid(sm_db, i + 1, EBDetId::SMCRYSTALMODE);
3145  if (calib_status[i])
3146  ical->setValue(ebid.rawId(), calib[i]);
3147  else
3148  ical->setValue(ebid.rawId(), 1.);
3149  }
3150  //}
3151  } // loop over channels
3152 
3153  // edm::LogInfo ("EcalTrivialConditionRetriever") << "INTERCALIBRATION DONE" ;
3154  return ical;
3155 }
3156 
3158  const EcalTimeCalibErrorsRcd&) {
3159  auto ical = std::make_unique<EcalTimeCalibErrors>();
3160 
3161  // Read the values from a txt file
3162  // -------------------------------
3163 
3164  edm::LogInfo("EcalTrivialConditionRetriever")
3165  << "Reading timeCalibration constants from file " << timeCalibErrorsFile_.c_str();
3166 
3167  FILE* inpFile;
3168  inpFile = fopen(timeCalibErrorsFile_.c_str(), "r");
3169  if (!inpFile) {
3170  edm::LogError("EcalTrivialConditionRetriever") << "*** Can not open file: " << timeCalibErrorsFile_;
3171  throw cms::Exception("Cannot open inter-calibration coefficients txt file");
3172  }
3173 
3174  char line[256];
3175  std::ostringstream str;
3176  fgets(line, 255, inpFile);
3177  int sm_number = atoi(line);
3178  str << "sm: " << sm_number;
3179 
3180  fgets(line, 255, inpFile);
3181  //int nevents=atoi (line) ; // not necessary here just for online conddb
3182 
3183  fgets(line, 255, inpFile);
3184  std::string gen_tag = line;
3185  str << "gen tag: " << gen_tag; // should I use this?
3186 
3187  fgets(line, 255, inpFile);
3188  std::string cali_method = line;
3189  str << "cali method: " << cali_method << std::endl; // not important
3190 
3191  fgets(line, 255, inpFile);
3192  std::string cali_version = line;
3193  str << "cali version: " << cali_version << std::endl; // not important
3194 
3195  fgets(line, 255, inpFile);
3196  std::string cali_type = line;
3197  str << "cali type: " << cali_type; // not important
3198 
3199  edm::LogInfo("EcalTrivialConditionRetriever") << "TimeCalibration file - " << str.str() << std::endl;
3200 
3201  float calib[1700] = {1};
3202  int calib_status[1700] = {0};
3203 
3204  int ii = 0;
3205 
3206  while (fgets(line, 255, inpFile)) {
3207  ii++;
3208  int dmy_num = 0;
3209  float dmy_calib = 0.;
3210  float dmy_RMS = 0.;
3211  int dmy_events = 0;
3212  int dmy_status = 0;
3213  sscanf(line, "%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3214  assert(dmy_num >= 1);
3215  assert(dmy_num <= 1700);
3216  calib[dmy_num - 1] = dmy_calib;
3217  calib_status[dmy_num - 1] = dmy_status;
3218 
3219  // edm::LogInfo ("EcalTrivialConditionRetriever")
3220  // << "[PIETRO] cry = " << dmy_num
3221  // << " calib = " << calib[dmy_num-1]
3222  // << " RMS = " << dmy_RMS
3223  // << " events = " << dmy_events
3224  // << " status = " << calib_status[dmy_num-1]
3225  // << std::endl ;
3226  }
3227 
3228  fclose(inpFile); // close inp. file
3229  edm::LogInfo("EcalTrivialConditionRetriever") << "Read time calibrations for " << ii << " xtals ";
3230  if (ii != 1700)
3231  edm::LogWarning("StoreEcalCondition") << "Some crystals missing, set to 1" << std::endl;
3232 
3233  // Transfer the data to the inter-calibration coefficients container
3234  // -----------------------------------------------------------------
3235 
3236  // DB supermodule always set to 1 for the TestBeam FIXME
3237  int sm_db = 1;
3238  // loop over channels
3239  for (int i = 0; i < 1700; i++) {
3240  //if (EBDetId::validDetId(iEta,iPhi)) {
3241  // CANNOT be used -- validDetId only checks ETA PHI method
3242  // doing a check by hand, here is the only place in CMSSW
3243  // outside TB code and EcalRawToDigi where needed
3244  // => no need for changing the DetId interface
3245  //
3246  // checking only sm_db -- guess can change with the above FIXME
3247  if (sm_db >= EBDetId::MIN_SM && sm_db <= EBDetId::MAX_SM) {
3248  EBDetId ebid(sm_db, i + 1, EBDetId::SMCRYSTALMODE);
3249  if (calib_status[i])
3250  ical->setValue(ebid.rawId(), calib[i]);
3251  else
3252  ical->setValue(ebid.rawId(), 1.);
3253  }
3254  //}
3255  } // loop over channels
3256 
3257  // edm::LogInfo ("EcalTrivialConditionRetriever") << "INTERCALIBRATION DONE" ;
3258  return ical;
3259 }
3260 
3261 // --------------------------------------------------------------------------------
3262 
3263 std::unique_ptr<EcalMappingElectronics> EcalTrivialConditionRetriever::getMappingFromConfiguration(
3264  const EcalMappingElectronicsRcd&) {
3265  auto mapping = std::make_unique<EcalMappingElectronics>();
3266  edm::LogInfo("EcalTrivialConditionRetriever")
3267  << "Reading mapping from file " << edm::FileInPath(mappingFile_).fullPath().c_str();
3268 
3269  std::ifstream f(edm::FileInPath(mappingFile_).fullPath().c_str());
3270  if (!f.good()) {
3271  edm::LogError("EcalTrivialConditionRetriever") << "File not found";
3272  throw cms::Exception("FileNotFound");
3273  }
3274 
3275  // uint32_t detid, elecid, triggerid;
3276 
3277  int ix, iy, iz, CL;
3278  // int dccid, towerid, stripid, xtalid;
3279  // int tccid, tower, ipseudostrip, xtalinps;
3280  int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
3281  int tccid, tower, pseudostrip_in_TCC, pseudostrip_in_TT;
3282 
3283  while (!f.eof()) {
3284  // f >> detid >> elecid >> triggerid;
3285  f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >> tower >>
3286  pseudostrip_in_TCC >> pseudostrip_in_TT;
3287 
3288  // if (!EEDetId::validDetId(ix,iy,iz))
3289  // continue;
3290 
3291  EEDetId detid(ix, iy, iz, EEDetId::XYMODE);
3292  // std::cout << " dcc tower ps_in_SC xtal_in_ps " << dccid << " " << towerid << " " << pseudostrip_in_SC << " " << xtal_in_pseudostrip << std::endl;
3293  EcalElectronicsId elecid(dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
3294  // std::cout << " tcc tt ps_in_TT xtal_in_ps " << tccid << " " << tower << " " << pseudostrip_in_TT << " " << xtal_in_pseudostrip << std::endl;
3295  EcalTriggerElectronicsId triggerid(tccid, tower, pseudostrip_in_TT, xtal_in_pseudostrip);
3296  EcalMappingElement aElement;
3297  aElement.electronicsid = elecid.rawId();
3298  aElement.triggerid = triggerid.rawId();
3299  (*mapping).setValue(detid, aElement);
3300  }
3301 
3302  f.close();
3303  return mapping;
3304 }
3305 
3307  const EcalMappingElectronicsRcd&) {
3308  auto ical = std::make_unique<EcalMappingElectronics>();
3309  return ical;
3310 }
3311 
3312 // --------------------------------------------------------------------------------
3313 
3315  double mytrans[3] = {0., 0., 0.};
3316  double myeuler[3] = {0., 0., 0.};
3317  std::ifstream f;
3318  if (getEBAlignmentFromFile_)
3319  f.open(edm::FileInPath(EBAlignmentFile_).fullPath().c_str());
3320  std::vector<AlignTransform> my_align;
3321  int ieta = 1;
3322  int iphi = 0;
3323  for (int SM = 1; SM < 37; SM++) {
3324  // make an EBDetId since we need EBDetId::rawId()
3325  if (SM > 18) {
3326  iphi = 1 + (SM - 19) * 20;
3327  ieta = -1;
3328  } else
3329  iphi = SM * 20;
3330  EBDetId ebdetId(ieta, iphi);
3331  if (getEBAlignmentFromFile_) {
3332  f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3333  edm::LogInfo(" translation ") << mytrans[0] << " " << mytrans[1] << " " << mytrans[2] << "\n"
3334  << " euler " << myeuler[0] << " " << myeuler[1] << " " << myeuler[2];
3335  }
3336  CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3337  CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3338  AlignTransform transform(translation, euler, ebdetId);
3339  my_align.push_back(transform);
3340  }
3341  /*
3342  // check
3343  uint32_t m_rawid;
3344  double m_x, m_y, m_z;
3345  double m_phi, m_theta, m_psi;
3346  int SM = 0;
3347  for (std::vector<AlignTransform>::const_iterator i = my_align.begin(); i != my_align.end(); ++i){
3348  m_rawid = i->rawId();
3349  CLHEP::Hep3Vector translation = i->translation();
3350  m_x = translation.x();
3351  m_y = translation.y();
3352  m_z = translation.z();
3353  CLHEP::HepRotation rotation = i->rotation();
3354  m_phi = rotation.getPhi();
3355  m_theta = rotation.getTheta();
3356  m_psi = rotation.getPsi();
3357  SM++;
3358  std::cout << " SM " << SM << " Id " << m_rawid << " x " << m_x << " y " << m_y << " z " << m_z
3359  << " phi " << m_phi << " theta " << m_theta << " psi " << m_psi << std::endl;
3360  }
3361  */
3362  Alignments a;
3363  a.m_align = my_align;
3364 
3365  return std::make_unique<Alignments>(a);
3366 }
3367 
3369  double mytrans[3] = {0., 0., 0.};
3370  double myeuler[3] = {0., 0., 0.};
3371  std::ifstream f;
3372  if (getEEAlignmentFromFile_)
3373  f.open(edm::FileInPath(EEAlignmentFile_).fullPath().c_str());
3374  std::vector<AlignTransform> my_align;
3375  int ix = 20;
3376  int iy = 50;
3377  int side = -1;
3378  for (int Dee = 0; Dee < 4; Dee++) {
3379  // make an EEDetId since we need EEDetId::rawId()
3380  if (Dee == 1 || Dee == 3)
3381  ix = 70;
3382  else
3383  ix = 20;
3384  if (Dee == 2)
3385  side = 1;
3386  EEDetId eedetId(ix, iy, side);
3387  if (getEEAlignmentFromFile_) {
3388  f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3389  edm::LogInfo(" translation ") << mytrans[0] << " " << mytrans[1] << " " << mytrans[2] << "\n"
3390  << " euler " << myeuler[0] << " " << myeuler[1] << " " << myeuler[2];
3391  }
3392  CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3393  CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3394  AlignTransform transform(translation, euler, eedetId);
3395  my_align.push_back(transform);
3396  }
3397  Alignments a;
3398  a.m_align = my_align;
3399  return std::make_unique<Alignments>(a);
3400 }
3401 
3403  double mytrans[3] = {0., 0., 0.};
3404  double myeuler[3] = {0., 0., 0.};
3405  std::ifstream f;
3406  if (getESAlignmentFromFile_)
3407  f.open(edm::FileInPath(ESAlignmentFile_).fullPath().c_str());
3408  std::vector<AlignTransform> my_align;
3409  // int ix_vect[10] = {10, 30, 30, 50, 10, 30, 10, 30};
3410  int pl_vect[10] = {2, 2, 1, 1, 1, 1, 2, 2};
3411  int iy = 10;
3412  int side = -1;
3413  int strip = 1;
3414  for (int layer = 0; layer < 8; layer++) {
3415  // make an ESDetId since we need ESDetId::rawId()
3416  int ix = 10 + (layer % 2) * 20;
3417  int plane = pl_vect[layer];
3418  if (layer > 3)
3419  side = 1;
3420  ESDetId esdetId(strip, ix, iy, plane, side);
3421  if (getESAlignmentFromFile_) {
3422  f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3423  edm::LogInfo(" translation ") << mytrans[0] << " " << mytrans[1] << " " << mytrans[2] << "\n"
3424  << " euler " << myeuler[0] << " " << myeuler[1] << " " << myeuler[2];
3425  }
3426  CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3427  CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3428  AlignTransform transform(translation, euler, esdetId);
3429  my_align.push_back(transform);
3430  }
3431  Alignments a;
3432  a.m_align = my_align;
3433  return std::make_unique<Alignments>(a);
3434 }
3435 
3437  return std::unique_ptr<EcalSampleMask>(new EcalSampleMask(sampleMaskEB_, sampleMaskEE_));
3438 }
3439 
3440 std::unique_ptr<EcalTimeBiasCorrections> EcalTrivialConditionRetriever::produceEcalTimeBiasCorrections(
3441  const EcalTimeBiasCorrectionsRcd&) {
3442  auto ipar = std::make_unique<EcalTimeBiasCorrections>();
3443  copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EBTimeCorrAmplitudeBins));
3444  copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(), back_inserter(ipar->EBTimeCorrShiftBins));
3445  copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EETimeCorrAmplitudeBins));
3446  copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(), back_inserter(ipar->EETimeCorrShiftBins));
3447  return ipar;
3448 }
3449 
3451  const EcalSamplesCorrelationRcd&) {
3452  if (getSamplesCorrelationFromFile_) {
3453  std::ifstream f;
3454  f.open(edm::FileInPath(SamplesCorrelationFile_).fullPath().c_str());
3455  float ww;
3456  for (int j = 0; j < 10; ++j) {
3457  f >> ww;
3458  EBG12samplesCorrelation_.push_back(ww);
3459  }
3460  for (int j = 0; j < 10; ++j) {
3461  f >> ww;
3462  EBG6samplesCorrelation_.push_back(ww);
3463  }
3464  for (int j = 0; j < 10; ++j) {
3465  f >> ww;
3466  EBG1samplesCorrelation_.push_back(ww);
3467  }
3468  for (int j = 0; j < 10; ++j) {
3469  f >> ww;
3470  EEG12samplesCorrelation_.push_back(ww);
3471  }
3472  for (int j = 0; j < 10; ++j) {
3473  f >> ww;
3474  EEG6samplesCorrelation_.push_back(ww);
3475  }
3476  for (int j = 0; j < 10; ++j) {
3477  f >> ww;
3478  EEG1samplesCorrelation_.push_back(ww);
3479  }
3480  f.close();
3481  }
3482  auto ipar = std::make_unique<EcalSamplesCorrelation>();
3483  copy(EBG12samplesCorrelation_.begin(), EBG12samplesCorrelation_.end(), back_inserter(ipar->EBG12SamplesCorrelation));
3484  copy(EBG6samplesCorrelation_.begin(), EBG6samplesCorrelation_.end(), back_inserter(ipar->EBG6SamplesCorrelation));
3485  copy(EBG1samplesCorrelation_.begin(), EBG1samplesCorrelation_.end(), back_inserter(ipar->EBG1SamplesCorrelation));
3486  copy(EEG12samplesCorrelation_.begin(), EEG12samplesCorrelation_.end(), back_inserter(ipar->EEG12SamplesCorrelation));
3487  copy(EEG6samplesCorrelation_.begin(), EEG6samplesCorrelation_.end(), back_inserter(ipar->EEG6SamplesCorrelation));
3488  copy(EEG1samplesCorrelation_.begin(), EEG1samplesCorrelation_.end(), back_inserter(ipar->EEG1SamplesCorrelation));
3489  return ipar;
3490 }
3491 
3493  const EcalSimPulseShapeRcd&) {
3494  auto result = std::make_unique<EcalSimPulseShape>();
3495 
3496  // save time interval to be used for the pulse shape
3497  result->time_interval = sim_pulse_shape_TI_;
3498 
3499  // containers to store the shape info
3500  std::vector<double> EBshape;
3501  std::vector<double> EEshape;
3502  std::vector<double> APDshape;
3503 
3504  // --- get the 3 shapes from the user provided txt files
3505  if (!EBSimPulseShapeFile_.empty()) {
3506  std::ifstream shapeEBFile;
3507  shapeEBFile.open(EBSimPulseShapeFile_.c_str());
3508  double ww;
3509  while (shapeEBFile >> ww)
3510  EBshape.push_back(ww);
3511  shapeEBFile.close();
3512  }
3513  if (!EESimPulseShapeFile_.empty()) {
3514  std::ifstream shapeEEFile;
3515  shapeEEFile.open(EESimPulseShapeFile_.c_str());
3516  double ww;
3517  while (shapeEEFile >> ww)
3518  EEshape.push_back(ww);
3519  shapeEEFile.close();
3520  }
3521  if (!APDSimPulseShapeFile_.empty()) {
3522  std::ifstream shapeAPDFile;
3523  shapeAPDFile.open(APDSimPulseShapeFile_.c_str());
3524  double ww;
3525  while (shapeAPDFile >> ww)
3526  APDshape.push_back(ww);
3527  shapeAPDFile.close();
3528  }
3529 
3530  // --- save threshold
3531  result->barrel_thresh = sim_pulse_shape_EB_thresh_;
3532  result->endcap_thresh = sim_pulse_shape_EE_thresh_;
3533  result->apd_thresh = sim_pulse_shape_APD_thresh_;
3534 
3535  // --- copy
3536  copy(EBshape.begin(), EBshape.end(), back_inserter(result->barrel_shape));
3537  copy(EEshape.begin(), EEshape.end(), back_inserter(result->endcap_shape));
3538  copy(APDshape.begin(), APDshape.end(), back_inserter(result->apd_shape));
3539 
3540  return result;
3541 }
EcalCondObjectContainer::getMap
const self & getMap() const
Definition: EcalCondObjectContainer.h:80
EcalTimeDependentCorrections::Values
Definition: EcalTimeDependentCorrections.h:16
EcalTrivialConditionRetriever::produceEcalPedestals
virtual std::unique_ptr< EcalPedestals > produceEcalPedestals(const EcalPedestalsRcd &)
Definition: EcalTrivialConditionRetriever.cc:564
EcalCondObjectContainer::end
const_iterator end() const
Definition: EcalCondObjectContainer.h:76
EcalLaserAPDPNRatios::EcalLaserAPDPNpair::p1
float p1
Definition: EcalLaserAPDPNRatios.h:18
EcalTimeOffsetConstantRcd
Definition: EcalTimeOffsetConstantRcd.h:5
L1DTConfigFromDB_cfi.CL
CL
Definition: L1DTConfigFromDB_cfi.py:283
DDAxes::y
EcalTrivialConditionRetriever::produceEcalLaserAPDPNRatios
virtual std::unique_ptr< EcalLaserAPDPNRatios > produceEcalLaserAPDPNRatios(const EcalLaserAPDPNRatiosRcd &)
Definition: EcalTrivialConditionRetriever.cc:1573
EcalElectronicsId.h
mps_fire.i
i
Definition: mps_fire.py:355
EnergyResolutionVsLumi
Definition: EnergyResolutionVsLumi.h:18
EcalTimeDependentCorrections::Times::t2
edm::Timestamp t2
Definition: EcalTimeDependentCorrections.h:27
EcalPFRecHitThresholdsRcd
Definition: EcalPFRecHitThresholdsRcd.h:5
MessageLogger.h
HLT_2018_cff.constantTerm
constantTerm
Definition: HLT_2018_cff.py:11837
EcalLaserAPDPNRatiosRcd
Definition: EcalLaserAPDPNRatiosRcd.h:24
EcalTrivialConditionRetriever::getEcalSimPulseShapeFromConfiguration
virtual std::unique_ptr< EcalSimPulseShape > getEcalSimPulseShapeFromConfiguration(const EcalSimPulseShapeRcd &)
Definition: EcalTrivialConditionRetriever.cc:3492
EcalMGPAGainRatio::setGain6Over1
void setGain6Over1(const float &g)
Definition: EcalMGPAGainRatio.h:23
EcalPedestal::mean_x6
float mean_x6
Definition: EcalPedestals.h:21
EBDetId::approxEta
float approxEta() const
Definition: EBDetId.h:102
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
EcalSamplesCorrelationRcd
Definition: EcalSamplesCorrelationRcd.h:12
EcalTriggerElectronicsId
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
Definition: EcalTriggerElectronicsId.h:18
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
EcalIntercalibErrorsRcd
Definition: EcalIntercalibErrorsRcd.h:5
EcalTrivialConditionRetriever::produceEcalTrgChannelStatus
virtual std::unique_ptr< EcalTPGCrystalStatus > produceEcalTrgChannelStatus(const EcalTPGCrystalStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2559
EcalTrivialConditionRetriever::produceEcalLaserAlphas
virtual std::unique_ptr< EcalLaserAlphas > produceEcalLaserAlphas(const EcalLaserAlphasRcd &)
Definition: EcalTrivialConditionRetriever.cc:1295
mps_update.status
status
Definition: mps_update.py:69
EcalTimeCalibErrorsRcd
Definition: EcalTimeCalibErrorsRcd.h:5
zMuMuMuonUserData.alpha
alpha
zGenParticlesMatch = cms.InputTag(""),
Definition: zMuMuMuonUserData.py:9
EcalTrivialConditionRetriever::produceEcalDCSTowerStatus
virtual std::unique_ptr< EcalDCSTowerStatus > produceEcalDCSTowerStatus(const EcalDCSTowerStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2398
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalLaserAPDPNRatios::EcalLaserTimeStamp::t3
edm::Timestamp t3
Definition: EcalLaserAPDPNRatios.h:28
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
EEDetId::unhashIndex
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
ESAlignmentRcd
Definition: ESAlignmentRcd.h:6
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
pos
Definition: PixelAliasList.h:18
EcalTPGCrystalStatusRcd
Definition: EcalTPGCrystalStatusRcd.h:5
EBDetId::MAX_SM
static const int MAX_SM
Definition: EBDetId.h:146
EBDetId.h
EcalSampleMask
Definition: EcalSampleMask.h:16
EEDetId.h
EEAlignmentRcd
Definition: EEAlignmentRcd.h:6
EcalScDetId::validDetId
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:59
EcalTimeBiasCorrectionsRcd
Definition: EcalTimeBiasCorrectionsRcd.h:12
edm::LogInfo
Definition: MessageLogger.h:254
EBDetId::unhashIndex
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
edm::ValidityInterval
Definition: ValidityInterval.h:28
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
EcalTrivialConditionRetriever::produceEcalDQMChannelStatus
virtual std::unique_ptr< EcalDQMChannelStatus > produceEcalDQMChannelStatus(const EcalDQMChannelStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2320
cms::cuda::assert
assert(be >=bs)
EcalDCSTowerStatusRcd
Definition: EcalDCSTowerStatusRcd.h:5
EcalTrivialConditionRetriever::produceEcalChannelStatus
virtual std::unique_ptr< EcalChannelStatus > produceEcalChannelStatus(const EcalChannelStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2289
EcalTrivialConditionRetriever::produceEcalLinearCorrections
virtual std::unique_ptr< EcalLinearCorrections > produceEcalLinearCorrections(const EcalLinearCorrectionsRcd &)
Definition: EcalTrivialConditionRetriever.cc:662
EEDetId::IX_MIN
static const int IX_MIN
Definition: EEDetId.h:290
EnergyResolutionVsLumi.h
EcalIntercalibConstantsXMLTranslator.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Timestamp::value
TimeValue_t value() const
Definition: Timestamp.h:45
EcalTrivialConditionRetriever::getPFRecHitThresholdsFromConfiguration
virtual std::unique_ptr< EcalPFRecHitThresholds > getPFRecHitThresholdsFromConfiguration(const EcalPFRecHitThresholdsRcd &)
Definition: EcalTrivialConditionRetriever.cc:2830
ESDetId
Definition: ESDetId.h:15
DDAxes::x
ESDetId.h
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
EEDetId::IY_MIN
static const int IY_MIN
Definition: EEDetId.h:294
EcalCondObjectContainer< float >
EcalIntercalibConstantsMCXMLTranslator.h
EcalFloatCondObjectContainerXMLTranslator::readXML
static int readXML(const std::string &filename, EcalCondHeader &header, EcalFloatCondObjectContainer &record)
Definition: EcalFloatCondObjectContainerXMLTranslator.cc:23
EcalLaserAPDPNRatiosRefRcd
Definition: EcalLaserAPDPNRatiosRefRcd.h:24
EcalXtalGroupId
Definition: EcalXtalGroupId.h:11
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
EcalBarrel
Definition: EcalSubdetector.h:10
EcalIntercalibConstant
float EcalIntercalibConstant
Definition: EcalIntercalibConstants.h:10
EcalTBWeightsRcd
Definition: EcalTBWeightsRcd.h:5
EcalTrivialConditionRetriever::getIntercalibErrorsFromConfiguration
virtual std::unique_ptr< EcalIntercalibErrors > getIntercalibErrorsFromConfiguration(const EcalIntercalibErrorsRcd &)
Definition: EcalTrivialConditionRetriever.cc:2947
EcalTimeDependentCorrections::Values::p3
float p3
Definition: EcalTimeDependentCorrections.h:20
EcalTrivialConditionRetriever.h
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
EcalPedestal::mean_x1
float mean_x1
Definition: EcalPedestals.h:23
EcalWeightSet::EcalWeightMatrix
math::Matrix< 3, 10 >::type EcalWeightMatrix
Definition: EcalWeightSet.h:19
EcalTimeDependentCorrections::Values::p1
float p1
Definition: EcalTimeDependentCorrections.h:18
edm::FileInPath
Definition: FileInPath.h:64
EcalTrivialConditionRetriever::produceEcalPFRecHitThresholds
virtual std::unique_ptr< EcalPFRecHitThresholds > produceEcalPFRecHitThresholds(const EcalPFRecHitThresholdsRcd &)
Definition: EcalTrivialConditionRetriever.cc:735
EcalTrivialConditionRetriever::produceEcalClusterEnergyUncertaintyParameters
virtual std::unique_ptr< EcalClusterEnergyUncertaintyParameters > produceEcalClusterEnergyUncertaintyParameters(const EcalClusterEnergyUncertaintyParametersRcd &)
Definition: EcalTrivialConditionRetriever.cc:1099
EcalTimeDependentCorrections::Times::t3
edm::Timestamp t3
Definition: EcalTimeDependentCorrections.h:28
EcalMappingElement::triggerid
uint32_t triggerid
Definition: EcalMappingElectronics.h:15
h
EcalTrivialConditionRetriever::produceEcalTBWeights
virtual std::unique_ptr< EcalTBWeights > produceEcalTBWeights(const EcalTBWeightsRcd &)
Definition: EcalTrivialConditionRetriever.cc:990
EcalPedestal::mean_x12
float mean_x12
Definition: EcalPedestals.h:19
EnergyResolutionVsLumi::calcampDropTotal
double calcampDropTotal(double eta)
Definition: EnergyResolutionVsLumi.cc:158
EcalSampleMaskRcd
Definition: EcalSampleMaskRcd.h:5
EcalTrivialConditionRetriever::produceEcalTimeOffsetConstant
virtual std::unique_ptr< EcalTimeOffsetConstant > produceEcalTimeOffsetConstant(const EcalTimeOffsetConstantRcd &)
Definition: EcalTrivialConditionRetriever.cc:944
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalClusterEnergyCorrectionObjectSpecificParametersRcd
Definition: EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h:5
DDAxes::z
EcalScDetId
Definition: EcalScDetId.h:24
str
#define str(s)
Definition: TestProcessor.cc:48
EcalTrivialConditionRetriever::getWeightsFromConfiguration
void getWeightsFromConfiguration(const edm::ParameterSet &ps)
Definition: EcalTrivialConditionRetriever.cc:1665
EcalTrivialConditionRetriever::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition: EcalTrivialConditionRetriever.cc:553
EcalCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: EcalCondObjectContainer.h:53
EcalPedestal::rms_x12
float rms_x12
Definition: EcalPedestals.h:20
EBDetId::MAX_IPHI
static const int MAX_IPHI
Definition: EBDetId.h:137
EEDetId::IY_MAX
static const int IY_MAX
Definition: EEDetId.h:302
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
edm::eventsetup::EventSetupRecordKey::name
const char * name() const
Definition: EventSetupRecordKey.h:46
EcalIntercalibConstants
EcalIntercalibConstantMap EcalIntercalibConstants
Definition: EcalIntercalibConstants.h:12
dqmdumpme.k
k
Definition: dqmdumpme.py:60
EcalClusterEnergyUncertaintyParametersRcd
Definition: EcalClusterEnergyUncertaintyParametersRcd.h:5
EcalWeightSet::getWeightsAfterGainSwitch
EcalWeightMatrix & getWeightsAfterGainSwitch()
Definition: EcalWeightSet.h:27
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
AlignTransform
Definition: AlignTransform.h:15
EEDetId
Definition: EEDetId.h:14
EcalGainRatiosRcd
Definition: EcalGainRatiosRcd.h:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
calib
Definition: CalibElectron.h:12
EcalDQMTowerStatusRcd
Definition: EcalDQMTowerStatusRcd.h:5
EcalSubdetector.h
EcalMappingElement::electronicsid
uint32_t electronicsid
Definition: EcalMappingElectronics.h:14
EcalMGPAGainRatio::setGain12Over6
void setGain12Over6(const float &g)
Definition: EcalMGPAGainRatio.h:22
edm::LogWarning
Definition: MessageLogger.h:141
EcalWeightSet::getWeightsBeforeGainSwitch
EcalWeightMatrix & getWeightsBeforeGainSwitch()
Definition: EcalWeightSet.h:26
EcalTrivialConditionRetriever::produceEcalWeightXtalGroups
virtual std::unique_ptr< EcalWeightXtalGroups > produceEcalWeightXtalGroups(const EcalWeightXtalGroupsRcd &)
Definition: EcalTrivialConditionRetriever.cc:629
EcalTrivialConditionRetriever::produceEcalSamplesCorrelation
virtual std::unique_ptr< EcalSamplesCorrelation > produceEcalSamplesCorrelation(const EcalSamplesCorrelationRcd &)
Definition: EcalTrivialConditionRetriever.cc:3450
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
EcalCondObjectContainer::setValue
void setValue(const uint32_t id, const Item &item)
Definition: EcalCondObjectContainer.h:78
EcalLaserAPDPNRatios::EcalLaserAPDPNpair
Definition: EcalLaserAPDPNRatios.h:16
EcalIntercalibConstantsMCRcd
Definition: EcalIntercalibConstantsMCRcd.h:5
EcalTrivialConditionRetriever::getTrgChannelStatusFromConfiguration
virtual std::unique_ptr< EcalTPGCrystalStatus > getTrgChannelStatusFromConfiguration(const EcalTPGCrystalStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2486
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
a
double a
Definition: hdecay.h:119
EcalTimeDependentCorrections::Values::p2
float p2
Definition: EcalTimeDependentCorrections.h:19
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
EcalTrivialConditionRetriever::produceEcalAlignmentES
virtual std::unique_ptr< Alignments > produceEcalAlignmentES(const ESAlignmentRcd &)
Definition: EcalTrivialConditionRetriever.cc:3402
EcalTrivialConditionRetriever::getChannelStatusFromConfiguration
virtual std::unique_ptr< EcalChannelStatus > getChannelStatusFromConfiguration(const EcalChannelStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2216
EcalChannelStatusRcd
Definition: EcalChannelStatusRcd.h:5
EcalTrivialConditionRetriever::produceEcalDQMTowerStatus
virtual std::unique_ptr< EcalDQMTowerStatus > produceEcalDQMTowerStatus(const EcalDQMTowerStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2354
EcalTrivialConditionRetriever::EcalTrivialConditionRetriever
EcalTrivialConditionRetriever(const edm::ParameterSet &pset)
Definition: EcalTrivialConditionRetriever.cc:29
EcalTrigTowerDetId::validDetId
static bool validDetId(int iz, EcalSubdetector sd, int i, int j)
check if a valid index combination
Definition: EcalTrigTowerDetId.cc:86
EcalCondHeader
Definition: EcalCondHeader.h:16
EcalWeightSet::EcalChi2WeightMatrix
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
Definition: EcalWeightSet.h:20
EcalLaserAPDPNRatios::EcalLaserTimeStamp::t1
edm::Timestamp t1
Definition: EcalLaserAPDPNRatios.h:26
EcalTrivialConditionRetriever::getTimeCalibConstantsFromConfiguration
virtual std::unique_ptr< EcalTimeCalibConstants > getTimeCalibConstantsFromConfiguration(const EcalTimeCalibConstantsRcd &)
Definition: EcalTrivialConditionRetriever.cc:3053
EEDetId::IX_MAX
static const int IX_MAX
Definition: EEDetId.h:298
EcalWeightSet::getChi2WeightsAfterGainSwitch
EcalChi2WeightMatrix & getChi2WeightsAfterGainSwitch()
Definition: EcalWeightSet.h:29
EcalTrivialConditionRetriever::produceEcalSampleMask
virtual std::unique_ptr< EcalSampleMask > produceEcalSampleMask(const EcalSampleMaskRcd &)
Definition: EcalTrivialConditionRetriever.cc:3436
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
EnergyResolutionVsLumi::setLumi
void setLumi(double x)
Definition: EnergyResolutionVsLumi.h:45
createfilelist.int
int
Definition: createfilelist.py:10
edm::Timestamp::endOfTime
static Timestamp endOfTime()
Definition: Timestamp.h:83
EcalTriggerElectronicsId.h
EcalPedestal::rms_x1
float rms_x1
Definition: EcalPedestals.h:24
EcalDQMChannelStatusRcd
Definition: EcalDQMChannelStatusRcd.h:5
EcalLaserAlphasRcd
Definition: EcalLaserAlphasRcd.h:24
EcalLinearCorrectionsRcd
Definition: EcalLinearCorrectionsRcd.h:5
EcalElectronicsId::rawId
uint32_t rawId() const
Definition: EcalElectronicsId.h:28
EcalTrivialConditionRetriever::produceEcalTimeBiasCorrections
virtual std::unique_ptr< EcalTimeBiasCorrections > produceEcalTimeBiasCorrections(const EcalTimeBiasCorrectionsRcd &)
Definition: EcalTrivialConditionRetriever.cc:3440
EcalTrivialConditionRetriever::getIntercalibConstantsMCFromConfiguration
virtual std::unique_ptr< EcalIntercalibConstantsMC > getIntercalibConstantsMCFromConfiguration(const EcalIntercalibConstantsMCRcd &)
Definition: EcalTrivialConditionRetriever.cc:2920
rand
Signal rand(Signal arg)
Definition: vlib.cc:379
EBDetId::MIN_SM
static const int MIN_SM
Definition: EBDetId.h:145
EcalTrivialConditionRetriever::produceEcalClusterCrackCorrParameters
virtual std::unique_ptr< EcalClusterCrackCorrParameters > produceEcalClusterCrackCorrParameters(const EcalClusterCrackCorrParametersRcd &)
Definition: EcalTrivialConditionRetriever.cc:1081
EcalTrivialConditionRetriever::~EcalTrivialConditionRetriever
~EcalTrivialConditionRetriever() override
Definition: EcalTrivialConditionRetriever.cc:548
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
EcalTimeCalibConstantsRcd
Definition: EcalTimeCalibConstantsRcd.h:5
photonOfflineClient_cfi.batch
batch
Definition: photonOfflineClient_cfi.py:12
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GOODCOLL_filter_cfg.thresh
thresh
Definition: GOODCOLL_filter_cfg.py:74
EcalWeightSet
Definition: EcalWeightSet.h:17
EBDetId::validDetId
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
EcalTrivialConditionRetriever::produceEcalAlignmentEE
virtual std::unique_ptr< Alignments > produceEcalAlignmentEE(const EEAlignmentRcd &)
Definition: EcalTrivialConditionRetriever.cc:3368
DDAxes::phi
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::IOVSyncValue::time
const Timestamp & time() const
Definition: IOVSyncValue.h:42
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
type
type
Definition: HCALResponse.h:21
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalTrivialConditionRetriever::getMappingFromConfiguration
virtual std::unique_ptr< EcalMappingElectronics > getMappingFromConfiguration(const EcalMappingElectronicsRcd &)
Definition: EcalTrivialConditionRetriever.cc:3263
EcalTimeDependentCorrections::Times::t1
edm::Timestamp t1
Definition: EcalTimeDependentCorrections.h:26
EcalTrivialConditionRetriever::produceEcalMappingElectronics
virtual std::unique_ptr< EcalMappingElectronics > produceEcalMappingElectronics(const EcalMappingElectronicsRcd &)
Definition: EcalTrivialConditionRetriever.cc:3306
EcalIntercalibConstantMC
float EcalIntercalibConstantMC
Definition: EcalIntercalibConstantsMC.h:10
EcalTrivialConditionRetriever::produceEcalADCToGeVConstant
virtual std::unique_ptr< EcalADCToGeVConstant > produceEcalADCToGeVConstant(const EcalADCToGeVConstantRcd &)
Definition: EcalTrivialConditionRetriever.cc:985
EEDetId::XYMODE
static const int XYMODE
Definition: EEDetId.h:335
EcalTrivialConditionRetriever::produceEcalClusterEnergyCorrectionObjectSpecificParameters
virtual std::unique_ptr< EcalClusterEnergyCorrectionObjectSpecificParameters > produceEcalClusterEnergyCorrectionObjectSpecificParameters(const EcalClusterEnergyCorrectionObjectSpecificParametersRcd &)
Definition: EcalTrivialConditionRetriever.cc:1108
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
EcalTimeDependentCorrections::Times
Definition: EcalTimeDependentCorrections.h:24
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
EcalTrivialConditionRetriever::produceEcalIntercalibConstants
virtual std::unique_ptr< EcalIntercalibConstants > produceEcalIntercalibConstants(const EcalIntercalibConstantsRcd &)
Definition: EcalTrivialConditionRetriever.cc:770
EcalPedestal
Definition: EcalPedestals.h:8
EBAlignmentRcd
Definition: EBAlignmentRcd.h:6
EcalTrivialConditionRetriever::produceEcalClusterEnergyCorrectionParameters
virtual std::unique_ptr< EcalClusterEnergyCorrectionParameters > produceEcalClusterEnergyCorrectionParameters(const EcalClusterEnergyCorrectionParametersRcd &)
Definition: EcalTrivialConditionRetriever.cc:1090
EnergyResolutionVsLumi::calcresolutitonConstantTerm
double calcresolutitonConstantTerm(double eta)
Definition: EnergyResolutionVsLumi.cc:189
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
EcalClusterEnergyCorrectionParametersRcd
Definition: EcalClusterEnergyCorrectionParametersRcd.h:5
Exception.h
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
EcalTrivialConditionRetriever::produceEcalTimeCalibErrors
virtual std::unique_ptr< EcalTimeCalibErrors > produceEcalTimeCalibErrors(const EcalTimeCalibErrorsRcd &)
Definition: EcalTrivialConditionRetriever.cc:911
EcalTrivialConditionRetriever::produceEcalGainRatios
virtual std::unique_ptr< EcalGainRatios > produceEcalGainRatios(const EcalGainRatiosRcd &)
Definition: EcalTrivialConditionRetriever.cc:951
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
EcalTrivialConditionRetriever::produceEcalIntercalibConstantsMC
virtual std::unique_ptr< EcalIntercalibConstantsMC > produceEcalIntercalibConstantsMC(const EcalIntercalibConstantsMCRcd &)
Definition: EcalTrivialConditionRetriever.cc:806
EnergyResolutionVsLumi::setInstLumi
void setInstLumi(double x)
Definition: EnergyResolutionVsLumi.h:46
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
EcalCondObjectContainer< float >::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19
drop
const int drop
Definition: GenParticlePruner.cc:48
mps_fire.result
result
Definition: mps_fire.py:303
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
EcalWeightXtalGroupsRcd
Definition: EcalWeightXtalGroupsRcd.h:5
ParameterSet.h
EcalPedestalsRcd
Definition: EcalPedestalsRcd.h:5
EcalClusterLocalContCorrParametersRcd
Definition: EcalClusterLocalContCorrParametersRcd.h:5
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EcalWeightSet::getChi2WeightsBeforeGainSwitch
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
Definition: EcalWeightSet.h:28
EcalMappingElement
Definition: EcalMappingElectronics.h:12
EcalTrivialConditionRetriever::getIntercalibConstantsFromConfiguration
virtual std::unique_ptr< EcalIntercalibConstants > getIntercalibConstantsFromConfiguration(const EcalIntercalibConstantsRcd &)
Definition: EcalTrivialConditionRetriever.cc:2590
EcalClusterCrackCorrParametersRcd
Definition: EcalClusterCrackCorrParametersRcd.h:5
EcalTrivialConditionRetriever::getTimeCalibErrorsFromConfiguration
virtual std::unique_ptr< EcalTimeCalibErrors > getTimeCalibErrorsFromConfiguration(const EcalTimeCalibErrorsRcd &)
Definition: EcalTrivialConditionRetriever.cc:3157
mps_splice.line
line
Definition: mps_splice.py:76
EcalTrivialConditionRetriever::produceEcalLaserAPDPNRatiosRef
virtual std::unique_ptr< EcalLaserAPDPNRatiosRef > produceEcalLaserAPDPNRatiosRef(const EcalLaserAPDPNRatiosRefRcd &)
Definition: EcalTrivialConditionRetriever.cc:1538
EBDetId::SMCRYSTALMODE
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
EcalIntercalibConstantsRcd
Definition: EcalIntercalibConstantsRcd.h:5
Alignments
Definition: Alignments.h:10
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
EcalADCToGeVConstantRcd
Definition: EcalADCToGeVConstantRcd.h:5
cuy.ii
ii
Definition: cuy.py:590
begin
#define begin
Definition: vmac.h:32
EcalIntercalibConstantsMC
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
Definition: EcalIntercalibConstantsMC.h:12
EcalTriggerElectronicsId::rawId
uint32_t rawId() const
Definition: EcalTriggerElectronicsId.h:28
EcalLaserAPDPNRatios::EcalLaserTimeStamp
Definition: EcalLaserAPDPNRatios.h:24
EcalLaserAPDPNRatios::EcalLaserAPDPNpair::p2
float p2
Definition: EcalLaserAPDPNRatios.h:19
EcalDAQTowerStatusRcd
Definition: EcalDAQTowerStatusRcd.h:5
EcalCondDBWriter_cfi.laser
laser
Definition: EcalCondDBWriter_cfi.py:46
EcalMappingElectronicsRcd
Definition: EcalMappingElectronicsRcd.h:5
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
EcalPedestal::rms_x6
float rms_x6
Definition: EcalPedestals.h:22
EBDetId::MAX_IETA
static const int MAX_IETA
Definition: EBDetId.h:136
EcalTrivialConditionRetriever::produceEcalAlignmentEB
virtual std::unique_ptr< Alignments > produceEcalAlignmentEB(const EBAlignmentRcd &)
Definition: EcalTrivialConditionRetriever.cc:3314
EcalTrivialConditionRetriever::produceEcalDAQTowerStatus
virtual std::unique_ptr< EcalDAQTowerStatus > produceEcalDAQTowerStatus(const EcalDAQTowerStatusRcd &)
Definition: EcalTrivialConditionRetriever.cc:2442
EcalTrivialConditionRetriever::produceEcalTimeCalibConstants
virtual std::unique_ptr< EcalTimeCalibConstants > produceEcalTimeCalibConstants(const EcalTimeCalibConstantsRcd &)
Definition: EcalTrivialConditionRetriever.cc:875
EcalMGPAGainRatio
Definition: EcalMGPAGainRatio.h:13
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
EnergyResolutionVsLumi::calcnoiseIncreaseADC
double calcnoiseIncreaseADC(double eta)
Definition: EnergyResolutionVsLumi.cc:165
EcalSimPulseShapeRcd
Definition: EcalSimPulseShapeRcd.h:5
EcalLaserAPDPNRatios::EcalLaserAPDPNpair::p3
float p3
Definition: EcalLaserAPDPNRatios.h:20
EcalTrivialConditionRetriever::produceEcalClusterLocalContCorrParameters
virtual std::unique_ptr< EcalClusterLocalContCorrParameters > produceEcalClusterLocalContCorrParameters(const EcalClusterLocalContCorrParametersRcd &)
Definition: EcalTrivialConditionRetriever.cc:1074
EBDetId::MIN_IPHI
static const int MIN_IPHI
Definition: EBDetId.h:135
EcalLaserAPDPNRatios::EcalLaserTimeStamp::t2
edm::Timestamp t2
Definition: EcalLaserAPDPNRatios.h:27
EcalTrivialConditionRetriever::produceEcalIntercalibErrors
virtual std::unique_ptr< EcalIntercalibErrors > produceEcalIntercalibErrors(const EcalIntercalibErrorsRcd &)
Definition: EcalTrivialConditionRetriever.cc:842
edm::Timestamp
Definition: Timestamp.h:30