77 this->
fGetIsolation(&*aPho, pfCandidateHandle, vtx, vertices);
86 for (
int isoBin = 0; isoBin < iNumberOfRings; isoBin++) {
90 float fTempPhoton = 0.0;
93 float fTempNeutral = 0.0;
96 float fTempCharged = 0.0;
99 float fTempChargedAll = 0.0;
137 for (
unsigned iPF = 0; iPF < pfCandidateHandle->size(); iPF++) {
141 pfParticle->superClusterRef() == photon->
superCluster())
144 if (pfParticle->pdgId() == 22) {
150 fEta_ = direction.Eta();
151 fPhi_ = direction.Phi();
152 fVx_ = pfParticle->vx();
153 fVy_ = pfParticle->vy();
154 fVz_ = pfParticle->vz();
162 }
else if (
std::abs(pfParticle->pdgId()) == 130) {
168 fEta_ = direction.Eta();
169 fPhi_ = direction.Phi();
170 fVx_ = pfParticle->vx();
171 fVy_ = pfParticle->vy();
172 fVz_ = pfParticle->vz();
180 }
else if (
std::abs(pfParticle->pdgId()) == 211) {
186 fEta_ = direction.Eta();
187 fPhi_ = direction.Phi();
215 float fDeltaEta =
fEta_ - pfIsoCand->
eta();
274 float fDeltaEta =
fEta_ - pfIsoCand->eta();
284 if (pfIsoCand->mva_nothing_gamma() > 0.99) {
286 if (pfIsoCand->superClusterRef() ==
refSC)
333 float fDeltaEta =
fEta_ - pfIsoCand->
eta();
383 float fDeltaEta =
fEta_ - pfIsoCand->eta();
443 float fVtxMainZ = (*vtxMain).z();
452 float dz = std::fabs(pfIsoCand->
trackRef()->dz((*vtxMain).position()));
456 double dxy = pfIsoCand->
trackRef()->dxy((*vtxMain).position());
457 if (std::fabs(dxy) > 0.1)
469 float dz = std::fabs(vtx->z() - fVtxMainZ);
473 double dxy = (-(vtx->x() -
fVx_) * pfIsoCand->
py() + (vtx->y() -
fVy_) * pfIsoCand->
px()) / pfIsoCand->
pt();
474 if (std::fabs(dxy) > 0.1)
485 float fDeltaEta =
fEta_ - pfIsoCand->
eta();
541 float fVtxMainZ = (*vtxMain).z();
550 float dz = std::fabs(pfIsoCand->trackRef()->dz((*vtxMain).position()));
554 double dxy = pfIsoCand->trackRef()->dxy((*vtxMain).position());
555 if (std::fabs(dxy) > 0.1)
567 float dz = std::fabs(vtx->z() - fVtxMainZ);
571 double dxy = (-(vtx->x() -
fVx_) * pfIsoCand->py() + (vtx->y() -
fVy_) * pfIsoCand->px()) / pfIsoCand->pt();
572 if (std::fabs(dxy) > 0.1)
583 float fDeltaEta =
fEta_ - pfIsoCand->eta();
637 unsigned int index = 0;
638 unsigned int nFoundVertex = 0;
640 float bestweight = 0;
644 for (
auto const&
vtx : vertices) {
647 if (w > bestweight) {
655 if (nFoundVertex > 0) {
656 if (nFoundVertex != 1)
657 edm::LogWarning(
"TrackOnTwoVertex") <<
"a track is shared by at least two verteces. Used to be an assert";
664 double dzmin = 10000.;
665 double ztrack = pfcand.
vertex().z();
666 bool foundVertex =
false;
668 for (reco::VertexCollection::const_iterator iv = vertices.begin(); iv != vertices.end(); ++iv, ++
index) {
669 double dz = std::fabs(ztrack - iv->z());
689 for (reco::PFCandidateCollection::const_iterator iPF = Candidates->begin(); iPF != Candidates->end(); iPF++) {
727 for (reco::PFCandidateCollection::const_iterator iPF = Candidates->begin(); iPF != Candidates->end(); iPF++) {
740 for (reco::PFCandidateCollection::const_iterator iPF = Candidates->begin(); iPF != Candidates->end(); iPF++) {
743 if (pfParticle.
pt() > fPt) {
744 float fDeltaR =
deltaR(pfParticle.
eta(), pfParticle.
phi(), electron->
eta(), electron->
phi());
747 fPt = pfParticle.
pt();
Bool_t bApplyMissHitPhVeto_
float fRectangleDeltaEtaVetoBarrelCharged_
T getParameter(std::string const &) const
int pdgId() const final
PDG identifier.
Bool_t bCheckClosestZVertex_
~PFPhotonIsolationCalculator()
float fRectangleDeltaEtaVetoEndcapNeutrals_
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
float isNeutralParticleVetoed(const reco::PFCandidate *pfIsoCand)
Bool_t bRectangleVetoBarrel_
int matchPFObject(const reco::Photon *photon, const reco::PFCandidateCollection *pfParticlesColl)
float fRectangleDeltaPhiVetoBarrelPhotons_
std::vector< float > fGetIsolationInRings(const reco::Photon *photon, edm::Handle< reco::PFCandidateCollection > pfCandidateHandle, reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices)
float mva_nothing_gamma() const
mva for gamma detection
reco::SuperClusterRef refSC
float fDeltaRVetoEndcapNeutrals_
PFPhotonIsolationCalculator()
float fDeltaRVetoBarrelCharged_
double px() const final
x coordinate of momentum vector
float fRectangleDeltaPhiVetoBarrelNeutrals_
float getIsolationPhoton()
float fDeltaRVetoEndcapPhotons_
Bool_t bRectangleVetoEndcap_
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< float > fIsolationInRings_
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
Bool_t bDeltaRVetoBarrel_
void setup(const edm::ParameterSet &conf)
float fNumberOfCrystalEndcapPhotons_
reco::TrackRef trackRef() const
const Point & vertex() const override
vertex position (overwritten by PF...)
std::vector< float > fIsolationInRingsChargedAll_
float fRectangleDeltaEtaVetoEndcapPhotons_
Abs< T >::type abs(const T &t)
float getIsolationCharged()
reco::VertexRef chargedHadronVertex(edm::Handle< reco::VertexCollection > verticies, const reco::PFCandidate &pfcand)
float fDeltaRVetoBarrelPhotons_
Bool_t bDeltaRVetoEndcap_
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
float fRectangleDeltaPhiVetoEndcapCharged_
float fRectangleDeltaEtaVetoBarrelPhotons_
bool isNull() const
Checks for null.
float fRectangleDeltaPhiVetoEndcapPhotons_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
std::vector< float > fIsolationInRingsNeutral_
T const * product() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
float fDeltaRVetoEndcapCharged_
float getIsolationNeutral()
double py() const final
y coordinate of momentum vector
float fRectangleDeltaEtaVetoEndcapCharged_
float fRectangleDeltaPhiVetoBarrelCharged_
Particle reconstructed by the particle flow algorithm.
SuperClusterRef superCluster() const override
reference to a SuperCluster
float fGetIsolation(const reco::Photon *photon, const edm::Handle< reco::PFCandidateCollection > pfCandidateHandle, reco::VertexRef vtx, edm::Handle< reco::VertexCollection > vertices)
float fDeltaRVetoBarrelNeutrals_
float fRectangleDeltaPhiVetoEndcapNeutrals_
float isPhotonParticleVetoed(const reco::PFCandidateRef pfIsoCand)
void initializeRings(int iNumberOfRings, float fRingSize)
float isChargedParticleVetoed(const reco::PFCandidate *pfIsoCand, edm::Handle< reco::VertexCollection > vertices)
double phi() const final
momentum azimuthal angle
float fRectangleDeltaEtaVetoBarrelNeutrals_
std::vector< float > fIsolationInRingsPhoton_
void calculate(const reco::Photon *, const edm::Handle< reco::PFCandidateCollection > pfCandidateHandle, edm::Handle< reco::VertexCollection > &vertices, const edm::Event &e, const edm::EventSetup &es, reco::Photon::PflowIsolationVariables &phoisol03)
std::vector< float > fIsolationInRingsCharged_
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any