Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TopObjetcResolutionsJet_h
0002 #define TopObjetcResolutionsJet_h
0003 
0004 #include <cmath>
0005 
0006 namespace res {
0007   class HelperJet {
0008   public:
0009     enum Flavor { kUds, kB };
0010 
0011     HelperJet(){};
0012     ~HelperJet(){};
0013 
0014     inline double pt(double pt, double eta, Flavor flav);
0015     inline double eta(double pt, double eta, Flavor flav);
0016     inline double phi(double pt, double eta, Flavor flav);
0017     inline double a(double pt, double eta, Flavor flav);
0018     inline double b(double pt, double eta, Flavor flav);
0019     inline double c(double pt, double eta, Flavor flav);
0020     inline double d(double pt, double eta, Flavor flav);
0021     inline double et(double pt, double eta, Flavor flav);
0022     inline double theta(double pt, double eta, Flavor flav);
0023   };
0024 }  // namespace res
0025 
0026 inline double res::HelperJet::pt(double pt, double eta, Flavor flav) {
0027   double res = 0.29 * sqrt(pt);
0028   if (fabs(eta) < 1.4)
0029     res += 6.68;
0030   else
0031     res += -3.14 * fabs(eta) + 11.89;
0032   if (flav == kB) {
0033     res = 0.33 * sqrt(pt);
0034     if (fabs(eta) < 1.4)
0035       res += 6.57;
0036     else
0037       res += -1.09 * fabs(eta) + 8.50;
0038   }
0039   return res;
0040 }
0041 
0042 inline double res::HelperJet::a(double pt, double eta, Flavor flav) {
0043   double res = 0.29 * sqrt(pt);
0044   if (flav == kB) {
0045     if (fabs(eta) < 0.17)
0046       res = 0.142188 + 0.288157 * exp(-(0.0275628 * pt));
0047     else if (fabs(eta) < 0.35)
0048       res = 0.141215 + 0.277502 * exp(-(0.0282327 * pt));
0049     else if (fabs(eta) < 0.5)
0050       res = 0.140493 + 0.26136 * exp(-(0.0254784 * pt));
0051     else if (fabs(eta) < 0.7)
0052       res = 0.142608 + 0.371256 * exp(-(0.0299132 * pt));
0053     else if (fabs(eta) < 0.9)
0054       res = 0.138817 + 0.237167 * exp(-(0.0268413 * pt));
0055     else if (fabs(eta) < 1.15)
0056       res = 0.137322 + 0.293834 * exp(-(0.0264771 * pt));
0057     else if (fabs(eta) < 1.4)
0058       res = 0.147184 + 0.40834 * exp(-(0.0366769 * pt));
0059     else if (fabs(eta) < 1.7)
0060       res = 0.141529 + 0.195563 * exp(-(0.023933 * pt));
0061     else if (fabs(eta) < 2.1)
0062       res = 0.129132 + 0.261012 * exp(-(0.0323658 * pt));
0063     else if (fabs(eta) < 2.5)
0064       res = 0.120065 + 0.239351 * exp(-(0.0356176 * pt));
0065   } else {
0066     if (fabs(eta) < 0.17)
0067       res = 0.142145 + 0.274541 * exp(-(0.0286487 * pt));
0068     else if (fabs(eta) < 0.35)
0069       res = 0.146112 + 0.284777 * exp(-(0.031039 * pt));
0070     else if (fabs(eta) < 0.5)
0071       res = 0.146703 + 0.343982 * exp(-(0.0333917 * pt));
0072     else if (fabs(eta) < 0.7)
0073       res = 0.149067 + 0.241197 * exp(-(0.0303415 * pt));
0074     else if (fabs(eta) < 0.9)
0075       res = 0.141233 + 0.304052 * exp(-(0.0314644 * pt));
0076     else if (fabs(eta) < 1.15)
0077       res = 0.144531 + 0.266871 * exp(-(0.0283385 * pt));
0078     else if (fabs(eta) < 1.4)
0079       res = 0.156593 + 0.41251 * exp(-(0.0411896 * pt));
0080     else if (fabs(eta) < 1.7)
0081       res = 0.13452 + 0.269 * exp(-(0.0230171 * pt));
0082     else if (fabs(eta) < 2.1)
0083       res = 0.0969416 + 0.211636 * exp(-(0.0166117 * pt));
0084     else if (fabs(eta) < 2.5)
0085       res = 0.0727398 + 0.205132 * exp(-(0.01661 * pt));
0086   }
0087   return res;
0088 }
0089 
0090 inline double res::HelperJet::b(double pt, double eta, Flavor flav) {
0091   double res = 0.29 * sqrt(pt);
0092   if (flav == kB) {
0093     if (fabs(eta) < 0.17)
0094       res = 2.02521 + 0.174301 * exp(-(-0.0136646 * pt));
0095     else if (fabs(eta) < 0.35)
0096       res = 0.690872 + 1.32174 * exp(-(-0.00459989 * pt));
0097     else if (fabs(eta) < 0.5)
0098       res = -956.522 + 958.486 * exp(-(-7.57551e-06 * pt));
0099     else if (fabs(eta) < 0.7)
0100       res = 2.01017 + 0.0670861 * exp(-(-0.0194879 * pt));
0101     else if (fabs(eta) < 0.9)
0102       res = 1.92701 + 0.124384 * exp(-(-0.0144246 * pt));
0103     else if (fabs(eta) < 1.15)
0104       res = 1.94854 + 0.034138 * exp(-(-0.0227995 * pt));
0105     else if (fabs(eta) < 1.4)
0106       res = 2.07599 + 0.0208406 * exp(-(-0.0214439 * pt));
0107     else if (fabs(eta) < 1.7)
0108       res = 1.99002 + 0.0077067 * exp(-(-0.0278379 * pt));
0109     else if (fabs(eta) < 2.1)
0110       res = 1.93181 + 0.00196985 * exp(-(-0.0390155 * pt));
0111     else if (fabs(eta) < 2.5)
0112       res = 1.75611 + 0.0287099 * exp(-(-0.0202162 * pt));
0113   } else {
0114     if (fabs(eta) < 0.17)
0115       res = -644.18 + 645.342 * exp(-(-1.7462e-05 * pt));
0116     else if (fabs(eta) < 0.35)
0117       res = -1.34986 + 2.48937 * exp(-(-0.00396448 * pt));
0118     else if (fabs(eta) < 0.5)
0119       res = -4.8078 + 5.98195 * exp(-(-0.0015 * pt));
0120     else if (fabs(eta) < 0.7)
0121       res = -9.55949 + 10.7419 * exp(-(-0.000891802 * pt));
0122     else if (fabs(eta) < 0.9)
0123       res = 0.374264 + 0.884391 * exp(-(-0.00642501 * pt));
0124     else if (fabs(eta) < 1.15)
0125       res = -9.51561 + 10.7429 * exp(-(-0.000639173 * pt));
0126     else if (fabs(eta) < 1.4)
0127       res = -0.158886 + 1.43841 * exp(-(-0.00347282 * pt));
0128     else if (fabs(eta) < 1.7)
0129       res = 0.28876 + 0.992659 * exp(-(-0.00454673 * pt));
0130     else if (fabs(eta) < 2.1)
0131       res = 0.292201 + 0.922609 * exp(-(-0.00536289 * pt));
0132     else if (fabs(eta) < 2.5)
0133       res = -657.479 + 658.533 * exp(-(-1.40481e-05 * pt));
0134   }
0135   return res;
0136 }
0137 
0138 inline double res::HelperJet::c(double pt, double eta, Flavor flav) {
0139   double res = 0.29 * sqrt(pt);
0140   if (flav == kB) {
0141     if (fabs(eta) < 0.17)
0142       res = -2048.11 + 2051.27 * exp(-(1.81337e-06 * pt));
0143     else if (fabs(eta) < 0.35)
0144       res = 2.86314 + 0.598484 * exp(-(0.0322582 * pt));
0145     else if (fabs(eta) < 0.5)
0146       res = 2.54785 + 0.77807 * exp(-(0.0100979 * pt));
0147     else if (fabs(eta) < 0.7)
0148       res = 2.78865 + 6.82558 * exp(-(0.0677953 * pt));
0149     else if (fabs(eta) < 0.9)
0150       res = 2.63261 + 2.66562 * exp(-(0.044099 * pt));
0151     else if (fabs(eta) < 1.15)
0152       res = 2.51691 + 2.75456 * exp(-(0.0425201 * pt));
0153     else if (fabs(eta) < 1.4)
0154       res = 2.60458 + 0.623776 * exp(-(0.0148415 * pt));
0155     else if (fabs(eta) < 1.7)
0156       res = 2.39005 + 1.60119 * exp(-(0.0154536 * pt));
0157     else if (fabs(eta) < 2.1)
0158       res = 2.49783 + 0.408896 * exp(-(0.04005 * pt));
0159     else if (fabs(eta) < 2.5)
0160       res = 2.02143 + 0.000354016 * exp(-(-0.0476218 * pt));
0161   } else {
0162     if (fabs(eta) < 0.17)
0163       res = 1.72736 + 0.212526 * exp(-(-0.00672611 * pt));
0164     else if (fabs(eta) < 0.35)
0165       res = -3480.32 + 3482.17 * exp(-(-7.08939e-07 * pt));
0166     else if (fabs(eta) < 0.5)
0167       res = 1.89173 + 0.0381423 * exp(-(-0.0151248 * pt));
0168     else if (fabs(eta) < 0.7)
0169       res = 2 + 0.00575323 * exp(-(-0.0233459 * pt));
0170     else if (fabs(eta) < 0.9)
0171       res = 1.92618 + 0.00541047 * exp(-(-0.0269683 * pt));
0172     else if (fabs(eta) < 1.15)
0173       res = 1.95535 + 0.0194328 * exp(-(-0.0175058 * pt));
0174     else if (fabs(eta) < 1.4)
0175       res = 1.99855 + 0.00403398 * exp(-(-0.027822 * pt));
0176     else if (fabs(eta) < 1.7)
0177       res = 2.02356 + 1.33745e-15 * exp(-(-0.201028 * pt));
0178     else if (fabs(eta) < 2.1)
0179       res = 1.70305 + 0.0428122 * exp(-(-0.0206051 * pt));
0180     else if (fabs(eta) < 2.5)
0181       res = 0.964128 + 0.370407 * exp(-(-0.0119056 * pt));
0182   }
0183   return res;
0184 }
0185 
0186 inline double res::HelperJet::d(double pt, double eta, Flavor flav) {
0187   double res = 0.29 * sqrt(pt);
0188   if (flav == kB) {
0189     if (fabs(eta) < 0.17)
0190       res = 0.144545 + 0.374307 * exp(-(0.0314642 * pt));
0191     else if (fabs(eta) < 0.35)
0192       res = 0.141366 + 0.241457 * exp(-(0.0263273 * pt));
0193     else if (fabs(eta) < 0.5)
0194       res = 0.142509 + 0.324478 * exp(-(0.0288208 * pt));
0195     else if (fabs(eta) < 0.7)
0196       res = 0.139809 + 0.292392 * exp(-(0.0257797 * pt));
0197     else if (fabs(eta) < 0.9)
0198       res = 0.137762 + 0.258213 * exp(-(0.0265974 * pt));
0199     else if (fabs(eta) < 1.15)
0200       res = 0.135831 + 0.338346 * exp(-(0.0277574 * pt));
0201     else if (fabs(eta) < 1.4)
0202       res = 0.148253 + 0.53999 * exp(-(0.0415757 * pt));
0203     else if (fabs(eta) < 1.7)
0204       res = 0.145785 + 0.297049 * exp(-(0.0319928 * pt));
0205     else if (fabs(eta) < 2.1)
0206       res = 0.126895 + 0.291297 * exp(-(0.0328976 * pt));
0207     else if (fabs(eta) < 2.5)
0208       res = 0.119259 + 0.228403 * exp(-(0.0341018 * pt));
0209   } else {
0210     if (fabs(eta) < 0.17)
0211       res = 0.139738 + 0.310387 * exp(-(0.0296992 * pt));
0212     else if (fabs(eta) < 0.35)
0213       res = 0.142229 + 0.274556 * exp(-(0.0286575 * pt));
0214     else if (fabs(eta) < 0.5)
0215       res = 0.14344 + 0.313425 * exp(-(0.0294567 * pt));
0216     else if (fabs(eta) < 0.7)
0217       res = 0.147284 + 0.252005 * exp(-(0.0303533 * pt));
0218     else if (fabs(eta) < 0.9)
0219       res = 0.13541 + 0.261376 * exp(-(0.0260026 * pt));
0220     else if (fabs(eta) < 1.15)
0221       res = 0.144023 + 0.27422 * exp(-(0.0282282 * pt));
0222     else if (fabs(eta) < 1.4)
0223       res = 0.158694 + 0.352571 * exp(-(0.0385597 * pt));
0224     else if (fabs(eta) < 1.7)
0225       res = 0.135936 + 0.24773 * exp(-(0.0226282 * pt));
0226     else if (fabs(eta) < 2.1)
0227       res = 0.0957325 + 0.213108 * exp(-(0.016424 * pt));
0228     else if (fabs(eta) < 2.5)
0229       res = 0.0622281 + 0.185045 * exp(-(0.0129321 * pt));
0230   }
0231   return res;
0232 }
0233 
0234 inline double res::HelperJet::theta(double pt, double eta, Flavor flav) {
0235   double res = 0.29 * sqrt(pt);
0236   if (flav == kB) {
0237     if (fabs(eta) < 0.17)
0238       res = 0.0348657 + 0.0966067 * exp(-(0.0388496 * pt));
0239     else if (fabs(eta) < 0.35)
0240       res = 0.0327521 + 0.0901303 * exp(-(0.0354149 * pt));
0241     else if (fabs(eta) < 0.5)
0242       res = 0.030283 + 0.0970732 * exp(-(0.036806 * pt));
0243     else if (fabs(eta) < 0.7)
0244       res = 0.0266898 + 0.0994089 * exp(-(0.0379773 * pt));
0245     else if (fabs(eta) < 0.9)
0246       res = 0.022614 + 0.091974 * exp(-(0.0384986 * pt));
0247     else if (fabs(eta) < 1.15)
0248       res = 0.0173219 + 0.0923928 * exp(-(0.0395886 * pt));
0249     else if (fabs(eta) < 1.4)
0250       res = 0.0129851 + 0.077473 * exp(-(0.0363236 * pt));
0251     else if (fabs(eta) < 1.7)
0252       res = 0.00967747 + 0.0667463 * exp(-(0.0383101 * pt));
0253     else if (fabs(eta) < 2.1)
0254       res = 0.00744593 + 0.050027 * exp(-(0.0432323 * pt));
0255     else if (fabs(eta) < 2.5)
0256       res = 0.00589309 + 0.0346904 * exp(-(0.0484705 * pt));
0257   } else {
0258     if (fabs(eta) < 0.17)
0259       res = 0.0384999 + 0.105382 * exp(-(0.0440247 * pt));
0260     else if (fabs(eta) < 0.35)
0261       res = 0.0384758 + 0.086093 * exp(-(0.0436464 * pt));
0262     else if (fabs(eta) < 0.5)
0263       res = 0.0325808 + 0.0860212 * exp(-(0.0371074 * pt));
0264     else if (fabs(eta) < 0.7)
0265       res = 0.0304022 + 0.094116 * exp(-(0.0402575 * pt));
0266     else if (fabs(eta) < 0.9)
0267       res = 0.0246649 + 0.0883167 * exp(-(0.0386519 * pt));
0268     else if (fabs(eta) < 1.15)
0269       res = 0.0197668 + 0.080217 * exp(-(0.0368397 * pt));
0270     else if (fabs(eta) < 1.4)
0271       res = 0.0148531 + 0.0692569 * exp(-(0.0354383 * pt));
0272     else if (fabs(eta) < 1.7)
0273       res = 0.0113007 + 0.0601861 * exp(-(0.0373138 * pt));
0274     else if (fabs(eta) < 2.1)
0275       res = 0.00860103 + 0.0522148 * exp(-(0.0450405 * pt));
0276     else if (fabs(eta) < 2.5)
0277       res = 0.00692992 + 0.031671 * exp(-(0.0490789 * pt));
0278   }
0279   return res;
0280 }
0281 
0282 inline double res::HelperJet::phi(double pt, double eta, Flavor flav) {
0283   double res = 0.29 * sqrt(pt);
0284   if (flav == kB) {
0285     if (fabs(eta) < 0.17)
0286       res = 0.0217379 + 0.157228 * exp(-(0.0237049 * pt));
0287     else if (fabs(eta) < 0.35)
0288       res = 0.0246735 + 0.165694 * exp(-(0.0269728 * pt));
0289     else if (fabs(eta) < 0.5)
0290       res = 0.0226496 + 0.162875 * exp(-(0.0250225 * pt));
0291     else if (fabs(eta) < 0.7)
0292       res = 0.0232004 + 0.167887 * exp(-(0.0259427 * pt));
0293     else if (fabs(eta) < 0.9)
0294       res = 0.0220083 + 0.183889 * exp(-(0.0273017 * pt));
0295     else if (fabs(eta) < 1.15)
0296       res = 0.0216601 + 0.18482 * exp(-(0.027148 * pt));
0297     else if (fabs(eta) < 1.4)
0298       res = 0.0225191 + 0.19558 * exp(-(0.0271747 * pt));
0299     else if (fabs(eta) < 1.7)
0300       res = 0.0208365 + 0.19241 * exp(-(0.0262627 * pt));
0301     else if (fabs(eta) < 2.1)
0302       res = 0.0233749 + 0.180684 * exp(-(0.032052 * pt));
0303     else if (fabs(eta) < 2.5)
0304       res = 0.0231891 + 0.165484 * exp(-(0.0389916 * pt));
0305   } else {
0306     if (fabs(eta) < 0.17)
0307       res = 0.025945 + 0.16529 * exp(-(0.027385 * pt));
0308     else if (fabs(eta) < 0.35)
0309       res = 0.0257294 + 0.155366 * exp(-(0.0268639 * pt));
0310     else if (fabs(eta) < 0.5)
0311       res = 0.0231924 + 0.166508 * exp(-(0.0264153 * pt));
0312     else if (fabs(eta) < 0.7)
0313       res = 0.0252736 + 0.176977 * exp(-(0.0281594 * pt));
0314     else if (fabs(eta) < 0.9)
0315       res = 0.0269299 + 0.174505 * exp(-(0.0295757 * pt));
0316     else if (fabs(eta) < 1.15)
0317       res = 0.0250191 + 0.178321 * exp(-(0.0284006 * pt));
0318     else if (fabs(eta) < 1.4)
0319       res = 0.0242345 + 0.174682 * exp(-(0.027202 * pt));
0320     else if (fabs(eta) < 1.7)
0321       res = 0.0242234 + 0.199735 * exp(-(0.0291262 * pt));
0322     else if (fabs(eta) < 2.1)
0323       res = 0.0300017 + 0.175617 * exp(-(0.0357093 * pt));
0324     else if (fabs(eta) < 2.5)
0325       res = 0.0282978 + 0.141994 * exp(-(0.0383663 * pt));
0326   }
0327   return res;
0328 }
0329 
0330 inline double res::HelperJet::et(double pt, double eta, Flavor flav) {
0331   double res = 0.29 * sqrt(pt);
0332   if (flav == kB) {
0333     if (fabs(eta) < 0.17)
0334       res = 10.1445 + 0.0445196 * pt;
0335     else if (fabs(eta) < 0.35)
0336       res = 8.944 + 0.0576391 * pt;
0337     else if (fabs(eta) < 0.5)
0338       res = 8.8462 + 0.0630703 * pt;
0339     else if (fabs(eta) < 0.7)
0340       res = 8.90812 + 0.057605 * pt;
0341     else if (fabs(eta) < 0.9)
0342       res = 8.42307 + 0.0623024 * pt;
0343     else if (fabs(eta) < 1.15)
0344       res = 8.64735 + 0.0619689 * pt;
0345     else if (fabs(eta) < 1.4)
0346       res = 8.90574 + 0.0595526 * pt;
0347     else if (fabs(eta) < 1.7)
0348       res = 8.74415 + 0.0612412 * pt;
0349     else if (fabs(eta) < 2.1)
0350       res = 7.80525 + 0.0511843 * pt;
0351     else if (fabs(eta) < 2.5)
0352       res = 6.07877 + 0.0569574 * pt;
0353   } else {
0354     if (fabs(eta) < 0.17)
0355       res = 8.04345 + 0.0705188 * pt;
0356     else if (fabs(eta) < 0.35)
0357       res = 7.77565 + 0.0722247 * pt;
0358     else if (fabs(eta) < 0.5)
0359       res = 8.53558 + 0.0647725 * pt;
0360     else if (fabs(eta) < 0.7)
0361       res = 7.99374 + 0.0681428 * pt;
0362     else if (fabs(eta) < 0.9)
0363       res = 7.51695 + 0.0755128 * pt;
0364     else if (fabs(eta) < 1.15)
0365       res = 7.70804 + 0.0748981 * pt;
0366     else if (fabs(eta) < 1.4)
0367       res = 7.2996 + 0.0852397 * pt;
0368     else if (fabs(eta) < 1.7)
0369       res = 7.95923 + 0.0715722 * pt;
0370     else if (fabs(eta) < 2.1)
0371       res = 7.68012 + 0.0543317 * pt;
0372     else if (fabs(eta) < 2.5)
0373       res = 6.59141 + 0.0452384 * pt;
0374   }
0375   return res;
0376 }
0377 
0378 inline double res::HelperJet::eta(double pt, double eta, Flavor flav) {
0379   double res = -1.53e-4 * pt + 0.05;
0380   if (flav == kB) {
0381     if (fabs(eta) < 0.17)
0382       res = 0.0354411 + 0.130211 * exp(-(0.0423321 * pt));
0383     else if (fabs(eta) < 0.35)
0384       res = 0.0341742 + 0.115784 * exp(-(0.0375787 * pt));
0385     else if (fabs(eta) < 0.5)
0386       res = 0.0336537 + 0.143109 * exp(-(0.0416702 * pt));
0387     else if (fabs(eta) < 0.7)
0388       res = 0.031894 + 0.140572 * exp(-(0.0405564 * pt));
0389     else if (fabs(eta) < 0.9)
0390       res = 0.0301507 + 0.126005 * exp(-(0.0384231 * pt));
0391     else if (fabs(eta) < 1.15)
0392       res = 0.0268018 + 0.140956 * exp(-(0.03872 * pt));
0393     else if (fabs(eta) < 1.4)
0394       res = 0.0242941 + 0.131887 * exp(-(0.0337869 * pt));
0395     else if (fabs(eta) < 1.7)
0396       res = 0.0223985 + 0.142949 * exp(-(0.0351412 * pt));
0397     else if (fabs(eta) < 2.1)
0398       res = 0.0229694 + 0.145993 * exp(-(0.0391759 * pt));
0399     else if (fabs(eta) < 2.5)
0400       res = 0.0243171 + 0.145419 * exp(-(0.0430824 * pt));
0401   } else {
0402     if (fabs(eta) < 0.17)
0403       res = 0.038575 + 0.129026 * exp(-(0.0427157 * pt));
0404     else if (fabs(eta) < 0.35)
0405       res = 0.0400221 + 0.127222 * exp(-(0.0458212 * pt));
0406     else if (fabs(eta) < 0.5)
0407       res = 0.0358472 + 0.119962 * exp(-(0.0395586 * pt));
0408     else if (fabs(eta) < 0.7)
0409       res = 0.0359612 + 0.136094 * exp(-(0.04212 * pt));
0410     else if (fabs(eta) < 0.9)
0411       res = 0.0327581 + 0.127339 * exp(-(0.0393077 * pt));
0412     else if (fabs(eta) < 1.15)
0413       res = 0.0305095 + 0.116238 * exp(-(0.0347537 * pt));
0414     else if (fabs(eta) < 1.4)
0415       res = 0.027529 + 0.117893 * exp(-(0.032858 * pt));
0416     else if (fabs(eta) < 1.7)
0417       res = 0.0253065 + 0.112751 * exp(-(0.0307028 * pt));
0418     else if (fabs(eta) < 2.1)
0419       res = 0.0266957 + 0.131998 * exp(-(0.0380667 * pt));
0420     else if (fabs(eta) < 2.5)
0421       res = 0.0298413 + 0.13651 * exp(-(0.0458475 * pt));
0422   }
0423   return res;
0424 }
0425 
0426 #endif