200 const auto &
photons = *photonsHandle;
207 if (!(mcIter->pdgId() == 22))
209 if (mcIter->mother() !=
nullptr && !(mcIter->mother()->pdgId() == 25))
211 if (fabs(mcIter->eta()) > 2.5)
216 float mcPhi = mcIter->phi();
217 float mcEta = mcIter->eta();
219 float mcEnergy = mcIter->energy();
221 double dR = 9999999.;
222 float minDr = 10000.;
224 bool matched =
false;
225 for (
size_t ipho = 0; ipho <
photons.size(); ipho++) {
228 double dphi = pho->phi() - mcPhi;
230 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
232 double deta = pho->superCluster()->position().eta() - mcEta;
235 if (dR < 0.1 && dR < minDr) {
248 bool phoIsInBarrel =
false;
249 bool phoIsInEndcap =
false;
251 float phoEta = matchingPho->superCluster()->position().eta();
252 if (fabs(phoEta) < 1.479) {
253 phoIsInBarrel =
true;
255 phoIsInEndcap =
true;
258 float photonE = matchingPho->energy();
259 float sigmaEoE = matchingPho->getCorrectedEnergyError(matchingPho->getCandidateP4type()) / matchingPho->energy();
260 float photonEt = matchingPho->energy() / cosh(matchingPho->eta());
263 float r9 = matchingPho->r9();
264 float full5x5_r9 = matchingPho->full5x5_r9();
265 float r1 = matchingPho->r1x5();
266 float r2 = matchingPho->r2x5();
267 float sieie = matchingPho->sigmaIetaIeta();
268 float full5x5_sieie = matchingPho->full5x5_sigmaIetaIeta();
269 float hOverE = matchingPho->hadronicOverEm();
270 float newhOverE = matchingPho->hadTowOverEm();
271 float ecalIso = matchingPho->ecalRecHitSumEtConeDR04();
272 float hcalIso = matchingPho->hcalTowerSumEtConeDR04();
273 float newhcalIso = matchingPho->hcalTowerSumEtBcConeDR04();
274 float trkIso = matchingPho->trkSumPtSolidConeDR04();
275 float nIsoTrk = matchingPho->nTrkSolidConeDR04();
277 float chargedHadIso = matchingPho->chargedHadronIso();
278 float neutralHadIso = matchingPho->neutralHadronIso();
279 float photonIso = matchingPho->photonIso();
edm::EDGetTokenT< reco::GenParticleCollection > genpartToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h_full5x5_sigmaIetaIeta_[3][3]
MonitorElement * h_r1_[3][3]
MonitorElement * h_full5x5_r9_[3][3]
MonitorElement * h_phoSigmaEoE_[3][3]
MonitorElement * h_nHadIso_[3]
MonitorElement * h_ecalRecHitSumEtConeDR04_[3][3]
MonitorElement * h_sigmaIetaIeta_[3][3]
MonitorElement * h_chHadIso_[3]
MonitorElement * h_hcalTowerBcSumEtConeDR04_[3][3]
MonitorElement * h_newhOverE_[3][3]
MonitorElement * h_isoTrkSolidConeDR04_[3][3]
MonitorElement * h_phoIso_[3]
MonitorElement * h_nTrkSolidConeDR04_[3][3]
MonitorElement * h_hOverE_[3][3]
MonitorElement * h_scPhi_[2]
MonitorElement * h_phoERes_[3][3]
MonitorElement * h_phoE_[2][3]
MonitorElement * h_r9_[3][3]
edm::EDGetTokenT< edm::View< pat::Photon > > photonToken_
MonitorElement * h_phoEt_[2][3]
MonitorElement * h_hcalTowerSumEtConeDR04_[3][3]
MonitorElement * h_r2_[3][3]
MonitorElement * h_scEta_[2]
Power< A, B >::type pow(const A &a, const B &b)