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
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 
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
reco::helper::JetIDHelper::fSubDetector3_
double fSubDetector3_
Definition: JetIDHelper.h:120
reco::helper::JetIDHelper::HBpos
Definition: JetIDHelper.h:107
reco::helper::JetIDHelper::nHCALTowers_
int nHCALTowers_
Definition: JetIDHelper.h:123
reco::helper::JetIDHelper::approximatefHPD_
double approximatefHPD_
Definition: JetIDHelper.h:125
reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
reco::helper::JetIDHelper::approximatefSubDetector3_
double approximatefSubDetector3_
Definition: JetIDHelper.h:130
CaloJet.h
reco::helper::JetIDHelper::n90Hits_
int n90Hits_
Definition: JetIDHelper.h:117
reco::helper::JetIDHelper::approximatefSubDetector2_
double approximatefSubDetector2_
Definition: JetIDHelper.h:129
reco::helper::JetIDHelper::eeRecHitsColl_
edm::InputTag eeRecHitsColl_
Definition: JetIDHelper.h:141
reco::helper::JetIDHelper::ebRecHitsColl_
edm::InputTag ebRecHitsColl_
Definition: JetIDHelper.h:140
reco::helper::JetIDHelper::input_HORecHits_token_
edm::EDGetTokenT< HORecHitCollection > input_HORecHits_token_
Definition: JetIDHelper.h:146
reco::helper::JetIDHelper
Definition: JetIDHelper.h:23
ESHandle.h
reco::helper::JetIDHelper::fLS_
double fLS_
Definition: JetIDHelper.h:134
reco::helper::JetIDHelper::fHPD
double fHPD() const
Definition: JetIDHelper.h:43
edm::EDGetTokenT
Definition: EDGetToken.h:33
reco::helper::JetIDHelper::input_EBRecHits_token_
edm::EDGetTokenT< EBRecHitCollection > input_EBRecHits_token_
Definition: JetIDHelper.h:148
reco::helper::JetIDHelper::calculate
void calculate(const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:93
EcalDetIdCollections.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
reco::helper::JetIDHelper::nCarrying
unsigned int nCarrying(double fraction, const std::vector< double > &descending_energies)
Definition: JetIDHelper.cc:234
reco::helper::JetIDHelper::region
Region region(int iEta)
Definition: JetIDHelper.cc:670
reco::helper::JetIDHelper::~JetIDHelper
~JetIDHelper()
Definition: JetIDHelper.h:28
reco::helper::JetIDHelper::useRecHits_
bool useRecHits_
Definition: JetIDHelper.h:136
reco::helper::JetIDHelper::hbheRecHitsColl_
edm::InputTag hbheRecHitsColl_
Definition: JetIDHelper.h:137
reco::helper::JetIDHelper::fHB_
double fHB_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::HBneg
Definition: JetIDHelper.h:107
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::helper::JetIDHelper::fSubDetector4_
double fSubDetector4_
Definition: JetIDHelper.h:121
reco::helper::JetIDHelper::approximatefSubDetector4_
double approximatefSubDetector4_
Definition: JetIDHelper.h:131
reco::helper::JetIDHelper::HEpos
Definition: JetIDHelper.h:107
reco::helper::JetIDHelper::fSubDetector2
double fSubDetector2() const
Definition: JetIDHelper.h:47
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
EcalRecHitCollections.h
reco::helper::JetIDHelper::fLSbad
double fLSbad() const
Definition: JetIDHelper.h:57
reco::helper::JetIDHelper::subtower::subtower
subtower(double xE, int xN)
Definition: JetIDHelper.h:72
reco::helper::JetIDHelper::fHE_
double fHE_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::fSubDetector4
double fSubDetector4() const
Definition: JetIDHelper.h:49
reco::helper::JetIDHelper::n90Hits
int n90Hits() const
Definition: JetIDHelper.h:45
reco::helper::JetIDHelper::restrictedEMF_
double restrictedEMF_
Definition: JetIDHelper.h:122
reco::helper::JetIDHelper::hfRecHitsColl_
edm::InputTag hfRecHitsColl_
Definition: JetIDHelper.h:139
reco::helper::JetIDHelper::sanity_checks_left_
static std::atomic< int > sanity_checks_left_
Definition: JetIDHelper.h:143
reco::helper::JetIDHelper::approximatefRBX_
double approximatefRBX_
Definition: JetIDHelper.h:126
reco::helper::JetIDHelper::approximatefRBX
double approximatefRBX() const
Definition: JetIDHelper.h:65
reco::helper::JetIDHelper::fShort_
double fShort_
Definition: JetIDHelper.h:133
HLT_FULL_cff.fraction
fraction
Definition: HLT_FULL_cff.py:52802
reco::helper::JetIDHelper::fEE_
double fEE_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::nECALTowers
int nECALTowers() const
Definition: JetIDHelper.h:62
reco::helper::JetIDHelper::input_HFRecHits_token_
edm::EDGetTokenT< HFRecHitCollection > input_HFRecHits_token_
Definition: JetIDHelper.h:147
reco::helper::JetIDHelper::fEB_
double fEB_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::HFneg
Definition: JetIDHelper.h:107
ParameterSetDescription.h
reco::helper::JetIDHelper::hitsInN90_
int hitsInN90_
Definition: JetIDHelper.h:127
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
reco::helper::JetIDHelper::HBHE_region
Region HBHE_region(uint32_t)
Definition: JetIDHelper.cc:650
reco::helper::JetIDHelper::Region
Region
Definition: JetIDHelper.h:107
HcalRecHitDefs.h
reco::helper::JetIDHelper::fHPD_
double fHPD_
Definition: JetIDHelper.h:115
reco::helper::JetIDHelper::nHCALTowers
int nHCALTowers() const
Definition: JetIDHelper.h:61
edm::ParameterSet
Definition: ParameterSet.h:47
reco::helper::JetIDHelper::fHO_
double fHO_
Definition: JetIDHelper.h:133
reco::helper::JetIDHelper::fEB
double fEB() const
Definition: JetIDHelper.h:50
reco::helper::JetIDHelper::fHO
double fHO() const
Definition: JetIDHelper.h:54
reco::helper::JetIDHelper::input_HBHERecHits_token_
edm::EDGetTokenT< HBHERecHitCollection > input_HBHERecHits_token_
Definition: JetIDHelper.h:145
Event.h
reco::helper::JetIDHelper::subtower
Definition: JetIDHelper.h:68
reco::helper::JetIDHelper::HFpos
Definition: JetIDHelper.h:107
reco::helper::JetIDHelper::fillDescription
void fillDescription(edm::ParameterSetDescription &iDesc)
Definition: JetIDHelper.cc:80
reco::helper::JetIDHelper::fLong_
double fLong_
Definition: JetIDHelper.h:133
helper
Definition: helper.py:1
reco::helper::JetIDHelper::fHFOOT
double fHFOOT() const
Definition: JetIDHelper.h:58
reco::helper::JetIDHelper::fHE
double fHE() const
Definition: JetIDHelper.h:53
reco::helper::JetIDHelper::HEneg
Definition: JetIDHelper.h:107
reco::helper::JetIDHelper::approximatefSubDetector1_
double approximatefSubDetector1_
Definition: JetIDHelper.h:128
reco::helper::JetIDHelper::fEE
double fEE() const
Definition: JetIDHelper.h:51
edm::EventSetup
Definition: EventSetup.h:58
reco::helper::JetIDHelper::subtower::Nhit
int Nhit
Definition: JetIDHelper.h:70
reco::helper::JetIDHelper::classifyJetTowers
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
reco::helper::JetIDHelper::unknown_region
Definition: JetIDHelper.h:107
reco::helper::JetIDHelper::fRBX
double fRBX() const
Definition: JetIDHelper.h:44
reco::helper::JetIDHelper::hoRecHitsColl_
edm::InputTag hoRecHitsColl_
Definition: JetIDHelper.h:138
reco::helper::JetIDHelper::nECALTowers_
int nECALTowers_
Definition: JetIDHelper.h:124
reco::helper::JetIDHelper::approximatefHPD
double approximatefHPD() const
Definition: JetIDHelper.h:64
reco::helper::JetIDHelper::hitsInN90
int hitsInN90() const
Definition: JetIDHelper.h:66
Frameworkfwd.h
metsig::jet
Definition: SignAlgoResolutions.h:47
reco::helper::JetIDHelper::fSubDetector2_
double fSubDetector2_
Definition: JetIDHelper.h:119
reco::helper::JetIDHelper::fShort
double fShort() const
Definition: JetIDHelper.h:56
HcalRecHitCollections.h
reco::helper::JetIDHelper::restrictedEMF
double restrictedEMF() const
Definition: JetIDHelper.h:60
reco::helper::JetIDHelper::initValues
void initValues()
Definition: JetIDHelper.cc:62
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
reco::helper::JetIDHelper::HBHE_oddness
int HBHE_oddness(int iEta, int depth)
Definition: JetIDHelper.cc:643
ConsumesCollector.h
ParameterSet.h
reco::helper::JetIDHelper::fLong
double fLong() const
Definition: JetIDHelper.h:55
reco::helper::JetIDHelper::fSubDetector1_
double fSubDetector1_
Definition: JetIDHelper.h:118
reco::helper::JetIDHelper::hitsInNCarrying
unsigned int hitsInNCarrying(double fraction, const std::vector< subtower > &descending_towers)
Definition: JetIDHelper.cc:251
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
reco::helper::JetIDHelper::fSubDetector3
double fSubDetector3() const
Definition: JetIDHelper.h:48
reco::helper::JetIDHelper::fHB
double fHB() const
Definition: JetIDHelper.h:52
reco::helper::JetIDHelper::classifyJetComponents
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
reco::helper::JetIDHelper::input_EERecHits_token_
edm::EDGetTokenT< EERecHitCollection > input_EERecHits_token_
Definition: JetIDHelper.h:149
reco::helper::JetIDHelper::JetIDHelper
JetIDHelper()
Definition: JetIDHelper.h:26
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
reco::helper::JetIDHelper::fRBX_
double fRBX_
Definition: JetIDHelper.h:116
reco::helper::JetIDHelper::fSubDetector1
double fSubDetector1() const
Definition: JetIDHelper.h:46
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
reco::helper::JetIDHelper::fHFOOT_
double fHFOOT_
Definition: JetIDHelper.h:134
reco::helper::JetIDHelper::subtower::E
double E
Definition: JetIDHelper.h:69