30 for (
unsigned int ibx = 0; ibx <
activeBXs.size(); ++ibx) {
65 if (timeAlgoName ==
"RatioMethod")
67 else if (timeAlgoName ==
"WeightsMethod")
69 else if (timeAlgoName !=
"None")
70 edm::LogError(
"EcalUncalibRecHitError") <<
"No time estimation algorithm defined";
135 int nnoise = SampleVector::RowsAtCompileTime;
143 for (
int i = 0;
i < nnoise; ++
i) {
144 for (
int j = 0;
j < nnoise; ++
j) {
157 unsigned int bunchspacing = 450;
162 bunchspacing = *bunchSpacingH;
168 if (bunchspacing == 25) {
170 activeBX << -5, -4, -3, -2, -1, 0, 1, 2, 3, 4;
189 const std::vector<float>& amplitudeBins,
190 const std::vector<float>& shiftBins) {
193 double theCorrection = 0;
196 if (amplitudeBins.empty()) {
197 edm::LogError(
"EcalRecHitError") <<
"timeCorrAmplitudeBins is empty, forcing no time bias corrections.";
202 if (amplitudeBins.size() != shiftBins.size()) {
203 edm::LogError(
"EcalRecHitError") <<
"Size of timeCorrAmplitudeBins different from "
204 "timeCorrShiftBins. Forcing no time bias corrections. ";
211 for (
int bin = 0;
bin < (
int)amplitudeBins.size();
bin++) {
212 if (ampli > amplitudeBins[
bin]) {
220 theCorrection = shiftBins[0];
221 }
else if (myBin == ((
int)(amplitudeBins.size() - 1))) {
222 theCorrection = shiftBins[myBin];
225 theCorrection = (shiftBins[myBin + 1] - shiftBins[myBin]);
226 theCorrection *= (((double)ampli) - amplitudeBins[myBin]) / (amplitudeBins[myBin + 1] - amplitudeBins[myBin]);
227 theCorrection += shiftBins[myBin];
231 constexpr
double inv25 = 1. / 25.;
232 return theCorrection * inv25;
268 for (
auto itdg = digis.
begin(); itdg != digis.
end(); ++itdg) {
269 DetId detid(itdg->id());
274 float offsetTime = 0;
305 fullpulse(
i + 7) = aPulse->
pdfval[
i];
309 fullpulsecov(
i + 7,
j + 7) = aPulseCov->
covval[
i][
j];
314 if (it !=
itime->end()) {
317 edm::LogError(
"EcalRecHitError") <<
"No time intercalib const found for xtal " << detid.rawId()
318 <<
"! something wrong with EcalTimeCalibConstants in your DB? ";
321 int lastSampleBeforeSaturation = -2;
324 lastSampleBeforeSaturation = iSample - 1;
331 if (lastSampleBeforeSaturation == 4) {
332 result.emplace_back((*itdg).id(), 4095 * 12, 0, 0, 0);
333 auto& uncalibRecHit =
result.back();
336 uncalibRecHit.setChi2(0);
337 }
else if (lastSampleBeforeSaturation >=
343 auto gainratio = gainRatios[
gainId - 1];
346 auto& uncalibRecHit =
result.back();
349 uncalibRecHit.setChi2(0);
355 auto& uncalibRecHit =
result.back();
360 constexpr
float clockToNsConstant = 25.;
361 constexpr
float invClockToNs = 1. / clockToNsConstant;
371 uncalibRecHit.setJitter(crh.timeMax - 5 + theTimeCorrectionEE);
372 uncalibRecHit.setJitterError(
382 if (uncalibRecHit.amplitude() > 3000.) {
392 float correctedTime = (crh.timeMax - 5) * clockToNsConstant + itimeconst + offsetTime;
394 float sigmaped = pedRMSVec[0];
395 float nterm =
EEtimeNconst_ * sigmaped / uncalibRecHit.amplitude();
396 float sigmat =
std::sqrt(nterm * nterm + cterm * cterm);
397 if ((correctedTime > sigmat * outOfTimeThreshP) || (correctedTime < -sigmat * outOfTimeThreshM)) {
413 uncalibRecHit.setJitter(crh.timeMax - 5 + theTimeCorrectionEB);
414 uncalibRecHit.setJitterError(std::hypot(crh.timeError,
EBtimeConstantTerm_ / clockToNsConstant));
423 if (uncalibRecHit.amplitude() > 3000.) {
433 float correctedTime = (crh.timeMax - 5) * clockToNsConstant + itimeconst + offsetTime;
435 float sigmaped = pedRMSVec[0];
436 float nterm =
EBtimeNconst_ * sigmaped / uncalibRecHit.amplitude();
437 float sigmat =
std::sqrt(nterm * nterm + cterm * cterm);
438 if ((correctedTime > sigmat * outOfTimeThreshP) || (correctedTime < -sigmat * outOfTimeThreshM)) {
445 std::vector<double> amplitudes;
446 for (
unsigned int ibx = 0; ibx <
activeBX.
size(); ++ibx)
447 amplitudes.push_back(uncalibRecHit.outOfTimeAmplitude(ibx));
451 EcalTBWeights::EcalTBWeightMap::const_iterator wit;
452 wit = wgtsMap.find(std::make_pair(*gid, tdcid));
453 if (wit == wgtsMap.end()) {
455 <<
"No weights found for EcalGroupId: " << gid->
id() <<
" and EcalTDCId: " << tdcid
456 <<
"\n skipping digi with id: " << detid.rawId();
474 uncalibRecHit.setJitter(timerh);
475 uncalibRecHit.setJitterError(0.);
477 uncalibRecHit.setJitter(0.);
478 uncalibRecHit.setJitterError(0.);
483 auto& uncalibRecHit =
result.back();
527 "EBCorrNoiseMatrixG12",
528 {1.00000, 0.71073, 0.55721, 0.46089, 0.40449, 0.35931, 0.33924, 0.32439, 0.31581, 0.30481},
531 "EECorrNoiseMatrixG12",
532 {1.00000, 0.71373, 0.44825, 0.30152, 0.21609, 0.14786, 0.11772, 0.10165, 0.09465, 0.08098},
535 "EBCorrNoiseMatrixG06",
536 {1.00000, 0.70946, 0.58021, 0.49846, 0.45006, 0.41366, 0.39699, 0.38478, 0.37847, 0.37055},
539 "EECorrNoiseMatrixG06",
540 {1.00000, 0.71217, 0.47464, 0.34056, 0.26282, 0.20287, 0.17734, 0.16256, 0.15618, 0.14443},
543 "EBCorrNoiseMatrixG01",
544 {1.00000, 0.73354, 0.64442, 0.58851, 0.55425, 0.53082, 0.51916, 0.51097, 0.50732, 0.50409},
547 "EECorrNoiseMatrixG01",
548 {1.00000, 0.72698, 0.62048, 0.55691, 0.51848, 0.49147, 0.47813, 0.47007, 0.46621, 0.46265},
555 "EBPulseShapeCovariance",
556 {3.001e-06, 1.233e-05, 0.000e+00, -4.416e-06, -4.571e-06, -3.614e-06, -2.636e-06, -1.286e-06, -8.410e-07,
557 -5.296e-07, 0.000e+00, 0.000e+00, 1.233e-05, 6.154e-05, 0.000e+00, -2.200e-05, -2.309e-05, -1.838e-05,
558 -1.373e-05, -7.334e-06, -5.088e-06, -3.745e-06, -2.428e-06, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00,
559 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00,
560 -4.416e-06, -2.200e-05, 0.000e+00, 8.319e-06, 8.545e-06, 6.792e-06, 5.059e-06, 2.678e-06, 1.816e-06,
561 1.223e-06, 8.245e-07, 5.589e-07, -4.571e-06, -2.309e-05, 0.000e+00, 8.545e-06, 9.182e-06, 7.219e-06,
562 5.388e-06, 2.853e-06, 1.944e-06, 1.324e-06, 9.083e-07, 6.335e-07, -3.614e-06, -1.838e-05, 0.000e+00,
563 6.792e-06, 7.219e-06, 6.016e-06, 4.437e-06, 2.385e-06, 1.636e-06, 1.118e-06, 7.754e-07, 5.556e-07,
564 -2.636e-06, -1.373e-05, 0.000e+00, 5.059e-06, 5.388e-06, 4.437e-06, 3.602e-06, 1.917e-06, 1.322e-06,
565 9.079e-07, 6.529e-07, 4.752e-07, -1.286e-06, -7.334e-06, 0.000e+00, 2.678e-06, 2.853e-06, 2.385e-06,
566 1.917e-06, 1.375e-06, 9.100e-07, 6.455e-07, 4.693e-07, 3.657e-07, -8.410e-07, -5.088e-06, 0.000e+00,
567 1.816e-06, 1.944e-06, 1.636e-06, 1.322e-06, 9.100e-07, 9.115e-07, 6.062e-07, 4.436e-07, 3.422e-07,
568 -5.296e-07, -3.745e-06, 0.000e+00, 1.223e-06, 1.324e-06, 1.118e-06, 9.079e-07, 6.455e-07, 6.062e-07,
569 7.217e-07, 4.862e-07, 3.768e-07, 0.000e+00, -2.428e-06, 0.000e+00, 8.245e-07, 9.083e-07, 7.754e-07,
570 6.529e-07, 4.693e-07, 4.436e-07, 4.862e-07, 6.509e-07, 4.418e-07, 0.000e+00, 0.000e+00, 0.000e+00,
571 5.589e-07, 6.335e-07, 5.556e-07, 4.752e-07, 3.657e-07, 3.422e-07, 3.768e-07, 4.418e-07, 6.142e-07},
574 "EEPulseShapeCovariance",
575 {3.941e-05, 3.333e-05, 0.000e+00, -1.449e-05, -1.661e-05, -1.424e-05, -1.183e-05, -6.842e-06, -4.915e-06,
576 -3.411e-06, 0.000e+00, 0.000e+00, 3.333e-05, 2.862e-05, 0.000e+00, -1.244e-05, -1.431e-05, -1.233e-05,
577 -1.032e-05, -5.883e-06, -4.154e-06, -2.902e-06, -2.128e-06, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00,
578 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00, 0.000e+00,
579 -1.449e-05, -1.244e-05, 0.000e+00, 5.840e-06, 6.649e-06, 5.720e-06, 4.812e-06, 2.708e-06, 1.869e-06,
580 1.330e-06, 9.186e-07, 6.446e-07, -1.661e-05, -1.431e-05, 0.000e+00, 6.649e-06, 7.966e-06, 6.898e-06,
581 5.794e-06, 3.157e-06, 2.184e-06, 1.567e-06, 1.084e-06, 7.575e-07, -1.424e-05, -1.233e-05, 0.000e+00,
582 5.720e-06, 6.898e-06, 6.341e-06, 5.347e-06, 2.859e-06, 1.991e-06, 1.431e-06, 9.839e-07, 6.886e-07,
583 -1.183e-05, -1.032e-05, 0.000e+00, 4.812e-06, 5.794e-06, 5.347e-06, 4.854e-06, 2.628e-06, 1.809e-06,
584 1.289e-06, 9.020e-07, 6.146e-07, -6.842e-06, -5.883e-06, 0.000e+00, 2.708e-06, 3.157e-06, 2.859e-06,
585 2.628e-06, 1.863e-06, 1.296e-06, 8.882e-07, 6.108e-07, 4.283e-07, -4.915e-06, -4.154e-06, 0.000e+00,
586 1.869e-06, 2.184e-06, 1.991e-06, 1.809e-06, 1.296e-06, 1.217e-06, 8.669e-07, 5.751e-07, 3.882e-07,
587 -3.411e-06, -2.902e-06, 0.000e+00, 1.330e-06, 1.567e-06, 1.431e-06, 1.289e-06, 8.882e-07, 8.669e-07,
588 9.522e-07, 6.717e-07, 4.293e-07, 0.000e+00, -2.128e-06, 0.000e+00, 9.186e-07, 1.084e-06, 9.839e-07,
589 9.020e-07, 6.108e-07, 5.751e-07, 6.717e-07, 7.911e-07, 5.493e-07, 0.000e+00, 0.000e+00, 0.000e+00,
590 6.446e-07, 7.575e-07, 6.886e-07, 6.146e-07, 4.283e-07, 3.882e-07, 4.293e-07, 5.493e-07, 7.027e-07},
596 edm::ParameterDescription<std::vector<int>>(
"activeBXs", {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4},
true) and
658 "ebPulseShape", {5.2e-05, -5.26e-05, 6.66e-05, 0.1168, 0.7575, 1., 0.8876, 0.6732, 0.4741, 0.3194},
true) and
660 "eePulseShape", {5.2e-05, -5.26e-05, 6.66e-05, 0.1168, 0.7575, 1., 0.8876, 0.6732, 0.4741, 0.3194},
true) and
676 "EcalUncalibRecHitWorkerMultiFit");