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 class HcalTopology;
21 
22 namespace reco {
23 
24  namespace helper {
25 
26  class JetIDHelper {
27  public:
28  // construction
32 
34 
35  void initValues();
36 
37  // interface
38  void calculate(const edm::Event &event,
39  const edm::EventSetup &setup,
40  const reco::CaloJet &jet,
41  const int iDbg = 0);
42 
43  // member access
44 
45  // these require RecHits, so can not be evaluated from AOD
46  double fHPD() const { return fHPD_; }
47  double fRBX() const { return fRBX_; }
48  int n90Hits() const { return n90Hits_; }
49  double fSubDetector1() const { return fSubDetector1_; }
50  double fSubDetector2() const { return fSubDetector2_; }
51  double fSubDetector3() const { return fSubDetector3_; }
52  double fSubDetector4() const { return fSubDetector4_; }
53  double fEB() const { return fEB_; }
54  double fEE() const { return fEE_; }
55  double fHB() const { return fHB_; }
56  double fHE() const { return fHE_; }
57  double fHO() const { return fHO_; }
58  double fLong() const { return fLong_; }
59  double fShort() const { return fShort_; }
60  double fLSbad() const { return fLS_; }
61  double fHFOOT() const { return fHFOOT_; }
62  // these are tower based
63  double restrictedEMF() const { return restrictedEMF_; }
64  int nHCALTowers() const { return nHCALTowers_; }
65  int nECALTowers() const { return nECALTowers_; }
66  // tower based approximations / inferior options
67  double approximatefHPD() const { return approximatefHPD_; }
68  double approximatefRBX() const { return approximatefRBX_; }
69  int hitsInN90() const { return hitsInN90_; }
70 
71  struct subtower { // contents of a sub-detector's tower
72  double E;
73  int Nhit;
74 
75  subtower(double xE, int xN) {
76  E = xE;
77  Nhit = xN;
78  }
79  };
80 
81  private:
82  // helper functions
84  const edm::EventSetup &setup,
85  const reco::CaloJet &jet,
86  std::vector<double> &energies,
87  std::vector<double> &subdet_energies,
88  std::vector<double> &Ecal_energies,
89  std::vector<double> &Hcal_energies,
90  std::vector<double> &HO_energies,
91  std::vector<double> &HPD_energies,
92  std::vector<double> &RBX_energies,
93  double &LS_bad_energy,
94  double &HF_OOT_energy,
95  const int iDbg = 0);
96 
98  const reco::CaloJet &jet,
99  std::vector<subtower> &subtowers,
100  std::vector<subtower> &Ecal_subtowers,
101  std::vector<subtower> &Hcal_subtowers,
102  std::vector<subtower> &HO_subtowers,
103  std::vector<double> &HPD_energies,
104  std::vector<double> &RBX_energies,
105  const int iDbg = 0);
106 
107  unsigned int nCarrying(double fraction, const std::vector<double> &descending_energies);
108  unsigned int hitsInNCarrying(double fraction, const std::vector<subtower> &descending_towers);
109 
111 
112  int HBHE_oddness(int iEta, int depth);
113  Region HBHE_region(uint32_t);
114  // tower-based. -1 means can't figure it out
115  int HBHE_oddness(int iEta);
116  Region region(int iEta);
117 
118  double fHPD_;
119  double fRBX_;
120  int n90Hits_;
135 
137  double fLS_, fHFOOT_;
138 
145 
146  static std::atomic<int> sanity_checks_left_;
147 
153 
155  };
156  } // namespace helper
157 } // namespace reco
158 #endif
Region region(int iEta)
Definition: JetIDHelper.cc:669
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:269
Jets made from CaloTowers.
Definition: CaloJet.h:27
edm::EDGetTokenT< EBRecHitCollection > input_EBRecHits_token_
Definition: JetIDHelper.h:151
edm::InputTag eeRecHitsColl_
Definition: JetIDHelper.h:144
edm::InputTag ebRecHitsColl_
Definition: JetIDHelper.h:143
double fSubDetector1() const
Definition: JetIDHelper.h:49
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcal_topo_token_
Definition: JetIDHelper.h:154
double approximatefRBX() const
Definition: JetIDHelper.h:68
double fSubDetector2() const
Definition: JetIDHelper.h:50
double fLSbad() const
Definition: JetIDHelper.h:60
edm::EDGetTokenT< HORecHitCollection > input_HORecHits_token_
Definition: JetIDHelper.h:149
unsigned int nCarrying(double fraction, const std::vector< double > &descending_energies)
Definition: JetIDHelper.cc:234
double fSubDetector4() const
Definition: JetIDHelper.h:52
void calculate(const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:93
Region HBHE_region(uint32_t)
Definition: JetIDHelper.cc:649
edm::EDGetTokenT< HFRecHitCollection > input_HFRecHits_token_
Definition: JetIDHelper.h:150
edm::InputTag hbheRecHitsColl_
Definition: JetIDHelper.h:140
static std::atomic< int > sanity_checks_left_
Definition: JetIDHelper.h:146
edm::InputTag hfRecHitsColl_
Definition: JetIDHelper.h:142
void fillDescription(edm::ParameterSetDescription &iDesc)
Definition: JetIDHelper.cc:80
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:519
edm::InputTag hoRecHitsColl_
Definition: JetIDHelper.h:141
double fHFOOT() const
Definition: JetIDHelper.h:61
edm::EDGetTokenT< HBHERecHitCollection > input_HBHERecHits_token_
Definition: JetIDHelper.h:148
double approximatefHPD() const
Definition: JetIDHelper.h:67
int HBHE_oddness(int iEta, int depth)
Definition: JetIDHelper.cc:642
double fShort() const
Definition: JetIDHelper.h:59
fixed size matrix
edm::EDGetTokenT< EERecHitCollection > input_EERecHits_token_
Definition: JetIDHelper.h:152
double fSubDetector3() const
Definition: JetIDHelper.h:51
double restrictedEMF() const
Definition: JetIDHelper.h:63
double fLong() const
Definition: JetIDHelper.h:58
unsigned int hitsInNCarrying(double fraction, const std::vector< subtower > &descending_towers)
Definition: JetIDHelper.cc:251
Definition: event.py:1