CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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 doSeverityChecks(const EcalRecHitCollection *const recHits,
00050                         const std::vector<int>& v) { 
00051     ecalBarHits_ = recHits; 
00052     severitiesexcl_.clear();
00053     severitiesexcl_.insert(severitiesexcl_.begin(), v.begin(), v.end());
00054     std::sort(severitiesexcl_.begin(), severitiesexcl_.end());
00055   }
00056 
00057   void doFlagChecks(const std::vector<int>& v) {
00058     flags_.clear();
00059     flags_.insert(flags_.begin(), v.begin(), v.end());
00060     std::sort(flags_.begin(), flags_.end() );
00061   }
00062 
00063   //destructor 
00064   ~EgammaRecHitIsolation() ;
00065   
00066  private:
00067   double getSum_(const reco::Candidate *, bool returnEt ) const;
00068   double getSum_(const reco::SuperCluster *, bool returnEt ) const;
00069 
00070   double extRadius_ ;
00071   double intRadius_ ;
00072   double etaSlice_;
00073   double etLow_ ;
00074   double eLow_ ;
00075 
00076   
00077   edm::ESHandle<CaloGeometry>  theCaloGeom_ ;
00078   CaloRecHitMetaCollectionV* caloHits_ ;
00079   const EcalSeverityLevelAlgo* sevLevel_;
00080 
00081   bool useNumCrystals_;
00082   bool vetoClustered_;
00083   const EcalRecHitCollection *ecalBarHits_;
00084   //const EcalChannelStatus *chStatus_;
00085   std::vector<int> severitiesexcl_;
00086   //int severityLevelCut_;
00087   //float severityRecHitThreshold_;
00088   //EcalSeverityLevelAlgo::SpikeId spId_;
00089   //float spIdThreshold_;
00090   std::vector<int> flags_;
00091 
00092   const CaloSubdetectorGeometry* subdet_[2]; // barrel+endcap
00093 };
00094 
00095 #endif