Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:25

0001 #ifndef TopObjetcResolutionsElectron_h
0002 #define TopObjetcResolutionsElectron_h
0003 
0004 #include <cmath>
0005 
0006 namespace res {
0007   class HelperElectron {
0008   public:
0009     HelperElectron(){};
0010     ~HelperElectron(){};
0011 
0012     inline double pt(double pt, double eta);
0013     inline double eta(double pt, double eta);
0014     inline double phi(double pt, double eta);
0015     inline double a(double pt, double eta);
0016     inline double b(double pt, double eta);
0017     inline double c(double pt, double eta);
0018     inline double d(double pt, double eta);
0019     inline double et(double pt, double eta);
0020     inline double theta(double pt, double eta);
0021   };
0022 }  // namespace res
0023 
0024 inline double res::HelperElectron::pt(double pt, double eta) {
0025   double res = 0.2 * sqrt(pt);
0026   if (fabs(eta) <= 0.8)
0027     res += -0.28 * fabs(eta) + 0.54;
0028   else if (0.8 < fabs(eta) && fabs(eta) <= 1.4)
0029     res += 1.52 * fabs(eta) - 1.07;
0030   else
0031     res += -0.158 * eta * eta + 0.97;
0032   return res;
0033 }
0034 
0035 inline double res::HelperElectron::a(double pt, double eta) {
0036   double res = 1000.;
0037   if (fabs(eta) < 0.17)
0038     res = 0.0114228 + 0.1135 * exp(-(0.111787 * pt));
0039   else if (fabs(eta) < 0.35)
0040     res = 0.010297 + 0.0163219 * exp(-(0.0248655 * pt));
0041   else if (fabs(eta) < 0.5)
0042     res = 0.0081634 + 0.0230718 * exp(-(0.0250963 * pt));
0043   else if (fabs(eta) < 0.7)
0044     res = 0.0122627 + 0.0228103 * exp(-(0.0420525 * pt));
0045   else if (fabs(eta) < 0.9)
0046     res = 0.0124118 + 0.0384051 * exp(-(0.0545988 * pt));
0047   else if (fabs(eta) < 1.15)
0048     res = 0.0133398 + 0.0307574 * exp(-(0.0316605 * pt));
0049   else if (fabs(eta) < 1.3)
0050     res = 0.0144956 + 0.0355239 * exp(-(0.0273916 * pt));
0051   else if (fabs(eta) < 1.6)
0052     res = -13.9017 + 13.9315 * exp(-(7.01823e-06 * pt));
0053   else if (fabs(eta) < 1.9)
0054     res = 0.0106309 + 0.0230149 * exp(-(0.00792017 * pt));
0055   else if (fabs(eta) < 2.5)
0056     res = 0.0187822 + 0.119922 * exp(-(0.140598 * pt));
0057   return res;
0058 }
0059 
0060 inline double res::HelperElectron::b(double pt, double eta) {
0061   double res = 1000.;
0062   if (fabs(eta) < 0.17)
0063     res = -36.5147 + 36.516 * exp(-(-9.36847e-06 * pt));
0064   else if (fabs(eta) < 0.35)
0065     res = -0.132294 + 0.134289 * exp(-(-0.0021212 * pt));
0066   else if (fabs(eta) < 0.5)
0067     res = -96.9689 + 96.9704 * exp(-(-2.83158e-06 * pt));
0068   else if (fabs(eta) < 0.7)
0069     res = -122.755 + 122.757 * exp(-(-1.90859e-06 * pt));
0070   else if (fabs(eta) < 0.9)
0071     res = -226.455 + 226.457 * exp(-(-8.91395e-07 * pt));
0072   else if (fabs(eta) < 1.15)
0073     res = -249.279 + 249.281 * exp(-(-7.57645e-07 * pt));
0074   else if (fabs(eta) < 1.3)
0075     res = -16.7465 + 16.7481 * exp(-(-1.17848e-05 * pt));
0076   else if (fabs(eta) < 1.6)
0077     res = -128.535 + 128.537 * exp(-(-1.52236e-06 * pt));
0078   else if (fabs(eta) < 1.9)
0079     res = -66.1731 + 66.1762 * exp(-(-2.49121e-06 * pt));
0080   else if (fabs(eta) < 2.5)
0081     res = -0.0199509 + 0.0237796 * exp(-(-0.00591733 * pt));
0082   return res;
0083 }
0084 
0085 inline double res::HelperElectron::c(double pt, double eta) {
0086   double res = 1000.;
0087   if (fabs(eta) < 0.17)
0088     res = -68.6101 + 68.6161 * exp(-(-7.88064e-07 * pt));
0089   else if (fabs(eta) < 0.35)
0090     res = -130.219 + 130.224 * exp(-(-8.39696e-07 * pt));
0091   else if (fabs(eta) < 0.5)
0092     res = -262.825 + 262.83 * exp(-(-4.26008e-07 * pt));
0093   else if (fabs(eta) < 0.7)
0094     res = -47.898 + 47.9041 * exp(-(-2.07568e-06 * pt));
0095   else if (fabs(eta) < 0.9)
0096     res = -178.795 + 178.799 * exp(-(-5.78263e-07 * pt));
0097   else if (fabs(eta) < 1.15)
0098     res = -249.26 + 249.267 * exp(-(-3.16408e-07 * pt));
0099   else if (fabs(eta) < 1.3)
0100     res = -173.603 + 173.606 * exp(-(-1.58982e-06 * pt));
0101   else if (fabs(eta) < 1.6)
0102     res = -98.726 + 98.7326 * exp(-(-2.67151e-06 * pt));
0103   else if (fabs(eta) < 1.9)
0104     res = -82.6028 + 82.6122 * exp(-(-2.79483e-06 * pt));
0105   else if (fabs(eta) < 2.5)
0106     res = -119.94 + 119.95 * exp(-(-1.69882e-06 * pt));
0107   return res;
0108 }
0109 
0110 inline double res::HelperElectron::d(double pt, double eta) {
0111   double res = 1000.;
0112   if (fabs(eta) < 0.17)
0113     res = 0.0114197 + 0.081753 * exp(-(0.0969625 * pt));
0114   else if (fabs(eta) < 0.35)
0115     res = 0.0097562 + 0.0137737 * exp(-(0.0187112 * pt));
0116   else if (fabs(eta) < 0.5)
0117     res = 0.00844899 + 0.021595 * exp(-(0.0241679 * pt));
0118   else if (fabs(eta) < 0.7)
0119     res = 0.0124758 + 0.0243678 * exp(-(0.0459914 * pt));
0120   else if (fabs(eta) < 0.9)
0121     res = 0.0117518 + 0.0357218 * exp(-(0.0463595 * pt));
0122   else if (fabs(eta) < 1.15)
0123     res = 0.0133048 + 0.0292511 * exp(-(0.0305812 * pt));
0124   else if (fabs(eta) < 1.3)
0125     res = 0.0144949 + 0.0337369 * exp(-(0.0269872 * pt));
0126   else if (fabs(eta) < 1.6)
0127     res = 0.0137634 + 0.0343427 * exp(-(0.0208025 * pt));
0128   else if (fabs(eta) < 1.9)
0129     res = 0.00572644 + 0.0270719 * exp(-(0.00536847 * pt));
0130   else if (fabs(eta) < 2.5)
0131     res = 0.0189177 + 0.169591 * exp(-(0.152597 * pt));
0132   return res;
0133 }
0134 
0135 inline double res::HelperElectron::theta(double pt, double eta) {
0136   double res = 1000.;
0137   if (fabs(eta) < 0.17)
0138     res = 0.000282805 + 0.000157786 * exp(-(0.0343273 * pt));
0139   else if (fabs(eta) < 0.35)
0140     res = 0.000184362 + 4.34076e-05 * exp(-(-0.0131909 * pt));
0141   else if (fabs(eta) < 0.5)
0142     res = 0.000249332 + 5.83114e-05 * exp(-(0.0508729 * pt));
0143   else if (fabs(eta) < 0.7)
0144     res = -6.56357e-05 + 0.000325051 * exp(-(0.00177319 * pt));
0145   else if (fabs(eta) < 0.9)
0146     res = 0.000182277 + 0.000125324 * exp(-(0.0581923 * pt));
0147   else if (fabs(eta) < 1.15)
0148     res = 0.000140771 + 0.000407914 * exp(-(0.0971668 * pt));
0149   else if (fabs(eta) < 1.3)
0150     res = 0.000125551 + 0.001266 * exp(-(0.180176 * pt));
0151   else if (fabs(eta) < 1.6)
0152     res = 0.000107631 + 101920 * exp(-(1.17024 * pt));
0153   else if (fabs(eta) < 1.9)
0154     res = 8.33927e-05 + 158936 * exp(-(1.20127 * pt));
0155   else if (fabs(eta) < 2.5)
0156     res = 6.55271e-05 + 0.12459 * exp(-(0.437044 * pt));
0157   return res;
0158 }
0159 
0160 inline double res::HelperElectron::phi(double pt, double eta) {
0161   double res = 1000.;
0162   if (fabs(eta) < 0.17)
0163     res = 0.000175676 + 0.000471783 * exp(-(0.0383161 * pt));
0164   else if (fabs(eta) < 0.35)
0165     res = 0.000202185 + 0.00048635 * exp(-(0.0373331 * pt));
0166   else if (fabs(eta) < 0.5)
0167     res = 0.000150868 + 0.000444216 * exp(-(0.0268835 * pt));
0168   else if (fabs(eta) < 0.7)
0169     res = 0.000243624 + 0.00182347 * exp(-(0.0850746 * pt));
0170   else if (fabs(eta) < 0.9)
0171     res = 0.000254463 + 0.000431233 * exp(-(0.0446507 * pt));
0172   else if (fabs(eta) < 1.15)
0173     res = 0.000309592 + 0.000918965 * exp(-(0.0555677 * pt));
0174   else if (fabs(eta) < 1.3)
0175     res = 0.000502204 + 0.000277996 * exp(-(0.076721 * pt));
0176   else if (fabs(eta) < 1.6)
0177     res = 0.000361181 + 0.000655126 * exp(-(0.0238519 * pt));
0178   else if (fabs(eta) < 1.9)
0179     res = 0.000321587 + 0.00155721 * exp(-(0.0337709 * pt));
0180   else if (fabs(eta) < 2.5)
0181     res = 0.000819101 + 0.00205336 * exp(-(0.0992806 * pt));
0182   return res;
0183 }
0184 
0185 inline double res::HelperElectron::et(double pt, double eta) {
0186   double res = 1000.;
0187   if (fabs(eta) < 0.17)
0188     res = 0.326238 + 0.00760789 * pt;
0189   else if (fabs(eta) < 0.35)
0190     res = 0.40493 + 0.00659958 * pt;
0191   else if (fabs(eta) < 0.5)
0192     res = 0.369785 + 0.00690331 * pt;
0193   else if (fabs(eta) < 0.7)
0194     res = 0.437539 + 0.00703808 * pt;
0195   else if (fabs(eta) < 0.9)
0196     res = 0.456138 + 0.0078252 * pt;
0197   else if (fabs(eta) < 1.15)
0198     res = 0.518685 + 0.00907836 * pt;
0199   else if (fabs(eta) < 1.3)
0200     res = 0.733672 + 0.00953255 * pt;
0201   else if (fabs(eta) < 1.6)
0202     res = 1.02678 + 0.0116056 * pt;
0203   else if (fabs(eta) < 1.9)
0204     res = 0.948368 + 0.00977619 * pt;
0205   else if (fabs(eta) < 2.5)
0206     res = 0.418302 + 0.0127816 * pt;
0207   return res;
0208 }
0209 
0210 inline double res::HelperElectron::eta(double pt, double eta) {
0211   double res = 1000.;
0212   if (fabs(eta) < 0.17)
0213     res = 0.000266154 + 0.000104322 * exp(-(0.0140464 * pt));
0214   else if (fabs(eta) < 0.35)
0215     res = -0.251539 + 0.251791 * exp(-(-7.37147e-07 * pt));
0216   else if (fabs(eta) < 0.5)
0217     res = 0.000290074 + 1.54664e-12 * exp(-(-0.115541 * pt));
0218   else if (fabs(eta) < 0.7)
0219     res = 8.37182e-05 + 0.000233453 * exp(-(0.00602386 * pt));
0220   else if (fabs(eta) < 0.9)
0221     res = 0.000229422 + 0.000114253 * exp(-(0.0188935 * pt));
0222   else if (fabs(eta) < 1.15)
0223     res = 0.000191525 + 0.000404238 * exp(-(0.0554545 * pt));
0224   else if (fabs(eta) < 1.3)
0225     res = 0.000195461 + 1.43699e-07 * exp(-(-0.0315088 * pt));
0226   else if (fabs(eta) < 1.6)
0227     res = 0.000223422 + 2.05169e+07 * exp(-(1.41408 * pt));
0228   else if (fabs(eta) < 1.9)
0229     res = -0.867114 + 0.867336 * exp(-(4.08639e-07 * pt));
0230   else if (fabs(eta) < 2.5)
0231     res = -0.866567 + 0.866746 * exp(-(-8.62871e-07 * pt));
0232   return res;
0233 }
0234 
0235 #endif