Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:47

0001 #ifndef L1Trigger_TrackFindingTracklet_interface_IMATH_TrackletCalculatorOverlap_h
0002 #define L1Trigger_TrackFindingTracklet_interface_IMATH_TrackletCalculatorOverlap_h
0003 
0004 #include "Settings.h"
0005 #include "imath.h"
0006 
0007 //
0008 // Constants used:
0009 //   dphisector
0010 //   rmaxL6
0011 //   zmaxD5
0012 //   rmaxdisk
0013 //   kr, kphi1, kz
0014 //
0015 //   rmean[], zmean[]
0016 
0017 namespace trklet {
0018 
0019   class IMATH_TrackletCalculatorOverlap {
0020   public:
0021     IMATH_TrackletCalculatorOverlap(Settings const& settings, imathGlobals* globals, int i1, int i2)
0022         : settings_(settings), globals_(globals) {
0023       if (settings_.debugTracklet()) {
0024         edm::LogVerbatim("Tracklet") << "=============================================";
0025         char s[1024];
0026         snprintf(
0027             s, 1024, "IMATH Tracklet Calculator for Overlap %i %i dphisector = %f", i1, i2, settings_.dphisector());
0028         edm::LogVerbatim("Tracklet") << s;
0029         snprintf(s, 1024, "rmaxL6 = %f, zmaxD5 = %f", settings_.rmax(5), settings_.zmax(4));
0030         edm::LogVerbatim("Tracklet") << s;
0031         snprintf(
0032             s, 1024, "      stub Ks: kr, kphi1, kz = %g, %g, %g", settings_.kr(), settings_.kphi1(), settings_.kz());
0033         edm::LogVerbatim("Tracklet") << s;
0034         snprintf(s,
0035                  1024,
0036                  "  tracklet Ks: krinvpars, kphi0pars, ktpars, kzpars = %g, %g, %g, %g",
0037                  settings_.kphi1() / settings_.kr() * pow(2, settings_.rinv_shift()),
0038                  settings_.kphi1() * pow(2, settings_.phi0_shift()),
0039                  settings_.kz() / settings_.kr() * pow(2, settings_.t_shift()),
0040                  settings_.kz() * pow(2, settings_.z0_shift()));
0041         edm::LogVerbatim("Tracklet") << s;
0042         snprintf(s,
0043                  1024,
0044                  "layer proj Ks: kphiproj456, kphider, kzproj, kzder = %g, %g, %g, %g",
0045                  settings_.kphi1() * pow(2, settings_.SS_phiL_shift()),
0046                  settings_.kphi1() / settings_.kr() * pow(2, settings_.SS_phiderL_shift()),
0047                  settings_.kz() * pow(2, settings_.PS_zL_shift()),
0048                  settings_.kz() / settings_.kr() * pow(2, settings_.PS_zderL_shift()));
0049         edm::LogVerbatim("Tracklet") << s;
0050         snprintf(s,
0051                  1024,
0052                  " disk proj Ks: kphiprojdisk, kphiprojderdisk, krprojdisk, krprojderdisk = %g, %g, %g, %g",
0053                  settings_.kphi1() * pow(2, settings_.SS_phiD_shift()),
0054                  settings_.kphi1() / settings_.kr() * pow(2, settings_.SS_phiderD_shift()),
0055                  settings_.kr() * pow(2, settings_.PS_rD_shift()),
0056                  settings_.kr() / settings_.kz() * pow(2, settings_.PS_rderD_shift()));
0057         edm::LogVerbatim("Tracklet") << s;
0058         edm::LogVerbatim("Tracklet") << "=============================================";
0059       }
0060 
0061       r1mean.set_fval(settings_.rmean(i1 - 1));
0062       z2mean.set_fval(settings_.zmean(abs(i2) - 1));
0063 
0064       if (i2 < 0) {  //t is negative
0065         z2mean.set_fval(-settings_.zmean(abs(i2) - 1));
0066         invt.set_mode(VarInv::mode::neg);
0067         invt.initLUT(0.);
0068       }
0069 
0070       valid_phiL_0.add_cut(&t_layer_cut);
0071       valid_phiL_1.add_cut(&t_layer_cut);
0072       valid_phiL_2.add_cut(&t_layer_cut);
0073 
0074       valid_der_phiL.add_cut(&t_layer_cut);
0075 
0076       valid_zL_0.add_cut(&t_layer_cut);
0077       valid_zL_1.add_cut(&t_layer_cut);
0078       valid_zL_2.add_cut(&t_layer_cut);
0079 
0080       valid_der_zL.add_cut(&t_layer_cut);
0081 
0082       valid_phiD_0.add_cut(&t_disk_cut_left);
0083       valid_phiD_1.add_cut(&t_disk_cut_left);
0084       valid_phiD_2.add_cut(&t_disk_cut_left);
0085       valid_phiD_3.add_cut(&t_disk_cut_left);
0086 
0087       valid_der_phiD.add_cut(&t_disk_cut_left);
0088 
0089       valid_rD_0.add_cut(&t_disk_cut_left);
0090       valid_rD_1.add_cut(&t_disk_cut_left);
0091       valid_rD_2.add_cut(&t_disk_cut_left);
0092       valid_rD_3.add_cut(&t_disk_cut_left);
0093 
0094       valid_der_rD.add_cut(&t_disk_cut_left);
0095 
0096       valid_phiD_0.add_cut(&t_disk_cut_right);
0097       valid_phiD_1.add_cut(&t_disk_cut_right);
0098       valid_phiD_2.add_cut(&t_disk_cut_right);
0099       valid_phiD_3.add_cut(&t_disk_cut_right);
0100 
0101       valid_der_phiD.add_cut(&t_disk_cut_right);
0102 
0103       valid_rD_0.add_cut(&t_disk_cut_right);
0104       valid_rD_1.add_cut(&t_disk_cut_right);
0105       valid_rD_2.add_cut(&t_disk_cut_right);
0106       valid_rD_3.add_cut(&t_disk_cut_right);
0107 
0108       valid_der_rD.add_cut(&t_disk_cut_right);
0109     }
0110 
0111     ~IMATH_TrackletCalculatorOverlap() = default;
0112 
0113     Settings const& settings_;
0114 
0115     imathGlobals* globals_;
0116 
0117     //max values
0118     const double dz_max = 50.;
0119     const double dr_max = 40;
0120     const double delta0_max = 0.005;
0121     const double a2_max = 3.;
0122     const double a2a_max = 0.1;
0123     const double x6a_max = 0.02;
0124     const double x6m_max = 2.;
0125     const double x8_max = 1.;
0126     const double x13_max = 300.;
0127     const double x22_max = 0.3;
0128     const double x23_max = 200.;
0129     const double deltaZ_max = 8.;
0130     const double der_phiD_max = 0.002;
0131     const double t_max = 7.9;
0132     const double t_disk_min = 1.;
0133     const double t_disk_max = 7.9;
0134     const double t_layer_max = 2.5;
0135     const double z0_max = 20.;
0136 
0137     // constants
0138     //
0139     VarParam plus2{globals_, "plus2", 2., 10};
0140     VarParam plus1{globals_, "plus1", 1., 10};
0141     VarParam minus1{globals_, "minus1", -1, 10};
0142     //
0143     //
0144     VarParam r1mean{globals_, "r1mean", "Kr", settings_.rmax(trklet::N_LAYER - 1), settings_.kr()};
0145     VarParam z2mean{globals_, "z2mean", "Kz", settings_.zmax(trklet::N_DISK - 1), settings_.kz()};
0146 
0147     //inputs
0148     VarDef r1{globals_, "r1", "Kr", settings_.drmax(), settings_.kr()};
0149     VarDef r2{globals_, "r2", "Kr", settings_.rmax(trklet::N_LAYER - 1), settings_.kr()};
0150     VarDef z1{globals_, "z1", "Kz", settings_.zlength(), settings_.kz()};
0151     VarDef z2{globals_, "z2", "Kz", settings_.dzmax(), settings_.kz()};
0152 
0153     VarDef phi1{globals_, "phi1", "Kphi", settings_.dphisector() / 0.75, settings_.kphi1()};
0154     VarDef phi2{globals_, "phi2", "Kphi", settings_.dphisector() / 0.75, settings_.kphi1()};
0155 
0156     VarDef rproj0{globals_, "rproj0", "Kr", settings_.rmax(trklet::N_LAYER - 1), settings_.kr()};
0157     VarDef rproj1{globals_, "rproj1", "Kr", settings_.rmax(trklet::N_LAYER - 1), settings_.kr()};
0158     VarDef rproj2{globals_, "rproj2", "Kr", settings_.rmax(trklet::N_LAYER - 1), settings_.kr()};
0159 
0160     VarDef zproj0{globals_, "zproj0", "Kz", settings_.zmax(trklet::N_DISK - 1), settings_.kz()};
0161     VarDef zproj1{globals_, "zproj1", "Kz", settings_.zmax(trklet::N_DISK - 1), settings_.kz()};
0162     VarDef zproj2{globals_, "zproj2", "Kz", settings_.zmax(trklet::N_DISK - 1), settings_.kz()};
0163     VarDef zproj3{globals_, "zproj3", "Kz", settings_.zmax(trklet::N_DISK - 1), settings_.kz()};
0164 
0165     //calculations
0166 
0167     //tracklet
0168     VarAdd r1abs{globals_, "r1abs", &r1, &r1mean, settings_.rmax(trklet::N_LAYER - 1)};
0169     VarAdd z2abs{globals_, "z2abs", &z2, &z2mean, settings_.zmax(trklet::N_DISK - 1)};
0170 
0171     VarSubtract dr{globals_, "dr", &r2, &r1abs, dr_max};
0172 
0173     //R LUT
0174     VarInv drinv{globals_, "drinv", &dr, 0, 18, 23, 0, VarInv::mode::pos};
0175 
0176     VarSubtract dphi{globals_, "dphi", &phi2, &phi1, settings_.dphisector() / 4.};
0177     VarSubtract dz{globals_, "dz", &z2abs, &z1, 2 * dz_max};
0178 
0179     VarMult delta0{globals_, "delta0", &dphi, &drinv, 8 * delta0_max};
0180     VarMult deltaZ{globals_, "deltaZ", &dz, &drinv, deltaZ_max};
0181     VarMult delta1{globals_, "delta1", &r1abs, &delta0};
0182     VarMult delta2{globals_, "delta2", &r2, &delta0};
0183     VarMult a2a{globals_, "a2a", &delta1, &delta2, 32 * a2a_max};
0184     VarNounits a2b{globals_, "a2b", &a2a};
0185     VarSubtract a2{globals_, "a2", &plus2, &a2b, a2_max};
0186     VarNeg a2n{globals_, "a2n", &a2};
0187     VarShift a{globals_, "a", &a2, 1};
0188 
0189     VarAdd Rabs{globals_, "Rabs", &r1abs, &r2};
0190     VarTimesC R6{globals_, "R6", &Rabs, 1. / 6., 12};
0191 
0192     VarMult x4{globals_, "x4", &R6, &delta0};
0193     VarMult x6a{globals_, "x6a", &delta2, &x4, 32 * x6a_max};
0194     VarNounits x6b{globals_, "x6b", &x6a};
0195     VarAdd x6m{globals_, "x6m", &minus1, &x6b, x6m_max};
0196     VarMult phi0a{globals_, "phi0a", &delta1, &x6m, settings_.dphisector()};
0197 
0198     VarMult z0a{globals_, "z0a", &r1abs, &deltaZ, 2 * settings_.zlength()};
0199     VarMult z0b{globals_, "z0b", &z0a, &x6m, 2 * settings_.zlength()};
0200 
0201     VarAdd phi0{globals_, "phi0", &phi1, &phi0a, 2 * settings_.dphisector()};
0202     VarMult rinv{globals_, "rinv", &a2n, &delta0, 8 * settings_.maxrinv()};
0203     VarMult t{globals_, "t", &a, &deltaZ, t_max};
0204     VarAdd z0{globals_, "z0", &z1, &z0b, 16 * z0_max};
0205 
0206     VarAdjustK rinv_final{
0207         globals_, "rinv_final", &rinv, settings_.kphi1() / settings_.kr() * pow(2, settings_.rinv_shift())};
0208     VarAdjustK phi0_final{globals_, "phi0_final", &phi0, settings_.kphi1() * pow(2, settings_.phi0_shift())};
0209     VarAdjustK t_final{globals_, "t_final", &t, settings_.kz() / settings_.kr() * pow(2, settings_.t_shift())};
0210     VarAdjustK z0_final{globals_, "z0_final", &z0, settings_.kz() * pow(2, settings_.z0_shift())};
0211 
0212     //projection to r
0213     VarShift x2{globals_, "x2", &delta0, 1};
0214 
0215     VarMult x1_0{globals_, "x1_0", &x2, &rproj0};
0216     VarMult x1_1{globals_, "x1_1", &x2, &rproj1};
0217     VarMult x1_2{globals_, "x1_2", &x2, &rproj2};
0218 
0219     VarMult x8_0{globals_, "x8_0", &x1_0, &a2n, 2 * x8_max};
0220     VarMult x8_1{globals_, "x8_1", &x1_1, &a2n, 2 * x8_max};
0221     VarMult x8_2{globals_, "x8_2", &x1_2, &a2n, 2 * x8_max};
0222 
0223     VarMult x12_0{globals_, "x12_0", &x8_0, &x8_0};
0224     VarMult x12_1{globals_, "x12_1", &x8_1, &x8_1};
0225     VarMult x12_2{globals_, "x12_2", &x8_2, &x8_2};
0226 
0227     VarNounits x12A_0{globals_, "x12A_0", &x12_0};
0228     VarNounits x12A_1{globals_, "x12A_1", &x12_1};
0229     VarNounits x12A_2{globals_, "x12A_2", &x12_2};
0230 
0231     VarTimesC x20_0{globals_, "x20_0", &x12A_0, 1. / 6.};
0232     VarTimesC x20_1{globals_, "x20_1", &x12A_1, 1. / 6.};
0233     VarTimesC x20_2{globals_, "x20_2", &x12A_2, 1. / 6.};
0234 
0235     VarAdd x10_0{globals_, "x10_0", &plus1, &x20_0};
0236     VarAdd x10_1{globals_, "x10_1", &plus1, &x20_1};
0237     VarAdd x10_2{globals_, "x10_2", &plus1, &x20_2};
0238 
0239     VarMult x22_0{globals_, "x22_0", &x8_0, &x10_0, 4 * x22_max};
0240     VarMult x22_1{globals_, "x22_1", &x8_1, &x10_1, 4 * x22_max};
0241     VarMult x22_2{globals_, "x22_2", &x8_2, &x10_2, 4 * x22_max};
0242 
0243     VarSubtract phiL_0{globals_, "phiL_0", &phi0_final, &x22_0, -1, phi0_final.nbits() + 1};
0244     VarSubtract phiL_1{globals_, "phiL_1", &phi0_final, &x22_1, -1, phi0_final.nbits() + 1};
0245     VarSubtract phiL_2{globals_, "phiL_2", &phi0_final, &x22_2, -1, phi0_final.nbits() + 1};
0246 
0247     VarShift x3{globals_, "x3", &rinv, 1};
0248     VarNeg der_phiL{globals_, "der_phiL", &x3};
0249 
0250     VarAdjustK phiL_0_final{globals_, "phiL_0_final", &phiL_0, settings_.kphi1() * pow(2, settings_.SS_phiL_shift())};
0251     VarAdjustK phiL_1_final{globals_, "phiL_1_final", &phiL_1, settings_.kphi1() * pow(2, settings_.SS_phiL_shift())};
0252     VarAdjustK phiL_2_final{globals_, "phiL_2_final", &phiL_2, settings_.kphi1() * pow(2, settings_.SS_phiL_shift())};
0253 
0254     VarAdjustK der_phiL_final{globals_,
0255                               "der_phiL_final",
0256                               &der_phiL,
0257                               settings_.kphi1() / settings_.kr() * pow(2, settings_.SS_phiderL_shift())};
0258 
0259     VarMult x11_0{globals_, "x11_0", &rproj0, &t};
0260     VarMult x11_1{globals_, "x11_1", &rproj1, &t};
0261     VarMult x11_2{globals_, "x11_2", &rproj2, &t};
0262 
0263     VarMult x23_0{globals_, "x23_0", &x11_0, &x10_0, 2 * x23_max};
0264     VarMult x23_1{globals_, "x23_1", &x11_1, &x10_1, 2 * x23_max};
0265     VarMult x23_2{globals_, "x23_2", &x11_2, &x10_2, 2 * x23_max};
0266 
0267     VarAdd zL_0{globals_, "zL_0", &z0, &x23_0};
0268     VarAdd zL_1{globals_, "zL_1", &z0, &x23_1};
0269     VarAdd zL_2{globals_, "zL_2", &z0, &x23_2};
0270 
0271     VarAdjustK zL_0_final{globals_, "zL_0_final", &zL_0, settings_.kz() * pow(2, settings_.PS_zL_shift())};
0272     VarAdjustK zL_1_final{globals_, "zL_1_final", &zL_1, settings_.kz() * pow(2, settings_.PS_zL_shift())};
0273     VarAdjustK zL_2_final{globals_, "zL_2_final", &zL_2, settings_.kz() * pow(2, settings_.PS_zL_shift())};
0274 
0275     VarAdjustK der_zL_final{
0276         globals_, "der_zL_final", &t_final, settings_.kz() / settings_.kr() * pow(2, settings_.PS_zderL_shift())};
0277 
0278     //projection to z
0279     VarInv invt{globals_, "invt", &t_final, 0., 18, 26, 1, VarInv::mode::pos, 13};
0280 
0281     VarMult x7{globals_, "x7", &x2, &a2};
0282 
0283     VarSubtract x5_0{globals_, "x5_0", &zproj0, &z0};
0284     VarSubtract x5_1{globals_, "x5_1", &zproj1, &z0};
0285     VarSubtract x5_2{globals_, "x5_2", &zproj2, &z0};
0286     VarSubtract x5_3{globals_, "x5_3", &zproj3, &z0};
0287 
0288     VarMult x13_0{globals_, "x13_0", &x5_0, &invt, x13_max};
0289     VarMult x13_1{globals_, "x13_1", &x5_1, &invt, x13_max};
0290     VarMult x13_2{globals_, "x13_2", &x5_2, &invt, x13_max};
0291     VarMult x13_3{globals_, "x13_3", &x5_3, &invt, x13_max};
0292 
0293     VarMult x25_0{globals_, "x25_0", &x13_0, &x7, 4 * settings_.dphisector()};
0294     VarMult x25_1{globals_, "x25_1", &x13_1, &x7, 4 * settings_.dphisector()};
0295     VarMult x25_2{globals_, "x25_2", &x13_2, &x7, 4 * settings_.dphisector()};
0296     VarMult x25_3{globals_, "x25_3", &x13_3, &x7, 4 * settings_.dphisector()};
0297 
0298     VarAdd phiD_0{globals_, "phiD_0", &phi0, &x25_0, 4 * settings_.dphisector()};
0299     VarAdd phiD_1{globals_, "phiD_1", &phi0, &x25_1, 4 * settings_.dphisector()};
0300     VarAdd phiD_2{globals_, "phiD_2", &phi0, &x25_2, 4 * settings_.dphisector()};
0301     VarAdd phiD_3{globals_, "phiD_3", &phi0, &x25_3, 4 * settings_.dphisector()};
0302 
0303     VarAdjustK phiD_0_final{globals_, "phiD_0_final", &phiD_0, settings_.kphi1() * pow(2, settings_.SS_phiD_shift())};
0304     VarAdjustK phiD_1_final{globals_, "phiD_1_final", &phiD_1, settings_.kphi1() * pow(2, settings_.SS_phiD_shift())};
0305     VarAdjustK phiD_2_final{globals_, "phiD_2_final", &phiD_2, settings_.kphi1() * pow(2, settings_.SS_phiD_shift())};
0306     VarAdjustK phiD_3_final{globals_, "phiD_3_final", &phiD_3, settings_.kphi1() * pow(2, settings_.SS_phiD_shift())};
0307 
0308     VarMult der_phiD{globals_, "der_phiD", &x7, &invt, 8 * der_phiD_max};
0309 
0310     VarAdjustK der_phiD_final{globals_,
0311                               "der_phiD_final",
0312                               &der_phiD,
0313                               settings_.kphi1() / settings_.kr() * pow(2, settings_.SS_phiderD_shift())};
0314 
0315     VarMult x26_0{globals_, "x26_0", &x25_0, &x25_0};
0316     VarMult x26_1{globals_, "x26_1", &x25_1, &x25_1};
0317     VarMult x26_2{globals_, "x26_2", &x25_2, &x25_2};
0318     VarMult x26_3{globals_, "x26_3", &x25_3, &x25_3};
0319 
0320     VarNounits x26A_0{globals_, "x26A_0", &x26_0};
0321     VarNounits x26A_1{globals_, "x26A_1", &x26_1};
0322     VarNounits x26A_2{globals_, "x26A_2", &x26_2};
0323     VarNounits x26A_3{globals_, "x26A_3", &x26_3};
0324 
0325     VarTimesC x9_0{globals_, "x9_0", &x26A_0, 1. / 6.};
0326     VarTimesC x9_1{globals_, "x9_1", &x26A_1, 1. / 6.};
0327     VarTimesC x9_2{globals_, "x9_2", &x26A_2, 1. / 6.};
0328     VarTimesC x9_3{globals_, "x9_3", &x26A_3, 1. / 6.};
0329 
0330     VarSubtract x27m_0{globals_, "x27_0", &plus1, &x9_0};
0331     VarSubtract x27m_1{globals_, "x27_1", &plus1, &x9_1};
0332     VarSubtract x27m_2{globals_, "x27_2", &plus1, &x9_2};
0333     VarSubtract x27m_3{globals_, "x27_3", &plus1, &x9_3};
0334 
0335     VarMult rD_0{globals_, "rD_0", &x13_0, &x27m_0, settings_.rmaxdisk()};
0336     VarMult rD_1{globals_, "rD_1", &x13_1, &x27m_1, settings_.rmaxdisk()};
0337     VarMult rD_2{globals_, "rD_2", &x13_2, &x27m_2, settings_.rmaxdisk()};
0338     VarMult rD_3{globals_, "rD_3", &x13_3, &x27m_3, settings_.rmaxdisk()};
0339 
0340     VarAdjustK rD_0_final{globals_, "rD_0_final", &rD_0, settings_.kr() * pow(2, settings_.PS_rD_shift())};
0341     VarAdjustK rD_1_final{globals_, "rD_1_final", &rD_1, settings_.kr() * pow(2, settings_.PS_rD_shift())};
0342     VarAdjustK rD_2_final{globals_, "rD_2_final", &rD_2, settings_.kr() * pow(2, settings_.PS_rD_shift())};
0343     VarAdjustK rD_3_final{globals_, "rD_3_final", &rD_3, settings_.kr() * pow(2, settings_.PS_rD_shift())};
0344 
0345     VarAdjustK der_rD_final{
0346         globals_, "der_rD_final", &invt, settings_.kr() / settings_.kz() * pow(2, settings_.PS_rderD_shift())};
0347 
0348     VarCut t_final_cut{globals_, &t_final, -10, 10};
0349     VarCut rinv_final_cut{globals_, &rinv_final, -settings_.rinvcut(), settings_.rinvcut()};
0350     VarCut z0_final_cut{globals_, &z0_final, -settings_.z0cut(), settings_.z0cut()};
0351 
0352     VarCut r1abs_cut{globals_, &r1abs, -settings_.rmax(5), settings_.rmax(5)};
0353     VarCut z2abs_cut{globals_, &z2abs, -settings_.zmax(4), settings_.zmax(4)};
0354     VarCut dr_cut{globals_, &dr, -dr_max, dr_max};
0355     VarCut dphi_cut{globals_, &dphi, -settings_.dphisector() / 4., settings_.dphisector() / 4.};
0356     VarCut dz_cut{globals_, &dz, -dz_max, dz_max};
0357     VarCut delta0_cut{globals_, &delta0, -delta0_max, delta0_max};
0358     VarCut deltaZ_cut{globals_, &deltaZ, -deltaZ_max, deltaZ_max};
0359     VarCut a2a_cut{globals_, &a2a, -a2a_max, a2a_max};
0360     VarCut a2_cut{globals_, &a2, -a2_max, a2_max};
0361     VarCut x6a_cut{globals_, &x6a, -x6a_max, x6a_max};
0362     VarCut x6m_cut{globals_, &x6m, -x6m_max, x6m_max};
0363     VarCut phi0a_cut{globals_, &phi0a, -settings_.dphisector(), settings_.dphisector()};
0364     VarCut z0a_cut{globals_, &z0a, -2 * settings_.zlength(), 2 * settings_.zlength()};
0365     VarCut phi0_cut{globals_, &phi0, -2 * settings_.dphisector(), 2 * settings_.dphisector()};
0366     VarCut rinv_cut{globals_, &rinv, -settings_.maxrinv(), settings_.maxrinv()};
0367     VarCut t_cut{globals_, &t, -t_max, t_max};
0368     VarCut z0_cut{globals_, &z0, -z0_max, z0_max};
0369     VarCut x8_0_cut{globals_, &x8_0, -x8_max, x8_max};
0370     VarCut x8_1_cut{globals_, &x8_1, -x8_max, x8_max};
0371     VarCut x8_2_cut{globals_, &x8_2, -x8_max, x8_max};
0372     VarCut x22_0_cut{globals_, &x22_0, -x22_max, x22_max};
0373     VarCut x22_1_cut{globals_, &x22_1, -x22_max, x22_max};
0374     VarCut x22_2_cut{globals_, &x22_2, -x22_max, x22_max};
0375     VarCut x23_0_cut{globals_, &x23_0, -x23_max, x23_max};
0376     VarCut x23_1_cut{globals_, &x23_1, -x23_max, x23_max};
0377     VarCut x23_2_cut{globals_, &x23_2, -x23_max, x23_max};
0378     VarCut x13_0_cut{globals_, &x13_0, -x13_max, x13_max};
0379     VarCut x13_1_cut{globals_, &x13_1, -x13_max, x13_max};
0380     VarCut x13_2_cut{globals_, &x13_2, -x13_max, x13_max};
0381     VarCut x13_3_cut{globals_, &x13_3, -x13_max, x13_max};
0382     VarCut x25_0_cut{globals_, &x25_0, -settings_.dphisector(), settings_.dphisector()};
0383     VarCut x25_1_cut{globals_, &x25_1, -settings_.dphisector(), settings_.dphisector()};
0384     VarCut x25_2_cut{globals_, &x25_2, -settings_.dphisector(), settings_.dphisector()};
0385     VarCut x25_3_cut{globals_, &x25_3, -settings_.dphisector(), settings_.dphisector()};
0386     VarCut phiD_0_cut{globals_, &phiD_0, -2 * settings_.dphisector(), 2 * settings_.dphisector()};
0387     VarCut phiD_1_cut{globals_, &phiD_1, -2 * settings_.dphisector(), 2 * settings_.dphisector()};
0388     VarCut phiD_2_cut{globals_, &phiD_2, -2 * settings_.dphisector(), 2 * settings_.dphisector()};
0389     VarCut phiD_3_cut{globals_, &phiD_3, -2 * settings_.dphisector(), 2 * settings_.dphisector()};
0390     VarCut der_phiD_cut{globals_, &der_phiD, -der_phiD_max, der_phiD_max};
0391     VarCut rD_0_cut{globals_, &rD_0, -settings_.rmaxdisk(), settings_.rmaxdisk()};
0392     VarCut rD_1_cut{globals_, &rD_1, -settings_.rmaxdisk(), settings_.rmaxdisk()};
0393     VarCut rD_2_cut{globals_, &rD_2, -settings_.rmaxdisk(), settings_.rmaxdisk()};
0394     VarCut rD_3_cut{globals_, &rD_3, -settings_.rmaxdisk(), settings_.rmaxdisk()};
0395 
0396     VarCut t_disk_cut_left{globals_, &t, -t_disk_max, -t_disk_min};
0397     VarCut t_disk_cut_right{globals_, &t, t_disk_min, t_disk_max};
0398     VarCut t_layer_cut{globals_, &t, -t_layer_max, t_layer_max};
0399 
0400     // the following flags are used to apply the cuts in TrackletCalculator
0401     // and in the output Verilog
0402     VarFlag valid_trackpar{globals_, "valid_trackpar", &rinv_final, &phi0_final, &t_final, &z0_final};
0403 
0404     VarFlag valid_phiL_0{globals_, "valid_phiL_0", &phiL_0_final};
0405     VarFlag valid_phiL_1{globals_, "valid_phiL_1", &phiL_1_final};
0406     VarFlag valid_phiL_2{globals_, "valid_phiL_2", &phiL_2_final};
0407 
0408     VarFlag valid_zL_0{globals_, "valid_zL_0", &zL_0_final};
0409     VarFlag valid_zL_1{globals_, "valid_zL_1", &zL_1_final};
0410     VarFlag valid_zL_2{globals_, "valid_zL_2", &zL_2_final};
0411 
0412     VarFlag valid_der_phiL{globals_, "valid_der_phiL", &der_phiL_final};
0413     VarFlag valid_der_zL{globals_, "valid_der_zL", &der_zL_final};
0414 
0415     VarFlag valid_phiD_0{globals_, "valid_phiD_0", &phiD_0_final};
0416     VarFlag valid_phiD_1{globals_, "valid_phiD_1", &phiD_1_final};
0417     VarFlag valid_phiD_2{globals_, "valid_phiD_2", &phiD_2_final};
0418     VarFlag valid_phiD_3{globals_, "valid_phiD_3", &phiD_3_final};
0419 
0420     VarFlag valid_rD_0{globals_, "valid_rD_0", &rD_0_final};
0421     VarFlag valid_rD_1{globals_, "valid_rD_1", &rD_1_final};
0422     VarFlag valid_rD_2{globals_, "valid_rD_2", &rD_2_final};
0423     VarFlag valid_rD_3{globals_, "valid_rD_3", &rD_3_final};
0424 
0425     VarFlag valid_der_phiD{globals_, "valid_der_phiD", &der_phiD_final};
0426     VarFlag valid_der_rD{globals_, "valid_der_rD", &der_rD_final};
0427   };
0428 };  // namespace trklet
0429 #endif