CMS 3D CMS Logo

EcalUncalibRecHitWorkerGlobal.cc
Go to the documentation of this file.
2 
7 
16 
19 
21  : EcalUncalibRecHitWorkerRunOneDigiBase(ps, c), testbeamEEShape(EEShape(true)), testbeamEBShape(EBShape(true)) {
22  // ratio method parameters
23  EBtimeFitParameters_ = ps.getParameter<std::vector<double>>("EBtimeFitParameters");
24  EEtimeFitParameters_ = ps.getParameter<std::vector<double>>("EEtimeFitParameters");
25  EBamplitudeFitParameters_ = ps.getParameter<std::vector<double>>("EBamplitudeFitParameters");
26  EEamplitudeFitParameters_ = ps.getParameter<std::vector<double>>("EEamplitudeFitParameters");
27  EBtimeFitLimits_.first = ps.getParameter<double>("EBtimeFitLimits_Lower");
28  EBtimeFitLimits_.second = ps.getParameter<double>("EBtimeFitLimits_Upper");
29  EEtimeFitLimits_.first = ps.getParameter<double>("EEtimeFitLimits_Lower");
30  EEtimeFitLimits_.second = ps.getParameter<double>("EEtimeFitLimits_Upper");
31  EBtimeConstantTerm_ = ps.getParameter<double>("EBtimeConstantTerm");
32  EBtimeNconst_ = ps.getParameter<double>("EBtimeNconst");
33  EEtimeConstantTerm_ = ps.getParameter<double>("EEtimeConstantTerm");
34  EEtimeNconst_ = ps.getParameter<double>("EEtimeNconst");
35  outOfTimeThreshG12pEB_ = ps.getParameter<double>("outOfTimeThresholdGain12pEB");
36  outOfTimeThreshG12mEB_ = ps.getParameter<double>("outOfTimeThresholdGain12mEB");
37  outOfTimeThreshG61pEB_ = ps.getParameter<double>("outOfTimeThresholdGain61pEB");
38  outOfTimeThreshG61mEB_ = ps.getParameter<double>("outOfTimeThresholdGain61mEB");
39  outOfTimeThreshG12pEE_ = ps.getParameter<double>("outOfTimeThresholdGain12pEE");
40  outOfTimeThreshG12mEE_ = ps.getParameter<double>("outOfTimeThresholdGain12mEE");
41  outOfTimeThreshG61pEE_ = ps.getParameter<double>("outOfTimeThresholdGain61pEE");
42  outOfTimeThreshG61mEE_ = ps.getParameter<double>("outOfTimeThresholdGain61mEE");
43  amplitudeThreshEB_ = ps.getParameter<double>("amplitudeThresholdEB");
44  amplitudeThreshEE_ = ps.getParameter<double>("amplitudeThresholdEE");
45 
46  // spike threshold
47  ebSpikeThresh_ = ps.getParameter<double>("ebSpikeThreshold");
48 
49  ebPulseShape_ = ps.getParameter<std::vector<double>>("ebPulseShape");
50  eePulseShape_ = ps.getParameter<std::vector<double>>("eePulseShape");
51 
52  // chi2 parameters
53  kPoorRecoFlagEB_ = ps.getParameter<bool>("kPoorRecoFlagEB");
54  kPoorRecoFlagEE_ = ps.getParameter<bool>("kPoorRecoFlagEE");
55  ;
56  chi2ThreshEB_ = ps.getParameter<double>("chi2ThreshEB_");
57  chi2ThreshEE_ = ps.getParameter<double>("chi2ThreshEE_");
58  EBchi2Parameters_ = ps.getParameter<std::vector<double>>("EBchi2Parameters");
59  EEchi2Parameters_ = ps.getParameter<std::vector<double>>("EEchi2Parameters");
60 }
61 
63  : EcalUncalibRecHitWorkerRunOneDigiBase(ps), testbeamEEShape(EEShape(true)), testbeamEBShape(EBShape(true)) {
64  // ratio method parameters
65  EBtimeFitParameters_ = ps.getParameter<std::vector<double>>("EBtimeFitParameters");
66  EEtimeFitParameters_ = ps.getParameter<std::vector<double>>("EEtimeFitParameters");
67  EBamplitudeFitParameters_ = ps.getParameter<std::vector<double>>("EBamplitudeFitParameters");
68  EEamplitudeFitParameters_ = ps.getParameter<std::vector<double>>("EEamplitudeFitParameters");
69  EBtimeFitLimits_.first = ps.getParameter<double>("EBtimeFitLimits_Lower");
70  EBtimeFitLimits_.second = ps.getParameter<double>("EBtimeFitLimits_Upper");
71  EEtimeFitLimits_.first = ps.getParameter<double>("EEtimeFitLimits_Lower");
72  EEtimeFitLimits_.second = ps.getParameter<double>("EEtimeFitLimits_Upper");
73  EBtimeConstantTerm_ = ps.getParameter<double>("EBtimeConstantTerm");
74  EBtimeNconst_ = ps.getParameter<double>("EBtimeNconst");
75  EEtimeConstantTerm_ = ps.getParameter<double>("EEtimeConstantTerm");
76  EEtimeNconst_ = ps.getParameter<double>("EEtimeNconst");
77  outOfTimeThreshG12pEB_ = ps.getParameter<double>("outOfTimeThresholdGain12pEB");
78  outOfTimeThreshG12mEB_ = ps.getParameter<double>("outOfTimeThresholdGain12mEB");
79  outOfTimeThreshG61pEB_ = ps.getParameter<double>("outOfTimeThresholdGain61pEB");
80  outOfTimeThreshG61mEB_ = ps.getParameter<double>("outOfTimeThresholdGain61mEB");
81  outOfTimeThreshG12pEE_ = ps.getParameter<double>("outOfTimeThresholdGain12pEE");
82  outOfTimeThreshG12mEE_ = ps.getParameter<double>("outOfTimeThresholdGain12mEE");
83  outOfTimeThreshG61pEE_ = ps.getParameter<double>("outOfTimeThresholdGain61pEE");
84  outOfTimeThreshG61mEE_ = ps.getParameter<double>("outOfTimeThresholdGain61mEE");
85  amplitudeThreshEB_ = ps.getParameter<double>("amplitudeThresholdEB");
86  amplitudeThreshEE_ = ps.getParameter<double>("amplitudeThresholdEE");
87 
88  // spike threshold
89  ebSpikeThresh_ = ps.getParameter<double>("ebSpikeThreshold");
90 
91  ebPulseShape_ = ps.getParameter<std::vector<double>>("ebPulseShape");
92  eePulseShape_ = ps.getParameter<std::vector<double>>("eePulseShape");
93  // chi2 parameters
94  kPoorRecoFlagEB_ = ps.getParameter<bool>("kPoorRecoFlagEB");
95  kPoorRecoFlagEE_ = ps.getParameter<bool>("kPoorRecoFlagEE");
96  ;
97  chi2ThreshEB_ = ps.getParameter<double>("chi2ThreshEB_");
98  chi2ThreshEE_ = ps.getParameter<double>("chi2ThreshEE_");
99  EBchi2Parameters_ = ps.getParameter<std::vector<double>>("EBchi2Parameters");
100  EEchi2Parameters_ = ps.getParameter<std::vector<double>>("EEchi2Parameters");
101 }
102 
104  // common setup
106  es.get<EcalPedestalsRcd>().get(peds);
107 
108  // for the weights method
110  es.get<EcalTBWeightsRcd>().get(wgts);
111 
112  // which of the samples need be used
114 
115  // for the ratio method
116 
119 
120  // for the time correction methods
122 
123  // for the DB Ecal Pulse Sim Shape
126 }
127 
128 // check saturation: 5 samples with gainId = 0
129 template <class C>
131  //bool saturated_ = 0;
132  int cnt;
133  for (int j = 0; j < C::MAXSAMPLES - 5; ++j) {
134  cnt = 0;
135  for (int i = j; i < (j + 5) && i < C::MAXSAMPLES; ++i) {
136  if (dataFrame.sample(i).gainId() == 0)
137  ++cnt;
138  }
139  if (cnt == 5)
140  return j - 1; // the last unsaturated sample
141  }
142  return -1; // no saturation found
143 }
144 
155  const std::vector<float>& amplitudeBins,
156  const std::vector<float>& shiftBins) {
157  // computed initially in ns. Than turned in the BX's, as
158  // EcalUncalibratedRecHit need be.
159  double theCorrection = 0;
160 
161  // sanity check for arrays
162  if (amplitudeBins.empty()) {
163  edm::LogError("EcalRecHitError") << "timeCorrAmplitudeBins is empty, forcing no time bias corrections.";
164 
165  return 0;
166  }
167 
168  if (amplitudeBins.size() != shiftBins.size()) {
169  edm::LogError("EcalRecHitError") << "Size of timeCorrAmplitudeBins different from "
170  "timeCorrShiftBins. Forcing no time bias corrections. ";
171 
172  return 0;
173  }
174 
175  int myBin = -1;
176  for (int bin = 0; bin < (int)amplitudeBins.size(); bin++) {
177  if (ampli > amplitudeBins.at(bin)) {
178  myBin = bin;
179  } else {
180  break;
181  }
182  }
183 
184  if (myBin == -1) {
185  theCorrection = shiftBins.at(0);
186  } else if (myBin == ((int)(amplitudeBins.size() - 1))) {
187  theCorrection = shiftBins.at(myBin);
188  } else if (-1 < myBin && myBin < ((int)amplitudeBins.size() - 1)) {
189  // interpolate linearly between two assingned points
190  theCorrection = (shiftBins.at(myBin + 1) - shiftBins.at(myBin));
191  theCorrection *=
192  (((double)ampli) - amplitudeBins.at(myBin)) / (amplitudeBins.at(myBin + 1) - amplitudeBins.at(myBin));
193  theCorrection += shiftBins.at(myBin);
194  } else {
195  edm::LogError("EcalRecHitError") << "Assigning time correction impossible. Setting it to 0 ";
196  theCorrection = 0.;
197  }
198 
199  // convert ns into clocks
200  return theCorrection / 25.;
201 }
202 
206  DetId detid(itdg->id());
207 
208  const EcalSampleMask* sampleMask_ = sampleMaskHand_.product();
209 
210  // intelligence for recHit computation
211  EcalUncalibratedRecHit uncalibRecHit;
212 
213  const EcalPedestals::Item* aped = nullptr;
214  const EcalMGPAGainRatio* aGain = nullptr;
215  const EcalXtalGroupId* gid = nullptr;
216  float offsetTime = 0;
217 
218  if (detid.subdetId() == EcalEndcap) {
219  unsigned int hashedIndex = EEDetId(detid).hashedIndex();
220  aped = &peds->endcap(hashedIndex);
221  aGain = &gains->endcap(hashedIndex);
222  gid = &grps->endcap(hashedIndex);
223  offsetTime = offtime->getEEValue();
224  } else {
225  unsigned int hashedIndex = EBDetId(detid).hashedIndex();
226  aped = &peds->barrel(hashedIndex);
227  aGain = &gains->barrel(hashedIndex);
228  gid = &grps->barrel(hashedIndex);
229  offsetTime = offtime->getEBValue();
230  }
231 
232  pedVec[0] = aped->mean_x12;
233  pedVec[1] = aped->mean_x6;
234  pedVec[2] = aped->mean_x1;
235  pedRMSVec[0] = aped->rms_x12;
236  pedRMSVec[1] = aped->rms_x6;
237  pedRMSVec[2] = aped->rms_x1;
238  gainRatios[0] = 1.;
239  gainRatios[1] = aGain->gain12Over6();
240  gainRatios[2] = aGain->gain6Over1() * aGain->gain12Over6();
241 
242  // compute the right bin of the pulse shape using time calibration constants
244  EcalTimeCalibConstant itimeconst = 0;
245  if (it != itime->end()) {
246  itimeconst = (*it);
247  } else {
248  edm::LogError("EcalRecHitError") << "No time intercalib const found for xtal " << detid.rawId()
249  << "! something wrong with EcalTimeCalibConstants in your DB? ";
250  }
251 
252  // === amplitude computation ===
253  int leadingSample = -1;
254  if (detid.subdetId() == EcalEndcap) {
255  leadingSample = ((EcalDataFrame)(*itdg)).lastUnsaturatedSample();
256  } else {
257  leadingSample = ((EcalDataFrame)(*itdg)).lastUnsaturatedSample();
258  }
259 
260  if (leadingSample == 4) { // saturation on the expected max sample
261  uncalibRecHit = EcalUncalibratedRecHit((*itdg).id(), 4095 * 12, 0, 0, 0);
263  // do not propagate the default chi2 = -1 value to the calib rechit (mapped to 64), set it to 0 when saturation
264  uncalibRecHit.setChi2(0);
265  } else if (leadingSample >= 0) { // saturation on other samples: cannot extrapolate from the fourth one
266  double pedestal = 0.;
267  double gainratio = 1.;
268  int gainId = ((EcalDataFrame)(*itdg)).sample(5).gainId();
269 
270  if (gainId == 0 || gainId == 3) {
271  pedestal = aped->mean_x1;
272  gainratio = aGain->gain6Over1() * aGain->gain12Over6();
273  } else if (gainId == 1) {
274  pedestal = aped->mean_x12;
275  gainratio = 1.;
276  } else if (gainId == 2) {
277  pedestal = aped->mean_x6;
278  gainratio = aGain->gain12Over6();
279  }
280  double amplitude = ((double)(((EcalDataFrame)(*itdg)).sample(5).adc()) - pedestal) * gainratio;
281  uncalibRecHit = EcalUncalibratedRecHit((*itdg).id(), amplitude, 0, 0, 0);
283  // do not propagate the default chi2 = -1 value to the calib rechit (mapped to 64), set it to 0 when saturation
284  uncalibRecHit.setChi2(0);
285  } else {
286  // weights method
287  EcalTBWeights::EcalTDCId tdcid(1);
288  EcalTBWeights::EcalTBWeightMap const& wgtsMap = wgts->getMap();
289  EcalTBWeights::EcalTBWeightMap::const_iterator wit;
290  wit = wgtsMap.find(std::make_pair(*gid, tdcid));
291  if (wit == wgtsMap.end()) {
292  edm::LogError("EcalUncalibRecHitError")
293  << "No weights found for EcalGroupId: " << gid->id() << " and EcalTDCId: " << tdcid
294  << "\n skipping digi with id: " << detid.rawId();
295 
296  return false;
297  }
298  const EcalWeightSet& wset = wit->second; // this is the EcalWeightSet
299 
302 
303  weights[0] = &mat1;
304  weights[1] = &mat2;
305 
306  // get uncalibrated recHit from weights
307  if (detid.subdetId() == EcalEndcap) {
309  } else {
311  }
312 
313  // === time computation ===
314  // ratio method
315  float const clockToNsConstant = 25.;
316  if (detid.subdetId() == EcalEndcap) {
317  ratioMethod_endcap_.init(*itdg, *sampleMask_, pedVec, pedRMSVec, gainRatios);
321  double theTimeCorrectionEE = timeCorrection(
323 
324  uncalibRecHit.setJitter(crh.timeMax - 5 + theTimeCorrectionEE);
325  uncalibRecHit.setJitterError(
326  std::sqrt(pow(crh.timeError, 2) + std::pow(EEtimeConstantTerm_, 2) / std::pow(clockToNsConstant, 2)));
327  // consider flagging as kOutOfTime only if above noise
328  if (uncalibRecHit.amplitude() > pedRMSVec[0] * amplitudeThreshEE_) {
329  float outOfTimeThreshP = outOfTimeThreshG12pEE_;
330  float outOfTimeThreshM = outOfTimeThreshG12mEE_;
331  // determine if gain has switched away from gainId==1 (x12 gain)
332  // and determine cuts (number of 'sigmas') to ose for kOutOfTime
333  // >3k ADC is necessasry condition for gain switch to occur
334  if (uncalibRecHit.amplitude() > 3000.) {
335  for (int iSample = 0; iSample < EEDataFrame::MAXSAMPLES; iSample++) {
336  int GainId = ((EcalDataFrame)(*itdg)).sample(iSample).gainId();
337  if (GainId != 1) {
338  outOfTimeThreshP = outOfTimeThreshG61pEE_;
339  outOfTimeThreshM = outOfTimeThreshG61mEE_;
340  break;
341  }
342  }
343  }
344  float correctedTime = (crh.timeMax - 5) * clockToNsConstant + itimeconst + offsetTime;
345  float cterm = EEtimeConstantTerm_;
346  float sigmaped = pedRMSVec[0]; // approx for lower gains
347  float nterm = EEtimeNconst_ * sigmaped / uncalibRecHit.amplitude();
348  float sigmat = std::sqrt(nterm * nterm + cterm * cterm);
349  if ((correctedTime > sigmat * outOfTimeThreshP) || (correctedTime < (-1. * sigmat * outOfTimeThreshM))) {
351  }
352  }
353 
354  } else {
355  ratioMethod_barrel_.init(*itdg, *sampleMask_, pedVec, pedRMSVec, gainRatios);
360 
361  double theTimeCorrectionEB = timeCorrection(
363 
364  uncalibRecHit.setJitter(crh.timeMax - 5 + theTimeCorrectionEB);
365 
366  uncalibRecHit.setJitterError(
367  std::sqrt(std::pow(crh.timeError, 2) + std::pow(EBtimeConstantTerm_, 2) / std::pow(clockToNsConstant, 2)));
368  // consider flagging as kOutOfTime only if above noise
369  if (uncalibRecHit.amplitude() > pedRMSVec[0] * amplitudeThreshEB_) {
370  float outOfTimeThreshP = outOfTimeThreshG12pEB_;
371  float outOfTimeThreshM = outOfTimeThreshG12mEB_;
372  // determine if gain has switched away from gainId==1 (x12 gain)
373  // and determine cuts (number of 'sigmas') to ose for kOutOfTime
374  // >3k ADC is necessasry condition for gain switch to occur
375  if (uncalibRecHit.amplitude() > 3000.) {
376  for (int iSample = 0; iSample < EBDataFrame::MAXSAMPLES; iSample++) {
377  int GainId = ((EcalDataFrame)(*itdg)).sample(iSample).gainId();
378  if (GainId != 1) {
379  outOfTimeThreshP = outOfTimeThreshG61pEB_;
380  outOfTimeThreshM = outOfTimeThreshG61mEB_;
381  break;
382  }
383  }
384  }
385  float correctedTime = (crh.timeMax - 5) * clockToNsConstant + itimeconst + offsetTime;
386  float cterm = EBtimeConstantTerm_;
387  float sigmaped = pedRMSVec[0]; // approx for lower gains
388  float nterm = EBtimeNconst_ * sigmaped / uncalibRecHit.amplitude();
389  float sigmat = std::sqrt(nterm * nterm + cterm * cterm);
390  if ((correctedTime > sigmat * outOfTimeThreshP) || (correctedTime < (-1. * sigmat * outOfTimeThreshM))) {
392  }
393  }
394  }
395 
396  // === chi2express ===
397  if (detid.subdetId() == EcalEndcap) {
398  double amplitude = uncalibRecHit.amplitude();
399  double amplitudeOutOfTime = 0.;
400  double jitter = uncalibRecHit.jitter();
401 
402  EcalUncalibRecHitRecChi2Algo<EEDataFrame> chi2expressEE_(*itdg,
403  amplitude,
404  (itimeconst + offsetTime),
405  amplitudeOutOfTime,
406  jitter,
407  pedVec,
408  pedRMSVec,
409  gainRatios,
412  double chi2 = chi2expressEE_.chi2();
413  uncalibRecHit.setChi2(chi2);
414 
415  if (kPoorRecoFlagEE_) {
416  if (chi2 > chi2ThreshEE_) {
417  // first check if all samples are ok, if not don't use chi2 to flag
418  bool samplesok = true;
419  for (int sample = 0; sample < EcalDataFrame::MAXSAMPLES; ++sample) {
420  if (!sampleMask_->useSampleEE(sample)) {
421  samplesok = false;
422  break;
423  }
424  }
425  if (samplesok)
427  }
428  }
429 
430  } else {
431  double amplitude = uncalibRecHit.amplitude();
432  double amplitudeOutOfTime = 0.;
433  double jitter = uncalibRecHit.jitter();
434 
435  EcalUncalibRecHitRecChi2Algo<EBDataFrame> chi2expressEB_(*itdg,
436  amplitude,
437  (itimeconst + offsetTime),
438  amplitudeOutOfTime,
439  jitter,
440  pedVec,
441  pedRMSVec,
442  gainRatios,
445  double chi2 = chi2expressEB_.chi2();
446  uncalibRecHit.setChi2(chi2);
447 
448  if (kPoorRecoFlagEB_) {
449  if (chi2 > chi2ThreshEB_) {
450  // first check if all samples are ok, if not don't use chi2 to flag
451  bool samplesok = true;
452  for (int sample = 0; sample < EcalDataFrame::MAXSAMPLES; ++sample) {
453  if (!sampleMask_->useSampleEB(sample)) {
454  samplesok = false;
455  break;
456  }
457  }
458  if (samplesok)
460  }
461  }
462  }
463  }
464 
465  // set flags if gain switch has occurred
466  if (((EcalDataFrame)(*itdg)).hasSwitchToGain6())
468  if (((EcalDataFrame)(*itdg)).hasSwitchToGain1())
470 
471  // put the recHit in the collection
472  if (detid.subdetId() == EcalEndcap) {
473  result.push_back(uncalibRecHit);
474  } else {
475  result.push_back(uncalibRecHit);
476  }
477 
478  return true;
479 }
480 
483  psd.addNode(
484  edm::ParameterDescription<std::vector<double>>(
485  "eePulseShape", {5.2e-05, -5.26e-05, 6.66e-05, 0.1168, 0.7575, 1.0, 0.8876, 0.6732, 0.4741, 0.3194}, true) and
486  edm::ParameterDescription<std::vector<double>>(
487  "EBtimeFitParameters",
488  {-2.015452, 3.130702, -12.3473, 41.88921, -82.83944, 91.01147, -50.35761, 11.05621},
489  true) and
490  edm::ParameterDescription<double>("outOfTimeThresholdGain61pEB", 5, true) and
491  edm::ParameterDescription<double>("amplitudeThresholdEE", 10, true) and
492  edm::ParameterDescription<double>("EBtimeConstantTerm", 0.6, true) and
493  edm::ParameterDescription<double>("outOfTimeThresholdGain61pEE", 1000, true) and
494  edm::ParameterDescription<double>("ebSpikeThreshold", 1.042, true) and
495  edm::ParameterDescription<double>("EBtimeNconst", 28.5, true) and
496  edm::ParameterDescription<bool>("kPoorRecoFlagEB", true, true) and
497  edm::ParameterDescription<std::vector<double>>(
498  "ebPulseShape", {5.2e-05, -5.26e-05, 6.66e-05, 0.1168, 0.7575, 1.0, 0.8876, 0.6732, 0.4741, 0.3194}, true) and
499  edm::ParameterDescription<double>("EBtimeFitLimits_Lower", 0.2, true) and
500  edm::ParameterDescription<bool>("kPoorRecoFlagEE", false, true) and
501  edm::ParameterDescription<double>("chi2ThreshEB_", 36.0, true) and
502  edm::ParameterDescription<std::vector<double>>(
503  "EEtimeFitParameters",
504  {-2.390548, 3.553628, -17.62341, 67.67538, -133.213, 140.7432, -75.41106, 16.20277},
505  true) and
506  edm::ParameterDescription<double>("outOfTimeThresholdGain61mEE", 1000, true) and
507  edm::ParameterDescription<std::vector<double>>("EEchi2Parameters", {2.122, 0.022, 2.122, 0.022}, true) and
508  edm::ParameterDescription<double>("outOfTimeThresholdGain12mEE", 1000, true) and
509  edm::ParameterDescription<double>("outOfTimeThresholdGain12mEB", 5, true) and
510  edm::ParameterDescription<double>("EEtimeFitLimits_Upper", 1.4, true) and
511  edm::ParameterDescription<double>("EEtimeFitLimits_Lower", 0.2, true) and
512  edm::ParameterDescription<std::vector<double>>("EEamplitudeFitParameters", {1.89, 1.4}, true) and
513  edm::ParameterDescription<std::vector<double>>("EBamplitudeFitParameters", {1.138, 1.652}, true) and
514  edm::ParameterDescription<double>("amplitudeThresholdEB", 10, true) and
515  edm::ParameterDescription<double>("outOfTimeThresholdGain12pEE", 1000, true) and
516  edm::ParameterDescription<double>("outOfTimeThresholdGain12pEB", 5, true) and
517  edm::ParameterDescription<double>("EEtimeNconst", 31.8, true) and
518  edm::ParameterDescription<double>("outOfTimeThresholdGain61mEB", 5, true) and
519  edm::ParameterDescription<std::vector<double>>("EBchi2Parameters", {2.122, 0.022, 2.122, 0.022}, true) and
520  edm::ParameterDescription<double>("EEtimeConstantTerm", 1.0, true) and
521  edm::ParameterDescription<double>("chi2ThreshEE_", 95.0, true) and
522  edm::ParameterDescription<double>("EBtimeFitLimits_Upper", 1.4, true));
523 
524  return psd;
525 }
526 
533  "EcalUncalibRecHitWorkerGlobal");
EcalDataFrame::MAXSAMPLES
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
ConfigurationDescriptions.h
EcalUncalibRecHitWorkerGlobal::isSaturated
int isSaturated(const C &digi)
Definition: EcalUncalibRecHitWorkerGlobal.cc:130
EcalUncalibratedRecHit::kHasSwitchToGain6
Definition: EcalUncalibratedRecHit.h:18
EcalUncalibRecHitRatioMethodAlgo::computeAmplitude
void computeAmplitude(std::vector< double > &amplitudeFitParameters)
Definition: EcalUncalibRecHitRatioMethodAlgo.h:527
EBDetId::hashedIndex
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:82
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EcalUncalibratedRecHit::setChi2
void setChi2(float chi2)
Definition: EcalUncalibratedRecHit.h:44
EcalTimeOffsetConstantRcd
Definition: EcalTimeOffsetConstantRcd.h:5
EcalTBWeights::getMap
const EcalTBWeightMap & getMap() const
Definition: EcalTBWeights.h:28
EcalShapeBase::setEventSetup
void setEventSetup(const edm::EventSetup &evtSetup)
Definition: EcalShapeBase.cc:19
ecalLiteDTU::gainId
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
Definition: EcalLiteDTUSample.h:14
EcalUncalibRecHitWorkerGlobal::offtime
edm::ESHandle< EcalTimeOffsetConstant > offtime
Definition: EcalUncalibRecHitWorkerGlobal.h:106
mps_fire.i
i
Definition: mps_fire.py:428
CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
EcalUncalibRecHitFillDescriptionWorkerFactory.h
MessageLogger.h
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG61pEE_
double outOfTimeThreshG61pEE_
Definition: EcalUncalibRecHitWorkerGlobal.h:97
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
EcalUncalibRecHitWorkerGlobal::testbeamEEShape
EEShape testbeamEEShape
Definition: EcalUncalibRecHitWorkerGlobal.h:70
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
EcalUncalibRecHitWorkerGlobal::timeCorrBias_
edm::ESHandle< EcalTimeBiasCorrections > timeCorrBias_
Definition: EcalUncalibRecHitWorkerGlobal.h:103
EcalUncalibRecHitWorkerGlobal::set
void set(const edm::EventSetup &es) override
Definition: EcalUncalibRecHitWorkerGlobal.cc:103
EBShape
Definition: EBShape.h:6
EcalUncalibRecHitRecChi2Algo
Definition: EcalUncalibRecHitRecChi2Algo.h:24
EcalUncalibratedRecHit::amplitude
float amplitude() const
Definition: EcalUncalibratedRecHit.h:28
EBDetId
Definition: EBDetId.h:17
EcalUncalibRecHitWorkerGlobal::eePulseShape_
std::vector< double > eePulseShape_
Definition: EcalUncalibRecHitWorkerGlobal.h:108
EcalUncalibRecHitWorkerGlobal::timeCorrection
double timeCorrection(float ampli, const std::vector< float > &amplitudeBins, const std::vector< float > &shiftBins)
Definition: EcalUncalibRecHitWorkerGlobal.cc:154
EcalUncalibRecHitWorkerGlobal::chi2ThreshEE_
double chi2ThreshEE_
Definition: EcalUncalibRecHitWorkerGlobal.h:114
EcalSampleMask
Definition: EcalSampleMask.h:16
EcalTimeBiasCorrectionsRcd
Definition: EcalTimeBiasCorrectionsRcd.h:12
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EcalTimeOffsetConstant::getEEValue
float getEEValue() const
Definition: EcalTimeOffsetConstant.h:21
EcalUncalibRecHitWorkerGlobal::weightsMethod_barrel_
EcalUncalibRecHitRecWeightsAlgo< EBDataFrame > weightsMethod_barrel_
Definition: EcalUncalibRecHitWorkerGlobal.h:68
edm::SortedCollection
Definition: SortedCollection.h:49
EcalUncalibRecHitWorkerGlobal::testbeamEBShape
EBShape testbeamEBShape
Definition: EcalUncalibRecHitWorkerGlobal.h:71
EcalUncalibRecHitWorkerGlobal::EEchi2Parameters_
std::vector< double > EEchi2Parameters_
Definition: EcalUncalibRecHitWorkerGlobal.h:116
EcalTimeOffsetConstant::getEBValue
float getEBValue() const
Definition: EcalTimeOffsetConstant.h:20
EcalUncalibRecHitRatioMethodAlgo::getCalculatedRecHit
CalculatedRecHit getCalculatedRecHit()
Definition: EcalUncalibRecHitRatioMethodAlgo.h:75
EcalUncalibRecHitWorkerGlobal
Definition: EcalUncalibRecHitWorkerGlobal.h:36
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
EcalUncalibRecHitWorkerGlobal::pedRMSVec
double pedRMSVec[3]
Definition: EcalUncalibRecHitWorkerGlobal.h:52
EcalUncalibRecHitWorkerGlobal::gainRatios
double gainRatios[3]
Definition: EcalUncalibRecHitWorkerGlobal.h:53
EcalDataFrame
Definition: EcalDataFrame.h:16
EcalUncalibRecHitWorkerGlobal::kPoorRecoFlagEB_
bool kPoorRecoFlagEB_
Definition: EcalUncalibRecHitWorkerGlobal.h:111
EcalUncalibRecHitRatioMethodAlgo::computeTime
void computeTime(std::vector< double > &timeFitParameters, std::pair< double, double > &timeFitLimits, std::vector< double > &amplitudeFitParameters)
Definition: EcalUncalibRecHitRatioMethodAlgo.h:211
EcalXtalGroupId
Definition: EcalXtalGroupId.h:11
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG61mEB_
double outOfTimeThreshG61mEB_
Definition: EcalUncalibRecHitWorkerGlobal.h:94
EcalUncalibRecHitWorkerGlobal::ratioMethod_endcap_
EcalUncalibRecHitRatioMethodAlgo< EEDataFrame > ratioMethod_endcap_
Definition: EcalUncalibRecHitWorkerGlobal.h:85
EcalTimeBiasCorrections::EETimeCorrAmplitudeBins
std::vector< float > EETimeCorrAmplitudeBins
Definition: EcalTimeBiasCorrections.h:26
EcalTBWeightsRcd
Definition: EcalTBWeightsRcd.h:5
EcalTimeBiasCorrections::EETimeCorrShiftBins
std::vector< float > EETimeCorrShiftBins
Definition: EcalTimeBiasCorrections.h:27
EcalUncalibratedRecHit::setFlagBit
void setFlagBit(Flags flag)
Definition: EcalUncalibratedRecHit.cc:99
EcalUncalibRecHitWorkerGlobal::EEtimeConstantTerm_
double EEtimeConstantTerm_
Definition: EcalUncalibRecHitWorkerGlobal.h:89
EcalWeightSet::EcalWeightMatrix
math::Matrix< 3, 10 >::type EcalWeightMatrix
Definition: EcalWeightSet.h:19
DetId
Definition: DetId.h:17
MakerMacros.h
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG12pEE_
double outOfTimeThreshG12pEE_
Definition: EcalUncalibRecHitWorkerGlobal.h:95
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
EcalUncalibRecHitWorkerGlobal::EBtimeFitParameters_
std::vector< double > EBtimeFitParameters_
Definition: EcalUncalibRecHitWorkerGlobal.h:77
EcalUncalibRecHitWorkerGlobal::EBtimeConstantTerm_
double EBtimeConstantTerm_
Definition: EcalUncalibRecHitWorkerGlobal.h:87
EcalUncalibRecHitWorkerGlobal::gains
edm::ESHandle< EcalGainRatios > gains
Definition: EcalUncalibRecHitWorkerGlobal.h:56
EcalUncalibratedRecHit::kPoorReco
Definition: EcalUncalibratedRecHit.h:14
EcalSampleMaskRcd
Definition: EcalSampleMaskRcd.h:5
EcalUncalibRecHitWorkerGlobal::grps
edm::ESHandle< EcalWeightXtalGroups > grps
Definition: EcalUncalibRecHitWorkerGlobal.h:64
EcalUncalibratedRecHit::kOutOfTime
Definition: EcalUncalibratedRecHit.h:16
EcalUncalibRecHitWorkerRunOneDigiBase
Definition: EcalUncalibRecHitWorkerRunOneDigiBase.h:10
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalTimeBiasCorrections::EBTimeCorrAmplitudeBins
std::vector< float > EBTimeCorrAmplitudeBins
Definition: EcalTimeBiasCorrections.h:23
EcalTimeOffsetConstantRcd.h
EcalUncalibRecHitWorkerGlobal::peds
edm::ESHandle< EcalPedestals > peds
Definition: EcalUncalibRecHitWorkerGlobal.h:55
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG12mEE_
double outOfTimeThreshG12mEE_
Definition: EcalUncalibRecHitWorkerGlobal.h:96
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG61pEB_
double outOfTimeThreshG61pEB_
Definition: EcalUncalibRecHitWorkerGlobal.h:93
EcalUncalibRecHitWorkerGlobal::EBtimeNconst_
double EBtimeNconst_
Definition: EcalUncalibRecHitWorkerGlobal.h:88
EcalUncalibRecHitWorkerGlobal::ebPulseShape_
std::vector< double > ebPulseShape_
Definition: EcalUncalibRecHitWorkerGlobal.h:107
ParameterSetDescription.h
EcalWeightSet::getWeightsAfterGainSwitch
EcalWeightMatrix & getWeightsAfterGainSwitch()
Definition: EcalWeightSet.h:27
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
EEShape
Definition: EEShape.h:6
EcalUncalibratedRecHit::setJitter
void setJitter(float jitter)
Definition: EcalUncalibratedRecHit.h:43
EcalUncalibRecHitWorkerGlobal::wgts
edm::ESHandle< EcalTBWeights > wgts
Definition: EcalUncalibRecHitWorkerGlobal.h:65
EcalMGPAGainRatio::gain12Over6
float gain12Over6() const
Definition: EcalMGPAGainRatio.h:19
EEDetId
Definition: EEDetId.h:14
EcalGainRatiosRcd
Definition: EcalGainRatiosRcd.h:5
EcalUncalibRecHitWorkerGlobal::run
bool run(const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result) override
Definition: EcalUncalibRecHitWorkerGlobal.cc:203
EcalUncalibRecHitRatioMethodAlgo
Definition: EcalUncalibRecHitRatioMethodAlgo.h:32
EcalEndcap
Definition: EcalSubdetector.h:10
EcalSampleMaskRcd.h
EcalWeightSet::getWeightsBeforeGainSwitch
EcalWeightMatrix & getWeightsBeforeGainSwitch()
Definition: EcalWeightSet.h:26
funct::true
true
Definition: Factorize.h:173
EcalTBWeights::EcalTDCId
int EcalTDCId
Definition: EcalTBWeights.h:17
edm::ParameterSet
Definition: ParameterSet.h:47
EcalUncalibRecHitWorkerGlobal::chi2ThreshEB_
double chi2ThreshEB_
Definition: EcalUncalibRecHitWorkerGlobal.h:113
EcalUncalibRecHitWorkerGlobal::amplitudeThreshEB_
double amplitudeThreshEB_
Definition: EcalUncalibRecHitWorkerGlobal.h:99
Event.h
EcalUncalibRecHitWorkerGlobal.h
EcalCondObjectContainer::Item
T Item
Definition: EcalCondObjectContainer.h:15
EcalUncalibRecHitWorkerGlobal::ratioMethod_barrel_
EcalUncalibRecHitRatioMethodAlgo< EBDataFrame > ratioMethod_barrel_
Definition: EcalUncalibRecHitWorkerGlobal.h:84
edmplugin::PluginFactory
Definition: PluginFactory.h:34
EcalUncalibRecHitWorkerGlobal::EBamplitudeFitParameters_
std::vector< double > EBamplitudeFitParameters_
Definition: EcalUncalibRecHitWorkerGlobal.h:79
EEDetId::hashedIndex
int hashedIndex() const
Definition: EEDetId.h:183
EcalUncalibRecHitWorkerGlobal::EBchi2Parameters_
std::vector< double > EBchi2Parameters_
Definition: EcalUncalibRecHitWorkerGlobal.h:115
EcalUncalibRecHitWorkerGlobal::EcalUncalibRecHitWorkerGlobal
EcalUncalibRecHitWorkerGlobal()
Definition: EcalUncalibRecHitWorkerGlobal.h:40
createfilelist.int
int
Definition: createfilelist.py:10
EcalUncalibRecHitWorkerGlobal::weights
const EcalWeightSet::EcalWeightMatrix * weights[2]
Definition: EcalUncalibRecHitWorkerGlobal.h:66
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG61mEE_
double outOfTimeThreshG61mEE_
Definition: EcalUncalibRecHitWorkerGlobal.h:98
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
edm::EventSetup
Definition: EventSetup.h:58
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition: ParameterSetDescription.cc:41
EcalGainRatiosRcd.h
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
EcalTBWeights::EcalTBWeightMap
std::map< std::pair< EcalXtalGroupId, EcalTDCId >, EcalWeightSet > EcalTBWeightMap
Definition: EcalTBWeights.h:18
EcalTimeCalibConstantsRcd
Definition: EcalTimeCalibConstantsRcd.h:5
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
EcalWeightSet
Definition: EcalWeightSet.h:17
EcalUncalibratedRecHit
Definition: EcalUncalibratedRecHit.h:8
EcalUncalibRecHitRatioMethodAlgo::init
void init(const C &dataFrame, const EcalSampleMask &sampleMask, const double *pedestals, const double *pedestalRMSes, const double *gainRatios)
Definition: EcalUncalibRecHitRatioMethodAlgo.h:96
EcalUncalibRecHitWorkerGlobal::EBtimeFitLimits_
std::pair< double, double > EBtimeFitLimits_
Definition: EcalUncalibRecHitWorkerGlobal.h:81
EcalUncalibRecHitWorkerFactory.h
EcalUncalibratedRecHit::setJitterError
void setJitterError(float jitterErr)
Definition: EcalUncalibratedRecHit.cc:45
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG12mEB_
double outOfTimeThreshG12mEB_
Definition: EcalUncalibRecHitWorkerGlobal.h:92
gen::C
C
Definition: PomwigHadronizer.cc:78
EcalMGPAGainRatio::gain6Over1
float gain6Over1() const
Definition: EcalMGPAGainRatio.h:20
EcalUncalibRecHitRecWeightsAlgo::makeRecHit
virtual EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *pedestalsRMS, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalShapeBase &testbeamPulseShape)
Compute parameters.
Definition: EcalUncalibRecHitRecWeightsAlgo.h:30
EventSetup.h
EcalUncalibRecHitWorkerGlobal::getAlgoDescription
edm::ParameterSetDescription getAlgoDescription() override
Definition: EcalUncalibRecHitWorkerGlobal.cc:481
EcalUncalibratedRecHit::kSaturated
Definition: EcalUncalibratedRecHit.h:15
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalUncalibRecHitWorkerGlobal::sampleMaskHand_
edm::ESHandle< EcalSampleMask > sampleMaskHand_
Definition: EcalUncalibRecHitWorkerGlobal.h:74
EcalUncalibRecHitWorkerGlobal::itime
edm::ESHandle< EcalTimeCalibConstants > itime
Definition: EcalUncalibRecHitWorkerGlobal.h:105
EcalUncalibRecHitRatioMethodAlgo::fixMGPAslew
bool fixMGPAslew(const C &dataFrame)
Definition: EcalUncalibRecHitRatioMethodAlgo.h:179
EcalPedestalsRcd.h
EcalXtalGroupId::id
unsigned int id() const
Definition: EcalXtalGroupId.h:22
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
EcalCondObjectContainer::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19
EcalUncalibRecHitWorkerGlobal::amplitudeThreshEE_
double amplitudeThreshEE_
Definition: EcalUncalibRecHitWorkerGlobal.h:100
EcalUncalibRecHitWorkerGlobal::kPoorRecoFlagEE_
bool kPoorRecoFlagEE_
Definition: EcalUncalibRecHitWorkerGlobal.h:112
mps_fire.result
result
Definition: mps_fire.py:311
EcalUncalibratedRecHit::jitter
float jitter() const
Definition: EcalUncalibratedRecHit.h:31
EcalUncalibRecHitWorkerGlobal::EEtimeFitParameters_
std::vector< double > EEtimeFitParameters_
Definition: EcalUncalibRecHitWorkerGlobal.h:78
EcalUncalibRecHitWorkerGlobal::pedVec
double pedVec[3]
Definition: EcalUncalibRecHitWorkerGlobal.h:51
EcalUncalibRecHitWorkerGlobal::outOfTimeThreshG12pEB_
double outOfTimeThreshG12pEB_
Definition: EcalUncalibRecHitWorkerGlobal.h:91
EcalWeightXtalGroupsRcd
Definition: EcalWeightXtalGroupsRcd.h:5
ParameterSet.h
EcalUncalibRecHitRecChi2Algo::chi2
virtual double chi2()
Definition: EcalUncalibRecHitRecChi2Algo.h:41
EcalTimeCalibConstantsRcd.h
EcalPedestalsRcd
Definition: EcalPedestalsRcd.h:5
EcalTimeBiasCorrections::EBTimeCorrShiftBins
std::vector< float > EBTimeCorrShiftBins
Definition: EcalTimeBiasCorrections.h:24
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EcalUncalibratedRecHit::kHasSwitchToGain1
Definition: EcalUncalibratedRecHit.h:19
EcalUncalibRecHitWorkerGlobal::EEtimeNconst_
double EEtimeNconst_
Definition: EcalUncalibRecHitWorkerGlobal.h:90
edm::Event
Definition: Event.h:73
EcalTimeBiasCorrectionsRcd.h
EcalUncalibRecHitWorkerGlobal::EEamplitudeFitParameters_
std::vector< double > EEamplitudeFitParameters_
Definition: EcalUncalibRecHitWorkerGlobal.h:80
ecalpyutils::hashedIndex
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:38
edm::ParameterDescription
Definition: ParameterDescription.h:110
EcalWeightXtalGroupsRcd.h
EcalUncalibRecHitWorkerGlobal::EEtimeFitLimits_
std::pair< double, double > EEtimeFitLimits_
Definition: EcalUncalibRecHitWorkerGlobal.h:82
EcalTBWeightsRcd.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
EcalUncalibRecHitWorkerGlobal::ebSpikeThresh_
double ebSpikeThresh_
Definition: EcalUncalibRecHitWorkerGlobal.h:101
EcalTimeCalibConstant
float EcalTimeCalibConstant
Definition: EcalTimeCalibConstants.h:10
EcalMGPAGainRatio
Definition: EcalMGPAGainRatio.h:13
EcalUncalibRecHitWorkerGlobal::weightsMethod_endcap_
EcalUncalibRecHitRecWeightsAlgo< EEDataFrame > weightsMethod_endcap_
Definition: EcalUncalibRecHitWorkerGlobal.h:69