#include <RecoEgamma/EgammaIsolationAlgos/interface/PhotonTkIsolation.h>
Public Member Functions | |
int | getNumberTracks (const reco::Candidate *) const |
double | getPtTracks (const reco::Candidate *) const |
PhotonTkIsolation (double extRadius, double intRadius, double etLow, double lip, const reco::TrackCollection *) | |
~PhotonTkIsolation () | |
Private Member Functions | |
std::pair< int, double > | getIso (const reco::Candidate *) const |
Private Attributes | |
double | etLow_ |
double | extRadius_ |
double | intRadius_ |
double | lip_ |
const reco::TrackCollection * | trackCollection_ |
Definition at line 24 of file PhotonTkIsolation.h.
PhotonTkIsolation::PhotonTkIsolation | ( | double | extRadius, | |
double | intRadius, | |||
double | etLow, | |||
double | lip, | |||
const reco::TrackCollection * | trackCollection | |||
) |
Definition at line 31 of file PhotonTkIsolation.cc.
00035 : 00036 extRadius_(extRadius), 00037 intRadius_(intRadius), 00038 etLow_(etLow), 00039 lip_(lip), 00040 trackCollection_(trackCollection) 00041 { 00042 }
PhotonTkIsolation::~PhotonTkIsolation | ( | ) |
std::pair< int, double > PhotonTkIsolation::getIso | ( | const reco::Candidate * | photon | ) | const [private] |
Definition at line 51 of file PhotonTkIsolation.cc.
References counter(), etLow_, extRadius_, reco::Candidate::get(), edm::Ref< C, T, F >::get(), intRadius_, lip_, trackCollection_, and reco::Particle::vertex().
Referenced by getNumberTracks(), and getPtTracks().
00052 { 00053 int counter =0 ; 00054 double ptSum =0.; 00055 00056 00057 //Take the SC position 00058 reco::SuperClusterRef sc = photon->get<reco::SuperClusterRef>(); 00059 math::XYZPoint theCaloPosition = sc.get()->position(); 00060 reco::Particle::Point vtxPos = photon->vertex(); 00061 math::XYZVector mom (theCaloPosition.x() - vtxPos.x(), 00062 theCaloPosition.y() - vtxPos.y(), 00063 theCaloPosition.z() - vtxPos.z()); 00064 00065 //loop over tracks 00066 for(reco::TrackCollection::const_iterator trItr = trackCollection_->begin(); trItr != trackCollection_->end(); ++trItr){ 00067 00068 //check z-distance of vertex 00069 if (fabs( (*trItr).dz() - photon->vertex().z() ) >= lip_ ) continue ; 00070 00071 math::XYZVector tmpTrackMomentumAtVtx = (*trItr).momentum () ; 00072 double this_pt = (*trItr).pt(); 00073 if ( this_pt < etLow_ ) 00074 continue ; 00075 double dr = DeltaR(tmpTrackMomentumAtVtx,mom) ; 00076 if(fabs(dr) < extRadius_ && 00077 fabs(dr) >= intRadius_ ) 00078 { 00079 ++counter; 00080 ptSum += this_pt; 00081 } 00082 00083 }//end loop over tracks 00084 00085 std::pair<int,double> retval; 00086 retval.first = counter; 00087 retval.second = ptSum; 00088 00089 return retval; 00090 }
int PhotonTkIsolation::getNumberTracks | ( | const reco::Candidate * | photon | ) | const |
Definition at line 92 of file PhotonTkIsolation.cc.
References getIso().
Referenced by PhotonIDAlgo::calculateTrackIso(), and EgammaPhotonTkNumIsolationProducer::produce().
00093 { 00094 //counter for the tracks in the isolation cone 00095 return getIso(photon).first ; 00096 }
double PhotonTkIsolation::getPtTracks | ( | const reco::Candidate * | photon | ) | const |
Definition at line 98 of file PhotonTkIsolation.cc.
References getIso().
Referenced by PhotonIDAlgo::calculateTrackIso(), and EgammaPhotonTkIsolationProducer::produce().
00099 { 00100 return getIso(photon).second ; 00101 }
double PhotonTkIsolation::etLow_ [private] |
double PhotonTkIsolation::extRadius_ [private] |
double PhotonTkIsolation::intRadius_ [private] |
double PhotonTkIsolation::lip_ [private] |
const reco::TrackCollection* PhotonTkIsolation::trackCollection_ [private] |