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