Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TopObjetcResolutionsMuon_h
0002 #define TopObjetcResolutionsMuon_h
0003 
0004 #include <cmath>
0005 
0006 namespace res {
0007   class HelperMuon {
0008   public:
0009     HelperMuon(){};
0010     ~HelperMuon(){};
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::HelperMuon::pt(double pt, double eta) {
0025   double res = 1.5e-4 * (pt * pt) + 0.534 * fabs(eta) + 1.9e-2;
0026   return res;
0027 }
0028 
0029 inline double res::HelperMuon::a(double pt, double eta) {
0030   double res = 1000.;
0031   if (fabs(eta) < 0.17)
0032     res = -0.00163044 + 0.00921744 * exp(-(-0.00517804 * pt));
0033   else if (fabs(eta) < 0.35)
0034     res = -38.9811 + 38.9892 * exp(-(-1.58728e-06 * pt));
0035   else if (fabs(eta) < 0.5)
0036     res = -17.254 + 17.2634 * exp(-(-2.86961e-06 * pt));
0037   else if (fabs(eta) < 0.7)
0038     res = 0.00651163 + 0.0038473 * exp(-(-0.00716166 * pt));
0039   else if (fabs(eta) < 0.9)
0040     res = -14.9098 + 14.9207 * exp(-(-3.61147e-06 * pt));
0041   else if (fabs(eta) < 1.15)
0042     res = -0.0130723 + 0.028881 * exp(-(-0.00143687 * pt));
0043   else if (fabs(eta) < 1.3)
0044     res = 0.0102039 + 0.00629269 * exp(-(-0.00659229 * pt));
0045   else if (fabs(eta) < 1.6)
0046     res = -26.1501 + 26.1657 * exp(-(-2.75489e-06 * pt));
0047   else if (fabs(eta) < 1.9)
0048     res = -26.1006 + 26.1168 * exp(-(-2.65457e-06 * pt));
0049   else if (fabs(eta) < 2.5)
0050     res = -110.342 + 110.361 * exp(-(-1.3011e-06 * pt));
0051   return res;
0052 }
0053 
0054 inline double res::HelperMuon::b(double pt, double eta) {
0055   double res = 1000.;
0056   if (fabs(eta) < 0.17)
0057     res = -25.2075 + 25.2104 * exp(-(-1.10483e-05 * pt));
0058   else if (fabs(eta) < 0.35)
0059     res = -117.663 + 117.666 * exp(-(-1.71416e-06 * pt));
0060   else if (fabs(eta) < 0.5)
0061     res = -21.8718 + 21.8742 * exp(-(-8.13178e-06 * pt));
0062   else if (fabs(eta) < 0.7)
0063     res = -35.0557 + 35.0573 * exp(-(-5.75421e-06 * pt));
0064   else if (fabs(eta) < 0.9)
0065     res = -6.37721 + 6.38003 * exp(-(-2.51376e-05 * pt));
0066   else if (fabs(eta) < 1.15)
0067     res = -73.9844 + 73.9873 * exp(-(-1.75066e-06 * pt));
0068   else if (fabs(eta) < 1.3)
0069     res = -32.7368 + 32.7402 * exp(-(-3.28819e-06 * pt));
0070   else if (fabs(eta) < 1.6)
0071     res = -46.9103 + 46.9132 * exp(-(-2.64771e-06 * pt));
0072   else if (fabs(eta) < 1.9)
0073     res = -63.3183 + 63.3218 * exp(-(-1.56186e-06 * pt));
0074   else if (fabs(eta) < 2.5)
0075     res = -13.913 + 13.9174 * exp(-(-6.62559e-06 * pt));
0076   return res;
0077 }
0078 
0079 inline double res::HelperMuon::c(double pt, double eta) {
0080   double res = 1000.;
0081   if (fabs(eta) < 0.17)
0082     res = -0.00784191 + 0.0107731 * exp(-(-0.00262573 * pt));
0083   else if (fabs(eta) < 0.35)
0084     res = -4.16489 + 4.16781 * exp(-(-8.18221e-06 * pt));
0085   else if (fabs(eta) < 0.5)
0086     res = -0.00758502 + 0.0109898 * exp(-(-0.0023199 * pt));
0087   else if (fabs(eta) < 0.7)
0088     res = -0.0190548 + 0.0222179 * exp(-(-0.00140706 * pt));
0089   else if (fabs(eta) < 0.9)
0090     res = -7.74332 + 7.74699 * exp(-(-3.61138e-06 * pt));
0091   else if (fabs(eta) < 1.15)
0092     res = 0.00239644 + 0.00222721 * exp(-(-0.00729116 * pt));
0093   else if (fabs(eta) < 1.3)
0094     res = -50.7222 + 50.7266 * exp(-(-5.72416e-07 * pt));
0095   else if (fabs(eta) < 1.6)
0096     res = -9.91368 + 9.91795 * exp(-(-3.8653e-06 * pt));
0097   else if (fabs(eta) < 1.9)
0098     res = 0.000103356 + 0.00464674 * exp(-(-0.00750142 * pt));
0099   else if (fabs(eta) < 2.5)
0100     res = -0.00425536 + 0.00971869 * exp(-(-0.00546016 * pt));
0101   return res;
0102 }
0103 
0104 inline double res::HelperMuon::d(double pt, double eta) {
0105   double res = 1000.;
0106   if (fabs(eta) < 0.17)
0107     res = -0.00146069 + 0.00904233 * exp(-(-0.00524103 * pt));
0108   else if (fabs(eta) < 0.35)
0109     res = -34.455 + 34.4631 * exp(-(-1.78448e-06 * pt));
0110   else if (fabs(eta) < 0.5)
0111     res = -15.3417 + 15.3511 * exp(-(-3.23796e-06 * pt));
0112   else if (fabs(eta) < 0.7)
0113     res = 0.00639493 + 0.00393752 * exp(-(-0.00707984 * pt));
0114   else if (fabs(eta) < 0.9)
0115     res = -12.855 + 12.866 * exp(-(-4.16994e-06 * pt));
0116   else if (fabs(eta) < 1.15)
0117     res = -0.00526993 + 0.0211877 * exp(-(-0.00186356 * pt));
0118   else if (fabs(eta) < 1.3)
0119     res = 0.0105021 + 0.00600376 * exp(-(-0.00677709 * pt));
0120   else if (fabs(eta) < 1.6)
0121     res = -23.5742 + 23.5898 * exp(-(-3.0526e-06 * pt));
0122   else if (fabs(eta) < 1.9)
0123     res = -27.317 + 27.3331 * exp(-(-2.56587e-06 * pt));
0124   else if (fabs(eta) < 2.5)
0125     res = -112.151 + 112.17 * exp(-(-1.25452e-06 * pt));
0126   return res;
0127 }
0128 
0129 inline double res::HelperMuon::theta(double pt, double eta) {
0130   double res = 1000.;
0131   if (fabs(eta) < 0.17)
0132     res = 0.000327129 + 0.000101907 * exp(-(0.0172489 * pt));
0133   else if (fabs(eta) < 0.35)
0134     res = 0.00025588 + 9.99049e-05 * exp(-(0.0189315 * pt));
0135   else if (fabs(eta) < 0.5)
0136     res = 0.000215701 + 0.000109968 * exp(-(0.0406069 * pt));
0137   else if (fabs(eta) < 0.7)
0138     res = 0.000196151 + 5.66998e-05 * exp(-(0.0263501 * pt));
0139   else if (fabs(eta) < 0.9)
0140     res = 0.000106579 + 0.000113065 * exp(-(0.00377145 * pt));
0141   else if (fabs(eta) < 1.15)
0142     res = 0.000120697 + 0.0001408 * exp(-(0.0520758 * pt));
0143   else if (fabs(eta) < 1.3)
0144     res = 9.57227e-05 + 0.000205436 * exp(-(0.0633277 * pt));
0145   else if (fabs(eta) < 1.6)
0146     res = 8.56706e-05 + 0.000117908 * exp(-(0.0582652 * pt));
0147   else if (fabs(eta) < 1.9)
0148     res = 6.62861e-05 + 0.000110841 * exp(-(0.0640963 * pt));
0149   else if (fabs(eta) < 2.5)
0150     res = 6.3783e-05 + 0.000122656 * exp(-(0.0974097 * pt));
0151   return res;
0152 }
0153 
0154 inline double res::HelperMuon::phi(double pt, double eta) {
0155   double res = 1000.;
0156   if (fabs(eta) < 0.17)
0157     res = 7.21523e-05 + 0.000293781 * exp(-(0.0518546 * pt));
0158   else if (fabs(eta) < 0.35)
0159     res = 7.15456e-05 + 0.000290324 * exp(-(0.0496431 * pt));
0160   else if (fabs(eta) < 0.5)
0161     res = 7.25417e-05 + 0.000322288 * exp(-(0.0497559 * pt));
0162   else if (fabs(eta) < 0.7)
0163     res = 7.24273e-05 + 0.000301504 * exp(-(0.0480936 * pt));
0164   else if (fabs(eta) < 0.9)
0165     res = 7.23791e-05 + 0.0003355 * exp(-(0.0454216 * pt));
0166   else if (fabs(eta) < 1.15)
0167     res = 8.13896e-05 + 0.000432844 * exp(-(0.0480919 * pt));
0168   else if (fabs(eta) < 1.3)
0169     res = 7.93329e-05 + 0.000333341 * exp(-(0.0367028 * pt));
0170   else if (fabs(eta) < 1.6)
0171     res = 9.34279e-05 + 0.000372581 * exp(-(0.0429296 * pt));
0172   else if (fabs(eta) < 1.9)
0173     res = 0.000112312 + 0.000479423 * exp(-(0.0513205 * pt));
0174   else if (fabs(eta) < 2.5)
0175     res = 0.000144398 + 0.000432592 * exp(-(0.0400788 * pt));
0176   return res;
0177 }
0178 
0179 inline double res::HelperMuon::et(double pt, double eta) {
0180   double res = 1000.;
0181   if (fabs(eta) < 0.17)
0182     res = -0.0552605 + 0.0115814 * pt;
0183   else if (fabs(eta) < 0.35)
0184     res = -0.05039 + 0.0122729 * pt;
0185   else if (fabs(eta) < 0.5)
0186     res = -0.0435167 + 0.0128949 * pt;
0187   else if (fabs(eta) < 0.7)
0188     res = -0.038473 + 0.0129088 * pt;
0189   else if (fabs(eta) < 0.9)
0190     res = -0.0333693 + 0.0140788 * pt;
0191   else if (fabs(eta) < 1.15)
0192     res = -0.0102406 + 0.0180217 * pt;
0193   else if (fabs(eta) < 1.3)
0194     res = -0.0244845 + 0.0190696 * pt;
0195   else if (fabs(eta) < 1.6)
0196     res = -0.055785 + 0.0205605 * pt;
0197   else if (fabs(eta) < 1.9)
0198     res = -0.0457006 + 0.0204167 * pt;
0199   else if (fabs(eta) < 2.5)
0200     res = -0.0399952 + 0.027388 * pt;
0201   return res;
0202 }
0203 
0204 inline double res::HelperMuon::eta(double pt, double eta) {
0205   double res = 1000.;
0206   if (fabs(eta) < 0.17)
0207     res = 0.000322451 + 0.000107167 * exp(-(0.0156347 * pt));
0208   else if (fabs(eta) < 0.35)
0209     res = 0.000271279 + 0.000106197 * exp(-(0.0235732 * pt));
0210   else if (fabs(eta) < 0.5)
0211     res = 0.000235783 + 0.000146536 * exp(-(0.0491182 * pt));
0212   else if (fabs(eta) < 0.7)
0213     res = 0.000241657 + 0.00012571 * exp(-(0.0681321 * pt));
0214   else if (fabs(eta) < 0.9)
0215     res = 0.000218419 + 0.000380006 * exp(-(0.0749053 * pt));
0216   else if (fabs(eta) < 1.15)
0217     res = 0.000184903 + 0.000217257 * exp(-(0.0520574 * pt));
0218   else if (fabs(eta) < 1.3)
0219     res = 0.000169888 + 0.000490542 * exp(-(0.0747289 * pt));
0220   else if (fabs(eta) < 1.6)
0221     res = 0.000179318 + 0.000290048 * exp(-(0.0613212 * pt));
0222   else if (fabs(eta) < 1.9)
0223     res = 0.000144481 + 0.000260476 * exp(-(0.0392984 * pt));
0224   else if (fabs(eta) < 2.5)
0225     res = 0.000158888 + 0.000442249 * exp(-(0.0537515 * pt));
0226   return res;
0227 }
0228 
0229 #endif