7 #include <CLHEP/Random/RandGaussQ.h>
13 : correctionRetriever_(
correctionFile), rng_(nullptr), minEt_(1.0) {}
30 const float smearNrSigma,
33 const float et =
photon.getCorrectedEnergy(reco::Photon::P4type::regression2) / cosh(scEtaAbs);
36 std::array<float, EGEnergySysIndex::kNrSysErrs> retVal;
37 retVal.fill(
photon.getCorrectedEnergy(reco::Photon::P4type::regression2));
51 const DetId seedDetId =
photon.superCluster()->seed()->seed();
53 unsigned int gainSeedSC = 12;
54 if (seedRecHit !=
recHits->end()) {
65 if (scaleCorr ==
nullptr)
67 if (smearCorr ==
nullptr)
70 std::array<float, EGEnergySysIndex::kNrSysErrs> uncertainties{};
91 const float smearNrSigma,
96 std::array<float, EGEnergySysIndex::kNrSysErrs>& energyData)
const {
97 const float smear = smearCorr.
sigma(
et);
98 const float smearRhoUp = smearCorr.
sigma(
et, 1, 0);
99 const float smearRhoDn = smearCorr.
sigma(
et, -1, 0);
100 const float smearPhiUp = smearCorr.
sigma(
et, 0, 1);
101 const float smearPhiDn = smearCorr.
sigma(
et, 0, -1);
103 const float corr =
scale + smear * smearNrSigma;
104 const float corrRhoUp =
scale + smearRhoUp * smearNrSigma;
105 const float corrRhoDn =
scale + smearRhoDn * smearNrSigma;
106 const float corrPhiUp =
scale + smearPhiUp * smearNrSigma;
107 const float corrPhiDn =
scale + smearPhiDn * smearNrSigma;
108 const float corrUp = corrRhoUp;
109 const float corrDn = corrRhoDn;
111 const double oldEcalEnergy =
photon.getCorrectedEnergy(reco::Photon::P4type::regression2);
112 const double oldEcalEnergyError =
photon.getCorrectedEnergyError(reco::Photon::P4type::regression2);
117 const double newEcalEnergy = oldEcalEnergy *
corr;
118 const double newEcalEnergyError = std::hypot(oldEcalEnergyError *
corr, smear * newEcalEnergy);
119 photon.setCorrectedEnergy(reco::Photon::P4type::regression2, newEcalEnergy, newEcalEnergyError,
true);
151 <<
"XXXXXXX requires the RandomNumberGeneratorService\n"
152 "which is not present in the configuration file. You must add the service\n"
153 "in the configuration file or remove the modules that require it.";
155 CLHEP::RandGaussQ gaussDistribution(rng->
getEngine(
id), 0.0, 1.0);
156 return gaussDistribution.fire();