CMS 3D CMS Logo

EvolutionECAL.cc
Go to the documentation of this file.
2 #include <memory>
3 
4 //_____________________________________________________
6  double f = 0;
7  if (z <= 0)
8  return f;
9  if (z >= 0.22)
10  return f;
11 
12  double e0 = 6.91563e-02;
13  double e1 = 1.64406e+00;
14  double e2 = 6.42509e-01;
15  double E = e0 / (1 + exp(e1 * (log10(mu) - e2)));
16 
17  double d0 = 3.85334e-01;
18  double d1 = -1.04647e-02;
19  double D = d0 * exp(d1 * mu);
20 
21  double c0 = 3.77629e-01;
22  double c1 = -3.23755e-01;
23  double c2 = 1.50247e+00;
24  double c3 = 3.03278e-01;
25  double C = -1 + c0 * exp(c1 * mu) * (1 + c2 * exp(c3 * mu));
26 
27  double b0 = -3.33575e-01;
28  double b1 = 4.44856e-01;
29  double b2 = 1.91766e+00;
30  double b3 = 2.69423e+00;
31  double b4 = 1.06905e+00;
32  double B =
33  (1 / mu) * (b0 + b1 * log10(mu) + b2 * pow(log10(mu), 2) + b3 * pow(log10(mu), 3) + b4 * pow(log10(mu), 4));
34 
35  double a0 = 7.18248e-02;
36  double a1 = 1.89016e+00;
37  double a2 = 2.15651e-02;
38  double a3 = 2.30786e-02;
39  double A = exp(B * mu * 0.015) * (a0 / (exp(a1 * (log10(mu) + a2)) + 1) + a3);
40 
41  double R = 0.01 * D * (4 / (0.222 + E) / (0.222 + E) - 1 / ((0.22 - z) * (z + E)));
42  f = A * exp(-B * mu * (0.22 - z)) * (1 + C * exp(R));
43 
44  return f;
45 }
46 
47 //_____________________________________________________
48 //
49 // This function is for CMSSW FullSim "slope_LY"
50 // It returns weight<=1 for light collection from relative distance "z"
51 // 0 < z < 1
52 // z = 0 at the face of a crystal
53 // z = 1 at the photo-detector
54 // weight = 1 for undamaged crystal at any z
55 //
56 
57 /* double EvolutionECAL::LightCollectionEfficiencyWeightedOld(double z, double mu_ind)
58 
59 {
60  if(z<=0) return 0;
61  if(z>=1) return 0;
62  if(mu_ind<0) return 1;
63 
64  double mu = mu_ind + 0.1;
65  double lmu = log10(mu);
66 
67  double e0 = 6.91563e-02;
68  double e1 = 1.64406e+00;
69  double e2 = 6.42509e-01;
70  double E = e0/(1+exp(e1*(lmu-e2)));
71 
72  double d0 = 3.85334e-01;
73  double d1 = -1.04647e-02;
74  double D = d0*exp(d1*mu);
75 
76  double c0 = 3.77629e-01;
77  double c1 = -3.23755e-01;
78  double c2 = 1.50247e+00;
79  double c3 = 3.03278e-01;
80  double C = -1 + c0*exp(c1*mu)*(1+c2*exp(c3*mu));
81 
82  double b0 = -3.33575e-01;
83  double b1 = 4.44856e-01;
84  double b2 = 1.91766e+00;
85  double b3 = 2.69423e+00;
86  double b4 = 1.06905e+00;
87  double B = (1/mu)*(b0 + b1*lmu + b2*pow(lmu,2)
88  + b3*pow(lmu,3) + b4*pow(lmu,4));
89 
90  double a0 = 7.18248e-02;
91  double a1 = 1.89016e+00;
92  double a2 = 2.15651e-02;
93  double a3 = 2.30786e-02;
94  double A = exp(B*mu*0.015)*(a0/(exp(a1*(lmu+a2))+1)+a3);
95 
96  double R = 0.01*D*( 4/(0.222+E)/(0.222+E) - 1/((0.22*0.22)*(1.-z)*(z+E/0.22)) );
97 
98  // for undamaged crystal, mu0 = 0.1
99  double A0 = 0.0845209;
100  double B0 = -4.85951;
101  double C0 = -0.0681855;
102  double D0 = 0.384931;
103  double E0 = 0.0648029;
104  double R0 = 0.01*D0*( 4/(0.222+E0)/(0.222+E0) - 1/((0.22*0.22)*(1.-z)*(z+E0/0.22)) );
105 
106 
107  double f = A/A0 * exp(-(B*mu-B0*0.1)*0.22*(1.-z)) * (1+C*exp(R))/(1+C0*exp(R0));
108 
109  return f;
110 }
111 
112 */
113 
115  if (z <= 0)
116  return 0;
117  if (z >= 1)
118  return 0;
119  if (mu_ind < 0)
120  return 1;
121 
122  double mu = mu_ind + 0.7;
123  double lmu = log10(mu);
124 
125  double e0 = 6.91563e-02;
126  double e1 = 1.64406e+00;
127  double e2 = 6.42509e-01;
128  double E = e0 / (1 + exp(e1 * (lmu - e2)));
129 
130  double d0 = 3.85334e-01;
131  double d1 = -1.04647e-02;
132  double D = d0 * exp(d1 * mu);
133 
134  double c0 = 3.77629e-01;
135  double c1 = -3.23755e-01;
136  double c2 = 1.50247e+00;
137  double c3 = 3.03278e-01;
138  double C = -1 + c0 * exp(c1 * mu) * (1 + c2 * exp(c3 * mu));
139 
140  double b0 = -3.33575e-01;
141  double b1 = 4.44856e-01;
142  double b2 = 1.91766e+00;
143  double b3 = 2.69423e+00;
144  double b4 = 1.06905e+00;
145  double B = (1 / mu) * (b0 + b1 * lmu + b2 * pow(lmu, 2) + b3 * pow(lmu, 3) + b4 * pow(lmu, 4));
146 
147  double a0 = 7.18248e-02;
148  double a1 = 1.89016e+00;
149  double a2 = 2.15651e-02;
150  double a3 = 2.30786e-02;
151  double A = exp(B * mu * 0.015) * (a0 / (exp(a1 * (lmu + a2)) + 1) + a3);
152 
153  double R = 0.01 * D * (4 / (0.222 + E) / (0.222 + E) - 1 / ((0.22 * 0.22) * (1. - z) * (z + E / 0.22)));
154 
155  // for undamaged crystal, mu0 = 0.7
156  double A0 = 0.0631452;
157  double B0 = -0.52267;
158  double C0 = -0.139646;
159  double D0 = 0.382522;
160  double E0 = 0.054473;
161  double R0 = 0.01 * D0 * (4 / (0.222 + E0) / (0.222 + E0) - 1 / ((0.22 * 0.22) * (1. - z) * (z + E0 / 0.22)));
162 
163  double f = A / A0 * exp(-(B * mu - B0 * 0.7) * 0.22 * (1. - z)) * (1 + C * exp(R)) / (1 + C0 * exp(R0));
164 
165  return f;
166 }
167 
168 //_________________________________________________________
170  double x = fabs(eta);
171  if (x < 1.497) {
172  return exp(-4.11065 + 0.258478 * x);
173  } else {
174  return exp(-13.5112 + 7.913860 * x - 0.998649 * x * x);
175  }
176 }
177 
178 //_________________________________________________________
180  double x = fabs(eta);
181  if (x < 1.497) {
182  double et = x / 1.48 * 34.0;
183  double etaprof = (9.54827 + et * 0.0379222 + et * et * (-0.00257047) + et * et * et * 0.00073546 +
184  et * et * et * et * (-1.49683e-05)) /
185  9.54827;
186  return etaprof;
187  } else {
188  return 1.0;
189  }
190 }
191 
192 //_________________________________________________________
194  double fluence = DamageProfileEta(eta) * 2.7e+13 / 500.0 * lumi;
195  double mu = 2.08E-13 * pow(fluence, 1.0049);
196  return mu;
197 }
198 
199 //_________________________________________________________
201  double alpha = 4.72877e+00;
202  double beta = 5.91296e-01;
203  double amp1 = 6.24495e+02;
204  double amp2 = 1.84367e-01;
205  double offset = 2.00705e+01;
206  if (z >= 0.0 && z <= 22.0) {
207  double term1 = (amp1 / TMath::Gamma(alpha)) * pow((beta * z), (alpha - 1)) * exp(-beta * z);
208  double term2 = amp2 * (z - 11.0) * (z - 11.0) + offset;
209  return (term1 + term2) / 150.44;
210  } else {
211  return 0;
212  }
213 }
214 
215 //_________________________________________________________
216 Double_t EvolutionECAL::EquilibriumFractionColorCentersEM(double *x, double *par) {
217  double instantLumi = par[0];
218  double eta = par[1];
219  double rate = DoseLongitudinalProfile(x[0]) * 5.0 * DamageProfileEta(eta) * instantLumi / 1e+34;
220  if (rate <= 0.0)
221  rate = 0.0;
222  double alpha = par[2];
223  return rate / (alpha + rate);
224 }
225 
226 //____________________________________________________________
228  double mu_max = 2.0;
229  double alpha1 = 3.41488e+00;
230 
231  std::unique_ptr<TF1> ftmp1 = std::make_unique<TF1>("ftmp1",
232  this,
234  0.0,
235  22.0,
236  3,
237  "EvolutionECAL",
238  "EquilibriumFractionColorCentersEM");
239  ftmp1->SetParameters(lumi, eta, alpha1);
240  double muEM = mu_max * ftmp1->Integral(0.0, 22.0) / 22.0;
241 
242  return muEM;
243 }
244 
245 //_____________________________________________________________
247  double retval = 1.0;
248  double x = mu;
249  if (x < 1e-4)
250  return retval;
251  if (x >= 200.0)
252  x = 200.0; // parameterization is not valid for large mu
253 
254  double par[11] = {1.00000e+01,
255  -4.41441e-01,
256  7.08607e-02,
257  -3.75572e-01,
258  -3.60410e-01,
259  1.30130e-01,
260  -4.72350e-01,
261  3.36315e-01,
262  -1.19872e-01,
263  1.99574e-02,
264  -1.22910e-03};
265 
266  double alpha = par[0];
267 
268  double f1 = par[1] * x + par[2] * x * x;
269  double u = log(x);
270  double f2 = par[10];
271  for (int i = 9; i >= 3; i--)
272  f2 = par[i] + f2 * u;
273 
274  retval = f1 / (1.0 + exp(alpha * u)) + f2 / (1.0 + exp(-alpha * u));
275  retval = exp(retval);
276  return retval;
277 }
278 
279 //_____________________________________________________________
281  if (ene <= 1e-3)
282  return 0.0;
283 
284  double x = mu;
285  if (mu <= 0.06)
286  x = 0.06;
287  if (mu >= 150.0)
288  x = 150.0;
289 
290  double par[9] = {5.17712e-03,
291  1.97597e-02,
292  3.36596e-02,
293  2.84505e-02,
294  1.38480e-02,
295  1.11498e-02,
296  7.73634e-03,
297  -1.30767e-03,
298  -2.20628e-03};
299 
300  double u = log10(x);
301  double slope = par[8];
302  for (int i = 7; i >= 0; i--)
303  slope = par[i] + slope * u;
304 
305  double retval = 1.0 + slope * log10(ene / 50.0);
306  if (retval <= 0.0)
307  retval = 0.0;
308  return retval;
309 }
310 
311 //_____________________________________________________________
313  double x = mu;
314  if (mu <= 0.01)
315  x = 0.01;
316  if (mu >= 200.0)
317  x = 200.0;
318 
319  double par[10] = {-6.21503e+00,
320  1.59759e+00,
321  -4.75221e-02,
322  -3.90299e-02,
323  3.97269e-03,
324  2.29574e-03,
325  -1.05280e-04,
326  -9.60963e-05,
327  -1.29594e-06,
328  1.70850e-06};
329 
330  double u = log(x);
331  double f = par[9];
332  for (int i = 8; i >= 0; i--)
333  f = par[i] + f * u;
334  return exp(f);
335 }
336 
337 //__________________________________________________________
338 double EvolutionECAL::ChargeVPTCathode(double instLumi, double eta, double integralLumi) {
339  double charge = 0.0;
340  double tmpLumi = 0.0;
341  double stepLumi = 1.0;
342  double muEM = InducedAbsorptionEM(instLumi, eta);
343  while (tmpLumi < integralLumi) {
344  tmpLumi += stepLumi;
345  double muHD = InducedAbsorptionHadronic(tmpLumi, eta);
346  double SS0 = DegradationMeanEM50GeV(muEM + muHD);
347  charge += SS0 * 0.26e-3 * DamageProfileEta(eta) * stepLumi;
348  }
349  return charge;
350 }
351 
352 //_________________________________________________________
353 double EvolutionECAL::AgingVPT(double instLumi, double integralLumi, double eta) {
354  if (fabs(eta) < 1.497)
355  return 1.0;
356  double Q = ChargeVPTCathode(instLumi, eta, integralLumi);
357  double result = 0.772 + 0.228 * (3.94304e-01 * exp(-Q / 5.99232e-04) + (1 - 3.94304e-01) * exp(-Q / 1.58243e-02));
358  return result;
359 }
360 
361 //_________________________________________________________
362 double EvolutionECAL::NoiseFactorFE(double lumi, double eta) {
363  double x = fabs(eta);
364  if (x < 1.497) {
365  return sqrt(1.0 + 0.495 * 0.03512 * lumi * DamageProfileEtaAPD(eta));
366  } else {
367  return 1.0;
368  }
369 }
weight_default_t b3[10]
Definition: b3.h:9
weight_default_t b1[25]
Definition: b1.h:9
Definition: APVGainStruct.h:7
Double_t EquilibriumFractionColorCentersEM(double *x, double *par)
weight_default_t b4[1]
Definition: b4.h:9
double LightCollectionEfficiencyWeighted(double z, double mu_ind)
static const double slope[3]
Divides< arg, void > D0
Definition: Factorize.h:135
double NoiseFactorFE(double lumi, double eta)
constexpr int pow(int x)
Definition: conifer.h:24
double ResolutionConstantTermEM50GeV(double mu)
float float float z
double DegradationMeanEM50GeV(double mu)
double DoseLongitudinalProfile(double z)
T sqrt(T t)
Definition: SSEVec.h:19
double f[11][100]
double InducedAbsorptionHadronic(double lumi, double eta)
weight_default_t b2[10]
Definition: b2.h:9
double ChargeVPTCathode(double instLumi, double eta, double integralLumi)
double InducedAbsorptionEM(double lumi, double eta)
static constexpr float d0
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
static constexpr float a0
double DegradationNonLinearityEM50GeV(double mu, double ene)
double rate(double x)
Definition: Constants.cc:3
double DamageProfileEta(double eta)
float x
Definition: APVGainStruct.h:7
static constexpr float b0
static constexpr float d1
double DamageProfileEtaAPD(double eta)
double LightCollectionEfficiency(double z, double mu)
Definition: EvolutionECAL.cc:5
double AgingVPT(double instLumi, double integralLumi, double eta)