CMS 3D CMS Logo

L1GTScales.cc
Go to the documentation of this file.
2 
3 #include <pybind11/pybind11.h>
4 
5 namespace py = pybind11;
6 
7 namespace l1t {
9  double phi_lsb,
10  double eta_lsb,
11  double z0_lsb,
12  //double d0_lsb,
13  double isolation_lsb,
14  double beta_lsb,
15  double mass_lsb,
16  double seed_pT_lsb,
17  double seed_z0_lsb,
18  double sca_sum_lsb,
19  double sum_pT_pv_lsb,
20  int pos_chg,
21  int neg_chg)
22  : pT_lsb_(pT_lsb),
23  phi_lsb_(phi_lsb),
24  eta_lsb_(eta_lsb),
25  z0_lsb_(z0_lsb),
26  //d0_lsb_(d0_lsb),
27  isolation_lsb_(isolation_lsb),
28  isolation_shift_(RELATIVE_ISOLATION_RESOLUTION + std::log2(isolation_lsb_ / pT_lsb_)),
29  beta_lsb_(beta_lsb),
30  mass_lsb_(mass_lsb),
31  seed_pT_lsb_(seed_pT_lsb),
32  seed_z0_lsb_(seed_z0_lsb),
33  sca_sum_lsb_(sca_sum_lsb),
34  sum_pT_pv_lsb_(sum_pT_pv_lsb),
35  pos_chg_(pos_chg),
36  neg_chg_(neg_chg) {}
37 
39  : pT_lsb_(config.getParameter<double>("pT_lsb")),
40  phi_lsb_(config.getParameter<double>("phi_lsb")),
41  eta_lsb_(config.getParameter<double>("eta_lsb")),
42  z0_lsb_(config.getParameter<double>("z0_lsb")),
43  //d0_lsb_(config.getParameter<double>("d0_lsb")),
44  isolation_lsb_(config.getParameter<double>("isolation_lsb")),
45  isolation_shift_(RELATIVE_ISOLATION_RESOLUTION + std::log2(isolation_lsb_ / pT_lsb_)),
46  beta_lsb_(config.getParameter<double>("beta_lsb")),
47  mass_lsb_(config.getParameter<double>("mass_lsb")),
48  seed_pT_lsb_(config.getParameter<double>("seed_pT_lsb")),
49  seed_z0_lsb_(config.getParameter<double>("seed_z0_lsb")),
50  sca_sum_lsb_(config.getParameter<double>("sca_sum_lsb")),
51  sum_pT_pv_lsb_(config.getParameter<double>("sum_pT_pv_lsb")),
52  pos_chg_(config.getParameter<int>("pos_chg")),
53  neg_chg_(config.getParameter<int>("neg_chg")) {}
54 
56  desc.add<double>("pT_lsb");
57  desc.add<double>("phi_lsb");
58  desc.add<double>("eta_lsb");
59  desc.add<double>("z0_lsb");
60  //desc.add<double>("d0_lsb");
61  desc.add<double>("isolation_lsb");
62  desc.add<double>("beta_lsb");
63  desc.add<double>("mass_lsb");
64  desc.add<double>("seed_pT_lsb");
65  desc.add<double>("seed_z0_lsb");
66  desc.add<double>("sca_sum_lsb");
67  desc.add<double>("sum_pT_pv_lsb");
68  desc.add<int>("pos_chg");
69  desc.add<int>("neg_chg");
70  }
71 
72  PYBIND11_MODULE(libL1TriggerPhase2L1GT, m) {
73  py::class_<L1GTScales>(m, "L1GTScales")
74  .def(py::init<double,
75  double,
76  double,
77  double,
78  /*double, */
79  double,
80  double,
81  double,
82  double,
83  double,
84  double,
85  double,
86  int,
87  int>())
88  .def("to_hw_pT", &L1GTScales::to_hw_pT)
89  .def("to_hw_phi", &L1GTScales::to_hw_phi)
90  .def("to_hw_eta", &L1GTScales::to_hw_eta)
91  .def("to_hw_z0", &L1GTScales::to_hw_z0)
92  .def("to_hw_isolation", &L1GTScales::to_hw_isolation)
93  .def("isolation_shift", &L1GTScales::isolation_shift)
94  .def("to_hw_beta", &L1GTScales::to_hw_beta)
95  .def("to_hw_mass", &L1GTScales::to_hw_mass)
96  .def("to_hw_seed_pT", &L1GTScales::to_hw_seed_pT)
97  .def("to_hw_seed_z0", &L1GTScales::to_hw_seed_z0)
98  .def("to_hw_sca_sum", &L1GTScales::to_hw_sca_sum)
99  .def("to_hw_sum_pT_pv", &L1GTScales::to_hw_sum_pT_pv)
100  .def("to_hw_dRSquared", &L1GTScales::to_hw_dRSquared)
101  .def("to_hw_InvMassSqrDiv2", &L1GTScales::to_hw_InvMassSqrDiv2)
102  .def("to_hw_TransMassSqrDiv2", &L1GTScales::to_hw_TransMassSqrDiv2)
103  .def("to_hw_PtSquared", &L1GTScales::to_hw_PtSquared)
104  .def("neg_chg", &L1GTScales::neg_chg)
105  .def("pos_chg", &L1GTScales::pos_chg);
106  }
107 } // namespace l1t
int to_hw_seed_z0(double value) const
Definition: L1GTScales.h:44
int def(FILE *, FILE *, int)
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
int to_hw_pT(double value) const
Definition: L1GTScales.h:33
int init
Definition: HydjetWrapper.h:66
static void fillPSetDescription(edm::ParameterSetDescription &)
Definition: L1GTScales.cc:55
delete x;
Definition: CaloConfig.h:22
Definition: config.py:1
int to_hw_sca_sum(double value) const
Definition: L1GTScales.h:45
int to_hw_z0(double value) const
Definition: L1GTScales.h:36
int pos_chg() const
Definition: L1GTScales.h:74
int to_hw_seed_pT(double value) const
Definition: L1GTScales.h:43
int to_hw_beta(double value) const
Definition: L1GTScales.h:41
int neg_chg() const
Definition: L1GTScales.h:75
int to_hw_sum_pT_pv(double value) const
Definition: L1GTScales.h:46
int isolation_shift() const
Definition: L1GTScales.h:76
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
PYBIND11_MODULE(libL1TriggerPhase2L1GT, m)
Definition: L1GTScales.cc:72
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