CMS 3D CMS Logo

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