CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
17 
18 namespace reco {
19 
20  namespace helper {
21 
22  class JetIDHelper {
23 
24  public :
25  // construction
29 
31 
32  void initValues ();
33 
34  // interface
35  void calculate( const edm::Event& event, const reco::CaloJet &jet, const int iDbg = 0 );
36 
37  // member access
38 
39  // these require RecHits, so can not be evaluated from AOD
40  double fHPD() const { return fHPD_;}
41  double fRBX() const { return fRBX_;}
42  int n90Hits() const { return n90Hits_;}
43  double fSubDetector1() const { return fSubDetector1_;}
44  double fSubDetector2() const { return fSubDetector2_;}
45  double fSubDetector3() const { return fSubDetector3_;}
46  double fSubDetector4() const { return fSubDetector4_;}
47  double fEB() const { return fEB_;}
48  double fEE() const { return fEE_;}
49  double fHB() const { return fHB_;}
50  double fHE() const { return fHE_;}
51  double fHO() const { return fHO_;}
52  double fLong() const { return fLong_;}
53  double fShort() const { return fShort_;}
54  double fLSbad() const { return fLS_;}
55  double fHFOOT() const { return fHFOOT_;}
56  // these are tower based
57  double restrictedEMF() const { return restrictedEMF_;}
58  int nHCALTowers() const { return nHCALTowers_;}
59  int nECALTowers() const { return nECALTowers_;}
60  // tower based approximations / inferior options
61  double approximatefHPD() const { return approximatefHPD_;}
62  double approximatefRBX() const { return approximatefRBX_;}
63  int hitsInN90() const { return hitsInN90_;}
64 
65  struct subtower { // contents of a sub-detector's tower
66  double E;
67  int Nhit;
68 
69  subtower( double xE, int xN ) { E = xE; Nhit = xN; }
70  };
71 
72 
73  private:
74 
75 
76  // helper functions
78  std::vector< double > &energies,
79  std::vector< double > &subdet_energies,
80  std::vector< double > &Ecal_energies, std::vector< double > &Hcal_energies,
81  std::vector< double > &HO_energies,
82  std::vector< double > &HPD_energies, std::vector< double > &RBX_energies,
83  double& LS_bad_energy, double& HF_OOT_energy, const int iDbg = 0);
84 
85  void classifyJetTowers( const edm::Event& event, const reco::CaloJet &jet,
86  std::vector< subtower > &subtowers,
87  std::vector< subtower > &Ecal_subtowers,
88  std::vector< subtower > &Hcal_subtowers,
89  std::vector< subtower > &HO_subtowers,
90  std::vector< double > &HPD_energies,
91  std::vector< double > &RBX_energies,
92  const int iDbg = 0);
93 
94  unsigned int nCarrying( double fraction, const std::vector< double >& descending_energies );
95  unsigned int hitsInNCarrying( double fraction, const std::vector< subtower >& descending_towers );
96 
97  enum Region{
100 
101  int HBHE_oddness( int iEta, int depth );
102  Region HBHE_region( int iEta, int depth );
103  // tower-based. -1 means can't figure it out
104  int HBHE_oddness( int iEta );
105  Region region( int iEta );
106 
107 
108  double fHPD_;
109  double fRBX_;
110  int n90Hits_;
125 
127  double fLS_, fHFOOT_;
128 
135 
136  static std::atomic<int> sanity_checks_left_;
137 
143 
144 
145  };
146  }
147 }
148 #endif
Region region(int iEta)
Definition: JetIDHelper.cc:616
double fHE() const
Definition: JetIDHelper.h:50
double fHB() const
Definition: JetIDHelper.h:49
Jets made from CaloTowers.
Definition: CaloJet.h:29
edm::EDGetTokenT< EBRecHitCollection > input_EBRecHits_token_
Definition: JetIDHelper.h:141
edm::InputTag eeRecHitsColl_
Definition: JetIDHelper.h:134
edm::InputTag ebRecHitsColl_
Definition: JetIDHelper.h:133
double fLSbad() const
Definition: JetIDHelper.h:54
int nHCALTowers() const
Definition: JetIDHelper.h:58
double approximatefRBX() const
Definition: JetIDHelper.h:62
double fLong() const
Definition: JetIDHelper.h:52
int nECALTowers() const
Definition: JetIDHelper.h:59
double fHPD() const
Definition: JetIDHelper.h:40
edm::EDGetTokenT< HORecHitCollection > input_HORecHits_token_
Definition: JetIDHelper.h:139
unsigned int nCarrying(double fraction, const std::vector< double > &descending_energies)
Definition: JetIDHelper.cc:213
double fSubDetector4() const
Definition: JetIDHelper.h:46
double restrictedEMF() const
Definition: JetIDHelper.h:57
double fSubDetector1() const
Definition: JetIDHelper.h:43
edm::EDGetTokenT< HFRecHitCollection > input_HFRecHits_token_
Definition: JetIDHelper.h:140
edm::InputTag hbheRecHitsColl_
Definition: JetIDHelper.h:130
static std::atomic< int > sanity_checks_left_
Definition: JetIDHelper.h:136
double approximatefHPD() const
Definition: JetIDHelper.h:61
double fEB() const
Definition: JetIDHelper.h:47
edm::InputTag hfRecHitsColl_
Definition: JetIDHelper.h:132
double fEE() const
Definition: JetIDHelper.h:48
void fillDescription(edm::ParameterSetDescription &iDesc)
Definition: JetIDHelper.cc:84
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:478
edm::InputTag hoRecHitsColl_
Definition: JetIDHelper.h:131
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::EDGetTokenT< HBHERecHitCollection > input_HBHERecHits_token_
Definition: JetIDHelper.h:138
Region HBHE_region(int iEta, int depth)
Definition: JetIDHelper.cc:600
double fSubDetector3() const
Definition: JetIDHelper.h:45
double fShort() const
Definition: JetIDHelper.h:53
int HBHE_oddness(int iEta, int depth)
Definition: JetIDHelper.cc:593
void classifyJetComponents(const edm::Event &event, 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:246
edm::EDGetTokenT< EERecHitCollection > input_EERecHits_token_
Definition: JetIDHelper.h:142
double fSubDetector2() const
Definition: JetIDHelper.h:44
double fHO() const
Definition: JetIDHelper.h:51
double fHFOOT() const
Definition: JetIDHelper.h:55
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:98
unsigned int hitsInNCarrying(double fraction, const std::vector< subtower > &descending_towers)
Definition: JetIDHelper.cc:230
double fRBX() const
Definition: JetIDHelper.h:41