CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EMECALShowerParametrization.h
Go to the documentation of this file.
1 #ifndef EMECALShowerParametrization_H
2 #define EMECALShowerParametrization_H
3 
8 
16 #include <vector>
17 #include <cmath>
18 
20 {
21  public:
22 
24  const HCALProperties* hcal,
25  const PreshowerLayer1Properties* layer1,
26  const PreshowerLayer2Properties* layer2,
27  const std::vector<double>& coreIntervals,
28  const std::vector<double>& tailIntervals,
29  double RCFact=1.,
30  double RTFact=1.) :
31  theECAL(ecal),
32  theHCAL(hcal),
33  theLayer1(layer1),
34  theLayer2(layer2),
35  theCore(coreIntervals),
36  theTail(tailIntervals),
37  theRcfactor(RCFact),
38  theRtfactor(RTFact){}
39 
41 
42 
43  //====== Longitudinal profiles =======
44 
45  // -------- Average -------
46 
47  inline double meanT(double lny) const {
48  if (theECAL->isHom()) return meanTHom(lny);
49  return meanTSam(lny); }
50 
51  inline double meanAlpha(double lny) const {
52  if (theECAL->isHom()) return meanAlphaHom(lny);
53  return meanAlphaSam(lny); }
54 
55 
56  // Average Homogeneous
57 
58  inline double meanTHom(double lny) const {
59  return lny-0.858; }
60  //return lny-1.23; }
61 
62  inline double meanAlphaHom(double lny) const {
63  return 0.21+(0.492+2.38/theECAL->theZeff())*lny; }
64 
65 
66  // Average sampling
67 
68 
69  inline double meanTSam(double lny) const {
70  return meanTHom(lny) - 0.59/theECAL->theFs() - 0.53*(1.-theECAL->ehat()); }
71 
72  inline double meanAlphaSam(double lny) const {
73  return meanAlphaHom(lny) - 0.444/theECAL->theFs(); }
74 
75 
76 
77 
78 
79 
80 
81  // ---- Fluctuated longitudinal profiles ----
82 
83  inline double meanLnT(double lny) const {
84  if (theECAL->isHom()) return meanLnTHom(lny);
85  return meanLnTSam(lny); }
86 
87  inline double sigmaLnT(double lny) const {
88  if (theECAL->isHom()) return sigmaLnTHom(lny);
89  return sigmaLnTSam(lny); }
90 
91 
92  inline double meanLnAlpha(double lny) const {
93  if (theECAL->isHom()) return meanLnAlphaHom(lny);
94  return meanLnAlphaSam(lny); }
95 
96 
97  inline double sigmaLnAlpha(double lny) const {
98  if (theECAL->isHom()) return sigmaLnAlphaHom(lny);
99  return sigmaLnAlphaSam(lny); }
100 
101 
102  inline double correlationAlphaT(double lny) const {
103  if (theECAL->isHom()) return correlationAlphaTHom(lny);
104  return correlationAlphaTSam(lny); }
105 
106 
107 
108 
109  // Fluctuated longitudinal profiles homogeneous
110 
111  inline double meanLnTHom(double lny) const {
112  return std::log(lny-0.812); }
113 
114 
115  inline double sigmaLnTHom(double lny) const {
116  return 1./(-1.4+1.26*lny); }
117 
118  inline double meanLnAlphaHom(double lny) const {
119  return std::log(0.81+(0.458+2.26/theECAL->theZeff())*lny); }
120 
121  inline double sigmaLnAlphaHom(double lny) const {
122  return 1./(-0.58+0.86*lny); }
123 
124  inline double correlationAlphaTHom(double lny) const {
125  return 0.705-0.023*lny; }
126 
127  // Fluctuated longitudinal profiles sampling
128 
129 
130  inline double meanLnTSam(double lny) const {
131  return log( std::exp(meanLnTHom(lny)) - 0.55/theECAL->theFs() - 0.69*(1-theECAL->ehat()) ); }
132 
133  inline double sigmaLnTSam(double lny) const {
134  return 1./(-2.5 + 1.25*lny); }
135 
136  inline double meanLnAlphaSam(double lny) const {
137  return log( std::exp(meanLnAlphaHom(lny)) - 0.476/theECAL->theFs() ); }
138 
139  inline double sigmaLnAlphaSam(double lny) const {
140  return 1./(-0.82+0.79*lny); }
141 
142  inline double correlationAlphaTSam(double lny) const {
143  return 0.784-0.023*lny; }
144 
145 
146 
147 
148 
149 
150  //====== Radial profiles =======
151 
152 
153  // ---- Radial Profiles ----
154 
155  inline double rC(double tau, double E) const {
156  if (theECAL->isHom()) return rCHom(tau, E);
157  return rCSam(tau, E); }
158 
159  inline double rT(double tau, double E) const {
160  if (theECAL->isHom()) return rTHom(tau, E);
161  return rTSam(tau, E); }
162 
163  inline double p(double tau, double E) const {
164  if (theECAL->isHom()) return pHom(tau, E);
165  return pSam(tau, E); }
166 
167 
168 
169  // Radial Profiles
170 
171  inline double rCHom(double tau, double E) const {
172  return theRcfactor*(z1(E) + z2()*tau);
173  }
174 
175  inline double rTHom(double tau,double E) const {
176  return theRtfactor*k1() * ( std::exp(k3()*(tau-k2()))+
177  std::exp(k4(E)*(tau-k2())) );
178  }
179 
180  inline double pHom(double tau, double E) const {
181  double arg = (p2()-tau)/p3(E);
182  return p1()* std::exp(arg-std::exp(arg));
183  }
184 
185 
186  // Radial Profiles Sampling
187 
188  inline double rCSam(double tau, double E) const {
189  return rCHom(tau, E) - 0.0203*(1-theECAL->ehat()) + 0.0397/theECAL->theFs()*std::exp(-1.*tau);
190  }
191 
192  inline double rTSam(double tau,double E) const {
193  return rTHom(tau, E) -0.14*(1-theECAL->ehat()) - 0.495/theECAL->theFs()*std::exp(-1.*tau);
194  }
195 
196  inline double pSam(double tau, double E) const {
197  return pHom(tau, E) + (1-theECAL->ehat())*(0.348-0.642/theECAL->theFs()*std::exp(-1.*std::pow((tau-1),2) ) );
198  }
199 
200 
201 
202 
203 
204 
205  // ---- Fluctuations of the radial profiles ----
206 
207  inline double nSpots(double E) const {
208  if (theECAL->isHom()) return nSpotsHom(E);
209  return nSpotsSam(E); }
210 
211  inline double meanTSpot(double T) const {
212  if (theECAL->isHom()) return meanTSpotHom(T);
213  return meanTSpotSam(T); }
214 
215  inline double meanAlphaSpot(double alpha) const {
216  if (theECAL->isHom()) return meanAlphaSpotHom(alpha);
217  return meanAlphaSpotSam(alpha); }
218 
219 
220 
221 
222  // Fluctuations of the radial profiles
223 
224  inline double nSpotsHom(double E) const {
225  return 93.*std::log(theECAL->theZeff()) * std::pow(E,0.876); }
226 
227  inline double meanTSpotHom(double T) const {
228  return T*(0.698+0.00212*theECAL->theZeff()); }
229 
230  inline double meanAlphaSpotHom(double alpha) const {
231  return alpha*(0.639+0.00334*theECAL->theZeff()); }
232 
233 
234  // Fluctuations of the radial profiles Sampling
235 
236  inline double nSpotsSam(double E) const {
237  return 10.3/theECAL->resE()*std::pow(E, 0.959); }
238 
239  inline double meanTSpotSam(double T) const {
240  return meanTSpotHom(T)*(0.813+0.0019*theECAL->theZeff()); }
241 
242  inline double meanAlphaSpotSam(double alpha) const {
243  return meanAlphaSpotHom(alpha)*(0.844+0.0026*theECAL->theZeff()); }
244 
245 
246 
247 
248 
249  inline const ECALProperties* ecalProperties() const {
250  return theECAL;
251  }
252 
253  inline const HCALProperties* hcalProperties() const {
254  return theHCAL;
255  }
256 
258  return theLayer1;
259  }
260 
262  return theLayer2;
263  }
264 
265  inline const std::vector<double>& getCoreIntervals() const { return theCore;}
266 
267  inline const std::vector<double>& getTailIntervals() const { return theTail;}
268 
269  private:
270 
275 
276  const std::vector<double>& theCore;
277  const std::vector<double>& theTail;
278 
279  double theRcfactor;
280  double theRtfactor;
281 
282  double p1() const { return 2.632-0.00094*theECAL->theZeff(); }
283  double p2() const { return 0.401+0.00187*theECAL->theZeff(); }
284  double p3(double E) const { return 1.313-0.0686*std::log(E); }
285 
286  double z1(double E) const { return 0.0251+0.00319*std::log(E); }
287  double z2() const { return 0.1162-0.000381*theECAL->theZeff(); }
288 
289  double k1() const { return 0.6590-0.00309*theECAL->theZeff(); }
290  double k2() const { return 0.6450; }
291  double k3() const { return -2.59; }
292  double k4(double E) const { return 0.3585+0.0421*std::log(E); }
293 
294 };
295 
296 #endif
float alpha
Definition: AMPTWrapper.h:95
double sigmaLnT(double lny) const
const HCALProperties * hcalProperties() const
double meanAlphaSpot(double alpha) const
double rTSam(double tau, double E) const
double pSam(double tau, double E) const
double meanAlphaSpotSam(double alpha) const
double correlationAlphaTSam(double lny) const
double theZeff() const
Effective Z: 68.36 for Standard ECAL.
double sigmaLnTSam(double lny) const
EMECALShowerParametrization(const ECALProperties *ecal, const HCALProperties *hcal, const PreshowerLayer1Properties *layer1, const PreshowerLayer2Properties *layer2, const std::vector< double > &coreIntervals, const std::vector< double > &tailIntervals, double RCFact=1., double RTFact=1.)
double rC(double tau, double E) const
double meanAlphaHom(double lny) const
bool isHom() const
a rough estimate of ECAL resolution sigma/E = resE/sqrt(E)
const PreshowerLayer1Properties * theLayer1
A arg
Definition: Factorize.h:36
const std::vector< double > & getTailIntervals() const
const std::vector< double > & getCoreIntervals() const
double sigmaLnAlphaSam(double lny) const
const PreshowerLayer2Properties * theLayer2
double rCSam(double tau, double E) const
double meanLnTSam(double lny) const
double sigmaLnAlphaHom(double lny) const
double ehat() const
ehat = e/mip of the calorimeter. 0 for homogeneous one
double meanAlphaSpotHom(double alpha) const
double meanLnAlphaSam(double lny) const
const std::vector< double > & theCore
double rT(double tau, double E) const
const std::vector< double > & theTail
double meanAlphaSam(double lny) const
const PreshowerLayer1Properties * layer1Properties() const
double correlationAlphaT(double lny) const
double meanTHom(double lny) const
double theFs() const
Sampling fraction Fs of the calorimeter. 0 for homogeneous one.
const ECALProperties * ecalProperties() const
double meanLnTHom(double lny) const
double rTHom(double tau, double E) const
double p(double tau, double E) const
double meanLnAlphaHom(double lny) const
const PreshowerLayer2Properties * layer2Properties() const
double meanLnAlpha(double lny) const
double meanTSam(double lny) const
double sigmaLnTHom(double lny) const
double meanAlpha(double lny) const
double rCHom(double tau, double E) const
double sigmaLnAlpha(double lny) const
double correlationAlphaTHom(double lny) const
long double T
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double pHom(double tau, double E) const
double resE() const
a rough estimate of ECAL resolution sigma/E = resE/sqrt(E)
tuple log
Definition: cmsBatch.py:341