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;
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();
692 unsigned int index=0;
693 unsigned int nFoundVertex = 0;
699 for(
auto const &
vtx : vertices) {
714 edm::LogWarning(
"TrackOnTwoVertex")<<
"a track is shared by at least two verteces. Used to be an assert";
722 double dzmin = 10000.;
723 double ztrack = pfcand.
vertex().z();
724 bool foundVertex =
false;
726 for( reco::VertexCollection::const_iterator iv=vertices.begin(); iv!=vertices.end(); ++iv, ++
index) {
728 double dz = std::fabs(ztrack - iv->z());
751 for(reco::PFCandidateCollection::const_iterator iPF=Candidates->begin();iPF !=Candidates->end();iPF++){
796 for(reco::PFCandidateCollection::const_iterator iPF=Candidates->begin();iPF !=Candidates->end();iPF++){
811 for(reco::PFCandidateCollection::const_iterator iPF=Candidates->begin();iPF !=Candidates->end();iPF++){
814 if(pfParticle.
pt()>fPt){
815 float fDeltaR =
deltaR(pfParticle.
eta(),pfParticle.
phi(),electron->
eta(),electron->
phi());
818 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_
std::vector< float > fIsolationInRingsCharged_
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
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
Bool_t bDeltaRVetoBarrel_
void setup(const edm::ParameterSet &conf)
float fNumberOfCrystalEndcapPhotons_
std::vector< float > fIsolationInRings_
reco::TrackRef trackRef() const
const Point & vertex() const override
vertex position (overwritten by PF...)
std::vector< float > fIsolationInRingsPhoton_
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
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.
std::vector< float > fIsolationInRingsNeutral_
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_
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