CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoJets/JetProducers/interface/JetIDHelper.h

Go to the documentation of this file.
00001 #ifndef RecoJets_JetProducers_interface_JetIDHelper_h
00002 #define RecoJets_JetProducers_interface_JetIDHelper_h
00003 
00004 
00005 #include "FWCore/Framework/interface/Frameworkfwd.h"
00006 #include "FWCore/Framework/interface/Event.h"
00007 #include "DataFormats/JetReco/interface/CaloJet.h"
00008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00009 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
00010 
00011 namespace reco {
00012 
00013   namespace helper {
00014 
00015     class JetIDHelper {
00016 
00017     public : 
00018       // construction
00019       JetIDHelper() {}
00020       JetIDHelper( edm::ParameterSet const & pset );
00021       ~JetIDHelper() {} 
00022 
00023       void fillDescription(edm::ParameterSetDescription& iDesc);
00024 
00025       void initValues ();
00026 
00027       // interface
00028       void calculate( const edm::Event& event, const reco::CaloJet &jet, const int iDbg = 0 );
00029 
00030       // member access
00031       
00032       // these require RecHits, so can not be evaluated from AOD
00033       double fHPD()          const    { return    fHPD_;}           
00034       double fRBX()          const    { return    fRBX_;}           
00035       int    n90Hits()       const    { return    n90Hits_;}
00036       double fSubDetector1() const    { return    fSubDetector1_;}  
00037       double fSubDetector2() const    { return    fSubDetector2_;}  
00038       double fSubDetector3() const    { return    fSubDetector3_;}  
00039       double fSubDetector4() const    { return    fSubDetector4_;}  
00040       double fEB()           const    { return    fEB_;}
00041       double fEE()           const    { return    fEE_;}
00042       double fHB()           const    { return    fHB_;}
00043       double fHE()           const    { return    fHE_;}
00044       double fHO()           const    { return    fHO_;}
00045       double fLong()         const    { return    fLong_;}
00046       double fShort()        const    { return    fShort_;}
00047       double fLSbad()        const    { return    fLS_;}  
00048       double fHFOOT()        const    { return    fHFOOT_;}  
00049       // these are tower based
00050       double restrictedEMF() const    { return    restrictedEMF_;}
00051       int    nHCALTowers()   const    { return    nHCALTowers_;}    
00052       int    nECALTowers()   const    { return    nECALTowers_;}    
00053       // tower based approximations / inferior options
00054       double approximatefHPD() const { return    approximatefHPD_;}           
00055       double approximatefRBX() const { return    approximatefRBX_;}           
00056       int    hitsInN90()        const { return    hitsInN90_;}        
00057  
00058       struct subtower { // contents of a sub-detector's tower
00059         double E;
00060         int Nhit;
00061         
00062         subtower( double xE, int xN ) { E = xE; Nhit = xN; }
00063       };
00064       
00065   
00066     private:
00067 
00068      
00069       // helper functions
00070       void classifyJetComponents( const edm::Event& event, const reco::CaloJet &jet, 
00071                                   std::vector< double > &energies,
00072                                   std::vector< double > &subdet_energies,
00073                                   std::vector< double > &Ecal_energies, std::vector< double > &Hcal_energies, 
00074                                   std::vector< double > &HO_energies,
00075                                   std::vector< double > &HPD_energies,  std::vector< double > &RBX_energies,
00076                                   double& LS_bad_energy, double& HF_OOT_energy, const int iDbg = 0);
00077 
00078       void classifyJetTowers( const edm::Event& event, const reco::CaloJet &jet, 
00079                               std::vector< subtower > &subtowers,      
00080                               std::vector< subtower > &Ecal_subtowers, 
00081                               std::vector< subtower > &Hcal_subtowers, 
00082                               std::vector< subtower > &HO_subtowers,
00083                               std::vector< double > &HPD_energies,  
00084                               std::vector< double > &RBX_energies,
00085                               const int iDbg = 0);
00086 
00087       unsigned int nCarrying( double fraction, std::vector< double > descending_energies );
00088       unsigned int hitsInNCarrying( double fraction, std::vector< subtower > descending_towers );
00089       
00090       enum Region{
00091         unknown_region = -1,
00092         HFneg, HEneg, HBneg, HBpos, HEpos, HFpos };
00093       
00094       int HBHE_oddness( int iEta, int depth );
00095       Region HBHE_region( int iEta, int depth );
00096       // tower-based. -1 means can't figure it out
00097       int HBHE_oddness( int iEta );
00098       Region region( int iEta );
00099       
00100 
00101       double fHPD_;
00102       double fRBX_;
00103       int    n90Hits_;
00104       double fSubDetector1_;
00105       double fSubDetector2_;
00106       double fSubDetector3_;
00107       double fSubDetector4_;
00108       double restrictedEMF_;
00109       int    nHCALTowers_;
00110       int    nECALTowers_;
00111       double approximatefHPD_;
00112       double approximatefRBX_;
00113       int    hitsInN90_;
00114       double approximatefSubDetector1_;
00115       double approximatefSubDetector2_;
00116       double approximatefSubDetector3_;
00117       double approximatefSubDetector4_;
00118       
00119       double fEB_, fEE_, fHB_, fHE_, fHO_, fLong_, fShort_;
00120       double fLS_, fHFOOT_;
00121       
00122       bool useRecHits_;
00123       edm::InputTag hbheRecHitsColl_;
00124       edm::InputTag hoRecHitsColl_;
00125       edm::InputTag hfRecHitsColl_;
00126       edm::InputTag ebRecHitsColl_;
00127       edm::InputTag eeRecHitsColl_;
00128 
00129       static int sanity_checks_left_;
00130     };
00131   }
00132 }
00133 #endif