Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-03 04:18:04

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 isolationPT_lsb,
0014                          double beta_lsb,
0015                          double mass_lsb,
0016                          double seed_pT_lsb,
0017                          double seed_z0_lsb,
0018                          double scalarSumPT_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         isolationPT_lsb_(isolationPT_lsb),
0028         beta_lsb_(beta_lsb),
0029         mass_lsb_(mass_lsb),
0030         seed_pT_lsb_(seed_pT_lsb),
0031         seed_z0_lsb_(seed_z0_lsb),
0032         scalarSumPT_lsb_(scalarSumPT_lsb),
0033         sum_pT_pv_lsb_(sum_pT_pv_lsb),
0034         pos_chg_(pos_chg),
0035         neg_chg_(neg_chg) {}
0036 
0037   L1GTScales::L1GTScales(const edm::ParameterSet& config)
0038       : pT_lsb_(config.getParameter<double>("pT_lsb")),
0039         phi_lsb_(config.getParameter<double>("phi_lsb")),
0040         eta_lsb_(config.getParameter<double>("eta_lsb")),
0041         z0_lsb_(config.getParameter<double>("z0_lsb")),
0042         //d0_lsb_(config.getParameter<double>("d0_lsb")),
0043         isolationPT_lsb_(config.getParameter<double>("isolationPT_lsb")),
0044         beta_lsb_(config.getParameter<double>("beta_lsb")),
0045         mass_lsb_(config.getParameter<double>("mass_lsb")),
0046         seed_pT_lsb_(config.getParameter<double>("seed_pT_lsb")),
0047         seed_z0_lsb_(config.getParameter<double>("seed_z0_lsb")),
0048         scalarSumPT_lsb_(config.getParameter<double>("scalarSumPT_lsb")),
0049         sum_pT_pv_lsb_(config.getParameter<double>("sum_pT_pv_lsb")),
0050         pos_chg_(config.getParameter<int>("pos_chg")),
0051         neg_chg_(config.getParameter<int>("neg_chg")) {}
0052 
0053   void L1GTScales::fillPSetDescription(edm::ParameterSetDescription& desc) {
0054     desc.add<double>("pT_lsb");
0055     desc.add<double>("phi_lsb");
0056     desc.add<double>("eta_lsb");
0057     desc.add<double>("z0_lsb");
0058     //desc.add<double>("d0_lsb");
0059     desc.add<double>("isolationPT_lsb");
0060     desc.add<double>("beta_lsb");
0061     desc.add<double>("mass_lsb");
0062     desc.add<double>("seed_pT_lsb");
0063     desc.add<double>("seed_z0_lsb");
0064     desc.add<double>("scalarSumPT_lsb");
0065     desc.add<double>("sum_pT_pv_lsb");
0066     desc.add<int>("pos_chg");
0067     desc.add<int>("neg_chg");
0068   }
0069 
0070   PYBIND11_MODULE(libL1TriggerPhase2L1GT, m) {
0071     py::class_<L1GTScales>(m, "L1GTScales")
0072         .def(py::init<double,
0073                       double,
0074                       double,
0075                       double,
0076                       /*double, */
0077                       double,
0078                       double,
0079                       double,
0080                       double,
0081                       double,
0082                       double,
0083                       double,
0084                       int,
0085                       int>())
0086         .def("to_hw_pT_ceil", &L1GTScales::to_hw_pT_ceil)
0087         .def("to_hw_phi_ceil", &L1GTScales::to_hw_phi_ceil)
0088         .def("to_hw_eta_ceil", &L1GTScales::to_hw_eta_ceil)
0089         .def("to_hw_z0_ceil", &L1GTScales::to_hw_z0_ceil)
0090         .def("to_hw_relative_isolationPT_ceil", &L1GTScales::to_hw_relative_isolationPT_ceil)
0091         .def("to_hw_beta_ceil", &L1GTScales::to_hw_beta_ceil)
0092         .def("to_hw_mass_ceil", &L1GTScales::to_hw_mass_ceil)
0093         .def("to_hw_seed_pT_ceil", &L1GTScales::to_hw_seed_pT_ceil)
0094         .def("to_hw_seed_z0_ceil", &L1GTScales::to_hw_seed_z0_ceil)
0095         .def("to_hw_scalarSumPT_ceil", &L1GTScales::to_hw_scalarSumPT_ceil)
0096         .def("to_hw_sum_pT_pv_ceil", &L1GTScales::to_hw_sum_pT_pv_ceil)
0097         .def("to_hw_dRSquared_ceil", &L1GTScales::to_hw_dRSquared_ceil)
0098         .def("to_hw_pT_floor", &L1GTScales::to_hw_pT_floor)
0099         .def("to_hw_phi_floor", &L1GTScales::to_hw_phi_floor)
0100         .def("to_hw_eta_floor", &L1GTScales::to_hw_eta_floor)
0101         .def("to_hw_z0_floor", &L1GTScales::to_hw_z0_floor)
0102         .def("to_hw_relative_isolationPT_floor", &L1GTScales::to_hw_relative_isolationPT_floor)
0103         .def("to_hw_beta_floor", &L1GTScales::to_hw_beta_floor)
0104         .def("to_hw_mass_floor", &L1GTScales::to_hw_mass_floor)
0105         .def("to_hw_seed_pT_floor", &L1GTScales::to_hw_seed_pT_floor)
0106         .def("to_hw_seed_z0_floor", &L1GTScales::to_hw_seed_z0_floor)
0107         .def("to_hw_scalarSumPT_floor", &L1GTScales::to_hw_scalarSumPT_floor)
0108         .def("to_hw_sum_pT_pv_floor", &L1GTScales::to_hw_sum_pT_pv_floor)
0109         .def("to_hw_dRSquared_floor", &L1GTScales::to_hw_dRSquared_floor)
0110         .def("to_hw_InvMassSqrDiv2", &L1GTScales::to_hw_InvMassSqrDiv2)
0111         .def("to_hw_TransMassSqrDiv2", &L1GTScales::to_hw_TransMassSqrDiv2)
0112         .def("to_hw_PtSquared", &L1GTScales::to_hw_PtSquared)
0113         .def("to_hw_InvMassSqrOver2DR", &L1GTScales::to_hw_InvMassSqrOver2DR)
0114         .def("neg_chg", &L1GTScales::neg_chg)
0115         .def("pos_chg", &L1GTScales::pos_chg);
0116   }
0117 }  // namespace l1t