Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:54

0001 #ifndef EgammaIsolationAlgos_ElectronTkIsolation_h
0002 #define EgammaIsolationAlgos_ElectronTkIsolation_h
0003 //*****************************************************************************
0004 // File:      ElectronTkIsolation.h
0005 // ----------------------------------------------------------------------------
0006 // OrigAuth:  Matthias Mozer
0007 // Institute: IIHE-VUB
0008 //=============================================================================
0009 //*****************************************************************************
0010 
0011 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0012 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0013 #include "DataFormats/TrackReco/interface/Track.h"
0014 #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTrackSelector.h"
0015 
0016 #include <string>
0017 #include <vector>
0018 
0019 class ElectronTkIsolation {
0020 public:
0021   //constructors
0022   ElectronTkIsolation(double extRadius,
0023                       double intRadius,
0024                       double ptLow,
0025                       double lip,
0026                       double drb,
0027                       const reco::TrackCollection* trackCollection,
0028                       reco::TrackBase::Point beamPoint)
0029       : extRadius_(extRadius),
0030         intRadiusBarrel_(intRadius),
0031         intRadiusEndcap_(intRadius),
0032         stripBarrel_(0.0),
0033         stripEndcap_(0.0),
0034         ptLow_(ptLow),
0035         lip_(lip),
0036         drb_(drb),
0037         trackCollection_(trackCollection),
0038         beamPoint_(beamPoint) {
0039     setAlgosToReject();
0040     setDzOption("vz");
0041   }
0042 
0043   ElectronTkIsolation(double extRadius,
0044                       double intRadiusBarrel,
0045                       double intRadiusEndcap,
0046                       double stripBarrel,
0047                       double stripEndcap,
0048                       double ptLow,
0049                       double lip,
0050                       double drb,
0051                       const reco::TrackCollection* trackCollection,
0052                       reco::TrackBase::Point beamPoint)
0053       : extRadius_(extRadius),
0054         intRadiusBarrel_(intRadiusBarrel),
0055         intRadiusEndcap_(intRadiusEndcap),
0056         stripBarrel_(stripBarrel),
0057         stripEndcap_(stripEndcap),
0058         ptLow_(ptLow),
0059         lip_(lip),
0060         drb_(drb),
0061         trackCollection_(trackCollection),
0062         beamPoint_(beamPoint) {
0063     setAlgosToReject();
0064     setDzOption("vz");
0065   }
0066 
0067   ElectronTkIsolation(double extRadius,
0068                       double intRadiusBarrel,
0069                       double intRadiusEndcap,
0070                       double stripBarrel,
0071                       double stripEndcap,
0072                       double ptLow,
0073                       double lip,
0074                       double drb,
0075                       const reco::TrackCollection*,
0076                       reco::TrackBase::Point beamPoint,
0077                       const std::string&);
0078 
0079   //destructor
0080   ~ElectronTkIsolation();
0081 
0082   //methods
0083 
0084   void setDzOption(const std::string& s) {
0085     if (!s.compare("dz"))
0086       dzOption_ = egammaisolation::EgammaTrackSelector::dz;
0087     else if (!s.compare("vz"))
0088       dzOption_ = egammaisolation::EgammaTrackSelector::vz;
0089     else if (!s.compare("bs"))
0090       dzOption_ = egammaisolation::EgammaTrackSelector::bs;
0091     else if (!s.compare("vtx"))
0092       dzOption_ = egammaisolation::EgammaTrackSelector::vtx;
0093     else
0094       dzOption_ = egammaisolation::EgammaTrackSelector::dz;
0095   }
0096 
0097   int getNumberTracks(const reco::GsfElectron*) const;
0098   double getPtTracks(const reco::GsfElectron*) const;
0099   std::pair<int, double> getIso(const reco::GsfElectron*) const;
0100   std::pair<int, double> getIso(const reco::Track*) const;
0101 
0102 private:
0103   bool passAlgo(const reco::TrackBase& trk) const;
0104   void setAlgosToReject();
0105   double extRadius_;
0106   double intRadiusBarrel_;
0107   double intRadiusEndcap_;
0108   double stripBarrel_;
0109   double stripEndcap_;
0110   double ptLow_;
0111   double lip_;
0112   double drb_;
0113   std::vector<int> algosToReject_;  //vector is sorted
0114   const reco::TrackCollection* trackCollection_;
0115   reco::TrackBase::Point beamPoint_;
0116 
0117   int dzOption_;
0118 };
0119 
0120 #endif