CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/RecoMuon/MuonIsolation/interface/SimpleCutsIsolator.h

Go to the documentation of this file.
00001 #ifndef SimpleCutsIsolator_H
00002 #define SimpleCutsIsolator_H
00003 
00004 #include "RecoMuon/MuonIsolation/interface/MuIsoBaseIsolator.h"
00005 #include "RecoMuon/MuonIsolation/interface/Cuts.h"
00006 
00007 
00008 class SimpleCutsIsolator : public muonisolation::MuIsoBaseIsolator {
00009  public:
00010   SimpleCutsIsolator(const edm::ParameterSet & par):
00011     theCuts(par.getParameter<std::vector<double> > ("EtaBounds"),
00012             par.getParameter<std::vector<double> > ("ConeSizes"),
00013             par.getParameter<std::vector<double> > ("Thresholds"))
00014     {
00015     }
00016 
00017   virtual ResultType resultType() const {return ISOL_BOOL_TYPE;}
00018 
00019   virtual Result result(DepositContainer deposits) const {
00020     Result answer(ISOL_BOOL_TYPE);
00021     answer.valBool = false;
00022     // fail miserably...
00023     return answer;
00024   }
00025 
00026   virtual Result result(DepositContainer deposits, const reco::Track& tk) const {
00027     Result answer(ISOL_BOOL_TYPE);
00028 
00029     muonisolation::Cuts::CutSpec cuts_here = theCuts(tk.eta());
00030     
00031     double conesize = cuts_here.conesize;
00032     double dephlt = deposits.front().dep->depositWithin(conesize);
00033     if (dephlt<cuts_here.threshold) {
00034       answer.valBool = true;
00035     } else {
00036       answer.valBool = false;
00037     }
00038     return answer;
00039   }
00040   
00041  private:
00042 
00043   // Isolation cuts
00044   muonisolation::Cuts theCuts;
00045 
00046 
00047 };
00048 
00049 #endif