CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/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(const DepositContainer& deposits, const edm::Event* = 0) const {
00020     Result answer(ISOL_BOOL_TYPE);
00021     answer.valBool = false;
00022     // fail miserably...
00023     return answer;
00024   }
00025 
00026   virtual Result result(const DepositContainer& deposits, const reco::Track& tk, const edm::Event* = 0) 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 = 0;
00033     unsigned int nDeps = deposits.size();
00034     for(unsigned int iDep = 0; iDep < nDeps; ++iDep ){
00035       dephlt += deposits[iDep].dep->depositWithin(conesize);
00036     }
00037     answer.valFloat = dephlt;
00038     if (dephlt<cuts_here.threshold) {
00039       answer.valBool = true;
00040     } else {
00041       answer.valBool = false;
00042     }
00043     return answer;
00044   }
00045   
00046  private:
00047 
00048   // Isolation cuts
00049   muonisolation::Cuts theCuts;
00050 
00051 
00052 };
00053 
00054 #endif