Go to the documentation of this file.00001 #ifndef EgammaIsolationProducers_EgammaRecHitIsolation_h
00002 #define EgammaIsolationProducers_EgammaRecHitIsolation_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/Candidate/interface/Candidate.h"
00018 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00019 #include "RecoCaloTools/MetaCollections/interface/CaloRecHitMetaCollections.h"
00020 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00021
00022 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h"
00023 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
00024 #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
00025
00026 class EgammaRecHitIsolation {
00027 public:
00028
00029
00030 EgammaRecHitIsolation (double extRadius,
00031 double intRadius,
00032 double etaSlice,
00033 double etLow,
00034 double eLow,
00035 edm::ESHandle<CaloGeometry> ,
00036 CaloRecHitMetaCollectionV* ,
00037 const EcalSeverityLevelAlgo*,
00038 DetId::Detector detector);
00039
00040 double getEtSum(const reco::Candidate * emObject) const {return getSum_(emObject,true);}
00041 double getEnergySum(const reco::Candidate * emObject) const{ return getSum_(emObject,false);}
00042 void setUseNumCrystals(bool b=true) { useNumCrystals_ = b; }
00043 void setVetoClustered(bool b=true) { vetoClustered_ = b; }
00044 void doSpikeRemoval(const EcalRecHitCollection *const recHits,
00045 const EcalChannelStatus *const chStatus,
00046 const int &severityLevelCut = 3
00047
00048
00049
00050 ) {
00051 ecalBarHits_ = recHits;
00052 chStatus_ = chStatus;
00053 severityLevelCut_ = severityLevelCut;
00054
00055
00056
00057 }
00058
00059 void doFlagChecks(const std::vector<int> v) {
00060 v_chstatus_.clear();
00061 v_chstatus_.insert(v_chstatus_.begin(),v.begin(),v.end());
00062 std::sort( v_chstatus_.begin(), v_chstatus_.end() );
00063 }
00064
00065
00066 ~EgammaRecHitIsolation() ;
00067
00068 private:
00069 double getSum_(const reco::Candidate *,bool returnEt )const;
00070
00071 double extRadius_ ;
00072 double intRadius_ ;
00073 double etaSlice_;
00074 double etLow_ ;
00075 double eLow_ ;
00076
00077
00078 edm::ESHandle<CaloGeometry> theCaloGeom_ ;
00079 CaloRecHitMetaCollectionV* caloHits_ ;
00080 const EcalSeverityLevelAlgo* sevLevel_;
00081
00082 bool useNumCrystals_;
00083 bool vetoClustered_;
00084 const EcalRecHitCollection *ecalBarHits_;
00085 const EcalChannelStatus *chStatus_;
00086 int severityLevelCut_;
00087
00088
00089
00090 std::vector<int> v_chstatus_;
00091
00092 const CaloSubdetectorGeometry* subdet_[2];
00093 };
00094
00095 #endif