CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaTowerExtractor.h

Go to the documentation of this file.
00001 #ifndef EgammaTowerIsolation_h
00002 #define EgammaTowerIsolation_h
00003 
00004 //*****************************************************************************
00005 // File:      EgammaTowerExtractor.h
00006 // ----------------------------------------------------------------------------
00007 // OrigAuth:  Matthias Mozer
00008 // Institute: IIHE-VUB
00009 //=============================================================================
00010 //*****************************************************************************
00011 
00012 //C++ includes
00013 #include <vector>
00014 #include <functional>
00015 
00016 //CMSSW includes
00017 #include "DataFormats/Candidate/interface/Candidate.h"
00018 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
00019 
00020 #include "FWCore/Framework/interface/Event.h"
00021 #include "FWCore/Framework/interface/EventSetup.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include "FWCore/Utilities/interface/InputTag.h"
00024 
00025 #include "DataFormats/TrackReco/interface/Track.h"
00026 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00027 
00028 #include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractor.h"
00029 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
00030 
00031 
00032 namespace egammaisolation {
00033 
00034   class EgammaTowerExtractor  : public reco::isodeposit::IsoDepositExtractor {
00035 
00036       public:
00037          enum HcalDepth{AllDepths=-1,Undefined=0,Depth1=1,Depth2=2};
00038 
00039 
00040       public:
00041          EgammaTowerExtractor ( const edm::ParameterSet& par ) :
00042             extRadius2_(par.getParameter<double>("extRadius")),
00043             intRadius_(par.getParameter<double>("intRadius")),
00044             etLow_(par.getParameter<double>("etMin")),
00045             caloTowerTag_(par.getParameter<edm::InputTag>("caloTowers")),
00046             depth_(par.getParameter<int>("hcalDepth"))
00047          { 
00048             extRadius2_ *= extRadius2_;
00049             //lets just check we have a valid depth
00050             //should we throw an exception or just warn and then fail gracefully later?
00051             if(depth_!=AllDepths && depth_!=Depth1 && depth_!=Depth2){
00052               throw cms::Exception("Configuration Error") << "hcalDepth passed to EgammaTowerExtractor is invalid "<<std::endl;
00053             }
00054          }
00055 
00056          virtual ~EgammaTowerExtractor() ;
00057 
00058          virtual void fillVetos(const edm::Event & ev, const edm::EventSetup & evSetup, 
00059                                  const reco::TrackCollection & tracks) { }
00060          virtual reco::IsoDeposit deposit(const edm::Event & ev, const edm::EventSetup & evSetup,
00061                                              const reco::Track & track) const {
00062             throw cms::Exception("Configuration Error") << 
00063                      "This extractor " << (typeid(this).name()) << " is not made for tracks";
00064          }
00065          virtual reco::IsoDeposit deposit(const edm::Event & ev, const edm::EventSetup & evSetup,
00066                                               const reco::Candidate & c) const ;
00067 
00068       private:
00069          double extRadius2_ ;
00070          double intRadius_ ;
00071          double etLow_ ;
00072          
00073 
00074          edm::InputTag caloTowerTag_;
00075          int depth_;
00076          //const CaloTowerCollection *towercollection_ ;
00077    };
00078 }
00079 #endif