CMS 3D CMS Logo

L1GTScales.h
Go to the documentation of this file.
1 #ifndef L1Trigger_Phase2L1GT_L1GTScales_h
2 #define L1Trigger_Phase2L1GT_L1GTScales_h
3 
6 
7 #include <cmath>
8 
9 namespace l1t {
10  class L1GTScales {
11  static constexpr int RELATIVE_ISOLATION_RESOLUTION = 10; // Resolution = 1/2^RELATIVE_ISOLATION_RESOLUTION
12 
13  public:
14  L1GTScales(double pT_lsb,
15  double phi_lsb,
16  double eta_lsb,
17  double z0_lsb,
18  //double dD_lsb,
19  double isolation_lsb,
20  double beta_lsb,
21  double mass_lsb,
22  double seed_pT_lsb,
23  double seed_dZ_lsb,
24  double sca_sum_lsb,
25  double sum_pT_pv_lsb,
26  int pos_chg,
27  int neg_chg);
28 
30 
32 
33  int to_hw_pT(double value) const { return std::round(value / pT_lsb_); };
34  int to_hw_phi(double value) const { return std::round(value / phi_lsb_); };
35  int to_hw_eta(double value) const { return std::round(value / eta_lsb_); };
36  int to_hw_z0(double value) const { return std::round(value / z0_lsb_); };
37  // int to_hw_d0(double value) const { return std::round(value / d0_lsb_); };
38  int to_hw_isolation(double value) const {
39  return std::round(pT_lsb_ * value * std::pow(2, isolation_shift_) / isolation_lsb_);
40  }
41  int to_hw_beta(double value) const { return std::round(value / beta_lsb_); };
42  int to_hw_mass(double value) const { return std::round(value / mass_lsb_); };
43  int to_hw_seed_pT(double value) const { return std::round(value / seed_pT_lsb_); };
44  int to_hw_seed_z0(double value) const { return std::round(value / seed_z0_lsb_); };
45  int to_hw_sca_sum(double value) const { return std::round(value / sca_sum_lsb_); };
46  int to_hw_sum_pT_pv(double value) const { return std::round(value / sum_pT_pv_lsb_); };
47 
48  int to_hw_dRSquared(double value) const { return std::round(value * value / (eta_lsb_ * eta_lsb_)); }
49 
50  double to_hw_InvMassSqrDiv2(double value) const { return value * value / (2 * pT_lsb_ * pT_lsb_); }
51  double to_hw_TransMassSqrDiv2(double value) const { return value * value / (2 * pT_lsb_ * pT_lsb_); }
52 
53  double to_hw_PtSquared(double value) const { return value * value / (pT_lsb_ * pT_lsb_); }
54 
55  double to_pT(int value) const { return value * pT_lsb_; };
56  double to_phi(int value) const { return value * phi_lsb_; };
57  double to_eta(int value) const { return value * eta_lsb_; };
58  double to_z0(int value) const { return value * z0_lsb_; };
59  double to_sca_sum(int value) const { return value * sca_sum_lsb_; };
60  int to_chg(int value) const { return value == pos_chg_ ? +1 : value == neg_chg_ ? -1 : 0; }
61 
62  double pT_lsb() const { return pT_lsb_; }
63  double phi_lsb() const { return phi_lsb_; }
64  double eta_lsb() const { return eta_lsb_; }
65  double z0_lsb() const { return z0_lsb_; }
66  double isolation_lsb() const { return isolation_lsb_; }
67  //const double dD_lsb_;
68  double beta_lsb() const { return beta_lsb_; }
69  double mass_lsb() const { return mass_lsb_; }
70  double seed_pT_lsb() const { return seed_pT_lsb_; }
71  double seed_z0_lsb() const { return seed_z0_lsb_; }
72  double sca_sum_lsb() const { return sca_sum_lsb_; }
73  double sum_pT_pv_lsb() const { return sum_pT_pv_lsb_; }
74  int pos_chg() const { return pos_chg_; }
75  int neg_chg() const { return neg_chg_; }
76  int isolation_shift() const { return isolation_shift_; }
77 
78  private:
79  const double pT_lsb_;
80  const double phi_lsb_;
81  const double eta_lsb_;
82  const double z0_lsb_;
83  //const double dD_lsb_;
84  const double isolation_lsb_;
85  const double isolation_shift_;
86  const double beta_lsb_;
87  const double mass_lsb_;
88  const double seed_pT_lsb_;
89  const double seed_z0_lsb_;
90  const double sca_sum_lsb_;
91  const double sum_pT_pv_lsb_;
92  const int pos_chg_;
93  const int neg_chg_;
94  };
95 } // namespace l1t
96 
97 #endif // L1Trigger_Phase2L1GT_L1GTScales_h
int to_hw_seed_z0(double value) const
Definition: L1GTScales.h:44
double beta_lsb() const
Definition: L1GTScales.h:68
double eta_lsb() const
Definition: L1GTScales.h:64
double pT_lsb() const
Definition: L1GTScales.h:62
int to_hw_phi(double value) const
Definition: L1GTScales.h:34
int to_hw_mass(double value) const
Definition: L1GTScales.h:42
double to_hw_InvMassSqrDiv2(double value) const
Definition: L1GTScales.h:50
double to_hw_TransMassSqrDiv2(double value) const
Definition: L1GTScales.h:51
double phi_lsb() const
Definition: L1GTScales.h:63
int to_hw_pT(double value) const
Definition: L1GTScales.h:33
const double seed_z0_lsb_
Definition: L1GTScales.h:89
double to_phi(int value) const
Definition: L1GTScales.h:56
const double sca_sum_lsb_
Definition: L1GTScales.h:90
const double seed_pT_lsb_
Definition: L1GTScales.h:88
const double eta_lsb_
Definition: L1GTScales.h:81
int to_chg(int value) const
Definition: L1GTScales.h:60
static void fillPSetDescription(edm::ParameterSetDescription &)
Definition: L1GTScales.cc:55
delete x;
Definition: CaloConfig.h:22
int to_hw_sca_sum(double value) const
Definition: L1GTScales.h:45
int to_hw_z0(double value) const
Definition: L1GTScales.h:36
double to_z0(int value) const
Definition: L1GTScales.h:58
int pos_chg() const
Definition: L1GTScales.h:74
double sca_sum_lsb() const
Definition: L1GTScales.h:72
double mass_lsb() const
Definition: L1GTScales.h:69
int to_hw_seed_pT(double value) const
Definition: L1GTScales.h:43
double isolation_lsb() const
Definition: L1GTScales.h:66
double to_eta(int value) const
Definition: L1GTScales.h:57
const int neg_chg_
Definition: L1GTScales.h:93
const double isolation_lsb_
Definition: L1GTScales.h:84
int to_hw_beta(double value) const
Definition: L1GTScales.h:41
const double phi_lsb_
Definition: L1GTScales.h:80
double to_sca_sum(int value) const
Definition: L1GTScales.h:59
int neg_chg() const
Definition: L1GTScales.h:75
const int pos_chg_
Definition: L1GTScales.h:92
const double sum_pT_pv_lsb_
Definition: L1GTScales.h:91
int to_hw_sum_pT_pv(double value) const
Definition: L1GTScales.h:46
const double mass_lsb_
Definition: L1GTScales.h:87
Definition: value.py:1
int isolation_shift() const
Definition: L1GTScales.h:76
const double beta_lsb_
Definition: L1GTScales.h:86
double sum_pT_pv_lsb() const
Definition: L1GTScales.h:73
double seed_pT_lsb() const
Definition: L1GTScales.h:70
double seed_z0_lsb() const
Definition: L1GTScales.h:71
double to_pT(int value) const
Definition: L1GTScales.h:55
static constexpr int RELATIVE_ISOLATION_RESOLUTION
Definition: L1GTScales.h:11
const double pT_lsb_
Definition: L1GTScales.h:79
L1GTScales(double pT_lsb, double phi_lsb, double eta_lsb, double z0_lsb, double isolation_lsb, double beta_lsb, double mass_lsb, double seed_pT_lsb, double seed_dZ_lsb, double sca_sum_lsb, double sum_pT_pv_lsb, int pos_chg, int neg_chg)
Definition: L1GTScales.cc:8
const double isolation_shift_
Definition: L1GTScales.h:85
const double z0_lsb_
Definition: L1GTScales.h:82
double z0_lsb() const
Definition: L1GTScales.h:65
int to_hw_eta(double value) const
Definition: L1GTScales.h:35
double to_hw_PtSquared(double value) const
Definition: L1GTScales.h:53
int to_hw_dRSquared(double value) const
Definition: L1GTScales.h:48
int to_hw_isolation(double value) const
Definition: L1GTScales.h:38
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29