CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/FastSimulation/ShowerDevelopment/interface/EMECALShowerParametrization.h

Go to the documentation of this file.
00001 #ifndef EMECALShowerParametrization_H
00002 #define EMECALShowerParametrization_H
00003 
00004 #include "FastSimulation/CalorimeterProperties/interface/ECALProperties.h"
00005 #include "FastSimulation/CalorimeterProperties/interface/HCALProperties.h"
00006 #include "FastSimulation/CalorimeterProperties/interface/PreshowerLayer1Properties.h"
00007 #include "FastSimulation/CalorimeterProperties/interface/PreshowerLayer2Properties.h"
00008 
00016 #include <vector>
00017 #include <cmath>
00018 
00019 class EMECALShowerParametrization
00020 {
00021  public:
00022 
00023   EMECALShowerParametrization(const ECALProperties* ecal,
00024                               const HCALProperties* hcal,
00025                               const PreshowerLayer1Properties* layer1,
00026                               const PreshowerLayer2Properties* layer2,
00027                               const std::vector<double>& coreIntervals,
00028                               const std::vector<double>& tailIntervals,
00029                               double RCFact=1.,
00030                               double RTFact=1.) : 
00031     theECAL(ecal),  
00032     theHCAL(hcal),
00033     theLayer1(layer1), 
00034     theLayer2(layer2),
00035     theCore(coreIntervals),
00036     theTail(tailIntervals),
00037     theRcfactor(RCFact),
00038     theRtfactor(RTFact){}
00039 
00040   virtual ~EMECALShowerParametrization() { }
00041 
00042 
00043   //====== Longitudinal profiles =======
00044 
00045   // -------- Average -------
00046 
00047   inline double meanT(double lny) const { 
00048     if (theECAL->isHom()) return meanTHom(lny);
00049     return meanTSam(lny); }
00050 
00051   inline double meanAlpha(double lny) const { 
00052     if (theECAL->isHom()) return meanAlphaHom(lny);
00053     return meanAlphaSam(lny); }
00054 
00055 
00056   // Average Homogeneous
00057 
00058   inline double meanTHom(double lny) const { 
00059     return lny-0.858; }
00060     //return lny-1.23; }
00061 
00062   inline double meanAlphaHom(double lny) const { 
00063     return 0.21+(0.492+2.38/theECAL->theZeff())*lny; }
00064 
00065 
00066   // Average sampling
00067 
00068 
00069   inline double meanTSam(double lny) const { 
00070     return meanTHom(lny) - 0.59/theECAL->theFs() - 0.53*(1.-theECAL->ehat()); }
00071 
00072   inline double meanAlphaSam(double lny) const { 
00073     return meanAlphaHom(lny) - 0.444/theECAL->theFs(); }
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081   // ---- Fluctuated longitudinal profiles ----
00082 
00083   inline double meanLnT(double lny) const {
00084     if (theECAL->isHom()) return meanLnTHom(lny); 
00085     return meanLnTSam(lny); }
00086 
00087   inline double sigmaLnT(double lny) const {
00088     if (theECAL->isHom()) return sigmaLnTHom(lny); 
00089     return sigmaLnTSam(lny); }
00090 
00091 
00092   inline double meanLnAlpha(double lny) const {
00093     if (theECAL->isHom()) return meanLnAlphaHom(lny); 
00094     return meanLnAlphaSam(lny); }
00095   
00096 
00097   inline double sigmaLnAlpha(double lny) const {
00098     if (theECAL->isHom()) return sigmaLnAlphaHom(lny); 
00099     return sigmaLnAlphaSam(lny); }
00100 
00101 
00102   inline double correlationAlphaT(double lny) const {
00103     if (theECAL->isHom()) return correlationAlphaTHom(lny); 
00104     return correlationAlphaTSam(lny); }
00105 
00106 
00107 
00108 
00109   // Fluctuated longitudinal profiles homogeneous
00110 
00111   inline double meanLnTHom(double lny) const {
00112     return std::log(lny-0.812); }
00113 
00114 
00115   inline double sigmaLnTHom(double lny) const {
00116     return 1./(-1.4+1.26*lny); }
00117 
00118   inline double meanLnAlphaHom(double lny) const {
00119     return std::log(0.81+(0.458+2.26/theECAL->theZeff())*lny); }
00120 
00121   inline double sigmaLnAlphaHom(double lny) const {
00122     return 1./(-0.58+0.86*lny); }
00123 
00124   inline double correlationAlphaTHom(double lny) const {
00125     return 0.705-0.023*lny; }
00126 
00127   // Fluctuated longitudinal profiles sampling
00128 
00129 
00130   inline double meanLnTSam(double lny) const {
00131     return log( std::exp(meanLnTHom(lny)) - 0.55/theECAL->theFs() - 0.69*(1-theECAL->ehat()) ); }
00132 
00133   inline double sigmaLnTSam(double lny) const {
00134     return 1./(-2.5 + 1.25*lny); }
00135 
00136   inline double meanLnAlphaSam(double lny) const {
00137     return log( std::exp(meanLnAlphaHom(lny)) - 0.476/theECAL->theFs() ); }
00138 
00139   inline double sigmaLnAlphaSam(double lny) const {
00140     return 1./(-0.82+0.79*lny); }
00141 
00142   inline double correlationAlphaTSam(double lny) const {
00143     return 0.784-0.023*lny; }
00144 
00145 
00146 
00147 
00148 
00149 
00150   //====== Radial profiles =======
00151 
00152 
00153   // ---- Radial Profiles ----
00154 
00155   inline double rC(double tau, double E) const {
00156     if (theECAL->isHom()) return rCHom(tau, E); 
00157     return rCSam(tau, E); }
00158   
00159   inline double rT(double tau, double E) const {
00160     if (theECAL->isHom()) return rTHom(tau, E); 
00161     return rTSam(tau, E); }
00162 
00163   inline double p(double tau, double E) const {
00164     if (theECAL->isHom()) return pHom(tau, E); 
00165     return pSam(tau, E); }
00166 
00167 
00168 
00169   // Radial Profiles
00170 
00171   inline double rCHom(double tau, double E) const {
00172     return theRcfactor*(z1(E) + z2()*tau);
00173   }  
00174 
00175   inline double rTHom(double tau,double E) const {
00176     return theRtfactor*k1() * ( std::exp(k3()*(tau-k2()))+
00177                                 std::exp(k4(E)*(tau-k2())) );
00178   }
00179 
00180   inline double pHom(double tau, double E) const {
00181     double arg = (p2()-tau)/p3(E);
00182     return p1()* std::exp(arg-std::exp(arg));
00183   }
00184 
00185   
00186   // Radial Profiles Sampling
00187 
00188   inline double rCSam(double tau, double E) const {
00189     return rCHom(tau, E) - 0.0203*(1-theECAL->ehat()) + 0.0397/theECAL->theFs()*std::exp(-1.*tau);
00190   }
00191 
00192   inline double rTSam(double tau,double E) const {
00193     return rTHom(tau, E) -0.14*(1-theECAL->ehat()) - 0.495/theECAL->theFs()*std::exp(-1.*tau);
00194   }
00195 
00196   inline double pSam(double tau, double E) const {
00197     return pHom(tau, E) + (1-theECAL->ehat())*(0.348-0.642/theECAL->theFs()*std::exp(-1.*std::pow((tau-1),2) ) );
00198   }
00199 
00200 
00201 
00202 
00203 
00204 
00205   // ---- Fluctuations of the radial profiles ----
00206 
00207   inline double nSpots(double E) const {
00208     if (theECAL->isHom()) return nSpotsHom(E); 
00209     return nSpotsSam(E); }
00210 
00211   inline double meanTSpot(double T) const {
00212     if (theECAL->isHom()) return meanTSpotHom(T); 
00213     return meanTSpotSam(T); }
00214 
00215   inline double meanAlphaSpot(double alpha) const {
00216     if (theECAL->isHom()) return meanAlphaSpotHom(alpha); 
00217     return meanAlphaSpotSam(alpha); }
00218 
00219 
00220 
00221 
00222   // Fluctuations of the radial profiles
00223   
00224   inline double nSpotsHom(double E) const {
00225     return 93.*std::log(theECAL->theZeff()) * std::pow(E,0.876); }
00226 
00227   inline double meanTSpotHom(double T) const {
00228     return T*(0.698+0.00212*theECAL->theZeff()); }
00229 
00230   inline double meanAlphaSpotHom(double alpha) const {
00231     return alpha*(0.639+0.00334*theECAL->theZeff()); }
00232 
00233 
00234   // Fluctuations of the radial profiles Sampling
00235 
00236   inline double nSpotsSam(double E) const {
00237     return 10.3/theECAL->resE()*std::pow(E, 0.959); }
00238 
00239   inline double meanTSpotSam(double T) const {
00240     return meanTSpotHom(T)*(0.813+0.0019*theECAL->theZeff()); }
00241 
00242   inline double meanAlphaSpotSam(double alpha) const {
00243     return meanAlphaSpotHom(alpha)*(0.844+0.0026*theECAL->theZeff()); }
00244 
00245 
00246 
00247 
00248 
00249   inline const ECALProperties* ecalProperties() const { 
00250     return theECAL; 
00251   }
00252 
00253   inline const HCALProperties* hcalProperties() const { 
00254     return theHCAL; 
00255   }
00256 
00257   inline const PreshowerLayer1Properties* layer1Properties() const { 
00258     return theLayer1; 
00259   }
00260 
00261   inline const PreshowerLayer2Properties* layer2Properties() const { 
00262     return theLayer2; 
00263   }
00264 
00265   inline const std::vector<double>& getCoreIntervals() const { return theCore;}
00266 
00267   inline const std::vector<double>& getTailIntervals() const { return theTail;}
00268 
00269  private:
00270   
00271   const ECALProperties* theECAL;
00272   const HCALProperties* theHCAL;
00273   const PreshowerLayer1Properties* theLayer1;
00274   const PreshowerLayer2Properties* theLayer2;
00275 
00276   const std::vector<double>& theCore;
00277   const std::vector<double>& theTail;
00278 
00279   double theRcfactor;
00280   double theRtfactor;
00281 
00282   double p1() const { return 2.632-0.00094*theECAL->theZeff(); }
00283   double p2() const { return 0.401+0.00187*theECAL->theZeff(); }
00284   double p3(double E) const { return 1.313-0.0686*std::log(E); }
00285 
00286   double z1(double E) const { return 0.0251+0.00319*std::log(E); }
00287   double z2() const { return 0.1162-0.000381*theECAL->theZeff(); }
00288 
00289   double k1() const { return 0.6590-0.00309*theECAL->theZeff(); }
00290   double k2() const { return 0.6450; }
00291   double k3() const { return -2.59; }
00292   double k4(double E) const { return 0.3585+0.0421*std::log(E); }
00293 
00294 };
00295 
00296 #endif