CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HCALResponse Class Reference

#include <HCALResponse.h>

List of all members.

Public Member Functions

double getHCALEnergyResolution (double e, int hit)
double getHCALEnergyResponse (double e, int hit)
double getHFEnergyResolution (double EGen)
 HCALResponse (const edm::ParameterSet &pset, const RandomEngine *engine)
response responseHCAL (int mip, double energy, double eta, int partype)
 ~HCALResponse ()

Private Member Functions

void interEM (double e, int ie, int ieta)
void interHD (int mip, double e, int ie, int ieta)
void interMU (double e, int ie, int ieta)

Private Attributes

double eBias
double eGridEM [maxEMe]
double eGridHD [maxHDe]
double eGridMU [maxMUe]
double eResponseCoefficient
double eResponseCorrection
double eResponseExponent
double eResponsePlateau [3]
double eResponseScale [3]
 HCAL response parameters.
double etaGridMU [maxMUeta]
double etaStep
double mean
double meanEM [maxEMe][maxEMeta]
double meanHD [maxHDe][maxHDeta]
double meanHD_mip [maxHDe][maxHDeta]
double meanHD_nomip [maxHDe][maxHDeta]
double muStep
const RandomEnginerandom
double responseMU [maxMUe][maxMUeta][maxMUbin]
double RespPar [3][2][3]
double sigma
double sigmaEM [maxEMe][maxEMeta]
double sigmaHD [maxHDe][maxHDeta]
double sigmaHD_mip [maxHDe][maxHDeta]
double sigmaHD_nomip [maxHDe][maxHDeta]

Detailed Description

Definition at line 30 of file HCALResponse.h.


Constructor & Destructor Documentation

HCALResponse::HCALResponse ( const edm::ParameterSet pset,
const RandomEngine engine 
)

Definition at line 16 of file HCALResponse.cc.

