CMS 3D CMS Logo

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