Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:14

0001 //
0002 // Negative energy filter parameters developed by Alexander Toropin for Run 2 data
0003 //
0004 #include "CondTools/Hcal/interface/make_HBHENegativeEFilter.h"
0005 
0006 #define make_poly /**/                                                                    \
0007   std::vector<std::vector<double> > coeffs;                                               \
0008   coeffs.reserve(6);                                                                      \
0009   coeffs.push_back(std::vector<double>(pol41, pol41 + sizeof(pol41) / sizeof(pol41[0]))); \
0010   coeffs.push_back(std::vector<double>(pol42, pol42 + sizeof(pol42) / sizeof(pol42[0]))); \
0011   coeffs.push_back(std::vector<double>(pol31, pol31 + sizeof(pol31) / sizeof(pol31[0]))); \
0012   coeffs.push_back(std::vector<double>(pol32, pol32 + sizeof(pol32) / sizeof(pol32[0]))); \
0013   coeffs.push_back(std::vector<double>(pol11, pol11 + sizeof(pol11) / sizeof(pol11[0]))); \
0014   coeffs.push_back(std::vector<double>(pol12, pol12 + sizeof(pol12) / sizeof(pol12[0]))); \
0015   const std::vector<double> lim(limits, limits + 5);                                      \
0016   return PiecewiseScalingPolynomial(coeffs, lim)
0017 
0018 static PiecewiseScalingPolynomial a1_HB() {  // version 23.02.2014
0019   // this function is made from profile TS5/TS4 vs TS4, MultiJet
0020   const double pol41[5] = {0.7261, -0.03124, 0.001177, -1.349e-05, -5.512e-08};
0021   const double pol42[5] = {0.4151, 0.006921, -0.0003291, 4.897e-06, -2.42e-08};
0022   const double pol31[4] = {0.469, -0.00151, 4.307e-06, -4.697e-09};
0023   const double pol32[4] = {0.5264, -0.001902, 4.613e-06, -3.808e-09};
0024   const double pol11[2] = {0.2648, -1.942e-05};
0025   const double pol12[2] = {0.2413, -3.638e-07};
0026   const double limits[5] = {28., 60., 190., 435., 1330.};
0027   make_poly;
0028 }
0029 
0030 static PiecewiseScalingPolynomial a2_HB() {  // version 23.02.2014
0031   // this function is made from profile TS6/TS4 vs TS4, MultiJet
0032   const double pol41[5] = {0.3148, -0.03012, 0.001738, -4.53e-05, 4.414e-07};
0033   const double pol42[5] = {0.1315, -0.00103, 1.192e-05, -6.723e-08, 3.843e-10};
0034   const double pol31[4] = {0.1108, -5.343e-05, -1.06e-06, 3.75e-09};
0035   const double pol32[4] = {0.1045, -0.0001121, 1.443e-07, -7.224e-11};
0036   const double pol11[2] = {0.07919, -1.252e-05};
0037   const double pol12[2] = {0.06529, -3.825e-06};
0038   const double limits[5] = {23., 65., 190., 850., 1640.};
0039   make_poly;
0040 }
0041 
0042 // ------------------------ 17-20 ----------------------------------------
0043 static PiecewiseScalingPolynomial a1_1720() {  // version 28.03.2014
0044   // this function is made from profile TS5/TS4 vs TS4, MultiJet
0045   const double pol41[5] = {0.6129, -0.00765, -0.0008141, 5.724e-05, -9.377e-07};
0046   const double pol42[5] = {0.4033, 0.00678, -0.000312, 4.534e-06, -2.197e-08};
0047   const double pol31[4] = {0.4603, -0.001526, 4.85e-06, -6.446e-09};
0048   const double pol32[4] = {0.4849, -0.001505, 3.307e-06, -2.461e-09};
0049   const double pol11[2] = {0.261, -2.086e-05};
0050   const double pol12[1] = {0.2354};
0051   const double limits[5] = {23., 68., 190., 410., 1320.};
0052   make_poly;
0053 }
0054 
0055 static PiecewiseScalingPolynomial a2_1720() {  // version 28.03.2014
0056   // this function is made from profile TS6/TS4 vs TS4, MultiJet
0057   const double pol41[5] = {0.313, -0.02747, 0.001404, -3.232e-05, 2.748e-07};
0058   const double pol42[5] = {0.1519, -0.003287, 7.798e-05, -9.27e-07, 4.455e-09};
0059   const double pol31[4] = {0.1079, -0.0002475, 2.859e-07, 7.703e-10};
0060   const double pol32[4] = {0.09147, -0.0001035, 1.268e-07, -5.747e-11};
0061   const double pol11[2] = {0.06536, -8.462e-06};
0062   const double pol12[1] = {0.05337};
0063   const double limits[5] = {27., 68., 190., 1050., 1550.};
0064   make_poly;
0065 }
0066 
0067 // ------------------------ 21-23 ----------------------------------------
0068 static PiecewiseScalingPolynomial a1_2123() {  // version 28.03.2014
0069   // this function is made from profile TS5/TS4 vs TS4, MultiJet
0070   const double pol41[5] = {0.4908, 0.01378, -0.002152, 9.244e-05, -1.27e-06};
0071   const double pol42[5] = {0.3983, 0.00721, -0.000334, 4.999e-06, -2.52e-08};
0072   const double pol31[4] = {0.4746, -0.001923, 8.029e-06, -1.411e-08};
0073   const double pol32[4] = {0.4848, -0.001503, 3.339e-06, -2.518e-09};
0074   const double pol11[2] = {0.264, -2.491e-05};
0075   const double pol12[2] = {0.2545, -1.539e-05};
0076   const double limits[5] = {23., 68., 190., 515., 1240.};
0077   make_poly;
0078 }
0079 
0080 static PiecewiseScalingPolynomial a2_2123() {  // version 28.03.2014
0081   // this function is made from profile TS6/TS4 vs TS4, MultiJet
0082   const double pol41[5] = {0.2886, -0.01573, 0.0003735, 3.986e-06, -1.723e-07};
0083   const double pol42[5] = {0.1724, -0.003205, 6.239e-05, -5.989e-07, 2.346e-09};
0084   const double pol31[4] = {0.1302, -0.0004984, 2.021e-06, -3.34e-09};
0085   const double pol32[4] = {0.104, -0.0001241, 1.579e-07, -7.438e-11};
0086   const double pol11[2] = {0.07527, -1.186e-05};
0087   const double pol12[1] = {0.05917};
0088   const double limits[5] = {23., 68., 190., 1000., 1380.};
0089   make_poly;
0090 }
0091 
0092 // ------------------------ 24-25 ----------------------------------------
0093 static PiecewiseScalingPolynomial a1_2425() {  // version 28.03.2014
0094   // this function is made from profile TS5/TS4 vs TS4, MultiJet
0095   const double pol41[5] = {0.4595, 0.01439, -0.001756, 6.716e-05, -8.552e-07};
0096   const double pol42[5] = {0.3636, 0.01037, -0.0004347, 6.349e-06, -3.167e-08};
0097   const double pol31[4] = {0.4698, -0.001775, 6.638e-06, -1.061e-08};
0098   const double pol32[4] = {0.4854, -0.001519, 3.321e-06, -2.483e-09};
0099   const double pol11[2] = {0.2568, -2.584e-05};
0100   const double pol12[2] = {0.2282, -2.334e-06};
0101   const double limits[5] = {23., 68., 190., 425., 1250.};
0102   make_poly;
0103 }
0104 
0105 static PiecewiseScalingPolynomial a2_2425() {  // version 28.03.2014
0106   // this function is made from profile TS6/TS4 vs TS4, MultiJet
0107   const double pol41[5] = {0.2922, -0.009065, -0.0002295, 2.453e-05, -4.171e-07};
0108   const double pol42[5] = {0.2008, -0.003443, 5.083e-05, -3.064e-07, 4.728e-10};
0109   const double pol31[4] = {0.1533, -0.0007735, 3.571e-06, -6.432e-09};
0110   const double pol32[4] = {0.111, -0.000138, 1.746e-07, -8.205e-11};
0111   const double pol11[2] = {0.07719, -1.123e-05};
0112   const double pol12[2] = {0.0637, -1.798e-06};
0113   const double limits[5] = {24., 68., 220., 975., 1450.};
0114   make_poly;
0115 }
0116 
0117 // ------------------------ 26-27 ----------------------------------------
0118 static PiecewiseScalingPolynomial a1_2627() {  // version 28.03.2014
0119   // this function is made from profile TS5/TS4 vs TS4, MultiJet
0120   const double pol41[5] = {0.4404, 0.01173, -0.001344, 4.862e-05, -5.896e-07};
0121   const double pol42[5] = {0.3483, 0.01019, -0.000416, 5.989e-06, -2.946e-08};
0122   const double pol31[4] = {0.4545, -0.0016, 5.716e-06, -8.879e-09};
0123   const double pol32[4] = {0.4794, -0.001485, 3.206e-06, -2.369e-09};
0124   const double pol11[2] = {0.2531, -2.403e-05};
0125   const double pol12[2] = {0.2376, -9.953e-06};
0126   const double limits[5] = {23., 68., 190., 515., 1200.};
0127   make_poly;
0128 }
0129 
0130 static PiecewiseScalingPolynomial a2_2627() {  // version 28.03.2014
0131   // this function is made from profile TS6/TS4 vs TS4, MultiJet
0132   const double pol41[5] = {0.3104, -0.01182, 0.0001538, 4.599e-06, -9.634e-08};
0133   const double pol42[5] = {0.2105, -0.003244, 2.824e-05, 1.422e-07, -2.243e-09};
0134   const double pol31[4] = {0.1587, -0.0008399, 3.787e-06, -6.468e-09};
0135   const double pol32[4] = {0.1107, -0.0001325, 1.632e-07, -7.479e-11};
0136   const double pol11[2] = {0.07933, -1.265e-05};
0137   const double pol12[2] = {0.06511, -2.133e-06};
0138   const double limits[5] = {20., 68., 215., 1000., 1350.};
0139   make_poly;
0140 }
0141 
0142 // ------------------------ 28 ----------------------------------------
0143 static PiecewiseScalingPolynomial a1_28() {  // version 28.03.2014
0144   // this function is made from profile TS5/TS4 vs TS4, MultiJet
0145   const double pol41[5] = {0.4552, 0.00774, -0.0007652, 2.166e-05, -2.04e-07};
0146   const double pol42[5] = {0.4447, 0.001959, -0.0001573, 2.587e-06, -1.341e-08};
0147   const double pol31[4] = {0.4364, -0.0009454, 9.873e-07, 1.515e-09};
0148   const double pol32[4] = {0.4726, -0.00135, 2.811e-06, -2.047e-09};
0149   const double pol11[2] = {0.2569, -2.931e-05};
0150   const double pol12[2] = {0.2345, -8.457e-06};
0151   const double limits[5] = {23., 68., 190., 515., 1150.};
0152   make_poly;
0153 }
0154 
0155 static PiecewiseScalingPolynomial a2_28() {  // version 28.03.2014
0156   // this function is made from profile TS6/TS4 vs TS4, MultiJet
0157   const double pol41[5] = {0.3477, -0.002766, -0.0003802, 1.631e-05, -1.871e-07};
0158   const double pol42[5] = {0.3404, -0.006505, 8.54e-05, -4.002e-07, -4.685e-11};
0159   const double pol31[4] = {0.2295, -0.001221, 4.778e-06, -7.352e-09};
0160   const double pol32[4] = {0.1589, -0.0002629, 3.0e-07, -1.249e-10};
0161   const double pol11[2] = {0.08305, -1.098e-05};
0162   const double pol12[2] = {0.07318, -3.478e-06};
0163   const double limits[5] = {23., 68., 190., 970., 1300.};
0164   make_poly;
0165 }
0166 
0167 std::unique_ptr<HBHENegativeEFilter> make_HBHENegativeEFilter() {
0168   // |ieta| limits for the "a1" and "a2" shapes
0169   const unsigned etaLim[5] = {17, 21, 24, 26, 28};
0170   const std::vector<uint32_t> lim(etaLim, etaLim + sizeof(etaLim) / sizeof(etaLim[0]));
0171 
0172   // Each element of the shape vector corresponds to
0173   // one of the |ieta| region defined by "lim". Element 0
0174   // corresponds to |ieta| < lim[0], element 1 corresponds
0175   // to lim[0] <= |ieta| < lim[1], etc.
0176   std::vector<PiecewiseScalingPolynomial> a1vec;
0177   a1vec.reserve(6);
0178   a1vec.push_back(a1_HB());
0179   a1vec.push_back(a1_1720());
0180   a1vec.push_back(a1_2123());
0181   a1vec.push_back(a1_2425());
0182   a1vec.push_back(a1_2627());
0183   a1vec.push_back(a1_28());
0184 
0185   std::vector<PiecewiseScalingPolynomial> a2vec;
0186   a2vec.reserve(6);
0187   a2vec.push_back(a2_HB());
0188   a2vec.push_back(a2_1720());
0189   a2vec.push_back(a2_2123());
0190   a2vec.push_back(a2_2425());
0191   a2vec.push_back(a2_2627());
0192   a2vec.push_back(a2_28());
0193 
0194   // The "negative energy" discriminant. The first element
0195   // of the pair is the collected charge in the [firstTS, lastTS]
0196   // window, and the second element is the value of the discriminant
0197   // (the "pass" region is above the line). Interpolation between
0198   // the points is linear. Extrapolation below the point with the
0199   // lowest charge and above the point with the highest charge is
0200   // constant, from the nearest point.
0201   //
0202   // The discriminant is applied only if the charge collected in
0203   // the window is at least "minChargeThreshold".
0204   //
0205   std::vector<std::pair<double, double> > cut;
0206   cut.reserve(4);
0207   cut.push_back(std::make_pair(0.0, -25.0));
0208   cut.push_back(std::make_pair(400.0, -45.0));
0209   cut.push_back(std::make_pair(1500.0, -135.0));
0210   cut.push_back(std::make_pair(15000.0, -1000.0));
0211 
0212   const double minChargeThreshold = 20.0;
0213   const unsigned firstTS = 4;
0214   const unsigned lastTS = 6;
0215 
0216   return std::unique_ptr<HBHENegativeEFilter>(
0217       new HBHENegativeEFilter(a1vec, a2vec, lim, cut, minChargeThreshold, firstTS, lastTS));
0218 }