CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/FastSimulation/Calorimetry/src/HCALResponse.cc

Go to the documentation of this file.
00001 //FastSimulation headers
00002 #include "FastSimulation/Calorimetry/interface/HCALResponse.h"
00003 #include "FastSimulation/Utilities/interface/RandomEngine.h"
00004 
00005 // CMSSW Headers
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008 
00009 #include<iostream>
00010 #include <math.h>
00011 
00012 #define debug 0
00013 
00014 using namespace edm;
00015 
00016 HCALResponse::HCALResponse(const edm::ParameterSet& pset,
00017                            const RandomEngine* engine) :
00018   random(engine)
00019 { 
00020   
00021   RespPar[HCAL][0][0] =  
00022     pset.getParameter<double>("HadronBarrelResolution_Stochastic");
00023   RespPar[HCAL][0][1] =  
00024     pset.getParameter<double>("HadronBarrelResolution_Constant");
00025   RespPar[HCAL][0][2] =  
00026     pset.getParameter<double>("HadronBarrelResolution_Noise");
00027 
00028   RespPar[HCAL][1][0] =  
00029     pset.getParameter<double>("HadronEndcapResolution_Stochastic");
00030   RespPar[HCAL][1][1] =  
00031     pset.getParameter<double>("HadronEndcapResolution_Constant");
00032   RespPar[HCAL][1][2] =  
00033     pset.getParameter<double>("HadronEndcapResolution_Noise");
00034 
00035   RespPar[VFCAL][0][0] =  
00036     pset.getParameter<double>("HadronForwardResolution_Stochastic");
00037   RespPar[VFCAL][0][1] =  
00038     pset.getParameter<double>("HadronForwardResolution_Constant");
00039   RespPar[VFCAL][0][2] =  
00040     pset.getParameter<double>("HadronForwardResolution_Noise");
00041 
00042   RespPar[VFCAL][1][0] =  
00043     pset.getParameter<double>("ElectronForwardResolution_Stochastic");
00044   RespPar[VFCAL][1][1] =  
00045     pset.getParameter<double>("ElectronForwardResolution_Constant");
00046   RespPar[VFCAL][1][2] =  
00047     pset.getParameter<double>("ElectronForwardResolution_Noise");
00048 
00049   eResponseScale[0] = 
00050     pset.getParameter<double>("eResponseScaleHB");  
00051   eResponseScale[1] = 
00052     pset.getParameter<double>("eResponseScaleHE");
00053   eResponseScale[2] = 
00054     pset.getParameter<double>("eResponseScaleHF");
00055 
00056   eResponsePlateau[0] = 
00057     pset.getParameter<double>("eResponsePlateauHB");
00058   eResponsePlateau[1] = 
00059     pset.getParameter<double>("eResponsePlateauHE");
00060   eResponsePlateau[2] = 
00061     pset.getParameter<double>("eResponsePlateauHF");
00062 
00063   eResponseExponent = 
00064     pset.getParameter<double>("eResponseExponent");
00065 
00066   eResponseCoefficient = 
00067     pset.getParameter<double>("eResponseCoefficient");
00068 
00069   eResponseCorrection = 
00070     pset.getParameter<double>("eResponseCorrection");
00071 
00072   // If need - add a small energy to each hadron ...
00073   eBias = 
00074     pset.getParameter<double>("energyBias");
00075   
00076   
00077   etaStep = 0.1;
00078   muStep  = 0.25;
00079 
00080   double _eGridHD[maxHDe]   = {1., 2., 3., 5., 9., 15., 20., 30., 50., 100., 150., 225., 300., 1000., 3000. };
00081   double _eGridEM[maxEMe]     = {10., 30., 100., 300., 1000., 3000.};
00082   double _eGridMU[maxMUe]     = {10., 30., 100., 300.};
00083   double _etaGridMU[maxMUeta] = {0.3, 0.6, 0.8, 1.25, 1.4, 3.0};
00084 
00085   // additional tuning factor to correct the response in the barrel
00086   //                              1     2     3     5     9    15    20    30 
00087   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};  
00088   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};
00089   //                             1-15 >>> 20   30    50   100   150   225
00090   double forwardCorrectionEnergyDependent[15] = {1.09, 1.09, 1.08, 1.08, 1.07, 1.06,
00091                                         1.05, 1.05, 1.06, 1.08, 1.09, 1.10, 
00092                                         1.09, 1.08, 1.08};     
00093   double forwardCorrectionEtaDependent[maxHDeta];
00094   for (unsigned int j=0;j<maxHDeta;j++){
00095     if (j<30) forwardCorrectionEtaDependent[j]=1.;
00096     if (j>=30 && j<43) forwardCorrectionEtaDependent[j]=0.98;
00097     if (j>=43 || j<46) forwardCorrectionEtaDependent[j]=0.95;
00098     if (j==46 || j==47) forwardCorrectionEtaDependent[j]=0.94;
00099     if (j==48) forwardCorrectionEtaDependent[j]=0.92;
00100     if (j>=49) forwardCorrectionEtaDependent[j]=0.86;
00101   }
00102 
00103   // MEAN energy response for (1) all (2) MIP in ECAL (3) non-MIP in ECAL 
00104   //-----------------------------------------------------------------------
00105 
00106   double _meanHD[maxHDe][maxHDeta] = {
00107 
00108     // 1 
00109     {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},
00110     // 2
00111     {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},
00112     // 3 
00113     {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},
00114     // 5 
00115     {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},
00116     // 9 
00117     {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},
00118     // 15 
00119     {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},
00120     // 20
00121     {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},
00122     // 30
00123     {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},  
00124     // 50
00125     {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},
00126     // 100
00127     {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},
00128     // 150 
00129     {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,},
00130     // 225 
00131     {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},
00132     // 300 
00133     {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},
00134     // 1000 
00135     {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},
00136 
00137     // 3000
00138     {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}
00139   };
00140 
00141 
00142 
00143   double _meanHD_mip[maxHDe][maxHDeta] = {
00144 
00145     // 1 
00146     {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},
00147     // 2
00148     {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},
00149     // 3 
00150     {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},
00151     // 5 
00152     {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},
00153     // 9 
00154     {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},
00155     // 15 
00156     {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},
00157     // 20
00158     {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},
00159     // 30
00160     {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},
00161     // 50
00162     {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},
00163     // 100
00164     {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},
00165     // 150 
00166     {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},
00167     // 225 
00168     {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},
00169     // 300 
00170     {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},
00171     // 1000 
00172     {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},
00173     // 3000
00174     {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}
00175 
00176   };
00177 
00178 
00179   double _meanHD_nomip[maxHDe][maxHDeta] = {
00180 
00181     // 1 
00182     {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},
00183     // 2
00184     {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},
00185     // 3 
00186     {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},
00187     // 5 
00188     {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},
00189     // 9 
00190     {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},
00191     // 15 
00192     {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},
00193     // 20
00194     {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},
00195     // 30
00196     {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},
00197     // 50
00198     {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},
00199     // 100
00200     {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},
00201     // 150 
00202     {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},
00203     // 225 
00204     {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,},
00205     // 300 
00206     {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},
00207     // 1000 
00208     {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},
00209     // 3000
00210     {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}
00211 
00212   };
00213 
00214   // ---------------------------------------   SIGMAS (from RMS)
00215   // ------------------------------------------------------------------------- 
00216 
00217   double _sigmaHD[maxHDe][maxHDeta] = {
00218 
00219     // 1 
00220     {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},
00221     // 2
00222     {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},
00223     // 3 
00224     {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},
00225     // 5 
00226     {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},
00227     // 9 
00228     {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},
00229     // 15 
00230     {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},
00231     // 20
00232     {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},
00233     // 30
00234     {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},
00235     // 50
00236     {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},
00237     // 100
00238     {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},
00239     // 150 
00240     {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},
00241     // 225 
00242     {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},
00243     // 300 
00244     {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},
00245     // 1000 
00246     {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},
00247     // 3000
00248     {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}
00249   };
00250 
00251 
00252   double _sigmaHD_mip[maxHDe][maxHDeta] = {
00253 
00254     // 1 
00255     {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},
00256     // 2
00257     {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},
00258     // 3 
00259     {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},
00260     // 5 
00261     {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},
00262     // 9 
00263     {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},
00264     // 15 
00265     {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},
00266     // 20
00267     {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},
00268     // 30
00269     {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},
00270     // 50
00271     {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},
00272     // 100
00273     {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},
00274     // 150 
00275     {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},
00276     // 225 
00277     {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},
00278     // 300 
00279     {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},
00280     // 1000 
00281     {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},
00282     // 3000
00283     {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}
00284 
00285   };
00286 
00287 
00288 
00289   double _sigmaHD_nomip[maxHDe][maxHDeta] = {
00290 
00291     // 1 
00292     {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},
00293     // 2
00294     {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},
00295     // 3 
00296     {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},
00297     // 5 
00298     { 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},
00299     // 9 
00300     {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},
00301     // 15 
00302     {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},
00303     // 20
00304     {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,},
00305     // 30
00306     {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},
00307     // 50
00308     {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},
00309     // 100
00310     {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},
00311     // 150 
00312     {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},
00313     // 225 
00314     {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},
00315     // 300 
00316     {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},
00317     // 1000 
00318     {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},
00319     // 3000
00320     {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}
00321 
00322   };
00323 
00324 
00325 
00326   // e-gamma mean response and sigma in HF 
00327   double _meanEM[maxEMe][maxEMeta] = 
00328     { 
00329       // 10
00330       {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 },
00331       // 30
00332       {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 },
00333       // 100
00334       { 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 },
00335       // 300
00336       {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 },
00337       // 1000
00338       {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 },
00339       // 3000
00340       {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 }
00341 
00342     };    
00343 
00344   double _sigmaEM[maxEMe][maxEMeta] =
00345     {
00346 
00347       // 10
00348       {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 },
00349       // 30
00350       {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 },
00351       // 100
00352       {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 },
00353       // 300
00354       { 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},
00355       // 1000
00356       { 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},
00357       // 3000
00358       {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 }
00359 
00360     };
00361 
00362 
00363   // MUON probability histos for bin size = 0.25 GeV (0-10 GeV, 40 bins)  
00364 
00365   double _responseMU[maxMUe][maxMUeta][maxMUbin] = {
00366     { 
00367       // 10 GeV
00368       {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}, 
00369       {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}, 
00370       {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}, 
00371       {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}, 
00372       {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},
00373       {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}
00374     },
00375     //30 GeV
00376     {
00377       {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}, 
00378       {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}, 
00379       {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}, 
00380       {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}, 
00381       {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}, 
00382       {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}
00383     },
00384     // 100 GeV
00385     {
00386       {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}, 
00387       {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},
00388       {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}, 
00389       {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}, 
00390       {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},
00391       {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}
00392     },
00393     // 300 GeV
00394     {
00395       {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}, 
00396       {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}, 
00397       {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}, 
00398       {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},
00399       {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},
00400       {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}
00401     }
00402   };
00403 
00404   // now assign
00405   for (int i1 = 0; i1 < maxMUe; i1++) { 
00406     eGridMU[i1] = _eGridMU[i1];
00407     for (int i2 = 0; i2 < maxMUeta; i2++) {
00408       for (int i3 = 0; i3 < maxMUbin; i3++) {
00409         
00410         responseMU[i1][i2][i3] = _responseMU[i1][i2][i3];
00411 
00412         if(debug) {
00413           //cout.width(6);
00414           LogDebug("FastCalorimetry") << " responseMU " << i1 << " " << i2 << " " << i3  << " = " 
00415                                       << responseMU[i1][i2][i3] << std::endl;
00416         }
00417         
00418       }
00419     }
00420   }
00421   for (int i2 = 0; i2 < maxMUeta; i2++) {
00422     etaGridMU[i2] = _etaGridMU[i2];
00423   }
00424 
00425 
00426   // Normalize the response and sigmas to the corresponding energies
00427   for(int i = 0; i<maxHDe;  i++) {
00428     eGridHD[i] = _eGridHD[i];
00429     for(int j = 0; j<maxHDeta; j++) {
00430  
00431       double factor     = 1.0;
00432       double factor_s   = 1.0;
00433 
00434       if( j < 16)             factor = barrelCorrection[i];  // special HB
00435       if( j < 30 && j >= 16)  factor = endcapCorrection[i];  // special HE
00436       if( j >= 30)            factor = forwardCorrectionEnergyDependent[i]*forwardCorrectionEtaDependent[j]; // special HF 
00437 
00438       meanHD[i][j]        =  factor * _meanHD[i][j]  / eGridHD[i];
00439       sigmaHD[i][j]       =  factor_s * _sigmaHD[i][j] / eGridHD[i];
00440 
00441       meanHD_mip[i][j]    =  factor * _meanHD_mip[i][j]  / eGridHD[i];
00442       sigmaHD_mip[i][j]   =  factor_s * _sigmaHD_mip[i][j] / eGridHD[i];
00443 
00444       meanHD_nomip[i][j]  =  factor * _meanHD_nomip[i][j]  / eGridHD[i];
00445       sigmaHD_nomip[i][j] =  factor_s * _sigmaHD_nomip[i][j] / eGridHD[i];
00446 
00447     }
00448   }
00449 
00450 
00451   for(int i = 0; i<maxEMe;  i++) {
00452     eGridEM[i] = _eGridEM[i];
00453     for(int j = 0; j<maxEMeta; j++) {
00454       meanEM[i][j]  = 0.92 * _meanEM[i][j] / eGridEM[i];
00455       sigmaEM[i][j] = 0.92 * _sigmaEM[i][j] / eGridEM[i];
00456     }
00457   }
00458 
00459 
00460 }
00461 
00462  
00463 std::pair<double,double> 
00464 HCALResponse::responseHCAL(int mip, double energy, double eta, int partype)
00465 {
00466 
00467   int ieta = abs((int)(eta / etaStep)) ;
00468   int ie = -1;
00469 
00470   mean  = 0.;
00471   sigma = 0.;
00472 
00473   // e/gamma
00474   if(partype == 0) {
00475     ieta -= 30;  // HF starts at ieta=30 till ieta=51 
00476                  // but resp.vector from index=0 through 20
00477     if(ieta >= maxEMeta ) ieta = maxEMeta-1;
00478     else if(ieta < 0) ieta = 0;
00479  
00480     for (int i = 0; i < maxEMe; i++) {
00481       if(energy < eGridEM[i])  {
00482         if(i == 0) ie = 0;       
00483         else  ie = i-1;
00484         break;
00485       }
00486     }
00487     if(ie == -1) ie = maxEMe - 2;  
00488     interEM(energy, ie, ieta);
00489   }  
00490      
00491   else { 
00492     // hadrons
00493     if(partype == 1) {  
00494       
00495       if(ieta >= maxHDeta) ieta = maxHDeta-1;
00496       
00497       if(ieta < 0 ) ieta = 0;
00498       for (int i = 0; i < maxHDe; i++) {
00499         if(energy < eGridHD[i])  {
00500           if(i == 0) ie = 0;     // less than minimal -
00501           else  ie = i-1;        // back extrapolation with the 1st interval
00502             break;
00503         }       
00504       }
00505       if(ie == -1) ie = maxHDe - 2;     // more than maximum - 
00506       interHD(mip, energy, ie, ieta);        // extrapolation with last interv.
00507       
00508     }
00509 
00510     
00511     // finally apply energy scale correction
00512     mean  *= eResponseCorrection;
00513     mean  += eBias;
00514     sigma *= eResponseCorrection;      
00515     
00516 
00517   }
00518   
00519   // muons
00520   if(partype == 2) { 
00521     
00522     ieta = maxMUeta;
00523     for(int i = 0; i < maxMUeta; i++) {
00524       if(fabs(eta) < etaGridMU[i]) {
00525         ieta = i;  
00526         break;
00527       }       
00528     }     
00529     
00530     if(ieta < 0) ieta = 0;
00531     if(ieta < maxMUeta) {  // HB-HE
00532       
00533       for (int i = 0; i < maxMUe; i++) {
00534         if(energy < eGridMU[i])  {
00535           if(i == 0) ie = 0;     // less than minimal -
00536           else  ie = i-1;        // back extrapolation with the first interval
00537           break;
00538         }
00539         
00540         if(ie == -1) ie = maxMUe - 2;     // more than maximum - 
00541         interMU(energy, ie, ieta);         // extrapolation using the last interv
00542         if(mean > energy) mean = energy;  
00543         
00544       }
00545     }
00546   }
00547   
00548   // debugging
00549   if(debug) {
00550     //  cout.width(6);
00551     LogDebug("FastCalorimetry") << std::endl
00552                                 << " HCALResponse::responseHCAL, partype = " <<  partype 
00553                                 << " E, eta = " << energy << " " << eta  
00554                                 << "  mean & sigma = " << mean   << " " << sigma << std::endl;
00555   }
00556 
00557   return std::pair<double,double>(mean,sigma);
00558 
00559 }
00560 
00561 void HCALResponse::interMU(double e, int ie, int ieta)
00562 {
00563 
00564   double x = random->flatShoot();
00565 
00566   int bin1 = maxMUbin;
00567   for(int i = 0; i < maxMUbin; i++) {
00568     if(x > responseMU[ie][ieta][i]) {
00569       bin1 = i-1;
00570       break;
00571     }
00572   }
00573   int bin2 = maxMUbin;
00574   for(int i = 0; i < maxMUbin; i++) {
00575     if(x > responseMU[ie+1][ieta][i]) {
00576       bin2 = i-1;
00577       break;
00578     }
00579   }
00580    
00581   double x1 = eGridMU[ie];
00582   double x2 = eGridMU[ie+1];
00583   double y1 = (bin1 + random->flatShoot()) * muStep;   
00584   double y2 = (bin2 + random->flatShoot()) * muStep;   
00585 
00586   if(debug) {
00587     //  cout.width(6);
00588     LogDebug("FastCalorimetry") << std::endl
00589                                 << " HCALResponse::interMU  " << std::endl
00590                                 << " x, x1-x2, y1-y2 = " 
00591                                 << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
00592   
00593   }
00594 
00595 
00596   mean  = y1 + (y2-y1) * (e - x1)/(x2 - x1);
00597   sigma = 0.;
00598 
00599   if(debug) {
00600     //cout.width(6);
00601     LogDebug("FastCalorimetry") << std::endl
00602                                 << " HCALResponse::interMU " << std::endl
00603                                 << " e, ie, ieta = " << e << " " << ie << " " << ieta << std::endl
00604                                 << " response  = " << mean << std::endl; 
00605   }
00606 
00607 }
00608 
00609 void HCALResponse::interHD(int mip, double e, int ie, int ieta)
00610 {
00611 
00612   double y1, y2;
00613 
00614   double x1 = eGridHD[ie];
00615   double x2 = eGridHD[ie+1];
00616 
00617   if(mip == 2) {           // mip doesn't matter
00618     y1 = meanHD[ie][ieta]; 
00619     y2 = meanHD[ie+1][ieta]; 
00620   }
00621   else {
00622     if(mip == 0) {         // not mip
00623       y1 = meanHD_nomip[ie][ieta]; 
00624       y2 = meanHD_nomip[ie+1][ieta]; 
00625     }
00626     else {                 // mip in ECAL
00627       y1 = meanHD_mip[ie][ieta]; 
00628       y2 = meanHD_mip[ie+1][ieta]; 
00629     }
00630   }
00631 
00632   if(debug) {
00633     //  cout.width(6);
00634     LogDebug("FastCalorimetry") << std::endl
00635                                 << " HCALResponse::interHD mean " << std::endl
00636                                 << " x, x1-x2, y1-y2 = " 
00637                                 << e << ", " << x1 <<"-" << x2 << " "
00638                                 << y1 <<"-" << y2 << std::endl;  
00639   }
00640   
00641   mean =  e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      
00642   
00643 
00644   if(mip == 2) {           // mip doesn't matter
00645     y1 = sigmaHD[ie][ieta]; 
00646     y2 = sigmaHD[ie+1][ieta]; 
00647   }
00648   else {
00649     if(mip == 0) {         // not mip
00650       y1 = sigmaHD_nomip[ie][ieta]; 
00651       y2 = sigmaHD_nomip[ie+1][ieta]; 
00652     }
00653     else {                 // mip in ECAL
00654       y1 = sigmaHD_mip[ie][ieta]; 
00655       y2 = sigmaHD_mip[ie+1][ieta]; 
00656     }
00657   }
00658   
00659   if(debug) {
00660     //  cout.width(6);
00661     LogDebug("FastCalorimetry") << std::endl
00662                                 << " HCALResponse::interHD sigma" << std::endl
00663                                 << " x, x1-x2, y1-y2 = " 
00664                                 << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
00665   
00666   }
00667  
00668   sigma = e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      
00669 
00670 
00671   if(debug) {
00672     //cout.width(6);
00673     LogDebug("FastCalorimetry") << std::endl
00674                                 << " HCALResponse::interHD " << std::endl
00675                                 << " e, ie, ieta = " << e << " " << ie << " " << ieta << std::endl
00676                                 << " mean, sigma  = " << mean << " " << sigma << std::endl ;
00677   }
00678 
00679 }
00680 
00681 
00682 void HCALResponse::interEM(double e, int ie, int ieta)
00683 { 
00684   double y1 = meanEM[ie][ieta]; 
00685   double y2 = meanEM[ie+1][ieta]; 
00686   double x1 = eGridEM[ie];
00687   double x2 = eGridEM[ie+1];
00688   
00689   if(debug) {
00690     //  cout.width(6);
00691     LogDebug("FastCalorimetry") << std::endl
00692                                 << " HCALResponse::interEM mean " << std::endl
00693                                 << " x, x1-x2, y1-y2 = " 
00694                                 << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
00695   
00696   }
00697 
00698   mean =  e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      
00699   
00700   y1 = sigmaEM[ie][ieta]; 
00701   y2 = sigmaEM[ie+1][ieta]; 
00702   
00703   if(debug) {
00704     //  cout.width(6);
00705     LogDebug("FastCalorimetry") << std::endl
00706                                 << " HCALResponse::interEM sigma" << std::endl
00707                                 << " x, x1-x2, y1-y2 = " 
00708                                 << e << ", " << x1 <<"-" << x2 << " " << y1 <<"-" << y2 << std::endl; 
00709   
00710   }
00711 
00712   sigma = e * (y1 + (y2 - y1) * (e - x1)/(x2 - x1));      
00713 }
00714 
00715 
00716 
00717 // Old parametrization for hadrons
00718 double HCALResponse::getHCALEnergyResolution(double e, int hit){
00719   
00720   if(hit==hcforward) 
00721     return e *sqrt( RespPar[VFCAL][1][0]*RespPar[VFCAL][1][0] / e + 
00722                     RespPar[VFCAL][1][1]*RespPar[VFCAL][1][1] );
00723   else
00724     return  e * sqrt( RespPar[HCAL][hit][0]*RespPar[HCAL][hit][0]/(e)
00725                       + RespPar[HCAL][hit][1]*RespPar[HCAL][hit][1]);   
00726 
00727 }
00728 
00729 // Old parameterization of the calo response to hadrons
00730 double HCALResponse::getHCALEnergyResponse(double e, int hit){
00731 
00732   double s = eResponseScale[hit];
00733   double n = eResponseExponent;
00734   double p = eResponsePlateau[hit];
00735   double c = eResponseCoefficient;
00736 
00737   double response = e * p / (1+c*exp(n * log(s/e)));
00738 
00739   if(response<0.) response = 0.;
00740 
00741   return response;
00742 }
00743 
00744 // old parameterization of the HF response to electrons
00745 double HCALResponse::getHFEnergyResolution(double EGen)
00746 {
00747   return EGen *sqrt( RespPar[VFCAL][0][0]*RespPar[VFCAL][0][0] / EGen + 
00748                      RespPar[VFCAL][0][1]*RespPar[VFCAL][0][1] );
00749 }  
00750 
00751 
00752 #ifdef IJKLMMNOP // This stuff was moved to Calorimetry.cfi
00753 // default values for old prameterizations
00754 const double HCALResponse::RespByDefault[3][2][3] = {
00755   //Numbers taken from Calorimetry TDR's.
00756   //ECAL - dummy, the numbers are in  FASTEnergyReconstructor.cc
00757   //Stochastic Constant Noise 
00758   {{3*0.},   //barrel
00759    {3*0.}}, //endcap
00760   //HCAL
00761   {{1.22,       0.05,       0},    //barrel
00762    {1.30,       0.05,       0}},   //endcap (R. Harris - 17-oct-2004)
00763   //VFCAL
00764   {{1.82,       0.09,    0},  //hadrons
00765    {1.38,       0.05,    0}}  //electrons & photons
00766 };
00767 #endif