Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

HadEcalEtaResponseBar.cxx

Go to the documentation of this file.
00001 #include "FastShowerUtils/Normalisers/HadEcalEtaResponseBar.h"
00002 
00003 #include "FastShowerUtils/ParticleParameters.h"
00004 
00005 #include "CLHEP/Random/RandFlat.h"
00006 
00007 #include <cmath>
00008 
00009 namespace FastShower{
00010 
00011   double HadEcalEtaResponseBar::value(const ParticleParameters& pp) const{
00012   
00013     // response symmetric about eta=0.0
00014     double aEta = fabs(pp.eta());
00015     
00016     // spline knots
00017     double x[14]={0.05, 0.15, 0.35, 0.55, 0.75, 0.95, 1.25, 
00018                   1.45, 1.75, 2.05, 2.25, 2.65, 2.95, 3.15 };
00019 
00020     double a[2][14] = {{.000, .839, .837, .860, .847, .846, .793,
00021                         .853, .815, .839, .839, .857, .823, .775},
00022                        {.000, .341, .337, .390, .442, .444, .515,
00023                         .543, .440, .489, .431, .433, .368, .412}};
00024     double b[2][14] = {{.000,-.0508, .0520, .0288,-.0113,-.184,-.0645,
00025                         .00211,-.140, .0839, .0523, .0354,-.0434,-.545},
00026                        {.000,-.0950, .0604, .359, .0759, .151, .413,
00027                         -.413,-.258, .0672,-.105,-.0408, .0417,-.0468}};
00028     double c[2][14] = {{.000, .000, 1.03,-1.14, .944,-1.81, 2.40,
00029                         -2.18, 1.47,-.722, .616,-.700, .503,-2.18},
00030                        {.000, .000, 1.55,-.0633,-1.35, 1.73, -.420,
00031                         -2.33, 3.11,-2.03, 1.45,-1.13, 1.34,-1.63}};
00032     double d[2][14] = {{.000, 3.43,-3.62, 3.48,-4.59, 7.02,-5.09,
00033                         6.08,-2.43, 1.49,-2.19, 1.00,-2.98, 3.63},
00034                        {.000, 5.18,-2.70,-2.15, 5.13,-3.58,-2.13,
00035                         9.07,-5.71, 3.87,-4.31, 2.06,-3.30, 2.72}};
00036 
00037 
00038     // iEta according to the abscissa of the spline function
00039     int iEta = (int)(aEta*10) + 1;
00040     double xval = (double)(iEta)*0.1 - 0.05;
00041 
00042     // default indices
00043     int i = 12;
00044     int j = 13;
00045 
00046     if (iEta>30) {
00047       // e.m. response saturates at |eta|=3.0
00048       aEta=3.0; 
00049     }else {
00050       // everything ends-up here if not saturated
00051       i=-1;
00052       do {i+=1;}
00053       while (i<13 && xval>x[i+1]);
00054     }
00055     
00056     // e.m. response at |eta|
00057     double result = a[1][j] + b[1][j] * (aEta-x[i])
00058                             + c[1][j] * std::pow(aEta-x[i],2)
00059                             + d[1][j] * std::pow(aEta-x[i],3);
00060 
00061     // e.m. normalisation at |eta|=0.2
00062     double emNorm = a[1][j] + b[1][j] * (0.2-x[1])
00063                             + c[1][j] * std::pow(0.2-x[1],2)
00064                             + d[1][j] * std::pow(0.2-x[1],3);
00065 
00066 
00067     // relative response factor wrt e.m. response at |eta|=0.2
00068     return result/emNorm;
00069   }
00070   //
00071   IFnOfParticleParameters* HadEcalEtaResponseBar::clone() const {
00072     return new HadEcalEtaResponseBar(*this);
00073   }
00074 }//namespace
00075 
00076 

Generated on Tue Mar 18 11:49:59 2003 for FastShowerUtils by doxygen1.3-rc1