Go to the documentation of this file.00001 #ifndef EgammaIsolationAlgos_EgammaHcalIsolation_h
00002 #define EgammaIsolationAlgos_EgammaHcalIsolation_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <vector>
00013 #include <functional>
00014
00015
00016 #include "FWCore/Framework/interface/ESHandle.h"
00017 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00018 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00019 #include "RecoCaloTools/MetaCollections/interface/CaloRecHitMetaCollections.h"
00020 #include "RecoCaloTools/Selectors/interface/CaloDualConeSelector.h"
00021 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00022 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00023 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00024 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00025
00026
00027
00028 double scaleToE(const double& eta);
00029 double scaleToEt(const double& eta);
00030
00031
00032 class EgammaHcalIsolation {
00033 public:
00034
00035 enum HcalDepth{AllDepths=0,Depth1=1,Depth2=2};
00036
00037
00038 EgammaHcalIsolation (
00039 double extRadius,
00040 double intRadius,
00041 double eLowB,
00042 double eLowE,
00043 double etLowB,
00044 double etLowE,
00045 edm::ESHandle<CaloGeometry> theCaloGeom ,
00046 HBHERecHitMetaCollection* mhbhe
00047 );
00048
00049
00050 ~EgammaHcalIsolation() ;
00051
00052
00053 double getHcalESum (const reco::Candidate *c) const { return getHcalESum(c->get<reco::SuperClusterRef>().get()); }
00054 double getHcalEtSum(const reco::Candidate *c) const { return getHcalEtSum(c->get<reco::SuperClusterRef>().get()); }
00055 double getHcalESum (const reco::SuperCluster *sc) const { return getHcalESum(sc->position()); }
00056 double getHcalEtSum(const reco::SuperCluster *sc) const { return getHcalEtSum(sc->position()); }
00057 double getHcalESum (const math::XYZPoint &p) const { return getHcalESum(GlobalPoint(p.x(),p.y(),p.z())); }
00058 double getHcalEtSum(const math::XYZPoint &p) const { return getHcalEtSum(GlobalPoint(p.x(),p.y(),p.z())); }
00059 double getHcalESum (const GlobalPoint &pclu) const { return getHcalSum(pclu,AllDepths,&scaleToE); }
00060 double getHcalEtSum(const GlobalPoint &pclu) const { return getHcalSum(pclu,AllDepths,&scaleToEt); }
00061
00062
00063 double getHcalESumDepth1 (const reco::Candidate *c) const { return getHcalESumDepth1(c->get<reco::SuperClusterRef>().get()); }
00064 double getHcalEtSumDepth1(const reco::Candidate *c) const { return getHcalEtSumDepth1(c->get<reco::SuperClusterRef>().get()); }
00065 double getHcalESumDepth1 (const reco::SuperCluster *sc) const { return getHcalESumDepth1(sc->position()); }
00066 double getHcalEtSumDepth1(const reco::SuperCluster *sc) const { return getHcalEtSumDepth1(sc->position()); }
00067 double getHcalESumDepth1 (const math::XYZPoint &p) const { return getHcalESumDepth1(GlobalPoint(p.x(),p.y(),p.z())); }
00068 double getHcalEtSumDepth1(const math::XYZPoint &p) const { return getHcalEtSumDepth1(GlobalPoint(p.x(),p.y(),p.z())); }
00069 double getHcalESumDepth1 (const GlobalPoint &pclu) const { return getHcalSum(pclu,Depth1,&scaleToE); }
00070 double getHcalEtSumDepth1(const GlobalPoint &pclu) const { return getHcalSum(pclu,Depth1,&scaleToEt); }
00071
00072
00073 double getHcalESumDepth2 (const reco::Candidate *c) const { return getHcalESumDepth2(c->get<reco::SuperClusterRef>().get()); }
00074 double getHcalEtSumDepth2(const reco::Candidate *c) const { return getHcalEtSumDepth2(c->get<reco::SuperClusterRef>().get()); }
00075 double getHcalESumDepth2 (const reco::SuperCluster *sc) const { return getHcalESumDepth2(sc->position()); }
00076 double getHcalEtSumDepth2(const reco::SuperCluster *sc) const { return getHcalEtSumDepth2(sc->position()); }
00077 double getHcalESumDepth2 (const math::XYZPoint &p) const { return getHcalESumDepth2(GlobalPoint(p.x(),p.y(),p.z())); }
00078 double getHcalEtSumDepth2(const math::XYZPoint &p) const { return getHcalEtSumDepth2(GlobalPoint(p.x(),p.y(),p.z())); }
00079 double getHcalESumDepth2 (const GlobalPoint &pclu) const { return getHcalSum(pclu,Depth2,&scaleToE); }
00080 double getHcalEtSumDepth2(const GlobalPoint &pclu) const { return getHcalSum(pclu,Depth2,&scaleToEt); }
00081
00082
00083 private:
00084
00085
00086 bool isDepth2(const DetId&) const;
00087 double getHcalSum(const GlobalPoint&, const HcalDepth&, double(*)(const double&) ) const;
00088
00089 double extRadius_ ;
00090 double intRadius_ ;
00091 double eLowB_ ;
00092 double eLowE_ ;
00093 double etLowB_ ;
00094 double etLowE_ ;
00095
00096
00097 edm::ESHandle<CaloGeometry> theCaloGeom_ ;
00098 HBHERecHitMetaCollection* mhbhe_ ;
00099
00100 CaloDualConeSelector* doubleConeSel_;
00101
00102 };
00103
00104 #endif