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

HadHcalEtaResponseBar.cxx

Go to the documentation of this file.
00001 #include "FastShowerUtils/Normalisers/HadHcalEtaResponseBar.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 HadHcalEtaResponseBar::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     // 2nd index is flag: (0)->e.m.+had.  &   (1)->e.m.
00021     double a[2][14] = {{.000, .839, .837, .860, .847, .846, .793,
00022                         .853, .815, .839, .839, .857, .823, .775},
00023                        {.000, .341, .337, .390, .442, .444, .515,
00024                         .543, .440, .489, .431, .433, .368, .412}};
00025     double b[2][14] = {{.000,-.0508, .0520, .0288,-.0113,-.184,-.0645,
00026                         .00211,-.140, .0839, .0523, .0354,-.0434,-.545},
00027                        {.000,-.0950, .0604, .359, .0759, .151, .413,
00028                         -.413,-.258, .0672,-.105,-.0408, .0417,-.0468}};
00029     double c[2][14] = {{.000, .000, 1.03,-1.14, .944,-1.81, 2.40,
00030                         -2.18, 1.47,-.722, .616,-.700, .503,-2.18},
00031                        {.000, .000, 1.55,-.0633,-1.35, 1.73, -.420,
00032                         -2.33, 3.11,-2.03, 1.45,-1.13, 1.34,-1.63}};
00033     double d[2][14] = {{.000, 3.43,-3.62, 3.48,-4.59, 7.02,-5.09,
00034                         6.08,-2.43, 1.49,-2.19, 1.00,-2.98, 3.63},
00035                        {.000, 5.18,-2.70,-2.15, 5.13,-3.58,-2.13,
00036                         9.07,-5.71, 3.87,-4.31, 2.06,-3.30, 2.72}};
00037 
00038 
00039     // iEta according to the abscissa of the spline function
00040     int iEta = (int)(aEta*10) + 1;
00041     double xval = (double)(iEta)*0.1 - 0.05;
00042 
00043     // default indices
00044     int i = 10;
00045     int j = 11;
00046 
00047     if (iEta>25) {
00048       // e.m.+had. response saturates at |eta|=2.5
00049       aEta=2.5;
00050     } else {
00051       // everything ends-up here if not saturated
00052       i=-1;
00053       do {i+=1;}
00054       while (i<13 && xval>x[i+1]);
00055     }
00056     
00057     // response at |eta|
00058     // e.m.+had. response at |eta|
00059     double emPLUShad = a[0][j] + b[0][j] * (aEta-x[i])
00060                                + c[0][j] * std::pow(aEta-x[i],2)
00061                                + d[0][j] * std::pow(aEta-x[i],3);
00062     // e.m. response at |eta|
00063     double em = a[1][j] + b[1][j] * (aEta-x[i])
00064                         + c[1][j] * std::pow(aEta-x[i],2)
00065                         + d[1][j] * std::pow(aEta-x[i],3);
00066     // had. response at |eta|
00067     double result = emPLUShad - em;
00068 
00069     // normalisation
00070     // e.m. normalisation at |eta|=0.2
00071     double emNorm = a[1][13] + b[1][13] * (0.2-x[1])
00072                              + c[1][13] * std::pow(0.2-x[1],2)
00073                              + d[1][13] * std::pow(0.2-x[1],3);
00074 
00075     // e.m.+had. normalisation at |eta|=0.2
00076     double emhadNorm = a[0][j] + b[0][j] * (0.2-x[1])
00077                                + c[0][j] * std::pow(0.2-x[1],2)
00078                                + d[0][j] * std::pow(0.2-x[1],3);
00079     // had. normalisation at |eta|=0.2
00080     double hadNorm = emhadNorm - emNorm;
00081 
00082 
00083     // relative response factors wrt had. response at |eta|=0.2
00084     return result/hadNorm;
00085   }
00086   //
00087   IFnOfParticleParameters* HadHcalEtaResponseBar::clone() const {
00088     return new HadHcalEtaResponseBar(*this);
00089   }
00090 }//namespace
00091 
00092 

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