Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:10

0001 #ifndef EgammaIsolationProducers_EgammaRecHitIsolation_h
0002 #define EgammaIsolationProducers_EgammaRecHitIsolation_h
0003 //*****************************************************************************
0004 // File:      EgammaRecHitIsolation.h
0005 // ----------------------------------------------------------------------------
0006 // OrigAuth:  Matthias Mozer, adapted from EgammaHcalIsolation by S. Harper
0007 // Institute: IIHE-VUB, RAL
0008 //=============================================================================
0009 //*****************************************************************************
0010 
0011 //C++ includes
0012 #include <vector>
0013 #include <functional>
0014 
0015 //CMSSW includes
0016 #include "FWCore/Framework/interface/ESHandle.h"
0017 #include "DataFormats/Candidate/interface/Candidate.h"
0018 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
0019 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0020 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0021 
0022 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h"
0023 
0024 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0025 
0026 class EgammaRecHitIsolation {
0027 public:
0028   //constructors
0029   EgammaRecHitIsolation(double extRadius,
0030                         double intRadius,
0031                         double etaSlice,
0032                         double etLow,
0033                         double eLow,
0034                         edm::ESHandle<CaloGeometry>,
0035                         const EcalRecHitCollection&,
0036                         const EcalSeverityLevelAlgo*,
0037                         DetId::Detector detector);
0038 
0039   double getEtSum(const reco::Candidate* emObject) const { return getSum_(emObject, true); }
0040   double getEnergySum(const reco::Candidate* emObject) const { return getSum_(emObject, false); }
0041 
0042   double getEtSum(const reco::SuperCluster* emObject) const { return getSum_(emObject, true); }
0043   double getEnergySum(const reco::SuperCluster* emObject) const { return getSum_(emObject, false); }
0044 
0045   void setUseNumCrystals(bool b = true) { useNumCrystals_ = b; }
0046   void setVetoClustered(bool b = true) { vetoClustered_ = b; }
0047   void doSeverityChecks(const EcalRecHitCollection* const recHits, const std::vector<int>& v) {
0048     ecalBarHits_ = recHits;
0049     severitiesexcl_.clear();
0050     severitiesexcl_.insert(severitiesexcl_.begin(), v.begin(), v.end());
0051     std::sort(severitiesexcl_.begin(), severitiesexcl_.end());
0052   }
0053 
0054   void doFlagChecks(const std::vector<int>& v) {
0055     flags_.clear();
0056     flags_.insert(flags_.begin(), v.begin(), v.end());
0057     std::sort(flags_.begin(), flags_.end());
0058   }
0059 
0060   //destructor
0061   ~EgammaRecHitIsolation();
0062 
0063 private:
0064   double getSum_(const reco::Candidate*, bool returnEt) const;
0065   double getSum_(const reco::SuperCluster*, bool returnEt) const;
0066 
0067   double extRadius_;
0068   double intRadius_;
0069   double etaSlice_;
0070   double etLow_;
0071   double eLow_;
0072 
0073   edm::ESHandle<CaloGeometry> theCaloGeom_;
0074   const EcalRecHitCollection& caloHits_;
0075   const EcalSeverityLevelAlgo* sevLevel_;
0076 
0077   bool useNumCrystals_;
0078   bool vetoClustered_;
0079   const EcalRecHitCollection* ecalBarHits_;
0080   std::vector<int> severitiesexcl_;
0081   std::vector<int> flags_;
0082 
0083   const CaloSubdetectorGeometry* subdet_[2];  // barrel+endcap
0084 };
0085 
0086 #endif