20 #include <vdt/vdtMath.h>
74 rhoToken_(
cc.consumes(conf.getParameter<
edm::
InputTag>(
"rhoTag"))),
75 useClosestToCentreSeedCrysDef_(conf.getParameter<
bool>(
"useClosestToCentreSeedCrysDef")),
76 maxRawEnergyForLowPtEBSigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEBSigma")),
77 maxRawEnergyForLowPtEESigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEESigma")) {
78 if (conf.
exists(
"eleRegs")) {
81 if (conf.
exists(
"phoRegs")) {
121 const float rawEnergy = superClus->rawEnergy();
122 const float rawESEnergy = superClus->preshowerEnergy();
124 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
128 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
141 const float corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
142 const float corrEnergyErr = corrEnergy * ecalSigma;
147 std::pair<float, float> combEnergyAndErr =
eleRegs_->epComb.combine(ele);
174 const float rawEnergy = superClus->rawEnergy();
175 const float rawESEnergy = superClus->preshowerEnergy();
177 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
180 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
191 const double corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
192 const double corrEnergyErr = corrEnergy * ecalSigma;
194 pho.
setCorrectedEnergy(reco::Photon::P4type::regression2, corrEnergy, corrEnergyErr,
true);
200 std::array<float, 32>
data;
205 const bool isEB = ele.
isEB();
206 const double rawEnergy = superClus->rawEnergy();
207 const double rawESEnergy = superClus->preshowerEnergy();
208 const int numberOfClusters = superClus->clusters().size();
211 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
214 data[1] = superClus->etaWidth();
215 data[2] = superClus->phiWidth();
216 data[3] = superClus->seed()->energy() / rawEnergy;
217 data[4] = ssFull5x5.e5x5 / rawEnergy;
220 data[7] = seedClus->
eta() - superClus->position().Eta();
222 data[9] = ssFull5x5.r9;
223 data[10] = ssFull5x5.sigmaIetaIeta;
224 data[11] = ssFull5x5.sigmaIetaIphi;
225 data[12] = ssFull5x5.sigmaIphiIphi;
226 data[13] = ssFull5x5.eMax * e5x5Inverse;
227 data[14] = ssFull5x5.e2nd * e5x5Inverse;
228 data[15] = ssFull5x5.eTop * e5x5Inverse;
229 data[16] = ssFull5x5.eBottom * e5x5Inverse;
230 data[17] = ssFull5x5.eLeft * e5x5Inverse;
231 data[18] = ssFull5x5.eRight * e5x5Inverse;
232 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
233 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
234 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
235 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
236 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
243 int signIEta =
iEta > 0 ? +1 : -1;
247 data[29] = (iPhi - 1) % 2;
248 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
249 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
251 data[31] = (iPhi - 1) % 20;
257 data[28] = rawESEnergy / rawEnergy;
264 std::array<float, 32>
data;
269 const bool isEB = pho.
isEB();
270 const double rawEnergy = superClus->rawEnergy();
271 const double rawESEnergy = superClus->preshowerEnergy();
272 const int numberOfClusters = superClus->clusters().size();
275 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
278 data[1] = superClus->etaWidth();
279 data[2] = superClus->phiWidth();
280 data[3] = superClus->seed()->energy() / rawEnergy;
281 data[4] = ssFull5x5.e5x5 / rawEnergy;
286 data[7] = seedClus->
eta() - superClus->position().Eta();
289 data[10] = ssFull5x5.sigmaIetaIeta;
292 data[11] = ssFull5x5.sigmaIetaIphi;
293 data[12] = ssFull5x5.sigmaIphiIphi;
294 data[13] = ssFull5x5.maxEnergyXtal * e5x5Inverse;
295 data[14] = ssFull5x5.e2nd * e5x5Inverse;
296 data[15] = ssFull5x5.eTop * e5x5Inverse;
297 data[16] = ssFull5x5.eBottom * e5x5Inverse;
298 data[17] = ssFull5x5.eLeft * e5x5Inverse;
299 data[18] = ssFull5x5.eRight * e5x5Inverse;
300 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
301 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
302 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
303 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
304 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
313 int signIEta =
iEta > 0 ? +1 : -1;
315 data[29] = (iPhi - 1) % 2;
316 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
317 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
319 data[31] = (iPhi - 1) % 20;
325 data[28] = rawESEnergy / rawEnergy;
347 iEtaOrX = ebId.
ieta();
348 iPhiOrY = ebId.iphi();
365 epComb.setEventContent(iSetup);