20 #include <vdt/vdtMath.h>
74 rhoToken_(
cc.consumes<double>(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")) {
125 const float rawEnergy = superClus->rawEnergy();
126 const float rawESEnergy = superClus->preshowerEnergy();
128 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
132 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
145 const float corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
146 const float corrEnergyErr = corrEnergy * ecalSigma;
151 std::pair<float, float> combEnergyAndErr =
eleRegs_->epComb.combine(ele);
178 const float rawEnergy = superClus->rawEnergy();
179 const float rawESEnergy = superClus->preshowerEnergy();
181 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
184 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
195 const double corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
196 const double corrEnergyErr = corrEnergy * ecalSigma;
198 pho.
setCorrectedEnergy(reco::Photon::P4type::regression2, corrEnergy, corrEnergyErr,
true);
204 std::array<float, 32>
data;
209 const bool isEB = ele.
isEB();
210 const double rawEnergy = superClus->rawEnergy();
211 const double rawESEnergy = superClus->preshowerEnergy();
212 const int numberOfClusters = superClus->clusters().size();
215 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
218 data[1] = superClus->etaWidth();
219 data[2] = superClus->phiWidth();
220 data[3] = superClus->seed()->energy() / rawEnergy;
221 data[4] = ssFull5x5.e5x5 / rawEnergy;
224 data[7] = seedClus->
eta() - superClus->position().Eta();
226 data[9] = ssFull5x5.r9;
227 data[10] = ssFull5x5.sigmaIetaIeta;
228 data[11] = ssFull5x5.sigmaIetaIphi;
229 data[12] = ssFull5x5.sigmaIphiIphi;
230 data[13] = ssFull5x5.eMax * e5x5Inverse;
231 data[14] = ssFull5x5.e2nd * e5x5Inverse;
232 data[15] = ssFull5x5.eTop * e5x5Inverse;
233 data[16] = ssFull5x5.eBottom * e5x5Inverse;
234 data[17] = ssFull5x5.eLeft * e5x5Inverse;
235 data[18] = ssFull5x5.eRight * e5x5Inverse;
236 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
237 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
238 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
239 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
240 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
247 int signIEta =
iEta > 0 ? +1 : -1;
251 data[29] = (iPhi - 1) % 2;
252 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
253 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
255 data[31] = (iPhi - 1) % 20;
261 data[28] = rawESEnergy / rawEnergy;
268 std::array<float, 32>
data;
273 const bool isEB = pho.
isEB();
274 const double rawEnergy = superClus->rawEnergy();
275 const double rawESEnergy = superClus->preshowerEnergy();
276 const int numberOfClusters = superClus->clusters().size();
279 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
282 data[1] = superClus->etaWidth();
283 data[2] = superClus->phiWidth();
284 data[3] = superClus->seed()->energy() / rawEnergy;
285 data[4] = ssFull5x5.e5x5 / rawEnergy;
290 data[7] = seedClus->
eta() - superClus->position().Eta();
293 data[10] = ssFull5x5.sigmaIetaIeta;
296 data[11] = ssFull5x5.sigmaIetaIphi;
297 data[12] = ssFull5x5.sigmaIphiIphi;
298 data[13] = ssFull5x5.maxEnergyXtal * e5x5Inverse;
299 data[14] = ssFull5x5.e2nd * e5x5Inverse;
300 data[15] = ssFull5x5.eTop * e5x5Inverse;
301 data[16] = ssFull5x5.eBottom * e5x5Inverse;
302 data[17] = ssFull5x5.eLeft * e5x5Inverse;
303 data[18] = ssFull5x5.eRight * e5x5Inverse;
304 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
305 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
306 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
307 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
308 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
317 int signIEta =
iEta > 0 ? +1 : -1;
319 data[29] = (iPhi - 1) % 2;
320 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
321 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
323 data[31] = (iPhi - 1) % 20;
329 data[28] = rawESEnergy / rawEnergy;
351 iEtaOrX = ebId.
ieta();
352 iPhiOrY = ebId.iphi();
369 epComb.setEventContent(iSetup);