97 this->
fGetIsolation(&*aPho, pfCandidateHandle, vtx, vertices);
113 for(
int isoBin =0;isoBin<iNumberOfRings;isoBin++){
117 float fTempPhoton = 0.0;
120 float fTempNeutral = 0.0;
123 float fTempCharged = 0.0;
126 float fTempChargedAll = 0.0;
131 fConeSize_ = fRingSize * (float)iNumberOfRings;
167 for(
unsigned iPF=0; iPF< pfCandidateHandle->size(); iPF++) {
171 if (pfParticle->superClusterRef().
isNonnull() &&
173 pfParticle->superClusterRef() == photon->
superCluster())
178 if(pfParticle->pdgId()==22){
184 fEta_ = direction.Eta();
185 fPhi_ = direction.Phi();
186 fVx_ = pfParticle->vx();
187 fVy_ = pfParticle->vy();
188 fVz_ = pfParticle->vz();
196 }
else if(
std::abs(pfParticle->pdgId())==130){
202 fEta_ = direction.Eta();
203 fPhi_ = direction.Phi();
204 fVx_ = pfParticle->vx();
205 fVy_ = pfParticle->vy();
206 fVz_ = pfParticle->vz();
214 }
else if(
std::abs(pfParticle->pdgId()) == 211){
220 fEta_ = direction.Eta();
221 fPhi_ = direction.Phi();
255 float fDeltaEta =
fEta_-pfIsoCand->
eta();
315 float fDeltaEta =
fEta_-pfIsoCand->eta();
325 if(pfIsoCand->mva_nothing_gamma() > 0.99) {
327 if(pfIsoCand->superClusterRef() ==
refSC)
373 float fDeltaEta =
fEta_-pfIsoCand->
eta();
423 float fDeltaEta =
fEta_-pfIsoCand->eta();
482 float fVtxMainZ = (*vtxMain).z();
493 float dz = std::fabs( pfIsoCand->
trackRef()->dz( (*vtxMain).position() ) );
497 double dxy = pfIsoCand->
trackRef()->dxy( (*vtxMain).position() );
498 if (std::fabs(dxy) > 0.1)
512 float dz = std::fabs(vtx->z() - fVtxMainZ);
516 double dxy = ( -(vtx->x() -
fVx_)*pfIsoCand->
py() + (vtx->y() -
fVy_)*pfIsoCand->
px()) / pfIsoCand->
pt();
517 if(std::fabs(dxy) > 0.1)
528 float fDeltaEta =
fEta_-pfIsoCand->
eta();
587 float fVtxMainZ = (*vtxMain).z();
598 float dz = std::fabs( pfIsoCand->trackRef()->dz( (*vtxMain).position() ) );
602 double dxy = pfIsoCand->trackRef()->dxy( (*vtxMain).position() );
603 if (std::fabs(dxy) > 0.1)
617 float dz = std::fabs(vtx->z() - fVtxMainZ);
621 double dxy = ( -(vtx->x() -
fVx_)*pfIsoCand->py() + (vtx->y() -
fVy_)*pfIsoCand->px()) / pfIsoCand->pt();
622 if(std::fabs(dxy) > 0.1)
633 float fDeltaEta =
fEta_-pfIsoCand->eta();
693 unsigned nFoundVertex = 0;
699 for( reco::VertexCollection::const_iterator iv=vertices.begin(); iv!=vertices.end(); ++iv, ++
index) {
709 if(baseRef == trackBaseRef ) {
726 edm::LogWarning(
"TrackOnTwoVertex")<<
"a track is shared by at least two verteces. Used to be an assert";
734 double dzmin = 10000.;
735 double ztrack = pfcand.
vertex().z();
736 bool foundVertex =
false;
738 for( reco::VertexCollection::const_iterator iv=vertices.begin(); iv!=vertices.end(); ++iv, ++
index) {
740 double dz = std::fabs(ztrack - iv->z());
763 for(reco::PFCandidateCollection::const_iterator iPF=Candidates->begin();iPF !=Candidates->end();iPF++){
808 for(reco::PFCandidateCollection::const_iterator iPF=Candidates->begin();iPF !=Candidates->end();iPF++){
823 for(reco::PFCandidateCollection::const_iterator iPF=Candidates->begin();iPF !=Candidates->end();iPF++){
826 if(pfParticle.
pt()>fPt){
827 float fDeltaR =
deltaR(pfParticle.
eta(),pfParticle.
phi(),electron->
eta(),electron->
phi());
830 fPt = pfParticle.
pt();
Bool_t bApplyMissHitPhVeto_
float fRectangleDeltaEtaVetoBarrelCharged_
T getParameter(std::string const &) const
Bool_t bCheckClosestZVertex_
~PFPhotonIsolationCalculator()
float fRectangleDeltaEtaVetoEndcapNeutrals_
float isNeutralParticleVetoed(const reco::PFCandidate *pfIsoCand)
Bool_t bRectangleVetoBarrel_
int matchPFObject(const reco::Photon *photon, const reco::PFCandidateCollection *pfParticlesColl)
trackRef_iterator tracks_end() const
last iterator over tracks
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()
virtual int pdgId() const GCC11_FINAL
PDG identifier.
float fDeltaRVetoBarrelCharged_
std::vector< float > fIsolationInRingsCharged_
float fRectangleDeltaPhiVetoBarrelNeutrals_
float getIsolationPhoton()
float fDeltaRVetoEndcapPhotons_
Bool_t bRectangleVetoEndcap_
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
std::vector< Vertex > VertexCollection
collection of Vertex objects
Bool_t bDeltaRVetoBarrel_
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
void setup(const edm::ParameterSet &conf)
float fNumberOfCrystalEndcapPhotons_
std::vector< float > fIsolationInRings_
reco::TrackRef trackRef() const
bool isNonnull() const
Checks for non-null.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
bool isNull() const
Checks for null.
std::vector< float > fIsolationInRingsPhoton_
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
std::vector< float > fIsolationInRingsChargedAll_
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
float fRectangleDeltaEtaVetoEndcapPhotons_
Abs< T >::type abs(const T &t)
virtual const Point & vertex() const
vertex position (overwritten by PF...)
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_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
float fRectangleDeltaPhiVetoEndcapPhotons_
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
XYZVectorD XYZVector
spatial vector with cartesian internal representation
float fDeltaRVetoEndcapCharged_
float getIsolationNeutral()
T const * product() const
float fRectangleDeltaEtaVetoEndcapCharged_
float fRectangleDeltaPhiVetoBarrelCharged_
Particle reconstructed by the particle flow algorithm.
std::vector< float > fIsolationInRingsNeutral_
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
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)
trackRef_iterator tracks_begin() const
first iterator over tracks
void initializeRings(int iNumberOfRings, float fRingSize)
float isChargedParticleVetoed(const reco::PFCandidate *pfIsoCand, edm::Handle< reco::VertexCollection > vertices)
virtual float pt() const GCC11_FINAL
transverse momentum
float fRectangleDeltaEtaVetoBarrelNeutrals_
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)
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any