Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:24

0001 #include "L1Trigger/Phase2L1GT/interface/L1GTScales.h"
0002 
0003 #include <pybind11/pybind11.h>
0004 
0005 namespace py = pybind11;
0006 
0007 namespace l1t {
0008   L1GTScales::L1GTScales(double pT_lsb,
0009                          double phi_lsb,
0010                          double eta_lsb,
0011                          double z0_lsb,
0012                          //double d0_lsb,
0013                          double isolation_lsb,
0014                          double beta_lsb,
0015                          double mass_lsb,
0016                          double seed_pT_lsb,
0017                          double seed_z0_lsb,
0018                          double sca_sum_lsb,
0019                          double sum_pT_pv_lsb,
0020                          int pos_chg,
0021                          int neg_chg)
0022       : pT_lsb_(pT_lsb),
0023         phi_lsb_(phi_lsb),
0024         eta_lsb_(eta_lsb),
0025         z0_lsb_(z0_lsb),
0026         //d0_lsb_(d0_lsb),
0027         isolation_lsb_(isolation_lsb),
0028         isolation_shift_(RELATIVE_ISOLATION_RESOLUTION + std::log2(isolation_lsb_ / pT_lsb_)),
0029         beta_lsb_(beta_lsb),
0030         mass_lsb_(mass_lsb),
0031         seed_pT_lsb_(seed_pT_lsb),
0032         seed_z0_lsb_(seed_z0_lsb),
0033         sca_sum_lsb_(sca_sum_lsb),
0034         sum_pT_pv_lsb_(sum_pT_pv_lsb),
0035         pos_chg_(pos_chg),
0036         neg_chg_(neg_chg) {}
0037 
0038   L1GTScales::L1GTScales(const edm::ParameterSet& config)
0039       : pT_lsb_(config.getParameter<double>("pT_lsb")),
0040         phi_lsb_(config.getParameter<double>("phi_lsb")),
0041         eta_lsb_(config.getParameter<double>("eta_lsb")),
0042         z0_lsb_(config.getParameter<double>("z0_lsb")),
0043         //d0_lsb_(config.getParameter<double>("d0_lsb")),
0044         isolation_lsb_(config.getParameter<double>("isolation_lsb")),
0045         isolation_shift_(RELATIVE_ISOLATION_RESOLUTION + std::log2(isolation_lsb_ / pT_lsb_)),
0046         beta_lsb_(config.getParameter<double>("beta_lsb")),
0047         mass_lsb_(config.getParameter<double>("mass_lsb")),
0048         seed_pT_lsb_(config.getParameter<double>("seed_pT_lsb")),
0049         seed_z0_lsb_(config.getParameter<double>("seed_z0_lsb")),
0050         sca_sum_lsb_(config.getParameter<double>("sca_sum_lsb")),
0051         sum_pT_pv_lsb_(config.getParameter<double>("sum_pT_pv_lsb")),
0052         pos_chg_(config.getParameter<int>("pos_chg")),
0053         neg_chg_(config.getParameter<int>("neg_chg")) {}
0054 
0055   void L1GTScales::fillPSetDescription(edm::ParameterSetDescription& desc) {
0056     desc.add<double>("pT_lsb");
0057     desc.add<double>("phi_lsb");
0058     desc.add<double>("eta_lsb");
0059     desc.add<double>("z0_lsb");
0060     //desc.add<double>("d0_lsb");
0061     desc.add<double>("isolation_lsb");
0062     desc.add<double>("beta_lsb");
0063     desc.add<double>("mass_lsb");
0064     desc.add<double>("seed_pT_lsb");
0065     desc.add<double>("seed_z0_lsb");
0066     desc.add<double>("sca_sum_lsb");
0067     desc.add<double>("sum_pT_pv_lsb");
0068     desc.add<int>("pos_chg");
0069     desc.add<int>("neg_chg");
0070   }
0071 
0072   PYBIND11_MODULE(libL1TriggerPhase2L1GT, m) {
0073     py::class_<L1GTScales>(m, "L1GTScales")
0074         .def(py::init<double,
0075                       double,
0076                       double,
0077                       double,
0078                       /*double, */
0079                       double,
0080                       double,
0081                       double,
0082                       double,
0083                       double,
0084                       double,
0085                       double,
0086                       int,
0087                       int>())
0088         .def("to_hw_pT", &L1GTScales::to_hw_pT)
0089         .def("to_hw_phi", &L1GTScales::to_hw_phi)
0090         .def("to_hw_eta", &L1GTScales::to_hw_eta)
0091         .def("to_hw_z0", &L1GTScales::to_hw_z0)
0092         .def("to_hw_isolation", &L1GTScales::to_hw_isolation)
0093         .def("isolation_shift", &L1GTScales::isolation_shift)
0094         .def("to_hw_beta", &L1GTScales::to_hw_beta)
0095         .def("to_hw_mass", &L1GTScales::to_hw_mass)
0096         .def("to_hw_seed_pT", &L1GTScales::to_hw_seed_pT)
0097         .def("to_hw_seed_z0", &L1GTScales::to_hw_seed_z0)
0098         .def("to_hw_sca_sum", &L1GTScales::to_hw_sca_sum)
0099         .def("to_hw_sum_pT_pv", &L1GTScales::to_hw_sum_pT_pv)
0100         .def("to_hw_dRSquared", &L1GTScales::to_hw_dRSquared)
0101         .def("to_hw_InvMassSqrDiv2", &L1GTScales::to_hw_InvMassSqrDiv2)
0102         .def("to_hw_TransMassSqrDiv2", &L1GTScales::to_hw_TransMassSqrDiv2)
0103         .def("to_hw_PtSquared", &L1GTScales::to_hw_PtSquared)
0104         .def("neg_chg", &L1GTScales::neg_chg)
0105         .def("pos_chg", &L1GTScales::pos_chg);
0106   }
0107 }  // namespace l1t