CMS 3D CMS Logo

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