References debug, eBias, eGridEM, eGridHD, eGridMU, eResponseCoefficient, eResponseCorrection, eResponseExponent, eResponsePlateau, eResponseScale, etaGridMU, etaStep, edm::ParameterSet::getParameter(), HCAL, i, j, LogDebug, maxEMe, maxEMeta, maxHDe, maxHDeta, maxMUbin, maxMUe, maxMUeta, meanEM, meanHD, meanHD_mip, meanHD_nomip, muStep, responseMU, RespPar, sigmaEM, sigmaHD, sigmaHD_mip, sigmaHD_nomip, and VFCAL.

                                                       :
  random(engine)
{ 
  
  RespPar[HCAL][0][0] =  
    pset.getParameter<double>("HadronBarrelResolution_Stochastic");
  RespPar[HCAL][0][1] =  
    pset.getParameter<double>("HadronBarrelResolution_Constant");
  RespPar[HCAL][0][2] =  
    pset.getParameter<double>("HadronBarrelResolution_Noise");

  RespPar[HCAL][1][0] =  
    pset.getParameter<double>("HadronEndcapResolution_Stochastic");
  RespPar[HCAL][1][1] =  
    pset.getParameter<double>("HadronEndcapResolution_Constant");
  RespPar[HCAL][1][2] =  
    pset.getParameter<double>("HadronEndcapResolution_Noise");

  RespPar[VFCAL][0][0] =  
    pset.getParameter<double>("HadronForwardResolution_Stochastic");
  RespPar[VFCAL][0][1] =  
    pset.getParameter<double>("HadronForwardResolution_Constant");
  RespPar[VFCAL][0][2] =  
    pset.getParameter<double>("HadronForwardResolution_Noise");

  RespPar[VFCAL][1][0] =  
    pset.getParameter<double>("ElectronForwardResolution_Stochastic");
  RespPar[VFCAL][1][1] =  
    pset.getParameter<double>("ElectronForwardResolution_Constant");
  RespPar[VFCAL][1][2] =  
    pset.getParameter<double>("ElectronForwardResolution_Noise");

  eResponseScale[0] = 
    pset.getParameter<double>("eResponseScaleHB");  
  eResponseScale[1] = 
    pset.getParameter<double>("eResponseScaleHE");
  eResponseScale[2] = 
    pset.getParameter<double>("eResponseScaleHF");

  eResponsePlateau[0] = 
    pset.getParameter<double>("eResponsePlateauHB");
  eResponsePlateau[1] = 
    pset.getParameter<double>("eResponsePlateauHE");
  eResponsePlateau[2] = 
    pset.getParameter<double>("eResponsePlateauHF");

  eResponseExponent = 
    pset.getParameter<double>("eResponseExponent");

  eResponseCoefficient = 
    pset.getParameter<double>("eResponseCoefficient");

  eResponseCorrection = 
    pset.getParameter<double>("eResponseCorrection");

  // If need - add a small energy to each hadron ...
  eBias = 
    pset.getParameter<double>("energyBias");
  
  
  etaStep = 0.1;
  muStep  = 0.25;

  double _eGridHD[maxHDe]   = {1., 2., 3., 5., 9., 15., 20., 30., 50., 100., 150., 225., 300., 1000., 3000. };
  double _eGridEM[maxEMe]     = {10., 30., 100., 300., 1000., 3000.};
  double _eGridMU[maxMUe]     = {10., 30., 100., 300.};
  double _etaGridMU[maxMUeta] = {0.3, 0.6, 0.8, 1.25, 1.4, 3.0};

  // additional tuning factor to correct the response in the barrel
  //                              1     2     3     5     9    15    20    30 
  double barrelCorrection[15] = {1.02, 1.01, 1.02, 1.02, 1.02, 1.02, 1.02, 1.03,     1.03, 1.03, 1.03, 1.03, 1.03, 1.03, 1.03};  
  double endcapCorrection[15] = {1.12, 1.12, 1.12, 1.12, 1.12, 1.13, 1.13, 1.14,    1.14, 1.15, 1.15, 1.16, 1.16, 1.16, 1.16};
  //                             1-15 >>> 20   30    50   100   150   225
  double forwardCorrectionEnergyDependent[15] = {1.09, 1.09, 1.08, 1.08, 1.07, 1.06,
                                        1.05, 1.05, 1.06, 1.08, 1.09, 1.10, 
                                        1.09, 1.08, 1.08};     
  double forwardCorrectionEtaDependent[maxHDeta];
  for (unsigned int j=0;j<maxHDeta;j++){
    if (j<30) forwardCorrectionEtaDependent[j]=1.;
    if (j>=30 && j<43) forwardCorrectionEtaDependent[j]=0.98;
    if (j>=43 || j<46) forwardCorrectionEtaDependent[j]=0.95;
    if (j==46 || j==47) forwardCorrectionEtaDependent[j]=0.94;
    if (j==48) forwardCorrectionEtaDependent[j]=0.92;
    if (j>=49) forwardCorrectionEtaDependent[j]=0.86;
  }

  // MEAN energy response for (1) all (2) MIP in ECAL (3) non-MIP in ECAL 
  //-----------------------------------------------------------------------

  double _meanHD[maxHDe][maxHDeta] = {

    // 1 
    {0.498065, 0.404691, 0.548967, 0.495652, 0.534227, 0.524606, 0.508564, 0.481217, 0.521575, 0.515757, 0.440118, 0.403436, 0.428668, 0.301629, 0.307736, 0.234175, 0.164866, 0.234019, 0.211831, 0.0653153, 0.107834, 0.330683, 0.180608, 0.207589, 0.304273, 0.0540994, 0.209118, 0.391319, 0.232648, 0.234898, 0.208077, 0.308006, 0.290552, 0.259652, 0.18443, 0.133599, 0.3911, 0.347598, 0.312221, 0.359135, 0.232424, 0.320564, 0.311762, 0.254582, 0.217367, 0.122154, -0.00413722, -0.036424, 0.126612, 0.111143, 0.288317},
    // 2
    {1.57972, 1.37399, 1.43655, 1.5125, 1.31345, 1.36459, 1.38216, 1.40692, 1.32073, 1.26229, 1.30908, 1.43567, 1.38469, 1.26809, 1.47129, 1.32678, 1.23131, 1.39958, 1.46372, 1.18126, 1.0845, 1.06794, 1.00575, 0.965808, 0.900216, 0.944202, 0.874973, 0.898207, 0.867519, 0.733549, 0.870763, 1.17635, 1.21511, 1.21462, 1.18553, 1.13462, 1.28003, 1.12645, 1.20299, 1.14238, 1.01274, 0.965059, 1.11555, 1.02381, 0.928315, 0.794881, 0.382241, 0.246772, 0.193689, 0.656259, 0.625278},
    // 3 
    {2.12989, 2.31481, 2.15544, 2.19007, 2.13461, 2.0792, 2.17335, 2.11172, 2.02293, 2.08878, 2.06673, 1.93027, 2.06126, 1.97278, 2.09217, 2.14697, 2.11711, 2.01625, 1.91831, 1.94221, 1.64667, 1.83264, 1.62192, 1.70733, 1.39248, 1.46817, 1.62296, 1.65423, 1.36795, 1.18386, 1.62018, 2.12758, 2.17206, 2.15099, 2.02866, 1.92812, 2.10885, 2.01636, 1.93395, 1.94289, 1.8381, 1.8196, 1.76276, 1.70083, 1.62286, 1.37874, 0.927394, 0.664318, 0.390784, 1.08148, 0.94247},
    // 5 
    {3.79969, 3.83696, 3.85438, 3.77577, 3.82985, 3.69219, 3.65657, 3.55887, 3.65097, 3.51659, 3.47784, 3.20721, 3.39076, 3.29976, 3.52155, 4.03899, 3.48854, 3.40099, 3.32876, 3.27881, 3.23115, 3.15658, 3.10874, 2.99215, 2.86622, 2.83488, 2.88909, 2.87325, 2.53987, 2.27076, 2.6893, 3.72487, 3.64249, 3.7106, 3.72475, 3.50516, 3.651, 3.53005, 3.35889, 3.42014, 3.40874, 3.38803, 3.04444, 2.84825, 2.83796, 2.74883, 2.11095, 1.91744, 1.2277, 2.01679, 1.91946},
    // 9 
    {7.33418, 7.037, 7.1857, 7.22616, 7.06822, 7.0287, 6.87545, 7.04592, 6.9982, 6.83358, 6.61643, 6.53737, 6.35026, 6.47591, 6.7283, 7.33445, 7.05116, 6.61201, 6.44648, 6.50046, 6.32645, 6.14354, 6.22557, 5.97735, 5.88157, 5.57615, 5.49984, 5.66394, 4.92412, 4.10878, 5.51943, 6.73539, 6.73847, 6.98001, 6.93693, 6.66939, 6.61707, 6.59897, 6.32261, 6.22746, 6.29714, 6.18276, 5.78676, 5.69114, 5.90317, 5.38993, 4.59656, 4.41804, 3.01731, 4.29533, 4.00189},
    // 15 
    {12.3987, 12.2643, 12.2793, 12.179, 12.3547, 12.0935, 11.8597, 12.1653, 11.788, 11.539, 11.5729, 11.2289, 11.1504, 11.4779, 11.5958, 12.6938, 12.1197, 11.6919, 11.3114, 11.6247, 11.4269, 11.063, 11.0909, 10.6237, 10.7047, 10.5085, 10.2482, 9.88405, 9.03025, 7.37058, 9.93625, 12.1988, 12.7835, 11.9396, 12.3678, 12.1135, 11.6804, 11.8069, 11.473, 11.5157, 10.7531, 10.8982, 10.9306, 10.23, 10.0229, 9.64279, 9.49989, 8.60977, 7.03686, 8.28512, 7.54974},
    // 20
    {17.3384, 17.0781, 17.2163, 17.3061, 17.3213, 16.8364, 16.5958, 16.8607, 16.7517, 16.2522, 16.1777, 15.658, 15.6477, 15.8748, 16.3848, 17.5565, 17.0197, 16.5522, 16.3709, 16.4071, 16.3072, 15.9921, 15.4634, 15.5757, 15.2698, 15.3085, 14.9893, 14.3979, 12.9883, 10.8171, 14.2262, 16.0727, 16.6616, 16.0846, 16.7279, 17.3604, 16.4479, 16.2404, 15.6615, 15.8759, 15.7255, 15.1258, 15.0434, 14.3791, 14.2026, 13.6396, 12.8426, 12.6552, 11.2295, 11.7883, 10.1417},
    // 30
    {26.7466, 26.5803, 26.5499, 26.9091, 26.809, 26.3558, 26.1633, 26.0755, 25.7335, 25.7752, 25.5418, 24.7251, 24.4703, 24.987, 26.0398, 27.2819, 26.7082, 26.0559, 25.8818, 25.5768, 25.5367, 25.2871, 25.1106, 24.5522, 24.5346, 24.0219, 23.7035, 23.2678, 21.3194, 17.419, 22.5762, 25.7012, 26.4278, 26.9853, 26.089, 26.0745, 25.8231, 25.1559, 24.992, 25.1553, 24.5522, 24.0027, 23.9581, 23.2477, 22.507, 22.1746, 21.6159, 21.2836, 18.4349, 19.1561, 17.5485},  
    // 50
    {45.2787, 44.7183, 44.9181, 45.3035, 45.0191, 44.1854, 44.3352, 44.2505, 43.4297, 43.6013, 43.1144, 42.1869, 41.8493, 42.9457, 44.0329, 46.2096, 45.028, 44.622, 43.9874, 44.0502, 43.7725, 43.2233, 42.6152, 42.6214, 41.9467, 41.3583, 40.9533, 39.7945, 36.6845, 30.5753, 40.4273, 45.2536, 46.5445, 46.6267, 46.7933, 47.2467, 45.8736, 45.6788, 44.515, 44.6325, 43.3669, 43.4235, 43.2972, 42.6776, 41.5965, 39.5964, 39.752, 38.4141, 36.3177, 36.0982, 33.4089},
    // 100
    {91.8725, 91.3321, 90.8971, 92.2019, 91.2672, 90.2137, 90.8733, 90.0962, 89.0324, 88.7248, 88.0996, 86.2052, 86.1663, 87.1758, 90.7845, 94.5074, 92.5074, 90.9688, 90.4699, 89.9941, 89.4472, 88.9629, 88.7093, 86.9898, 86.7386, 86.0378, 84.5077, 82.8183, 77.299, 66.3294, 87.5922, 95.2022, 97.8843, 98.7436, 99.6861, 99.1151, 98.3366, 97.9507, 97.6038, 96.4471, 94.0358, 93.0037, 92.9773, 91.2049, 88.1207, 87.4069, 84.2282, 83.8522, 81.8764, 78.9989, 70.298},
    // 150 
    {138.006, 137.443, 138.89, 137.97, 136.92, 136.528, 135.441, 136.217, 134.672, 133.332, 132.949, 130.944, 130.32, 131.672, 134.696, 142.14, 139.952, 137.62, 137.413, 136.931, 135.878, 135.271, 134.911, 133.299, 132.028, 131.485, 129.275, 126.061, 118.607, 101.446, 131.992, 144.464, 148.213, 150.13, 150.987, 151.286, 150.791, 149.995, 148.368, 147.577, 145.48, 142.34, 143.454, 138.375, 135.837, 132.561, 129.091, 128.208, 126.132, 119.948, 111.099,},
    // 225 
    {208.434, 206.644, 206.761, 208.121, 208.672, 206.279, 205.651, 205.209, 202.451, 202.843, 200.412, 197.773, 197.344, 198.311, 203.822, 214.97, 211.144, 209.616, 207.132, 207.941, 206.874, 204.48, 204.091, 201.978, 201.087, 199.66, 196.069, 192.911, 180.729, 156.775, 204.908, 219.108, 228.108, 229.749, 228.067, 226.528, 230.235, 228.524, 225.871, 225.174, 219.457, 217.595, 216.638, 212.493, 208.688, 204.828, 201.991, 196.901, 194.538, 184.078, 169.081},
    // 300 
    {279.737, 276.864, 277.859, 279.048, 277.58, 275.103, 273.656, 274.063, 271.992, 271.212, 268.653, 265.553, 261.791, 267.537, 272.599, 288.29, 283.04, 278.909, 276.672, 278.153, 276.332, 274.104, 274.267, 270.842, 268.532, 268.08, 263.793, 257.801, 243.432, 211.312, 277.612, 295.489, 307.189, 307.943, 310.223, 310.02, 314.238, 309.12, 306.579, 303.694, 300.318, 298.695, 293.55, 289.409, 284.556, 277.424, 271.741, 269.034, 265.426, 253.705, 232.875},
    // 1000 
    {930.426, 930.435, 930.099, 930.338, 931.365, 922.105, 920.117, 915.776, 915.421, 910.612, 908.278, 894.039, 887.25, 895.609, 932.412, 963.949, 956.491, 942.734, 932.293, 939.009, 933.408, 927.949, 928.508, 919.239, 915.86, 918.757, 903.507, 886.135, 847.219, 760.95, 981.542, 1029.26, 1069.04, 1068.39, 1081.64, 1080.06, 1086.39, 1074.79, 1082.87, 1064.78, 1057.94, 1045.98, 1031.85, 1022.71, 992.495, 981.055, 966.408, 949.906, 943.805, 881.26, 833.582},

    // 3000
    {2767.08, 2761.52, 2766.4, 2752.21, 2764.56, 2745.52, 2755.25, 2767.94, 2756.84, 2754.28, 2734.55, 2703.34, 2679.54, 2698.1, 2725.23, 2866.94, 2855.41, 2835.59, 2816.65, 2820.5, 2813.94, 2801.05, 2784.99, 2770.56, 2761.05, 2757.94, 2722.04, 2662.61, 2559.62, 2275.27, 3017.4, 3121.92, 3229.64, 3274.97, 3302.15, 3318.3, 3300.48, 3302.31, 3278.61, 3254.56, 3220.55, 3191.32, 3160.05, 3123.17, 3053.1, 3005.8, 2934.83, 2866.33, 2798.92, 2662.28, 2497.03}
  };



  double _meanHD_mip[maxHDe][maxHDeta] = {

    // 1 
    {0.470401, 0.420807, 0.582019, 0.513316, 0.582146, 0.507601, 0.425305, 0.496197, 0.462072, 0.500715, 0.45951, 0.35951, 0.326801, 0.27982, 0.334088, 0.206558, 0.0753332, 0.160812, 0.185407, 0.0125398, 0.140744, 0.358137, 0.0823871, 0.206733, 0.245851, 0.0529039, 0.185571, 0.324772, 0.187823, 0.206319, 0.206809, 0.305131, 0.290422, 0.259652, 0.18443, 0.133599, 0.3911, 0.347598, 0.312221, 0.359135, 0.232424, 0.320564, 0.311762, 0.254582, 0.217367, 0.122154, -0.00413722, -0.036424, 0.126612, 0.111143, 0.288317},
    // 2
    {1.97994, 1.7386, 1.70442, 1.77383, 1.64153, 1.56375, 1.90802, 1.63272, 1.50595, 1.64778, 1.54636, 1.87225, 1.54531, 1.69112, 1.57854, 1.47766, 1.29508, 1.53696, 1.45168, 1.21659, 1.2014, 1.06158, 0.884319, 1.08992, 0.846027, 1.09638, 0.899982, 0.935183, 0.719585, 0.756828, 0.867439, 1.17839, 1.21802, 1.21462, 1.18553, 1.13462, 1.28003, 1.12645, 1.20299, 1.14238, 1.01274, 0.965059, 1.11555, 1.02381, 0.928315, 0.794881, 0.382241, 0.246772, 0.193689, 0.656259, 0.625278},
    // 3 
    {2.71594, 2.79159, 2.59821, 2.58225, 2.68199, 2.66167, 2.7375, 2.48203, 2.63667, 2.58193, 2.52125, 2.37671, 2.62732, 2.16079, 2.55597, 2.26316, 2.3525, 2.29651, 2.12106, 2.21009, 1.88882, 1.99457, 1.80421, 1.75014, 1.53729, 1.81885, 1.81352, 1.72573, 1.49147, 1.31362, 1.6589, 2.13777, 2.17206, 2.15099, 2.02866, 1.92812, 2.10885, 2.01636, 1.93395, 1.94289, 1.8381, 1.8196, 1.76276, 1.70083, 1.62286, 1.37874, 0.927394, 0.664318, 0.390784, 1.08148, 0.94247},
    // 5 
    {4.75151, 4.63625, 4.85254, 4.56444, 4.63668, 4.45475, 4.36332, 4.3556, 4.38966, 4.29637, 4.21689, 3.94001, 4.468, 4.13119, 4.43904, 4.8149, 4.05317, 4.22918, 3.97242, 4.20607, 4.2177, 4.09719, 3.97134, 3.63644, 3.63634, 3.64081, 3.41821, 3.59108, 3.04798, 2.48535, 2.76348, 3.73573, 3.64249, 3.7106, 3.72475, 3.50516, 3.651, 3.53005, 3.35889, 3.42014, 3.40874, 3.38803, 3.04444, 2.84825, 2.83796, 2.74883, 2.11095, 1.91744, 1.2277, 2.01679, 1.91946},
    // 9 
    {8.70073, 8.37734, 8.47582, 8.75102, 8.42956, 8.37756, 8.09668, 8.4846, 8.55989, 8.46654, 7.84586, 8.13407, 7.9355, 8.10852, 8.45778, 8.54585, 8.55344, 8.3817, 7.97998, 8.0996, 7.68261, 7.94504, 7.90402, 7.37088, 7.64637, 7.01952, 6.85184, 7.10643, 6.11873, 4.60073, 5.6986, 6.78406, 6.73847, 6.98001, 6.93693, 6.66939, 6.61707, 6.59897, 6.32261, 6.22746, 6.29714, 6.18276, 5.78676, 5.69114, 5.90317, 5.38993, 4.59656, 4.41804, 3.01731, 4.29533, 4.00189},
    // 15 
    {14.2601, 13.8824, 13.9055, 13.4131, 13.8953, 13.5235, 13.5502, 13.7647, 13.7798, 13.4293, 13.1247, 13.2181, 12.8636, 14.0848, 13.6479, 13.7527, 13.7484, 13.826, 12.9325, 13.8022, 13.6611, 13.1938, 12.952, 12.4985, 12.8824, 12.5299, 12.4391, 11.9163, 11.0181, 8.33753, 10.2206, 12.2827, 12.7835, 11.9396, 12.3678, 12.1135, 11.6804, 11.8069, 11.473, 11.5157, 10.7531, 10.8982, 10.9306, 10.23, 10.0229, 9.64279, 9.49989, 8.60977, 7.03686, 8.28512, 7.54974},
    // 20
    {19.1167, 19.1172, 19.286, 18.9669, 19.1198, 18.6396, 18.4973, 18.9448, 18.9708, 18.3458, 18.4377, 17.9278, 18.3301, 19.6231, 19.1867, 19.0734, 19.1304, 18.6843, 18.7502, 18.9822, 18.7113, 18.9523, 18.1198, 18.5638, 18.1078, 17.8885, 17.9659, 16.6333, 15.614, 12.1879, 14.6052, 16.181, 16.6616, 16.0846, 16.7279, 17.3604, 16.4479, 16.2404, 15.6615, 15.8759, 15.7255, 15.1258, 15.0434, 14.3791, 14.2026, 13.6396, 12.8426, 12.6552, 11.2295, 11.7883, 10.1417},
    // 30
    {28.9749, 28.5726, 29.172, 29.4858, 29.6026, 28.5177, 29.0576, 28.3767, 28.5346, 28.6647, 28.4945, 28.2276, 28.2084, 28.6309, 30.2471, 29.0976, 29.0621, 29.2827, 28.9496, 29.2011, 28.8115, 28.7003, 28.5203, 28.1136, 28.412, 27.6112, 27.7741, 26.0693, 24.8016, 19.0662, 23.2434, 25.8155, 26.4278, 26.9853, 26.089, 26.0745, 25.8231, 25.1559, 24.992, 25.1553, 24.5522, 24.0027, 23.9581, 23.2477, 22.507, 22.1746, 21.6159, 21.2836, 18.4349, 19.1561, 17.5485},
    // 50
    {48.7874, 48.1071, 48.4495, 49.4601, 49.1021, 48.5374, 48.9075, 48.4611, 48.3038, 48.5488, 47.4558, 47.2834, 47.122, 51.2157, 49.7897, 48.7864, 48.4591, 49.6476, 48.5436, 48.9401, 48.653, 48.1094, 47.3705, 47.9376, 47.3971, 47.0711, 45.8921, 44.158, 41.5615, 33.0918, 41.7188, 45.4356, 46.5445, 46.6267, 46.7933, 47.2467, 45.8736, 45.6788, 44.515, 44.6325, 43.3669, 43.4235, 43.2972, 42.6776, 41.5965, 39.5964, 39.752, 38.4141, 36.3177, 36.0982, 33.4089},
    // 100
    {98.1442, 97.8033, 97.4476, 98.8587, 99.309, 97.7537, 98.2409, 97.3532, 97.7625, 97.193, 96.887, 95.3895, 97.465, 100.999, 101.174, 98.589, 98.7491, 97.5652, 98.3535, 97.7735, 98.2814, 98.2271, 97.0003, 95.9617, 95.6252, 95.5939, 92.8623, 89.5072, 84.8809, 69.9022, 89.8172, 95.5743, 97.8843, 98.7436, 99.6861, 99.1151, 98.3366, 97.9507, 97.6038, 96.4471, 94.0358, 93.0037, 92.9773, 91.2049, 88.1207, 87.4069, 84.2282, 83.8522, 81.8764, 78.9989, 70.298},
    // 150 
    {147.203, 146.956, 149.324, 148.346, 147.17, 146.798, 147.541, 146.59, 146.661, 143.988, 144.108, 143.151, 145.65, 151.785, 149.991, 146.177, 148.883, 146.917, 148.254, 146.948, 147.936, 147.766, 146.004, 146.068, 143.403, 144.279, 140.408, 136.858, 130.549, 107.279, 134.718, 145.068, 148.213, 150.13, 150.987, 151.286, 150.791, 149.995, 148.368, 147.577, 145.48, 142.34, 143.454, 138.375, 135.837, 132.561, 129.091, 128.208, 126.132, 119.948, 111.099},
    // 225 
    {224.229, 224.043, 220.105, 222.924, 223.355, 222.03, 221.909, 222.766, 219.544, 221.056, 216.508, 216.161, 222.002, 233.047, 226.028, 220.528, 222.104, 223.327, 221.452, 222.739, 222.681, 222.698, 222.379, 219.474, 217.868, 217.092, 212.225, 206.507, 194.671, 164.038, 209.773, 219.534, 228.108, 229.749, 228.067, 226.528, 230.235, 228.524, 225.871, 225.174, 219.457, 217.595, 216.638, 212.493, 208.688, 204.828, 201.991, 196.901, 194.538, 184.078, 169.081},
    // 300 
    {301.394, 299.771, 301.235, 301.02, 300.507, 298.555, 297.249, 292.877, 296.764, 296.562, 295.809, 291.398, 292.9, 316.596, 302.764, 298.404, 295.682, 295.77, 293.368, 296.398, 295.075, 294.662, 295.356, 292.611, 287.658, 290.223, 284.301, 275.682, 263.832, 219.641, 283.083, 296.316, 307.189, 307.943, 310.223, 310.02, 314.238, 309.12, 306.579, 303.694, 300.318, 298.695, 293.55, 289.409, 284.556, 277.424, 271.741, 269.034, 265.426, 253.705, 232.875},
    // 1000 
    {1003.07, 999.293, 998.375, 1004.44, 1002.26, 998.555, 979.203, 978.408, 973.797, 978.299, 958.427, 941.507, 958.405, 1021.84, 1007.45, 979.226, 994.857, 989.671, 990.326, 984.519, 994.589, 991.448, 990.205, 984.08, 976.489, 978.4, 955.416, 929.705, 900.975, 788.13, 986.688, 1029.66, 1069.04, 1068.39, 1081.64, 1080.06, 1086.39, 1074.79, 1082.87, 1064.78, 1057.94, 1045.98, 1031.85, 1022.71, 992.495, 981.055, 966.408, 949.906, 943.805, 881.26, 833.582},
    // 3000
    {2814.24, 2818.89, 2811.41, 2769.88, 2814.53, 2784.61, 2834.7, 2852.19, 2859.22, 2878.11, 2855.71, 2849.99, 2816.53, 2806.13, 2820.78, 2858.65, 2896.53, 2877.99, 2875.06, 2871.91, 2877.39, 2870.12, 2863.07, 2846.81, 2839.81, 2849.02, 2810.73, 2723.37, 2663.06, 2302.37, 3036.7, 3122.08, 3229.64, 3274.97, 3302.15, 3318.3, 3300.48, 3302.31, 3278.61, 3254.56, 3220.55, 3191.32, 3160.05, 3123.17, 3053.1, 3005.8, 2934.83, 2866.33, 2798.92, 2662.28, 2497.03}

  };


  double _meanHD_nomip[maxHDe][maxHDeta] = {

    // 1 
    {0.538035, 0.380346, 0.502414, 0.474803, 0.463365, 0.546573, 0.612518, 0.461013, 0.611347, 0.536771, 0.407523, 0.480637, 0.589332, 0.3402, 0.237015, 0.380297, 0.577407, 0.576915, 0.349076, 0.310323, -0.0509831, 0.202025, 0.701234, 0.213346, 0.65973, 0.0614016, 0.345311, 0.671091, 0.496759, 0.652966, 0.336046, 0.886645, 0.471441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 2
    {1.31187, 1.15209, 1.25928, 1.37094, 1.11478, 1.24876, 1.09264, 1.26967, 1.21653, 1.05327, 1.18939, 1.20603, 1.29638, 1.08811, 1.37928, 1.10916, 1.1724, 1.27499, 1.47554, 1.14582, 0.945006, 1.0752, 1.14979, 0.824152, 0.969066, 0.768981, 0.844886, 0.859602, 1.05618, 0.622927, 0.956376, 0.910133, -3.17789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 3 
    {1.76283, 2.04742, 1.90964, 1.98401, 1.81918, 1.7511, 1.8688, 1.91406, 1.74089, 1.8593, 1.86467, 1.71051, 1.82464, 1.88763, 1.78568, 2.02434, 1.96735, 1.82166, 1.76662, 1.73633, 1.46003, 1.70062, 1.46702, 1.67231, 1.2741, 1.16183, 1.45725, 1.60227, 1.26306, 0.800212, 0.548262, 0.854848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 5 
    {3.25403, 3.39252, 3.29012, 3.38248, 3.41375, 3.30431, 3.32948, 3.15393, 3.31146, 3.14037, 3.15738, 2.89084, 2.92799, 3.02174, 2.97057, 3.44817, 3.17555, 2.96205, 2.95103, 2.71578, 2.65455, 2.58593, 2.59574, 2.58151, 2.38628, 2.32248, 2.55864, 2.39301, 2.17953, 1.86248, 1.46207, 1.87986, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 9 
    {6.66052, 6.32375, 6.46965, 6.44203, 6.32701, 6.34328, 6.34491, 6.26752, 6.3171, 6.13838, 6.18042, 5.84043, 5.77492, 5.89014, 5.71905, 6.41413, 6.27692, 5.71089, 5.62836, 5.72954, 5.56298, 5.13405, 5.27806, 5.1817, 4.8646, 4.7633, 4.69759, 4.79047, 4.23171, 3.24406, 2.64129, 1.48333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 15 
    {11.5267, 11.5275, 11.5939, 11.6157, 11.6608, 11.5146, 11.1743, 11.3789, 10.9857, 10.8249, 10.9503, 10.4856, 10.6288, 10.5684, 10.5441, 11.9903, 11.3749, 10.6982, 10.5491, 10.4975, 10.3165, 10.13, 10.1151, 9.60929, 9.60629, 9.42971, 8.99902, 8.7732, 7.91507, 5.95748, 5.37731, 4.42891, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 20
    {16.4108, 16.1001, 16.2784, 16.5151, 16.4263, 16.0978, 15.7983, 15.8776, 15.8171, 15.4325, 15.3691, 14.8097, 14.8394, 14.8536, 14.9256, 16.4697, 15.9176, 15.4887, 15.3125, 15.1783, 15.0219, 14.5696, 14.1231, 14.0434, 13.8381, 13.713, 13.1931, 13.1034, 11.4965, 8.8448, 6.70916, 4.38266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 30
    {25.5365, 25.6331, 25.2689, 25.7105, 25.4534, 25.3369, 25.0056, 25.0437, 24.6447, 24.4564, 24.3698, 23.4038, 23.5035, 24.0512, 24.1803, 25.9993, 25.4781, 24.5336, 24.3231, 23.8557, 23.8954, 23.5883, 23.2132, 22.7173, 22.4483, 21.9378, 21.4239, 21.4063, 19.4302, 15.1999, 12.1803, 12.7179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 50
    {43.6082, 43.2859, 43.5543, 43.7581, 43.2892, 42.665, 42.7535, 42.5985, 41.823, 42.0454, 41.5345, 40.2785, 40.3667, 41.2179, 41.2877, 44.5395, 43.2688, 42.2997, 41.9365, 41.8111, 41.4475, 40.5245, 40.2431, 39.8221, 39.2722, 38.3172, 37.7767, 37.2045, 33.9799, 27.3247, 21.653, 19.7784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 100
    {89.6457, 89.2045, 88.9257, 90.3777, 88.8238, 88.0398, 88.5256, 87.8205, 86.6693, 86.3962, 85.9306, 83.5703, 84.054, 85.1409, 86.0575, 91.9994, 90.0152, 88.3933, 87.4175, 86.7935, 85.9223, 84.8021, 84.3199, 83.2051, 82.2645, 81.4098, 79.8567, 79.2858, 73.4298, 61.6089, 56.7125, 50.2075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 150 
    {135.592, 134.999, 136.288, 135.588, 134.585, 134.194, 132.704, 133.445, 132.067, 131.135, 130.598, 128.281, 128.079, 129.792, 130.654, 139.978, 137, 134.32, 134.014, 133.403, 132.114, 130.32, 130.261, 128.019, 127.189, 125.742, 123.715, 121.009, 113.176, 94.4467, 94.7822, 97.0659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 225 
    {205.592, 203.502, 204.61, 205.399, 205.599, 203.664, 202.814, 201.351, 199.485, 199.466, 197.502, 194.228, 194.506, 195.902, 197.194, 212.282, 208.354, 205.311, 203.11, 203.268, 202.374, 198.863, 198.434, 195.344, 195.098, 192.408, 187.982, 187.202, 175.03, 148.03, 147.666, 181.691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
    // 300 
    {276.262, 273.28, 274.689, 276.186, 273.902, 271.735, 270.656, 271.094, 268.774, 267.281, 264.614, 261.285, 259.014, 264.033, 265.301, 284.45, 279.862, 275.308, 272.565, 273.018, 271.529, 268.402, 267.81, 264.43, 262.264, 260.079, 255.824, 250.103, 235.431, 202.416, 213.619, 229.86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 1000 
    {920.885, 919.367, 919.677, 919.82, 916.141, 913.914, 903.201, 904.213, 897.768, 893.266, 892.848, 878.024, 870.951, 885.334, 902.636, 958.534, 948.168, 930.635, 919.911, 926.424, 919.985, 916.535, 912.798, 903.747, 900.96, 899.07, 883.885, 868.323, 827.483, 724.471, 825.028, 817.925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 3000
    {2748.63, 2742.59, 2751.1, 2745.87, 2747.05, 2733.63, 2733.25, 2739.41, 2725.2, 2714.84, 2698.01, 2663.16, 2655.27, 2676.47, 2689.86, 2871.04, 2844.13, 2824.38, 2801.95, 2807.07, 2797.07, 2782.14, 2765.89, 2748.2, 2740.18, 2732.74, 2692.31, 2641.15, 2527.92, 2250.5, 2651.6, 2966.71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

  };

  // ---------------------------------------   SIGMAS (from RMS)
  // ------------------------------------------------------------------------- 

  double _sigmaHD[maxHDe][maxHDeta] = {

    // 1 
    {0.654243, 0.54759, 0.554919, 0.540598, 0.614809, 0.541676, 0.51995, 0.528313, 0.524612, 0.451454, 0.539606, 0.496828, 0.521872, 0.553163, 0.53043, 0.681183, 0.642071, 0.633848, 0.641433, 0.52785, 0.635601, 0.689876, 0.556327, 0.654269, 0.699126, 0.597849, 0.620694, 0.576555, 0.74591, 0.953982, 1.18004, 1.27418, 0.990666, 1.05536, 1.02326, 1.1367, 1.01794, 1.01225, 1.08847, 1.07718, 1.02113, 1.01568, 0.977003, 1.00096, 1.08425, 1.02849, 1.10268, 0.837944, 0, 1.09619, 1.03152},
    // 2
    {1.04849, 0.95042, 1.07076, 0.938815, 0.958506, 0.901895, 0.934511, 0.909165, 0.877238, 0.947066, 0.800055, 0.863728, 0.851536, 0.897028, 1.08678, 1.1785, 0.9976, 1.10224, 1.0848, 1.13915, 1.066, 1.10804, 1.26671, 1.15587, 1.13133, 1.20492, 1.22911, 1.23427, 1.0922, 1.42662, 1.95473, 1.96945, 1.88187, 2.02005, 1.93721, 1.94036, 1.92859, 1.7827, 1.85167, 1.89864, 1.77171, 1.80239, 1.92528, 1.75196, 2.05081, 2.02081, 1.79087, 1.9192, 1.58171, 1.85944, 2.02791},
    // 3 
    {1.4294, 1.2456, 1.20707, 1.14556, 1.25742, 1.2199, 1.16569, 1.19243, 1.15026, 1.12949, 1.05493, 1.16273, 1.03159, 1.18381, 1.33897, 1.52733, 1.48233, 1.41865, 1.27196, 1.50468, 1.5215, 1.50577, 1.56971, 1.48321, 1.54208, 1.54648, 1.43802, 1.50561, 1.48878, 1.75328, 2.6017, 2.50123, 2.45695, 2.47525, 2.52202, 2.57096, 2.58251, 2.59535, 2.61837, 2.64694, 2.52185, 2.58304, 2.57567, 2.59575, 2.58563, 2.50564, 2.7245, 2.5858, 2.17512, 2.15902, 2.41278},
    // 5 
    {1.81831, 1.81742, 1.75487, 1.72162, 1.64749, 1.5866, 1.69199, 1.63862, 1.68482, 1.58405, 1.70946, 1.63601, 1.57029, 1.69973, 1.91585, 2.18734, 1.84282, 2.02572, 1.93117, 2.02463, 1.92167, 2.23995, 2.19176, 2.14821, 2.04342, 2.05693, 1.88699, 2.2405, 2.33248, 2.23391, 3.21682, 3.70269, 3.708, 3.59491, 3.9369, 3.95298, 3.75865, 3.49118, 3.5627, 3.66728, 3.63721, 3.62393, 3.6652, 3.4398, 3.57089, 3.78434, 3.26152, 3.2083, 3.40895, 3.32569, 2.98498},
    // 9 
    {2.52668, 2.44778, 2.44177, 2.42032, 2.53905, 2.38791, 2.52553, 2.50969, 2.60929, 2.42961, 2.31846, 2.48905, 2.27869, 2.433, 3.00791, 2.8618, 3.11658, 2.97914, 2.77078, 2.88684, 3.02479, 2.86153, 3.06224, 2.99113, 2.90642, 2.92377, 2.77296, 2.9994, 2.68947, 3.15869, 5.20636, 5.38235, 5.73539, 5.53785, 5.5623, 5.19174, 5.54152, 5.43156, 5.26755, 5.31479, 5.28972, 5.41666, 5.12447, 5.22247, 5.38052, 5.11109, 5.093, 5.33558, 5.1815, 4.93659, 4.65727},
    // 15 
    {3.14832, 3.05504, 3.14571, 3.00289, 3.1173, 2.99701, 3.03887, 3.21416, 3.10122, 3.20582, 2.97096, 3.19932, 3.4257, 3.47036, 3.59931, 3.74147, 3.43376, 3.52894, 3.45358, 3.81862, 3.61217, 3.62717, 3.6696, 3.48641, 3.81029, 3.66759, 3.73557, 3.58479, 3.69214, 4.24557, 7.25288, 7.6224, 7.8853, 7.97948, 7.99384, 7.70162, 7.71505, 7.49541, 7.87982, 7.51382, 7.56649, 7.83046, 7.87266, 7.44729, 7.56599, 7.22515, 7.51595, 7.02557, 6.70885, 7.1887, 6.8927},
    // 20
    {3.65942, 3.71614, 3.74617, 3.66571, 3.74753, 3.5772, 3.60349, 3.60986, 3.81491, 3.65451, 3.79229, 3.85787, 3.9636, 4.21572, 4.70849, 4.34, 4.12324, 4.1588, 4.16405, 4.24259, 4.27687, 4.39028, 4.6248, 4.25679, 4.39827, 4.60956, 4.49145, 4.323, 4.61318, 5.35888, 8.80925, 8.93697, 9.09177, 8.72766, 9.29694, 9.49524, 9.20403, 9.03093, 9.46118, 9.54883, 9.31422, 9.28219, 8.88813, 8.65058, 8.74377, 8.67198, 8.17223, 8.07636, 8.47314, 8.28788, 7.30018},
    // 30
    {4.48183, 4.58054, 4.56734, 4.79134, 4.64243, 4.53877, 4.78416, 4.53241, 4.8177, 4.99135, 4.89975, 5.13506, 5.12159, 5.49841, 5.88801, 5.0184, 5.20165, 5.23251, 5.38127, 5.15948, 5.43023, 5.36552, 5.45139, 5.58202, 5.45562, 5.48219, 5.63453, 5.42961, 5.73878, 6.50813, 11.5501, 11.3124, 11.4657, 11.7336, 11.5705, 11.169, 10.9813, 11.3242, 11.1847, 11.2608, 11.0911, 10.8234, 11.236, 10.5069, 11.0018, 10.899, 11.0764, 10.8729, 10.1028, 10.1989, 10.1941},
    // 50
    {6.2121, 6.1742, 6.34747, 6.37806, 6.34637, 6.28515, 6.47774, 6.61278, 6.86245, 7.15145, 7.04701, 7.27502, 7.36053, 8.27777, 8.29453, 6.68087, 6.65543, 7.71098, 7.12222, 7.1565, 7.09359, 7.41065, 7.23412, 7.52493, 7.27621, 7.91761, 7.66554, 7.47463, 8.03413, 9.70782, 18.1241, 16.483, 17.1813, 17.3658, 17.4841, 18.6194, 17.5862, 17.7405, 16.9355, 17.501, 17.0814, 16.8238, 17.2449, 17.2871, 17.4992, 16.3745, 16.5136, 16.7275, 16.5255, 16.8767, 16.1624},
    // 100
    {9.47186, 10.2362, 9.56713, 9.21796, 9.9144, 9.91375, 10.3168, 10.1675, 10.9019, 11.1353, 11.4252, 12.3321, 12.45, 13.5292, 13.8654, 9.52318, 9.95835, 10.1922, 11.2597, 10.6527, 11.2355, 11.4173, 11.4988, 11.2949, 11.8111, 11.9417, 11.5431, 11.3764, 12.4696, 16.1244, 29.5567, 27.3882, 28.588, 29.1074, 28.3109, 27.8629, 28.8158, 28.7806, 28.7331, 28.9457, 28.6342, 27.3588, 28.3431, 27.7969, 28.256, 28.8408, 28.486, 27.1806, 29.2728, 27.7144, 26.7184},
    // 150 
    {12.4276, 13.5292, 13.5804, 12.6999, 12.9549, 13.5128, 14.2977, 13.6446, 14.4192, 14.53, 14.7085, 16.5145, 16.4166, 18.2974, 16.6537, 11.4149, 12.5243, 13.443, 13.6957, 13.0088, 13.632, 14.3784, 14.4194, 15.1285, 13.8689, 15.6477, 15.171, 15.3448, 17.2841, 22.2132, 39.9953, 35.4014, 37.6362, 36.8467, 37.3134, 38.101, 38.6699, 38.8439, 38.1075, 37.8466, 37.6496, 37.2975, 38.6973, 39.1277, 38.0919, 37.2578, 37.0307, 37.5844, 37.2306, 35.9936, 36.708},
    // 225 
    {17.6391, 18.4868, 17.3573, 16.4683, 16.2583, 17.9271, 18.8133, 18.1503, 19.8413, 20.3529, 21.1942, 22.3488, 22.9126, 25.649, 25.5353, 15.1312, 15.0908, 17.571, 18.0511, 16.8729, 17.395, 18.3989, 18.7657, 19.0412, 18.7768, 20.1612, 21.1617, 19.3891, 21.7359, 32.3984, 49.1524, 44.9927, 44.7472, 47.214, 46.1513, 46.044, 46.8023, 46.4742, 47.7225, 46.3888, 45.4054, 45.2045, 45.7073, 45.7436, 46.683, 47.4651, 44.7381, 44.5912, 48.9839, 44.0898, 43.3713},
    // 300 
    {20.4991, 26.3044, 22.8877, 20.9287, 22.0241, 23.2163, 23.1972, 21.6865, 23.8184, 24.655, 27.6292, 28.457, 30.6513, 37.2257, 32.9059, 17.475, 16.8226, 19.8153, 21.1167, 20.2592, 21.1095, 21.8057, 22.2603, 22.6789, 24.3058, 24.5198, 23.4713, 25.9872, 27.2996, 39.2299, 58.8975, 52.6489, 51.4979, 52.7112, 52.3372, 54.8999, 54.1426, 52.5347, 54.1224, 54.0766, 53.6057, 52.9367, 54.6645, 55.8427, 51.8527, 52.8579, 53.6665, 53.8615, 57.953, 51.8215, 50.002},
    // 1000 
    {76.8692, 72.894, 65.4229, 71.375, 65.7604, 64.1007, 72.4559, 65.5679, 77.6797, 70.0211, 80.8702, 78.6715, 83.8302, 96.6057, 93.2839, 55.4212, 59.688, 63.2679, 59.6005, 45.0842, 48.1845, 49.4618, 52.4163, 56.1897, 52.4311, 57.0064, 55.6159, 54.6314, 65.0613, 130.91, 165.476, 160.834, 170.718, 167.347, 170.811, 164.406, 166.097, 162.292, 170.88, 169.925, 164.988, 170.948, 174.354, 170.179, 174.459, 173.268, 175.867, 177.236, 178.42, 179.31, 183.959},
    // 3000
    {213.071, 209.01, 202.003, 220.047, 206.91, 210.66, 187.343, 179.07, 193.637, 187.63, 206.509, 215.351, 223.517, 262.794, 264.415, 108.394, 98.3669, 127.004, 135.795, 107.451, 118.536, 129.427, 135.41, 130.023, 125.538, 149.714, 137.456, 133.275, 156.462, 321.834, 323.063, 307.204, 324.542, 306.463, 317.174, 324.326, 330.111, 321.972, 334.589, 340.288, 339.401, 342.602, 345.941, 337.956, 357.865, 331.336, 339.223, 352.806, 347.789, 357.553, 350.867}
  };


  double _sigmaHD_mip[maxHDe][maxHDeta] = {

    // 1 
    {0.726138, 0.606843, 0.609745, 0.590281, 0.680991, 0.590601, 0.571659, 0.593314, 0.581745, 0.494778, 0.598463, 0.548825, 0.580369, 0.603817, 0.552516, 0.700541, 0.662277, 0.649192, 0.656628, 0.532553, 0.644946, 0.694764, 0.561231, 0.65879, 0.705496, 0.589957, 0.624619, 0.581866, 0.754053, 0.962787, 1.182, 1.27418, 0.990666, 1.05536, 1.02326, 1.1367, 1.01794, 1.01225, 1.08847, 1.07718, 1.02113, 1.01568, 0.977003, 1.00096, 1.08425, 1.02849, 1.10268, 0.837944, 0, 1.09619, 1.03152},
    // 2
    {1.26665, 1.14514, 1.32436, 1.14718, 1.1652, 1.06516, 1.18738, 1.13125, 1.11887, 1.16329, 0.983976, 1.1278, 1.06695, 1.23121, 1.26499, 1.33537, 1.1389, 1.25225, 1.21155, 1.2503, 1.1477, 1.20299, 1.27943, 1.2334, 1.174, 1.28106, 1.29091, 1.30902, 1.12832, 1.45286, 1.9583, 1.96945, 1.88187, 2.02005, 1.93721, 1.94036, 1.92859, 1.7827, 1.85167, 1.89864, 1.77171, 1.80239, 1.92528, 1.75196, 2.05081, 2.02081, 1.79087, 1.9192, 1.58171, 1.85944, 2.02791},
    // 3 
    {1.76565, 1.48257, 1.40457, 1.33341, 1.50712, 1.47268, 1.37172, 1.49195, 1.50123, 1.36156, 1.34367, 1.35746, 1.2792, 1.4677, 1.67986, 1.79449, 1.80841, 1.63634, 1.50944, 1.7525, 1.79757, 1.70692, 1.73941, 1.62181, 1.71103, 1.66543, 1.56833, 1.64141, 1.62448, 1.79835, 2.60384, 2.50123, 2.45695, 2.47525, 2.52202, 2.57096, 2.58251, 2.59535, 2.61837, 2.64694, 2.52185, 2.58304, 2.57567, 2.59575, 2.58563, 2.50564, 2.7245, 2.5858, 2.17512, 2.15902, 2.41278},
    // 5 
    {2.13897, 2.17439, 2.09798, 2.00055, 1.90815, 1.87392, 2.02572, 2.03359, 2.07205, 1.94283, 2.15733, 1.96784, 2.04426, 2.24208, 2.39818, 2.5643, 2.16222, 2.41454, 2.25228, 2.36592, 2.23594, 2.72316, 2.53867, 2.4222, 2.283, 2.26317, 2.15004, 2.47632, 2.66362, 2.35903, 3.22988, 3.70269, 3.708, 3.59491, 3.9369, 3.95298, 3.75865, 3.49118, 3.5627, 3.66728, 3.63721, 3.62393, 3.6652, 3.4398, 3.57089, 3.78434, 3.26152, 3.2083, 3.40895, 3.32569, 2.98498},
    // 9 
    {2.72321, 2.77203, 2.57304, 2.66525, 2.84513, 2.64469, 2.98115, 2.89133, 3.14374, 2.86366, 2.77452, 2.89181, 2.5313, 2.88834, 3.22573, 3.00814, 3.60749, 3.36813, 2.96722, 3.27775, 3.45248, 3.02828, 3.49416, 3.10162, 3.14364, 3.13388, 3.0518, 3.283, 2.95514, 3.39547, 5.24004, 5.38197, 5.73539, 5.53785, 5.5623, 5.19174, 5.54152, 5.43156, 5.26755, 5.31479, 5.28972, 5.41666, 5.12447, 5.22247, 5.38052, 5.11109, 5.093, 5.33558, 5.1815, 4.93659, 4.65727},
    // 15 
    {3.40577, 3.21705, 3.61672, 3.22548, 3.25841, 3.17806, 3.42777, 3.65423, 3.42134, 3.41287, 2.98251, 3.54689, 3.9228, 4.00323, 4.05739, 3.87708, 3.74517, 3.78553, 3.82884, 4.06609, 3.85715, 3.71809, 3.75815, 3.59145, 4.0311, 3.94035, 3.86857, 3.7066, 3.84449, 4.54871, 7.30297, 7.61376, 7.8853, 7.97948, 7.99384, 7.70162, 7.71505, 7.49541, 7.87982, 7.51382, 7.56649, 7.83046, 7.87266, 7.44729, 7.56599, 7.22515, 7.51595, 7.02557, 6.70885, 7.1887, 6.8927},
    // 20
    {3.85932, 4.21247, 3.96252, 3.78676, 3.9639, 3.8895, 3.86129, 3.75728, 3.9122, 3.69085, 4.12874, 4.01927, 4.68508, 4.78171, 4.86119, 4.63851, 4.52335, 4.42512, 4.53993, 4.21258, 4.4623, 4.32235, 4.68967, 4.2494, 4.44706, 4.6705, 4.50057, 4.33045, 4.80956, 5.74826, 8.83168, 8.92139, 9.09177, 8.72766, 9.29694, 9.49524, 9.20403, 9.03093, 9.46118, 9.54883, 9.31422, 9.28219, 8.88813, 8.65058, 8.74377, 8.67198, 8.17223, 8.07636, 8.47314, 8.28788, 7.30018},
    // 30
    {4.62986, 4.72569, 4.50718, 5.0973, 4.96277, 4.52224, 4.81016, 4.76865, 5.04285, 5.12472, 5.03809, 5.28763, 5.67856, 6.16948, 5.5554, 4.98644, 5.64655, 5.16931, 5.39158, 5.14164, 5.0178, 5.11762, 5.19113, 5.52529, 4.99832, 5.46049, 5.203, 5.32034, 5.43115, 6.86722, 11.4765, 11.2819, 11.4657, 11.7336, 11.5705, 11.169, 10.9813, 11.3242, 11.1847, 11.2608, 11.0911, 10.8234, 11.236, 10.5069, 11.0018, 10.899, 11.0764, 10.8729, 10.1028, 10.1989, 10.1941},
    // 50
    {6.29826, 6.33234, 5.94593, 6.32841, 5.97286, 6.13765, 6.28593, 6.70057, 6.85038, 6.76979, 6.64328, 6.93836, 7.95126, 8.32031, 7.4751, 6.59424, 6.77376, 7.37931, 6.42456, 6.9036, 6.47467, 6.37218, 6.55568, 6.73402, 6.66384, 7.04671, 6.77803, 6.67119, 7.44412, 10.3416, 17.8305, 16.3546, 17.1813, 17.3658, 17.4841, 18.6194, 17.5862, 17.7405, 16.9355, 17.501, 17.0814, 16.8238, 17.2449, 17.2871, 17.4992, 16.3745, 16.5136, 16.7275, 16.5255, 16.8767, 16.1624},
    // 100
    {8.7221, 9.21099, 9.75916, 8.5584, 9.78641, 9.40806, 9.75344, 9.78962, 9.99414, 10.0105, 11.3647, 11.6419, 12.1345, 11.3424, 10.0414, 8.97915, 9.69895, 9.33555, 9.73919, 9.2147, 8.89525, 9.60328, 9.68976, 9.15348, 9.6642, 9.40434, 9.05406, 9.57242, 10.1645, 17.4044, 28.9406, 27.108, 28.588, 29.1074, 28.3109, 27.8629, 28.8158, 28.7806, 28.7331, 28.9457, 28.6342, 27.3588, 28.3431, 27.7969, 28.256, 28.8408, 28.486, 27.1806, 29.2728, 27.7144, 26.7184},
    // 150 
    {12.0432, 11.3025, 11.4065, 11.673, 11.9818, 12.0084, 10.4297, 13.8448, 12.8515, 14.33, 13.5828, 16.3788, 18.5152, 18.1639, 12.4814, 10.9913, 10.8769, 11.2605, 11.1472, 10.2735, 11.0674, 10.9639, 11.7156, 11.8188, 10.5128, 12.6841, 12.1581, 13.1062, 13.8433, 23.9359, 39.3712, 35.0411, 37.6362, 36.8467, 37.3134, 38.101, 38.6699, 38.8439, 38.1075, 37.8466, 37.6496, 37.2975, 38.6973, 39.1277, 38.0919, 37.2578, 37.0307, 37.5844, 37.2306, 35.9936, 36.708},
    // 225 
    {13.8641, 15.542, 15.1054, 14.9161, 15.1604, 18.0233, 16.9022, 15.1899, 18.3394, 16.0125, 19.5938, 20.6606, 19.3887, 30.5977, 15.7143, 14.2806, 12.6543, 15.5073, 13.4936, 13.2129, 13.5063, 13.3172, 13.7496, 13.7341, 13.908, 13.9222, 17.9723, 14.4024, 19.2603, 36.4234, 46.9016, 44.8268, 44.7472, 47.214, 46.1513, 46.044, 46.8023, 46.4742, 47.7225, 46.3888, 45.4054, 45.2045, 45.7073, 45.7436, 46.683, 47.4651, 44.7381, 44.5912, 48.9839, 44.0898, 43.3713},
    // 300 
    {16.9944, 18.9205, 20.8001, 17.8224, 19.3021, 16.7482, 21.1001, 18.0842, 20.5991, 19.8241, 24.8666, 26.4907, 32.3758, 30.6717, 20.8016, 15.1935, 14.7758, 15.0471, 15.1962, 16.2268, 15.0031, 15.3989, 15.9812, 16.3309, 24.8515, 17.9795, 16.2584, 23.4372, 21.5472, 44.4881, 56.4241, 52.3563, 51.4979, 52.7112, 52.3372, 54.8999, 54.1426, 52.5347, 54.1224, 54.0766, 53.6057, 52.9367, 54.6645, 55.8427, 51.8527, 52.8579, 53.6665, 53.8615, 57.953, 51.8215, 50.002},
    // 1000 
    {59.0244, 63.6645, 62.6869, 70.7556, 67.7925, 72.2779, 55.8689, 58.9518, 60.2247, 58.3482, 71.5504, 83.0422, 80.3075, 94.9576, 41.5711, 30.6758, 35.3841, 31.4403, 32.1144, 33.5467, 30.1252, 29.5774, 32.7844, 30.9231, 29.7836, 33.3183, 38.1399, 39.2919, 48.5019, 153.296, 164.454, 160.703, 170.718, 167.347, 170.811, 164.406, 166.097, 162.292, 170.88, 169.925, 164.988, 170.948, 174.354, 170.179, 174.459, 173.268, 175.867, 177.236, 178.42, 179.31, 183.959},
    // 3000
    {283.151, 255.142, 273.786, 297.296, 292.621, 301.363, 242.577, 243.369, 234.127, 240.297, 240.279, 204.427, 232.687, 349.512, 269.475, 143.788, 123.22, 130.551, 133.728, 122.405, 154.145, 163.873, 191.197, 159.676, 142.329, 198.347, 143.764, 157.205, 129.523, 404.048, 313.681, 307.322, 324.542, 306.463, 317.174, 324.326, 330.111, 321.972, 334.589, 340.288, 339.401, 342.602, 345.941, 337.956, 357.865, 331.336, 339.223, 352.806, 347.789, 357.553, 350.867}

  };



  double _sigmaHD_nomip[maxHDe][maxHDeta] = {

    // 1 
    {0.425279, 0.339273, 0.389316, 0.409793, 0.386133, 0.39614, 0.37742, 0.304747, 0.311317, 0.310081, 0.291173, 0.29778, 0.325339, 0.291068, 0.313641, 0.257993, 0.22569, 0.154834, 0.167121, 0.171794, 0.13655, 0.135869, 0.271888, 0.280532, 0.298494, 0.855501, 0.218673, 0.187485, 0.366677, 0.108571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 2
    {0.75719, 0.71597, 0.737951, 0.6957, 0.699902, 0.715328, 0.655913, 0.621224, 0.626306, 0.719005, 0.610581, 0.563811, 0.596934, 0.558679, 0.636214, 0.619313, 0.650394, 0.667241, 0.686055, 0.7966, 0.695469, 0.664227, 1.19689, 0.607486, 0.855758, 0.634348, 0.509801, 0.608603, 0.773866, 0.397242, 0.447583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 3 
    {1.0093, 0.976643, 0.982287, 0.922133, 0.975993, 0.936507, 0.916898, 0.893869, 0.846689, 0.920078, 0.806065, 0.989527, 0.830185, 0.944449, 0.776194, 0.981227, 1.00997, 1.07422, 0.813579, 0.881027, 0.867415, 0.936386, 1.00341, 1.04398, 0.785985, 1.07454, 0.714963, 1.01231, 0.798676, 0.899543, 1.94893, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 5 
    { 1.41022, 1.40199, 1.30995, 1.3703, 1.30774, 1.25226, 1.3549, 1.18622, 1.32315, 1.17598, 1.33558, 1.34884, 1.14969, 1.2871, 1.25497, 1.64569, 1.45693, 1.52425, 1.44791, 1.43443, 1.25058, 1.1704, 1.55611, 1.60772, 1.47771, 1.49061, 1.21322, 1.57805, 1.32767, 1.24772, 1.01461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 9 
    {2.1282, 2.00456, 2.00904, 1.99597, 2.01448, 1.94432, 2.05738, 1.94753, 2.00776, 1.87321, 1.95674, 2.03121, 1.93692, 1.99244, 2.29846, 2.4523, 2.38904, 2.27696, 2.31332, 2.31142, 2.12105, 2.19571, 2.1931, 2.48426, 2.13065, 2.28861, 1.95762, 2.16347, 2.00876, 1.93497, 2.41443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 15 
    {2.61598, 2.70499, 2.65084, 2.65553, 2.83135, 2.67948, 2.58397, 2.64841, 2.59011, 2.84365, 2.69072, 2.76119, 3.05387, 2.82506, 2.75112, 3.41642, 2.91361, 3.02394, 2.90582, 3.06331, 3.01564, 3.02435, 3.16734, 2.77598, 3.1145, 2.92145, 3.09567, 3.00313, 3.05968, 3.16881, 3.17696, 2.72369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 20
    {3.17133, 3.06967, 3.19656, 3.29202, 3.31358, 3.14671, 3.163, 3.1411, 3.3873, 3.33715, 3.28855, 3.41333, 3.37018, 3.49255, 3.96126, 3.71765, 3.42684, 3.55911, 3.52645, 3.6549, 3.5134, 3.72378, 3.95295, 3.44384, 3.51834, 3.68805, 3.39884, 3.70982, 3.72924, 4.08001, 3.44122, 2.26957, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
    // 30
    {3.98032, 4.12848, 4.03269, 4.19262, 3.86747, 4.11783, 4.27295, 4.01387, 4.27327, 4.43392, 4.37632, 4.41582, 4.46359, 4.8768, 5.08438, 4.66853, 4.49082, 4.54816, 4.62596, 4.18638, 4.81035, 4.55389, 4.53817, 4.52524, 4.50569, 4.39844, 4.59143, 4.54169, 4.92757, 5.12576, 6.8169, 8.08539, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 50
    {5.50739, 5.57815, 5.93501, 5.7277, 5.66154, 5.61796, 5.77919, 5.71603, 6.05937, 6.43391, 6.4725, 6.4409, 6.52976, 7.14274, 7.17463, 6.20589, 5.86831, 6.70149, 6.40698, 6.0592, 6.14269, 6.45153, 6.18661, 6.30111, 5.93083, 6.32151, 6.26149, 6.66151, 6.84189, 7.78437, 9.99489, 8.08376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 100
    {8.69684, 9.64567, 8.57978, 8.52717, 8.56985, 8.94329, 9.33978, 9.16784, 9.88795, 10.2661, 10.3495, 11.2109, 11.3191, 12.6007, 12.7432, 8.96379, 8.91282, 9.31623, 10.284, 9.49166, 10.0732, 9.57189, 9.84152, 9.88767, 10.1458, 10.1583, 10.0645, 10.643, 11.7393, 12.8119, 18.7507, 23.5734, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 150 
    {11.3527, 12.9622, 12.8083, 11.6895, 11.9984, 12.7244, 13.618, 12.1766, 13.3862, 13.5674, 13.8307, 15.3004, 14.813, 17.1439, 15.2088, 11.0446, 11.5982, 12.5813, 12.6103, 11.9947, 12.0849, 12.4356, 12.8193, 13.0559, 12.1942, 13.2699, 13.3592, 13.6087, 15.9092, 17.556, 28.1058, 31.176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 225 
    {16.7204, 17.1848, 16.7253, 15.2463, 14.7305, 16.516, 17.6545, 16.386, 18.5506, 19.251, 20.1416, 20.8738, 21.5431, 23.4329, 24.1218, 14.7947, 14.373, 15.8937, 17.1008, 15.1155, 15.6658, 15.9474, 16.345, 16.3842, 16.5222, 17.7741, 17.7266, 18.3433, 20.0502, 24.0027, 37.4783, 43.7664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 300 
    {18.8139, 25.4799, 21.262, 19.5607, 20.1308, 22.0406, 21.6825, 20.6939, 22.267, 22.9367, 25.6699, 26.4405, 28.9086, 35.1191, 31.0916, 16.736, 15.7791, 18.8272, 20.3313, 18.2148, 19.724, 19.7957, 19.7784, 20.1637, 20.5624, 21.4588, 20.8648, 23.0802, 25.0646, 30.2594, 48.5815, 29.1331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    // 1000 
    {69.0244, 73.6645, 62.6869, 70.7556, 67.7925, 72.2779, 65.8689, 62.9518, 60.2247, 58.3482, 71.5504, 83.0422, 80.3075, 94.9576, 41.5711, 30.6758, 35.3841, 31.4403, 28.1144, 33.5467, 30.1252, 29.5774, 32.7844, 30.9231, 29.7836, 33.3183, 38.1399, 39.2919, 48.5019, 153.296, 164.454, 160.703, 170.718, 167.347, 170.811, 164.406, 166.097, 162.292, 170.88, 169.925, 164.988, 170.948, 174.354, 170.179, 174.459, 173.268, 175.867, 177.236, 178.42, 179.31, 183.959},
    // 3000
    {174.9, 187.545, 168.146, 184.227, 163.178, 154.515, 162.136, 155.853, 167.044, 175.335, 179.813, 200.312, 212.852, 235.845, 223.548, 185.388, 187.0394, 123.643, 132.309, 98.8791, 100.563, 111.001, 109.645, 110.376, 111.755, 121.66, 121.568, 116.369, 150.191, 218.452, 2747.046, 273.926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

  };



  // e-gamma mean response and sigma in HF 
  double _meanEM[maxEMe][maxEMeta] = 
    { 
      // 10
      {7.8757, 8.54299, 8.31929, 8.73801, 8.49535, 8.7193, 8.40631, 8.29179, 8.40983, 8.10598, 8.45281, 8.21852, 8.32999, 8.00596, 7.80171, 7.79796, 7.65744, 7.34728, 7.71235, 7.79666, 7.02263 },
      // 30
      {25.3453, 27.55, 27.2665, 27.4085, 26.8778, 27.4831, 27.1889, 26.6712, 26.9011, 26.7303, 26.6148, 26.0337, 26.1737, 25.9955, 25.4115, 25.4994, 25.1352, 24.6945, 24.4964, 23.3701, 22.354 },
      // 100
      { 90.7679, 98.4241, 99.1375, 98.121, 97.1997, 97.9898, 97.5763, 96.4063, 95.6132, 95.2455, 95.0654, 93.9277, 94.6812, 92.6419, 92.6798, 89.9094, 89.148, 88.9531, 87.1606, 85.7692, 79.0264 },
      // 300
      {287.124, 313.334, 317.253, 317.406, 314.405, 313.192, 311.142, 312.162, 309.664, 308.535, 305.681, 302.984, 301.737, 299.043, 297.731, 292.476, 290.687, 283.472, 280.144, 277.89, 259.707 },
      // 1000
      {1037.98, 1156.5, 1167.59, 1155.32, 1157.02, 1160.62, 1142.1, 1137.42, 1135.19, 1137.04, 1130, 1117.67, 1109.17, 1094.39, 1092.35, 1085.32, 1055.6, 1040.6, 1032.99, 1006.05, 956.675 },
      // 3000
      {2943.94, 3264.31, 3169.64, 3261.88, 3188.14, 3349.69, 3370.97, 3370.68, 3375.69, 3331.67, 3337.76, 3323.93, 3312.87, 3263.96, 3284.73, 3218.47, 3187.94, 3188.04, 3087.53, 3023.14, 2886.91 }

    };    

  double _sigmaEM[maxEMe][maxEMeta] =
    {

      // 10
      {5.6531, 6.27197, 6.24877, 6.13235, 6.27261, 6.25803, 6.2146, 6.31748, 6.3178, 5.92181, 6.49741, 6.12966, 6.33539, 6.14887, 5.92745, 5.86183, 5.84069, 5.67205, 5.99716, 6.18501, 5.74927 },
      // 30
      {10.7631, 11.6839, 12.0031, 12.0105, 11.3945, 12.0823, 11.9511, 11.5226, 11.737, 11.4636, 11.7777, 11.6057, 11.6463, 11.7102, 11.4542, 11.814, 11.7707, 11.45, 11.6129, 11.2084, 11.5158 },
      // 100
      {27.1053, 31.0103, 32.5718, 31.2112, 30.6487, 31.9749, 32.4812, 31.8854, 30.8795, 31.5266, 31.4954, 31.9637, 32.6102, 30.9646, 31.6948, 32.5483, 31.967, 32.886, 32.2816, 32.7599, 33.0516 },
      // 300
      { 56.5496, 58.6146, 59.9897, 60.5523, 62.1159, 61.182, 62.4681, 61.5686, 62.7223, 64.3423, 63.2253, 63.3899, 65.9444, 67.1132, 65.4711, 67.7073, 65.9442, 67.0971, 66.6814, 67.0256, 68.3018},
      // 1000
      { 204.75, 222.083, 224.726, 221.883, 235.668, 234.81, 242.02, 244.02, 238.789, 252.229, 239.422, 251.573, 242.6, 259.176, 261.525, 259.249, 263.13, 274.504, 274.11, 271.536, 277.354},
      // 3000
      {408.394, 376.008, 371.877, 385.928, 384.045, 408.71, 428.087, 406.591, 435.168, 424.928, 465.78, 462.915, 484.967, 480.945, 502.854, 545.007, 537.067, 530.899, 527.306, 519.876, 536.353 }

    };


  // MUON probability histos for bin size = 0.25 GeV (0-10 GeV, 40 bins)  

  double _responseMU[maxMUe][maxMUeta][maxMUbin] = {
    { 
      // 10 GeV
      {1, 0.999009, 0.999009, 0.999009, 0.997027, 0.981169, 0.949455, 0.922696, 0.863231, 0.782953, 0.665015, 0.555996, 0.443013, 0.322101, 0.230922, 0.162537, 0.114965, 0.0812686, 0.0604559, 0.0475719, 0.0376611, 0.0307235, 0.0178394, 0.0138751, 0.0099108, 0.00792864, 0.00792864, 0.00693756, 0.00396432, 0.00297324, 0.00297324, 0.00198216, 0.00198216, 0.00198216, 0.00198216, 0.00198216, 0.00198216, 0.00099108, 0.00099108, 0}, 
      {1, 1, 1, 0.998037, 0.993131, 0.976447, 0.908734, 0.843965, 0.698724, 0.546614, 0.437684, 0.336605, 0.245339, 0.177625, 0.123651, 0.077527, 0.063788, 0.0451423, 0.0353288, 0.0284593, 0.0245339, 0.0215898, 0.0186457, 0.0147203, 0.013739, 0.00981354, 0.00490677, 0.00490677, 0.00392542, 0.00294406, 0.00294406, 0.00196271, 0.00196271, 0.00196271, 0.00196271, 0.000981354, 0.000981354, 0.000981354, 0.000981354, 0}, 
      {1, 1, 1, 1, 0.99854, 0.986861, 0.964964, 0.941606, 0.870073, 0.747445, 0.640876, 0.562044, 0.426277, 0.344526, 0.255474, 0.191241, 0.135766, 0.109489, 0.0729927, 0.0525547, 0.0423358, 0.0291971, 0.0233577, 0.0175182, 0.0131387, 0.010219, 0.00437956, 0.00437956, 0.00437956, 0.00291971, 0.00145985, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 
      {1, 1, 1, 1, 1, 1, 0.987603, 0.982782, 0.9573, 0.909091, 0.85124, 0.800275, 0.727961, 0.626722, 0.536501, 0.447658, 0.341598, 0.274793, 0.208678, 0.153581, 0.125344, 0.0971074, 0.0764463, 0.0633609, 0.0495868, 0.0371901, 0.0316804, 0.0213499, 0.0172176, 0.0144628, 0.0110193, 0.00964187, 0.00826446, 0.00757576, 0.00688705, 0.00413223, 0.00344353, 0.00206612, 0.00206612, 0.00206612}, 
      {1, 0.995918, 0.995918, 0.995918, 0.953061, 0.846939, 0.75102, 0.634694, 0.512245, 0.355102, 0.263265, 0.218367, 0.136735, 0.0836735, 0.0612245, 0.0469388, 0.0326531, 0.0265306, 0.0142857, 0.0102041, 0.00408163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0},
      {1, 0.999541, 0.999541, 0.999541, 0.996784, 0.977257, 0.977257, 0.909028, 0.909028, 0.769354, 0.698369, 0.698369, 0.455088, 0.244659, 0.244429, 0.129566, 0.129336, 0.0884448, 0.0443372, 0.0438778, 0.0238916, 0.0238916, 0.0130944, 0.00987824, 0.00735125, 0.00574317, 0.00436481, 0.00229727, 0.00229727, 0.00160809, 0.00160809, 0.00160809, 0.00114863, 0.00114863, 0.000459453, 0.000229727, 0.000229727, 0.000229727, 0.000229727, 0}
    },
    //30 GeV
    {
      {1, 1, 1, 1, 1, 0.997006, 0.981038, 0.963074, 0.928144, 0.852295, 0.761477, 0.662675, 0.538922, 0.399202, 0.299401, 0.234531, 0.190619, 0.154691, 0.125749, 0.0918164, 0.0718563, 0.0638723, 0.0568862, 0.0399202, 0.0319361, 0.0259481, 0.0199601, 0.0159681, 0.0149701, 0.011976, 0.00898204, 0.00798403, 0.00299401, 0.00299401, 0.00299401, 0.00299401, 0.00199601, 0.00199601, 0.000998004, 0.000998004}, 
      {1, 0.998024, 0.998024, 0.998024, 0.996047, 0.982213, 0.927866, 0.885375, 0.791502, 0.601779, 0.477273, 0.383399, 0.29249, 0.205534, 0.177866, 0.126482, 0.100791, 0.0790514, 0.0494071, 0.0375494, 0.0286561, 0.0217391, 0.0217391, 0.0158103, 0.0128458, 0.0118577, 0.0108696, 0.00988142, 0.00889328, 0.00889328, 0.00889328, 0.00790514, 0.00592885, 0.00592885, 0.00395257, 0.00197628, 0.000988142, 0.000988142, 0, 0}, 
      {1, 1, 1, 1, 1, 0.997041, 0.97929, 0.964497, 0.903846, 0.803254, 0.681953, 0.594675, 0.5, 0.360947, 0.298817, 0.214497, 0.150888, 0.130178, 0.0872781, 0.0695266, 0.0591716, 0.0384615, 0.0340237, 0.0251479, 0.0192308, 0.0177515, 0.0177515, 0.0162722, 0.0162722, 0.0133136, 0.010355, 0.00739645, 0.00443787, 0.00443787, 0.00443787, 0.00443787, 0.00295858, 0.00295858, 0, 0}, 
      {1, 1, 1, 1, 1, 0.999306, 0.997917, 0.997222, 0.986111, 0.953472, 0.901389, 0.865972, 0.775, 0.6625, 0.603472, 0.501389, 0.402083, 0.349306, 0.264583, 0.220833, 0.194444, 0.145139, 0.119444, 0.09375, 0.0763889, 0.0625, 0.0472222, 0.0368056, 0.0326389, 0.0291667, 0.0201389, 0.0145833, 0.0145833, 0.0111111, 0.00833333, 0.00694444, 0.00486111, 0.00416667, 0.00208333, 0.000694444}, 
      {1, 0.991803, 0.991803, 0.991803, 0.969262, 0.881148, 0.762295, 0.67623, 0.532787, 0.409836, 0.295082, 0.243852, 0.188525, 0.139344, 0.122951, 0.0778689, 0.0532787, 0.0471311, 0.0368852, 0.0286885, 0.0286885, 0.022541, 0.0184426, 0.0163934, 0.0163934, 0.0122951, 0.0122951, 0.00819672, 0.00819672, 0.00819672, 0.00819672, 0.00614754, 0.00204918, 0.00204918, 0.00204918, 0.00204918, 0, 0, 0, 0}, 
      {1, 0.999304, 0.999304, 0.999304, 0.998609, 0.990958, 0.990958, 0.952469, 0.952237, 0.819615, 0.777417, 0.777417, 0.563877, 0.332251, 0.332251, 0.190587, 0.190587, 0.157663, 0.0987712, 0.0987712, 0.061674, 0.061674, 0.0377927, 0.0352423, 0.0268954, 0.0257361, 0.0234176, 0.0132159, 0.0127521, 0.0106654, 0.0106654, 0.00881057, 0.00394157, 0.00394157, 0.00370971, 0.001623, 0.001623, 0.000927429, 0.000927429, 0.000695572}
    },
    // 100 GeV
    {
      {1, 1, 1, 1, 1, 0.998976, 0.9826, 0.971341, 0.947799, 0.895599, 0.804504, 0.73695, 0.650972, 0.520983, 0.417605, 0.350051, 0.286592, 0.239509, 0.192426, 0.146366, 0.125896, 0.106448, 0.0921187, 0.073695, 0.0593654, 0.0470829, 0.0388946, 0.0286592, 0.0225179, 0.0214944, 0.0184237, 0.0153531, 0.0143296, 0.011259, 0.00921187, 0.00716479, 0.00716479, 0.00511771, 0.00409417, 0.00307062}, 
      {1, 1, 1, 1, 0.999004, 0.989044, 0.949203, 0.922311, 0.850598, 0.724104, 0.600598, 0.510956, 0.432271, 0.334661, 0.293825, 0.217131, 0.184263, 0.164343, 0.123506, 0.10757, 0.0916335, 0.0717131, 0.062749, 0.0507968, 0.0418327, 0.0408367, 0.0328685, 0.0278884, 0.0268924, 0.0229084, 0.0199203, 0.0179283, 0.0149402, 0.0119522, 0.0109562, 0.00996016, 0.00896414, 0.00697211, 0.00498008, 0.00199203},
      {1, 1, 1, 1, 1, 0.994048, 0.985119, 0.974702, 0.934524, 0.827381, 0.708333, 0.639881, 0.5625, 0.450893, 0.392857, 0.316964, 0.258929, 0.235119, 0.162202, 0.130952, 0.120536, 0.0907738, 0.078869, 0.0669643, 0.0625, 0.0565476, 0.047619, 0.0357143, 0.0342262, 0.0282738, 0.0208333, 0.0208333, 0.016369, 0.0133929, 0.0119048, 0.0104167, 0.00446429, 0.00446429, 0.0014881, 0.0014881}, 
      {1, 0.999281, 0.999281, 0.999281, 0.999281, 0.999281, 0.997124, 0.996405, 0.991373, 0.966211, 0.925953, 0.893602, 0.839684, 0.742631, 0.695902, 0.597412, 0.507549, 0.470884, 0.38821, 0.327822, 0.295471, 0.230769, 0.199856, 0.166068, 0.136592, 0.119339, 0.0941769, 0.0754853, 0.069734, 0.0603882, 0.0510424, 0.0409777, 0.0359454, 0.0287563, 0.0201294, 0.0143781, 0.0107836, 0.00790798, 0.00647017, 0.00359454}, 
      {1, 0.997934, 0.997934, 0.997934, 0.987603, 0.92562, 0.834711, 0.77686, 0.654959, 0.518595, 0.409091, 0.353306, 0.299587, 0.216942, 0.206612, 0.161157, 0.130165, 0.123967, 0.0909091, 0.0867769, 0.0681818, 0.053719, 0.0433884, 0.035124, 0.0330579, 0.0330579, 0.0289256, 0.0268595, 0.0227273, 0.0227273, 0.0206612, 0.018595, 0.0123967, 0.0103306, 0.00619835, 0.00619835, 0.00413223, 0.00413223, 0.00206612, 0.00206612},
      {1, 1, 1, 1, 0.999765, 0.995535, 0.9953, 0.970153, 0.969918, 0.881316, 0.853584, 0.853584, 0.670035, 0.441833, 0.441833, 0.286251, 0.286016, 0.251234, 0.171798, 0.171798, 0.114454, 0.114454, 0.0777908, 0.0747356, 0.0571093, 0.0552291, 0.053349, 0.0293772, 0.0293772, 0.026557, 0.0249119, 0.0211516, 0.012691, 0.0115159, 0.0110458, 0.00658049, 0.00634548, 0.00305523, 0.00305523, 0.00188014}
    },
    // 300 GeV
    {
      {1, 1, 1, 1, 1, 0.997817, 0.99345, 0.983624, 0.966157, 0.933406, 0.873362, 0.815502, 0.74345, 0.64083, 0.558952, 0.479258, 0.419214, 0.379913, 0.325328, 0.270742, 0.239083, 0.19869, 0.167031, 0.141921, 0.113537, 0.0971616, 0.0840611, 0.0687773, 0.058952, 0.0436681, 0.0393013, 0.0327511, 0.0305677, 0.0262009, 0.0196507, 0.0163755, 0.0120087, 0.00982533, 0.00873362, 0.00327511}, 
      {1, 1, 1, 1, 1, 0.996865, 0.972832, 0.948798, 0.904911, 0.802508, 0.719958, 0.649948, 0.584117, 0.491118, 0.46604, 0.364681, 0.331243, 0.308255, 0.244514, 0.221526, 0.202717, 0.169279, 0.15256, 0.126437, 0.111808, 0.106583, 0.0909091, 0.0783699, 0.0710554, 0.0574713, 0.0501567, 0.045977, 0.0376176, 0.0344828, 0.030303, 0.0261233, 0.0188088, 0.0135841, 0.0104493, 0.00522466}, 
      {1, 1, 1, 1, 1, 0.998415, 0.993661, 0.988906, 0.977813, 0.935024, 0.858954, 0.812995, 0.762282, 0.662441, 0.622821, 0.505547, 0.445325, 0.426307, 0.329635, 0.29794, 0.275753, 0.242472, 0.22187, 0.191759, 0.171157, 0.158479, 0.141046, 0.125198, 0.120444, 0.110935, 0.0982567, 0.0792393, 0.0586371, 0.0570523, 0.0538827, 0.0459588, 0.0332805, 0.0269414, 0.0174326, 0.0110935}, 
      {1, 1, 1, 1, 1, 1, 0.998436, 0.997654, 0.992963, 0.982017, 0.960125, 0.94527, 0.906177, 0.845192, 0.820954, 0.744332, 0.671618, 0.624707, 0.538702, 0.475371, 0.441751, 0.36982, 0.333855, 0.291634, 0.250977, 0.22674, 0.199375, 0.1681, 0.150899, 0.137608, 0.110242, 0.0992963, 0.0820954, 0.0664582, 0.0578577, 0.0453479, 0.0359656, 0.0289289, 0.0187647, 0.00938233},
      {1, 1, 1, 1, 0.989177, 0.941558, 0.887446, 0.839827, 0.75974, 0.612554, 0.525974, 0.478355, 0.426407, 0.361472, 0.350649, 0.279221, 0.253247, 0.24026, 0.168831, 0.145022, 0.134199, 0.108225, 0.101732, 0.0779221, 0.0606061, 0.0562771, 0.0497835, 0.04329, 0.0411255, 0.034632, 0.034632, 0.0238095, 0.0194805, 0.017316, 0.017316, 0.0108225, 0.0108225, 0.0108225, 0.00649351, 0.00649351},
      {1, 0.99926, 0.99926, 0.99926, 0.99852, 0.995312, 0.995312, 0.984949, 0.984703, 0.925241, 0.915865, 0.915865, 0.798668, 0.630891, 0.630891, 0.484826, 0.484579, 0.455712, 0.356279, 0.356279, 0.268937, 0.268937, 0.196891, 0.191463, 0.154453, 0.149519, 0.146558, 0.0957316, 0.0949914, 0.0885764, 0.0880829, 0.0745127, 0.0478658, 0.0471256, 0.0446583, 0.0264002, 0.0261535, 0.0157908, 0.0152973, 0.00986923}
    }
  };

  // now assign
  for (int i1 = 0; i1 < maxMUe; i1++) { 
    eGridMU[i1] = _eGridMU[i1];
    for (int i2 = 0; i2 < maxMUeta; i2++) {
      for (int i3 = 0; i3 < maxMUbin; i3++) {
        
        responseMU[i1][i2][i3] = _responseMU[i1][i2][i3];

        if(debug) {
          //cout.width(6);
          LogDebug("FastCalorimetry") << " responseMU " << i1 << " " << i2 << " " << i3  << " = " 
                                      << responseMU[i1][i2][i3] << std::endl;
        }
        
      }
    }
  }
  for (int i2 = 0; i2 < maxMUeta; i2++) {
    etaGridMU[i2] = _etaGridMU[i2];
  }


  // Normalize the response and sigmas to the corresponding energies
  for(int i = 0; i<maxHDe;  i++) {
    eGridHD[i] = _eGridHD[i];
    for(int j = 0; j<maxHDeta; j++) {
 
      double factor     = 1.0;
      double factor_s   = 1.0;

      if( j < 16)             factor = barrelCorrection[i];  // special HB
      if( j < 30 && j >= 16)  factor = endcapCorrection[i];  // special HE
      if( j >= 30)            factor = forwardCorrectionEnergyDependent[i]*forwardCorrectionEtaDependent[j]; // special HF 

      meanHD[i][j]        =  factor * _meanHD[i][j]  / eGridHD[i];
      sigmaHD[i][j]       =  factor_s * _sigmaHD[i][j] / eGridHD[i];

      meanHD_mip[i][j]    =  factor * _meanHD_mip[i][j]  / eGridHD[i];
      sigmaHD_mip[i][j]   =  factor_s * _sigmaHD_mip[i][j] / eGridHD[i];

      meanHD_nomip[i][j]  =  factor * _meanHD_nomip[i][j]  / eGridHD[i];
      sigmaHD_nomip[i][j] =  factor_s * _sigmaHD_nomip[i][j] / eGridHD[i];

    }
  }


  for(int i = 0; i<maxEMe;  i++) {
    eGridEM[i] = _eGridEM[i];
    for(int j = 0; j<maxEMeta; j++) {
      meanEM[i][j]  = 0.92 * _meanEM[i][j] / eGridEM[i];
      sigmaEM[i][j] = 0.92 * _sigmaEM[i][j] / eGridEM[i];
    }
  }


}
HCALResponse::~HCALResponse ( ) [inline]

Definition at line 35 of file HCALResponse.h.

{;} 

Member Function Documentation

double HCALResponse::getHCALEnergyResolution ( double  e,
int  hit 
)

Definition at line 718 of file HCALResponse.cc.

References HCAL, hcforward, RespPar, mathSSE::sqrt(), and VFCAL.

Referenced by CalorimetryManager::HDShowerSimulation(), and CalorimetryManager::reconstructHCAL().

                                                             {
  
  if(hit==hcforward) 
    return e *sqrt( RespPar[VFCAL][1][0]*RespPar[VFCAL][1][0] / e + 
                    RespPar[VFCAL][1][1]*RespPar[VFCAL][1][1] );
  else
    return  e * sqrt( RespPar[HCAL][hit][0]*RespPar[HCAL][hit][0]/(e)
                      + RespPar[HCAL][hit][1]*RespPar[HCAL][hit][1]);   

}
double HCALResponse::getHCALEnergyResponse ( double  e,
int  hit 
)
double HCALResponse::getHFEnergyResolution ( double  EGen)

Definition at line 745 of file HCALResponse.cc.

References RespPar, mathSSE::sqrt(), and VFCAL.

{
  return EGen *sqrt( RespPar[VFCAL][0][0]*RespPar[VFCAL][0][0] / EGen + 
                     RespPar[VFCAL][0][1]*RespPar[VFCAL][0][1] );
}  
void HCALResponse::interEM ( double  e,
int  ie,
int  ieta 
) [private]

Definition at line 682 of file HCALResponse.cc.

References debug, eGridEM, LogDebug, mean, meanEM, sigma, and sigmaEM.

Referenced by responseHCAL().

{ 
  double y1 = meanEM[ie][ieta]; 
  double y2 = meanEM[ie+1][ieta]; 
  double x1 = eGridEM[ie];
  double x2 = eGridEM[ie+1];
  
  if(debug) {
    //  cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::interEM mean " << std::endl
                                << " x, x1-x2, y1-y2 = " 
                                << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
  
  }

  mean =  e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      
  
  y1 = sigmaEM[ie][ieta]; 
  y2 = sigmaEM[ie+1][ieta]; 
  
  if(debug) {
    //  cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::interEM sigma" << std::endl
                                << " x, x1-x2, y1-y2 = " 
                                << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
  
  }

  sigma = e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      
}
void HCALResponse::interHD ( int  mip,
double  e,
int  ie,
int  ieta 
) [private]

Definition at line 609 of file HCALResponse.cc.

References debug, eGridHD, LogDebug, mean, meanHD, meanHD_mip, meanHD_nomip, sigma, sigmaHD, sigmaHD_mip, and sigmaHD_nomip.

Referenced by responseHCAL().

{

  double y1, y2;

  double x1 = eGridHD[ie];
  double x2 = eGridHD[ie+1];

  if(mip == 2) {           // mip doesn't matter
    y1 = meanHD[ie][ieta]; 
    y2 = meanHD[ie+1][ieta]; 
  }
  else {
    if(mip == 0) {         // not mip
      y1 = meanHD_nomip[ie][ieta]; 
      y2 = meanHD_nomip[ie+1][ieta]; 
    }
    else {                 // mip in ECAL
      y1 = meanHD_mip[ie][ieta]; 
      y2 = meanHD_mip[ie+1][ieta]; 
    }
  }

  if(debug) {
    //  cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::interHD mean " << std::endl
                                << " x, x1-x2, y1-y2 = " 
                                << e << ", " << x1 <<"-" << x2 << " "
                                << y1 <<"-" << y2 << std::endl;  
  }
  
  mean =  e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      
  

  if(mip == 2) {           // mip doesn't matter
    y1 = sigmaHD[ie][ieta]; 
    y2 = sigmaHD[ie+1][ieta]; 
  }
  else {
    if(mip == 0) {         // not mip
      y1 = sigmaHD_nomip[ie][ieta]; 
      y2 = sigmaHD_nomip[ie+1][ieta]; 
    }
    else {                 // mip in ECAL
      y1 = sigmaHD_mip[ie][ieta]; 
      y2 = sigmaHD_mip[ie+1][ieta]; 
    }
  }
  
  if(debug) {
    //  cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::interHD sigma" << std::endl
                                << " x, x1-x2, y1-y2 = " 
                                << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
  
  }
 
  sigma = e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      


  if(debug) {
    //cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::interHD " << std::endl
                                << " e, ie, ieta = " << e << " " << ie << " " << ieta << std::endl
                                << " mean, sigma  = " << mean << " " << sigma << std::endl ;
  }

}
void HCALResponse::interMU ( double  e,
int  ie,
int  ieta 
) [private]

Definition at line 561 of file HCALResponse.cc.

References debug, eGridMU, RandomEngine::flatShoot(), i, LogDebug, maxMUbin, mean, muStep, random, responseMU, sigma, and x.

Referenced by responseHCAL().

{

  double x = random->flatShoot();

  int bin1 = maxMUbin;
  for(int i = 0; i < maxMUbin; i++) {
    if(x > responseMU[ie][ieta][i]) {
      bin1 = i-1;
      break;
    }
  }
  int bin2 = maxMUbin;
  for(int i = 0; i < maxMUbin; i++) {
    if(x > responseMU[ie+1][ieta][i]) {
      bin2 = i-1;
      break;
    }
  }
   
  double x1 = eGridMU[ie];
  double x2 = eGridMU[ie+1];
  double y1 = (bin1 + random->flatShoot()) * muStep;   
  double y2 = (bin2 + random->flatShoot()) * muStep;   

  if(debug) {
    //  cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::interMU  " << std::endl
                                << " x, x1-x2, y1-y2 = " 
                                << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
  
  }


  mean  = y1 + (y2-y1) * (e - x1)/(x2 - x1);
  sigma = 0.;

  if(debug) {
    //cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::interMU " << std::endl
                                << " e, ie, ieta = " << e << " " << ie << " " << ieta << std::endl
                                << " response  = " << mean << std::endl; 
  }

}
std::pair< double, double > HCALResponse::responseHCAL ( int  mip,
double  energy,
double  eta,
int  partype 
)

Definition at line 464 of file HCALResponse.cc.

References abs, debug, eBias, eGridEM, eGridHD, eGridMU, relval_parameters_module::energy, eResponseCorrection, etaGridMU, etaStep, i, interEM(), interHD(), interMU(), LogDebug, maxEMe, maxEMeta, maxHDe, maxHDeta, maxMUe, maxMUeta, mean, and sigma.

Referenced by CalorimetryManager::HDShowerSimulation(), CalorimetryManager::reconstructECAL(), and CalorimetryManager::reconstructHCAL().

{

  int ieta = abs((int)(eta / etaStep)) ;
  int ie = -1;

  mean  = 0.;
  sigma = 0.;

  // e/gamma
  if(partype == 0) {
    ieta -= 30;  // HF starts at ieta=30 till ieta=51 
                 // but resp.vector from index=0 through 20
    if(ieta >= maxEMeta ) ieta = maxEMeta-1;
    else if(ieta < 0) ieta = 0;
 
    for (int i = 0; i < maxEMe; i++) {
      if(energy < eGridEM[i])  {
        if(i == 0) ie = 0;       
        else  ie = i-1;
        break;
      }
    }
    if(ie == -1) ie = maxEMe - 2;  
    interEM(energy, ie, ieta);
  }  
     
  else { 
    // hadrons
    if(partype == 1) {  
      
      if(ieta >= maxHDeta) ieta = maxHDeta-1;
      
      if(ieta < 0 ) ieta = 0;
      for (int i = 0; i < maxHDe; i++) {
        if(energy < eGridHD[i])  {
          if(i == 0) ie = 0;     // less than minimal -
          else  ie = i-1;        // back extrapolation with the 1st interval
            break;
        }       
      }
      if(ie == -1) ie = maxHDe - 2;     // more than maximum - 
      interHD(mip, energy, ie, ieta);        // extrapolation with last interv.
      
    }

    
    // finally apply energy scale correction
    mean  *= eResponseCorrection;
    mean  += eBias;
    sigma *= eResponseCorrection;      
    

  }
  
  // muons
  if(partype == 2) { 
    
    ieta = maxMUeta;
    for(int i = 0; i < maxMUeta; i++) {
      if(fabs(eta) < etaGridMU[i]) {
        ieta = i;  
        break;
      }       
    }     
    
    if(ieta < 0) ieta = 0;
    if(ieta < maxMUeta) {  // HB-HE
      
      for (int i = 0; i < maxMUe; i++) {
        if(energy < eGridMU[i])  {
          if(i == 0) ie = 0;     // less than minimal -
          else  ie = i-1;        // back extrapolation with the first interval
          break;
        }
        
        if(ie == -1) ie = maxMUe - 2;     // more than maximum - 
        interMU(energy, ie, ieta);         // extrapolation using the last interv
        if(mean > energy) mean = energy;  
        
      }
    }
  }
  
  // debugging
  if(debug) {
    //  cout.width(6);
    LogDebug("FastCalorimetry") << std::endl
                                << " HCALResponse::responseHCAL, partype = " <<  partype 
                                << " E, eta = " << energy << " " << eta  
                                << "  mean & sigma = " << mean   << " " << sigma << std::endl;
  }

  return std::pair<double,double>(mean,sigma);

}

Member Data Documentation

double HCALResponse::eBias [private]

Definition at line 67 of file HCALResponse.h.

Referenced by HCALResponse(), and responseHCAL().

double HCALResponse::eGridEM[maxEMe] [private]

Definition at line 76 of file HCALResponse.h.

Referenced by HCALResponse(), interEM(), and responseHCAL().

double HCALResponse::eGridHD[maxHDe] [private]

Definition at line 75 of file HCALResponse.h.

Referenced by HCALResponse(), interHD(), and responseHCAL().

double HCALResponse::eGridMU[maxMUe] [private]

Definition at line 77 of file HCALResponse.h.

Referenced by HCALResponse(), interMU(), and responseHCAL().

Definition at line 65 of file HCALResponse.h.

Referenced by getHCALEnergyResponse(), and HCALResponse().

Definition at line 66 of file HCALResponse.h.

Referenced by HCALResponse(), and responseHCAL().

Definition at line 64 of file HCALResponse.h.

Referenced by getHCALEnergyResponse(), and HCALResponse().

double HCALResponse::eResponsePlateau[3] [private]

Definition at line 63 of file HCALResponse.h.

Referenced by getHCALEnergyResponse(), and HCALResponse().

double HCALResponse::eResponseScale[3] [private]

HCAL response parameters.

Definition at line 62 of file HCALResponse.h.

Referenced by getHCALEnergyResponse(), and HCALResponse().

double HCALResponse::etaGridMU[maxMUeta] [private]

Definition at line 78 of file HCALResponse.h.

Referenced by HCALResponse(), and responseHCAL().

double HCALResponse::etaStep [private]

Definition at line 70 of file HCALResponse.h.

Referenced by HCALResponse(), and responseHCAL().

double HCALResponse::mean [private]

Definition at line 72 of file HCALResponse.h.

Referenced by interEM(), interHD(), interMU(), and responseHCAL().

double HCALResponse::meanEM[maxEMe][maxEMeta] [private]

Definition at line 86 of file HCALResponse.h.

Referenced by HCALResponse(), and interEM().

double HCALResponse::meanHD[maxHDe][maxHDeta] [private]

Definition at line 81 of file HCALResponse.h.

Referenced by HCALResponse(), and interHD().

double HCALResponse::meanHD_mip[maxHDe][maxHDeta] [private]

Definition at line 82 of file HCALResponse.h.

Referenced by HCALResponse(), and interHD().

double HCALResponse::meanHD_nomip[maxHDe][maxHDeta] [private]

Definition at line 83 of file HCALResponse.h.

Referenced by HCALResponse(), and interHD().

double HCALResponse::muStep [private]

Definition at line 70 of file HCALResponse.h.

Referenced by HCALResponse(), and interMU().

Definition at line 92 of file HCALResponse.h.

Referenced by interMU().

double HCALResponse::responseMU[maxMUe][maxMUeta][maxMUbin] [private]

Definition at line 89 of file HCALResponse.h.

Referenced by HCALResponse(), and interMU().

double HCALResponse::RespPar[3][2][3] [private]

Default values for resolution parametrisation: stochastic, constant and noise.

Definition at line 59 of file HCALResponse.h.

Referenced by getHCALEnergyResolution(), getHFEnergyResolution(), and HCALResponse().

double HCALResponse::sigma [private]

Definition at line 72 of file HCALResponse.h.

Referenced by interEM(), interHD(), interMU(), and responseHCAL().

double HCALResponse::sigmaEM[maxEMe][maxEMeta] [private]

Definition at line 86 of file HCALResponse.h.

Referenced by HCALResponse(), and interEM().

double HCALResponse::sigmaHD[maxHDe][maxHDeta] [private]

Definition at line 81 of file HCALResponse.h.

Referenced by HCALResponse(), and interHD().

double HCALResponse::sigmaHD_mip[maxHDe][maxHDeta] [private]

Definition at line 82 of file HCALResponse.h.

Referenced by HCALResponse(), and interHD().

double HCALResponse::sigmaHD_nomip[maxHDe][maxHDeta] [private]

Definition at line 83 of file HCALResponse.h.

Referenced by HCALResponse(), and interHD().