CMS 3D CMS Logo

JetIDHelper.h
Go to the documentation of this file.
1 #ifndef RecoJets_JetProducers_interface_JetIDHelper_h
2 #define RecoJets_JetProducers_interface_JetIDHelper_h
3 
4 #include <atomic>
5 
10 
18 
19 namespace reco {
20 
21  namespace helper {
22 
23  class JetIDHelper {
24 
25  public :
26  // construction
30 
32 
33  void initValues ();
34 
35  // interface
36  void calculate( const edm::Event& event, const edm::EventSetup& setup, const reco::CaloJet &jet, const int iDbg = 0 );
37 
38  // member access
39 
40  // these require RecHits, so can not be evaluated from AOD
41  double fHPD() const { return fHPD_;}
42  double fRBX() const { return fRBX_;}
43  int n90Hits() const { return n90Hits_;}
44  double fSubDetector1() const { return fSubDetector1_;}
45  double fSubDetector2() const { return fSubDetector2_;}
46  double fSubDetector3() const { return fSubDetector3_;}
47  double fSubDetector4() const { return fSubDetector4_;}
48  double fEB() const { return fEB_;}
49  double fEE() const { return fEE_;}
50  double fHB() const { return fHB_;}
51  double fHE() const { return fHE_;}
52  double fHO() const { return fHO_;}
53  double fLong() const { return fLong_;}
54  double fShort() const { return fShort_;}
55  double fLSbad() const { return fLS_;}
56  double fHFOOT() const { return fHFOOT_;}
57  // these are tower based
58  double restrictedEMF() const { return restrictedEMF_;}
59  int nHCALTowers() const { return nHCALTowers_;}
60  int nECALTowers() const { return nECALTowers_;}
61  // tower based approximations / inferior options
62  double approximatefHPD() const { return approximatefHPD_;}
63  double approximatefRBX() const { return approximatefRBX_;}
64  int hitsInN90() const { return hitsInN90_;}
65 
66  struct subtower { // contents of a sub-detector's tower
67  double E;
68  int Nhit;
69 
70  subtower( double xE, int xN ) { E = xE; Nhit = xN; }
71  };
72 
73 
74  private:
75 
76 
77  // helper functions
78  void classifyJetComponents( const edm::Event& event, const edm::EventSetup& setup,
79  const reco::CaloJet &jet,
80  std::vector< double > &energies,
81  std::vector< double > &subdet_energies,
82  std::vector< double > &Ecal_energies, std::vector< double > &Hcal_energies,
83  std::vector< double > &HO_energies,
84  std::vector< double > &HPD_energies, std::vector< double > &RBX_energies,
85  double& LS_bad_energy, double& HF_OOT_energy, const int iDbg = 0);
86 
87  void classifyJetTowers( const edm::Event& event, const reco::CaloJet &jet,
88  std::vector< subtower > &subtowers,
89  std::vector< subtower > &Ecal_subtowers,
90  std::vector< subtower > &Hcal_subtowers,
91  std::vector< subtower > &HO_subtowers,
92  std::vector< double > &HPD_energies,
93  std::vector< double > &RBX_energies,
94  const int iDbg = 0);
95 
96  unsigned int nCarrying( double fraction, const std::vector< double >& descending_energies );
97  unsigned int hitsInNCarrying( double fraction, const std::vector< subtower >& descending_towers );
98 
99  enum Region{
102 
103  int HBHE_oddness( int iEta, int depth );
104  Region HBHE_region( uint32_t );
105  // tower-based. -1 means can't figure it out
106  int HBHE_oddness( int iEta );
107  Region region( int iEta );
108 
109  double fHPD_;
110  double fRBX_;
111  int n90Hits_;
126 
128  double fLS_, fHFOOT_;
129 
136 
137  static std::atomic<int> sanity_checks_left_;
138 
144 
145 
146  };
147  }
148 }
149 #endif
Region region(int iEta)
Definition: JetIDHelper.cc:625
double fHE() const
Definition: JetIDHelper.h:51
double fHB() const
Definition: JetIDHelper.h:50
Definition: helper.py:1
void classifyJetComponents(const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, std::vector< double > &energies, std::vector< double > &subdet_energies, std::vector< double > &Ecal_energies, std::vector< double > &Hcal_energies, std::vector< double > &HO_energies, std::vector< double > &HPD_energies, std::vector< double > &RBX_energies, double &LS_bad_energy, double &HF_OOT_energy, const int iDbg=0)
Definition: JetIDHelper.cc:248
Jets made from CaloTowers.
Definition: CaloJet.h:29
edm::EDGetTokenT< EBRecHitCollection > input_EBRecHits_token_
Definition: JetIDHelper.h:142
edm::InputTag eeRecHitsColl_
Definition: JetIDHelper.h:135
edm::InputTag ebRecHitsColl_
Definition: JetIDHelper.h:134
double fLSbad() const
Definition: JetIDHelper.h:55
int nHCALTowers() const
Definition: JetIDHelper.h:59
double approximatefRBX() const
Definition: JetIDHelper.h:63
double fLong() const
Definition: JetIDHelper.h:53
int nECALTowers() const
Definition: JetIDHelper.h:60
double fHPD() const
Definition: JetIDHelper.h:41
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
edm::EDGetTokenT< HORecHitCollection > input_HORecHits_token_
Definition: JetIDHelper.h:140
unsigned int nCarrying(double fraction, const std::vector< double > &descending_energies)
Definition: JetIDHelper.cc:215
double fSubDetector4() const
Definition: JetIDHelper.h:47
double restrictedEMF() const
Definition: JetIDHelper.h:58
void calculate(const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:100
Region HBHE_region(uint32_t)
Definition: JetIDHelper.cc:606
double fSubDetector1() const
Definition: JetIDHelper.h:44
edm::EDGetTokenT< HFRecHitCollection > input_HFRecHits_token_
Definition: JetIDHelper.h:141
edm::InputTag hbheRecHitsColl_
Definition: JetIDHelper.h:131
static std::atomic< int > sanity_checks_left_
Definition: JetIDHelper.h:137
double approximatefHPD() const
Definition: JetIDHelper.h:62
double fEB() const
Definition: JetIDHelper.h:48
edm::InputTag hfRecHitsColl_
Definition: JetIDHelper.h:133
double fEE() const
Definition: JetIDHelper.h:49
void fillDescription(edm::ParameterSetDescription &iDesc)
Definition: JetIDHelper.cc:86
void classifyJetTowers(const edm::Event &event, const reco::CaloJet &jet, std::vector< subtower > &subtowers, std::vector< subtower > &Ecal_subtowers, std::vector< subtower > &Hcal_subtowers, std::vector< subtower > &HO_subtowers, std::vector< double > &HPD_energies, std::vector< double > &RBX_energies, const int iDbg=0)
Definition: JetIDHelper.cc:484
edm::InputTag hoRecHitsColl_
Definition: JetIDHelper.h:132
edm::EDGetTokenT< HBHERecHitCollection > input_HBHERecHits_token_
Definition: JetIDHelper.h:139
double fSubDetector3() const
Definition: JetIDHelper.h:46
double fShort() const
Definition: JetIDHelper.h:54
int HBHE_oddness(int iEta, int depth)
Definition: JetIDHelper.cc:599
fixed size matrix
edm::EDGetTokenT< EERecHitCollection > input_EERecHits_token_
Definition: JetIDHelper.h:143
double fSubDetector2() const
Definition: JetIDHelper.h:45
double fHO() const
Definition: JetIDHelper.h:52
double fHFOOT() const
Definition: JetIDHelper.h:56
unsigned int hitsInNCarrying(double fraction, const std::vector< subtower > &descending_towers)
Definition: JetIDHelper.cc:232
Definition: event.py:1
double fRBX() const
Definition: JetIDHelper.h:42