CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/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                          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 /*0 - 4*/
00047                       //const float &sevRecHitThresh = 5.0, /*GeV*/
00048                       //const EcalSeverityLevelAlgo::SpikeId &id = EcalSeverityLevelAlgo::kSwissCross, /*kE1OverE9=0 or kSwissCross=1*/
00049                       //const float &spIdThresh = 0.95
00050                       ) { 
00051     ecalBarHits_ = recHits; 
00052     chStatus_ = chStatus;
00053     severityLevelCut_ = severityLevelCut;
00054     //severityRecHitThreshold_ = sevRecHitThresh;
00055     //spId_ = id;
00056     //spIdThreshold_ = spIdThresh;
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   //destructor 
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   //float severityRecHitThreshold_;
00088   //EcalSeverityLevelAlgo::SpikeId spId_;
00089   //float spIdThreshold_;
00090   std::vector<int> v_chstatus_;
00091 
00092   const CaloSubdetectorGeometry* subdet_[2]; // barrel+endcap
00093 };
00094 
00095 #endif