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