CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoEgamma/EgammaIsolationAlgos/interface/EgammaRecHitIsolation.h

Go to the documentation of this file.
00001 #ifndef EgammaIsolationProducers_EgammaRecHitIsolation_h
00002 #define EgammaIsolationProducers_EgammaRecHitIsolation_h
00003 //*****************************************************************************
00004 // File:      EgammaRecHitIsolation.h
00005 // ----------------------------------------------------------------------------
00006 // OrigAuth:  Matthias Mozer, adapted from EgammaHcalIsolation by S. Harper
00007 // Institute: IIHE-VUB, RAL
00008 //=============================================================================
00009 //*****************************************************************************
00010 
00011 //C++ includes
00012 #include <vector>
00013 #include <functional>
00014 
00015 //CMSSW includes
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   //constructors
00030   EgammaRecHitIsolation (double extRadius,
00031                          double intRadius,
00032                          double etaSlice,
00033                          double etLow,
00034                          double eLow,
00035                          edm::ESHandle<CaloGeometry> ,
00036                          CaloRecHitMetaCollectionV* ,
00037                          DetId::Detector detector);
00038   
00039   double getEtSum(const reco::Candidate * emObject) const {return getSum_(emObject,true);}
00040   double getEnergySum(const reco::Candidate * emObject) const{ return  getSum_(emObject,false);}
00041   void setUseNumCrystals(bool b=true) { useNumCrystals_ = b; }
00042   void setVetoClustered(bool b=true) { vetoClustered_ = b; }
00043   void doSpikeRemoval(const EcalRecHitCollection *const recHits, 
00044                       const EcalChannelStatus *const chStatus,
00045                       const int &severityLevelCut = 3, /*0 - 4*/
00046                       const float &sevRecHitThresh = 5.0, /*GeV*/
00047                       const EcalSeverityLevelAlgo::SpikeId &id = EcalSeverityLevelAlgo::kSwissCross, /*kE1OverE9=0 or kSwissCross=1*/
00048                       const float &spIdThresh = 0.95) { 
00049     ecalBarHits_ = recHits; 
00050     chStatus_ = chStatus;
00051     severityLevelCut_ = severityLevelCut;
00052     severityRecHitThreshold_ = sevRecHitThresh;
00053     spId_ = id;
00054     spIdThreshold_ = spIdThresh;
00055   }
00056 
00057   void doFlagChecks(const std::vector<int> v) {
00058     v_chstatus_.clear();
00059     v_chstatus_.insert(v_chstatus_.begin(),v.begin(),v.end());
00060     std::sort( v_chstatus_.begin(), v_chstatus_.end() );
00061   }
00062 
00063   //destructor 
00064   ~EgammaRecHitIsolation() ;
00065   
00066  private:
00067   double getSum_(const reco::Candidate *,bool returnEt )const;
00068 
00069   double extRadius_ ;
00070   double intRadius_ ;
00071   double etaSlice_;
00072   double etLow_ ;
00073   double eLow_ ;
00074 
00075   
00076   edm::ESHandle<CaloGeometry>  theCaloGeom_ ;
00077   CaloRecHitMetaCollectionV* caloHits_ ;
00078 
00079   bool useNumCrystals_;
00080   bool vetoClustered_;
00081   const EcalRecHitCollection *ecalBarHits_;
00082   const EcalChannelStatus *chStatus_;
00083   int severityLevelCut_;
00084   float severityRecHitThreshold_;
00085   EcalSeverityLevelAlgo::SpikeId spId_;
00086   float spIdThreshold_;
00087   std::vector<int> v_chstatus_;
00088 
00089 
00090   const CaloSubdetectorGeometry* subdet_[2]; // barrel+endcap
00091 
00092 };
00093 
00094 #endif