Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:18:39

0001 #include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalCrystalMatrixProbality.h"
0002 
0003 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0004 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0005 
0006 template <>
0007 double EcalCrystalMatrixProbality<EBDetId>::Central(double x) {
0008   double vEBCentral = 0.0;
0009 
0010   if (x <= 0.180) {
0011     vEBCentral = 0.0;
0012   } else if (0.180 < x && x <= 0.300) {
0013     vEBCentral = (-3267.97 + 53882 * x - 298536 * x * x + 555872 * x * x * x) / 2.19773067484200601e+03;
0014   } else if (0.300 < x && x <= 0.450) {
0015     vEBCentral = (-35768.3 + 307852 * x - 892325 * x * x + 914708 * x * x * x) / 2.19773067484200601e+03;
0016   } else if (0.450 < x && x <= 0.780) {
0017     vEBCentral = (28483 - 113912 * x + 184167 * x * x - 99781.8 * x * x * x) / 2.19773067484200601e+03;
0018   } else if (0.780 < x && x <= 0.845) {
0019     vEBCentral =
0020         (-2.49877e+07 + 9.18933e+07 * x - 1.12504e+08 * x * x + 4.58581e+07 * x * x * x) / 2.19773067484200601e+03;
0021   } else if (0.845 < x) {
0022     vEBCentral = 0.0;
0023   } else {
0024     vEBCentral = 0.0;
0025   }
0026 
0027   return vEBCentral;
0028 }
0029 
0030 template <>
0031 double EcalCrystalMatrixProbality<EBDetId>::Diagonal(double x) {
0032   double vEBDiagonal = 0.0;
0033 
0034   if (0.000 < x && x <= 0.010) {
0035     vEBDiagonal = TMath::Landau(x, 7.02750e-03, 2.41060e-03, true) * 3.96033283438174431e+03 / 4.39962923475768821e+03;
0036   } else if (0.010 < x && x <= 0.100) {
0037     vEBDiagonal = TMath::Landau(x, 1.70472e-03, 2.47564e-03, true) * 8.34898553737588554e+03 / 4.39962923475768821e+03;
0038   } else if (0.100 < x && x <= 0.350) {
0039     vEBDiagonal = (18206.7 - 326578 * x + 2.44528e+06 * x * x - 9.27532e+06 * x * x * x + 1.75264e+07 * x * x * x * x -
0040                    1.30949e+07 * x * x * x * x * x) /
0041                   4.39962923475768821e+03;
0042   } else if (0.350 < x) {
0043     vEBDiagonal = 0.0;
0044   } else {
0045     vEBDiagonal = 0.0;
0046   }
0047 
0048   return vEBDiagonal;
0049 }
0050 
0051 template <>
0052 double EcalCrystalMatrixProbality<EBDetId>::UpDown(double x) {
0053   double vEBUpDown = 0.0;
0054 
0055   if (0.000 < x && x <= 0.005) {
0056     vEBUpDown = (28.5332 - 35350 * x + 4.28566e+07 * x * x - 2.02038e+10 * x * x * x + 3.56185e+12 * x * x * x * x) /
0057                 2.20315994559946967e+03;
0058   } else if (0.005 < x && x <= 0.015) {
0059     vEBUpDown = TMath::Landau(x, 1.51342e-02, 3.65756e-03, true) * 7.04501225670452641e+02 / 2.20315994559946967e+03;
0060   } else if (0.015 < x && x <= 0.020) {
0061     vEBUpDown = TMath::Landau(x, 1.52460e-02, 5.04539e-03, true) * 9.70980301933632518e+02 / 2.20315994559946967e+03;
0062   } else if (0.020 < x && x <= 0.100) {
0063     vEBUpDown = (62436.8 - 2.52677e+06 * x + 4.92704e+07 * x * x - 4.95769e+08 * x * x * x +
0064                  2.48261e+09 * x * x * x * x - 4.89172e+09 * x * x * x * x * x) /
0065                 2.20315994559946967e+03;
0066   } else if (0.100 < x && x <= 0.430) {
0067     vEBUpDown = (19976.7 - 265844 * x + 1.80629e+06 * x * x - 6.40378e+06 * x * x * x + 1.13017e+07 * x * x * x * x -
0068                  7.91581e+06 * x * x * x * x * x) /
0069                 2.20315994559946967e+03;
0070   } else if (0.430 < x && x <= 0.453) {
0071     vEBUpDown =
0072         (-3.78481e+06 + 2.60128e+07 * x - 5.9519e+07 * x * x + 4.53408e+07 * x * x * x) / 2.20315994559946967e+03;
0073   } else if (0.453 < x) {
0074     vEBUpDown = 0.0;
0075   } else {
0076     vEBUpDown = 0.0;
0077   }
0078 
0079   return vEBUpDown;
0080 }
0081 
0082 template <>
0083 double EcalCrystalMatrixProbality<EBDetId>::ReftRight(double x) {
0084   double vEBReftRight = 0.0;
0085 
0086   if (0.000 < x && x <= 0.003) {
0087     vEBReftRight = (102.682 + 457094 * x - 4.34553e+08 * x * x + 2.59638e+11 * x * x * x) / 2.19081589410447168e+03;
0088   } else if (0.003 < x && x <= 0.010) {
0089     vEBReftRight = TMath::Landau(x, 9.56298e-03, 2.59171e-03, true) * 1.27769617491053555e+03 / 2.19081589410447168e+03;
0090   } else if (0.010 < x && x <= 0.070) {
0091     vEBReftRight =
0092         TMath::Landau(x, -1.11570e-02, 9.08308e-04, true) * 3.58026004645168359e+04 / 2.19081589410447168e+03;
0093   } else if (0.070 < x && x <= 0.400) {
0094     vEBReftRight = (15362.5 - 230546 * x + 1.57249e+06 * x * x - 5.47903e+06 * x * x * x + 9.4296e+06 * x * x * x * x -
0095                     6.3775e+06 * x * x * x * x * x) /
0096                    2.19081589410447168e+03;
0097   } else if (0.400 < x && x <= 0.440) {
0098     vEBReftRight = (2.3163882e+06 - 2.2437252e+07 * x + 8.1519104e+07 * x * x - 1.3162869e+08 * x * x * x +
0099                     7.9682168e+07 * x * x * x * x) /
0100                    2.19081589410447168e+03;
0101   } else if (0.440 < x) {
0102     vEBReftRight = 0.0;
0103   } else {
0104     vEBReftRight = 0.0;
0105   }
0106 
0107   return vEBReftRight;
0108 }
0109 
0110 template <>
0111 double EcalCrystalMatrixProbality<EEDetId>::Central(double x) {
0112   double vEECentral = 0.0;
0113 
0114   if (x <= 0.195) {
0115     vEECentral = 0.0;
0116   } else if (0.195 < x && x <= 0.440) {
0117     vEECentral = (-30295.4 + 562760 * x - 4.04967e+06 * x * x + 1.40276e+07 * x * x * x - 2.33108e+07 * x * x * x * x +
0118                   1.50243e+07 * x * x * x * x * x) /
0119                  9.44506089594767786e+02;
0120   } else if (0.440 < x && x <= 0.840) {
0121     vEECentral = (-34683.3 + 274011 * x - 749408 * x * x + 895482 * x * x * x - 396108 * x * x * x * x) /
0122                  9.44506089594767786e+02;
0123   } else if (0.840 < x && x <= 0.875) {
0124     vEECentral = (4.7355575e+06 - 1.6268056e+07 * x + 1.8629316e+07 * x * x - 7.1113915e+06 * x * x * x) /
0125                  9.44506089594767786e+02;
0126   } else if (0.875 < x) {
0127     vEECentral = 0.0;
0128   } else {
0129     vEECentral = 0.0;
0130   }
0131 
0132   return vEECentral;
0133 }
0134 
0135 template <>
0136 double EcalCrystalMatrixProbality<EEDetId>::Diagonal(double x) {
0137   double vEEDiagonal = 0.0;
0138 
0139   if (0.000 < x && x <= 0.015) {
0140     vEEDiagonal = TMath::Landau(x, 8.25505e-03, 3.10387e-03, true) * 1.68601977536835489e+03 / 1.86234137068993937e+03;
0141   } else if (0.015 < x && x <= 0.150) {
0142     vEEDiagonal = TMath::Landau(x, -5.58560e-04, 2.44735e-03, true) * 4.88463235185936264e+03 / 1.86234137068993937e+03;
0143   } else if (0.150 < x && x <= 0.400) {
0144     vEEDiagonal = (7416.66 - 114653 * x + 763877 * x * x - 2.57767e+06 * x * x * x + 4.28872e+06 * x * x * x * x -
0145                    2.79218e+06 * x * x * x * x * x) /
0146                   1.86234137068993937e+03;
0147   } else if (0.400 < x) {
0148     vEEDiagonal = 0.0;
0149   } else {
0150     vEEDiagonal = 0.0;
0151   }
0152 
0153   return vEEDiagonal;
0154 }
0155 
0156 template <>
0157 double EcalCrystalMatrixProbality<EEDetId>::UpDown(double x) {
0158   double vEEUpDown = 0.0;
0159 
0160   if (0.000 < x && x <= 0.015) {
0161     vEEUpDown = TMath::Landau(x, 1.34809e-02, 3.70278e-03, true) * 8.62383670884733533e+02 / 1.88498009908992071e+03;
0162   } else if (0.015 < x && x <= 0.100) {
0163     vEEUpDown =
0164         (75877.4 - 3.18767e+06 * x + 5.89073e+07 * x * x - 5.08829e+08 * x * x * x + 1.67247e+09 * x * x * x * x) /
0165         1.88498009908992071e+03;
0166   } else if (0.100 < x && x <= 0.450) {
0167     vEEUpDown = (12087 - 123704 * x + 566586 * x * x - 1.20111e+06 * x * x * x + 933789 * x * x * x * x) /
0168                 1.88498009908992071e+03;
0169   } else if (0.450 < x) {
0170     vEEUpDown = 0.0;
0171   } else {
0172     vEEUpDown = 0.0;
0173   }
0174 
0175   return vEEUpDown;
0176 }
0177 
0178 template <>
0179 double EcalCrystalMatrixProbality<EEDetId>::ReftRight(double x) {
0180   double vEEReftRight = 0.0;
0181 
0182   if (0.000 < x && x <= 0.015) {
0183     vEEReftRight = TMath::Landau(x, 1.34809e-02, 3.70278e-03, true) * 8.62383670884733533e+02 / 1.88498009908992071e+03;
0184   } else if (0.015 < x && x <= 0.100) {
0185     vEEReftRight =
0186         (75877.4 - 3.18767e+06 * x + 5.89073e+07 * x * x - 5.08829e+08 * x * x * x + 1.67247e+09 * x * x * x * x) /
0187         1.88498009908992071e+03;
0188   } else if (0.100 < x && x <= 0.450) {
0189     vEEReftRight = (12087 - 123704 * x + 566586 * x * x - 1.20111e+06 * x * x * x + 933789 * x * x * x * x) /
0190                    1.88498009908992071e+03;
0191   } else if (0.450 < x) {
0192     vEEReftRight = 0.0;
0193   } else {
0194     vEEReftRight = 0.0;
0195   }
0196 
0197   return vEEReftRight;
0198 }