188 }
else if (!
src->empty()) {
190 if (
test.isNull() || !
test.isAvailable()) {
192 <<
"DataFormat is detected as miniAOD but cannot cast to pat::Photon!";
210 for(
auto const& iPho :
src->ptrs())
215 const auto&
seed = *(iPho->superCluster()->seed());
221 std::vector<float> vCov = lazyToolnoZS.localCovariances(
seed);
223 vars[1].push_back(vCov[1]);
224 vars[2].push_back(lazyToolnoZS.e1x3(
seed));
225 vars[3].push_back(lazyToolnoZS.e2x2(
seed));
226 vars[4].push_back(lazyToolnoZS.e2x5Max(
seed));
227 vars[5].push_back(lazyToolnoZS.e5x5(
seed));
228 vars[6].push_back(lazyToolnoZS.eseffsirir(*(iPho->superCluster())));
229 vars[7].push_back(vars[2].back() / vars[5].back());
230 vars[8].push_back(vars[3].back() / vars[5].back());
231 vars[9].push_back(vars[4].back() / vars[5].back());
239 iPho->superCluster()->x() - pv.
x(), iPho->superCluster()->y() - pv.
y(), iPho->superCluster()->z() - pv.
z());
242 float chargedIsoSum = 0.;
243 float neutralHadronIsoSum = 0.;
244 float photonIsoSum = 0.;
247 for(
auto const& iCand : pfCandsHandle->ptrs())
269 float dR2 =
deltaR2(phoWrtVtx.Eta(), phoWrtVtx.Phi(), iCand->eta(), iCand->phi());
275 if(isInFootprint((*particleBasedIsolationMap)[iPho], iCand))
279 if(isInFootprint(
patPhotonPtr->associatedPackedPFCandidates(), iCand))
293 getImpactParameters(CachingPtrCandidate(&*iCand, isAOD), pv, dxy, dz);
299 chargedIsoSum += iCand->pt();
303 neutralHadronIsoSum += iCand->pt();
306 photonIsoSum += iCand->pt();
309 vars[10].push_back(chargedIsoSum);
310 vars[11].push_back(neutralHadronIsoSum);
311 vars[12].push_back(photonIsoSum);
326 vars[16].push_back(iPho->trkSumPtSolidConeDR04());
328 vars[17].push_back(0.
f);
329 vars[18].push_back(0.
f);
const unsigned char DR_VETO
float computeWorstPFChargedIsolation(const reco::Photon &photon, const edm::View< reco::Candidate > &pfCands, const reco::VertexCollection &vertices, const reco::Vertex &pv, unsigned char options, bool isAOD) const
ParticleType
particle types
const unsigned char PV_CONSTRAINT
const MultiTokenT< EcalRecHitCollection > esRecHits_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
constexpr bool isNotFinite(T x)
double y() const
y coordinate
const MultiTokenT< EcalRecHitCollection > ebRecHits_
const MultiTokenT< edm::View< reco::Photon > > src_
EcalClusterLazyToolsT< noZS::EcalClusterTools > EcalClusterLazyTools
const std::string names[nVars_]
const MultiTokenT< EcalRecHitCollection > eeRecHits_
const unsigned char PT_MIN_THRESH
double z() const
z coordinate
edm::Handle< T > getValidHandle(const edm::Event &iEvent) const
double x() const
x coordinate
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::Ptr< pat::Photon > patPhotonPtr
int getGoodTokenIndex() const
const edm::EDGetToken particleBasedIsolationToken_
const MultiTokenT< edm::View< reco::Candidate > > pfCandsToken_
const MultiTokenT< reco::VertexCollection > vtxToken_