00001 #ifndef EgammaHLTAlgos_EgammaHLTTrackIsolation_h
00002 #define EgammaHLTAlgos_EgammaHLTTrackIsolation_h
00003
00004
00005
00006
00007
00015
00016
00017
00018
00019
00020
00021
00022 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00023 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
00024 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00025 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00026 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00027 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00028 #include "DataFormats/TrackReco/interface/Track.h"
00029 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00030
00031 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00032
00033 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00034 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00035 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00036
00037 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00038 #include "DataFormats/Math/interface/Vector3D.h"
00039 #include "DataFormats/Math/interface/Vector.h"
00040 #include "DataFormats/Math/interface/Point3D.h"
00041
00042
00043
00044 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00045
00046
00047
00048 class EgammaHLTTrackIsolation
00049 {
00050
00051 public:
00052
00053
00054 EgammaHLTTrackIsolation(double egTrkIso_PtMin,
00055 double egTrkIso_ConeSize,
00056 double egTrkIso_ZSpan,
00057 double egTrkIso_RSpan,
00058 double egTrkIso_VetoConeSize,
00059 double egTrkIso_stripBarrel=0,
00060 double egTrkIso_stripEndcap=0) :
00061 ptMin(egTrkIso_PtMin),
00062 conesize(egTrkIso_ConeSize),
00063 zspan(egTrkIso_ZSpan),
00064 rspan(egTrkIso_RSpan),
00065 vetoConesize(egTrkIso_VetoConeSize),
00066 stripBarrel(egTrkIso_stripBarrel),
00067 stripEndcap(egTrkIso_stripEndcap)
00068 {
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 }
00080
00081
00083 std::pair<int,float> electronIsolation(const reco::Track * const tr, const reco::TrackCollection* isoTracks);
00084 std::pair<int,float> electronIsolation(const reco::Track * const tr, const reco::ElectronCollection* allEle, const reco::TrackCollection* isoTracks);
00085 std::pair<int,float> electronIsolation(const reco::Track * const tr, const reco::TrackCollection* isoTracks, GlobalPoint vertex);
00086
00090 std::pair<int,float> photonIsolation(const reco::RecoCandidate * const recocand, const reco::TrackCollection* isoTracks, bool useVertex);
00091 std::pair<int,float> photonIsolation(const reco::RecoCandidate * const recocand, const reco::TrackCollection* isoTracks, GlobalPoint vertex);
00092 std::pair<int,float> photonIsolation(const reco::RecoCandidate * const recocand, const reco::ElectronCollection* allEle, const reco::TrackCollection* isoTracks);
00093
00095 int electronTrackCount(const reco::Track * const tr, const reco::TrackCollection* isoTracks)
00096 {return electronIsolation(tr,isoTracks).first;}
00097 int electronTrackCount(const reco::Track * const tr, const reco::TrackCollection* isoTracks, GlobalPoint vertex)
00098 {return electronIsolation(tr,isoTracks,vertex).first;}
00099
00103 int photonTrackCount(const reco::RecoCandidate * const recocand, const reco::TrackCollection* isoTracks, bool useVertex)
00104 {return photonIsolation(recocand,isoTracks,useVertex).first;}
00105 int photonTrackCount(const reco::RecoCandidate * const recocand, const reco::TrackCollection* isoTracks, GlobalPoint vertex)
00106 {return photonIsolation(recocand,isoTracks,vertex).first;}
00107 int photonTrackCount(const reco::RecoCandidate * const recocand, const reco::ElectronCollection* allEle, const reco::TrackCollection* isoTracks)
00108 {return photonIsolation(recocand,allEle,isoTracks).first;}
00109
00111 float electronPtSum(const reco::Track * const tr, const reco::TrackCollection* isoTracks)
00112 {return electronIsolation(tr,isoTracks).second;}
00113 float electronPtSum(const reco::Track * const tr, const reco::TrackCollection* isoTracks, GlobalPoint vertex)
00114 {return electronIsolation(tr,isoTracks,vertex).second;}
00115 float electronPtSum(const reco::Track * const tr, const reco::ElectronCollection* allEle ,const reco::TrackCollection* isoTracks)
00116 {return electronIsolation(tr,allEle,isoTracks).second;}
00117
00121 float photonPtSum(const reco::RecoCandidate * const recocand, const reco::TrackCollection* isoTracks, bool useVertex)
00122 {return photonIsolation(recocand,isoTracks, useVertex).second;}
00123 float photonPtSum(const reco::RecoCandidate * const recocand, const reco::TrackCollection* isoTracks, GlobalPoint vertex)
00124 {return photonIsolation(recocand,isoTracks, vertex).second;}
00125 float photonPtSum(const reco::RecoCandidate * const recocand, const reco::ElectronCollection* allEle, const reco::TrackCollection* isoTracks)
00126 {return photonIsolation(recocand,allEle,isoTracks).second;}
00127
00128
00130 double getPtMin() { return ptMin;}
00132 double getConeSize() { return conesize; }
00134 double getZspan() {return zspan; }
00136 double getRspan() { return rspan; }
00138 double getvetoConesize() { return vetoConesize; }
00139
00140 private:
00141
00142 std::pair<int,float> findIsoTracks(GlobalVector mom, GlobalPoint vtx, const reco::TrackCollection* isoTracks, bool isElectron, bool useVertex=true);
00143 std::pair<int,float> findIsoTracksWithoutEle(GlobalVector mom, GlobalPoint vtx, const reco::ElectronCollection* allEle, const reco::TrackCollection* isoTracks);
00144
00145
00146 double ptMin;
00147 double conesize;
00148 double zspan;
00149 double rspan;
00150 double vetoConesize;
00151
00152
00153 double stripBarrel;
00154 double stripEndcap;
00155
00156
00157
00158 };
00159
00160
00161 #endif