9#include <cdc/modules/cdcDigitizer/EDepInGas.h>
10#include <framework/gearbox/Unit.h>
11#include <framework/logging/Logger.h>
13#include <TDatabasePDG.h>
40 const double aHe = 4.003;
44 const double aC = 12.011;
48 const double aH = 1.008;
51 double f = fHe + fC + fH;
55 m_z1 = fHe * zHe + fC * zC + fH * zH;
56 m_a1 = fHe * aHe + fC * aC + fH * aH;
63 const double aW = 183.842;
66 const double zAl = 13;
67 const double aAl = 26.982;
73 m_z2 = fW * zW + fAl * zAl;
74 m_a2 = fW * aW + fAl * aAl;
84 f = fHe + fC + fH + fW + fAl;
90 m_z0 = fHe * zHe + fC * zC + fH * zH + fW * zW + fAl * zAl;
91 m_a0 = fHe * aHe + fC * aC + fH * aH + fW * aW + fAl * aAl;
101 m_ak1[2][0] = 0.8135;
102 m_ak1[2][1] = -11.33;
103 m_ak1[3][0] = 0.00402;
104 m_ak1[3][1] = -10.36;
105 m_ak1[4][0] = - 1.7564;
106 m_ak1[4][1] = - 9.611;
107 m_ak1[5][0] = - 1.5065;
108 m_ak1[5][1] = - 8.6753;
110 m_bk1[0][0] = - 8.5619;
112 m_bk1[1][0] = - 4.5857;
114 m_bk1[2][0] = - 2.1447;
116 m_bk1[3][0] = - 1.1582;
118 m_bk1[4][0] = 0.67256;
120 m_bk1[5][0] = 1.0156;
123 m_ck1[0][0] = 1.82804;
125 m_ck1[1][0] = 1.27579;
127 m_ck1[2][0] = 0.93676;
129 m_ck1[3][0] = 0.79975;
131 m_ck1[4][0] = 0.49093;
133 m_ck1[5][0] = 0.44805;
142 if (mode == 0)
return e3 * xi1 / (xi1 + xi2);
144 static TDatabasePDG* ptrTDatabasePDG = TDatabasePDG::Instance();
145 const double mass = ptrTDatabasePDG->GetParticle(pdg)->Mass();
146 const double chrg = fabs(ptrTDatabasePDG->GetParticle(pdg)->Charge() / 3);
151 return e3 * me1 / me0;
154 if (mode == 1)
return e3 * me1 / (me1 + me2);
159 const double mom2 = mom * mom;
160 const double beta2 = mom2 / (mass * mass + mom2);
161 const double buf = 0.1535e-3 * dx * chrg * chrg / beta2;
164 const double xi1i = 1 / xi1;
165 const double xi2i = 1 / xi2;
166 const double lm1min = -me1 * xi1i;
167 const double lm1max = (e3 - me1) * xi1i;
168 double lm1 = (e3 * me1 / (me1 + me2) - me1) * xi1i;
169 lm1 = min(lm1, lm1max);
170 lm1 = max(lm1, lm1min);
175 const double lm2b = (e3 - me1 - me2) * xi2i;
176 const double r = xi1 * xi2i;
179 while (itry <= 2 || fabs(lm1 - lm1old) > 0.001) {
187 lm1 = max(lm1min, lm1);
188 lm1 = min(lm1max, lm1);
189 double lm2 = lm2b - r * lm1;
190 double emlm1 = exp(-lm1);
191 double emlm2 = exp(-lm2);
192 double dldlm1 = 1 - emlm1 - r + r * emlm2;
193 double dl2dlm12 = emlm1 + r * r * emlm2;
194 deltal = dldlm1 / dl2dlm12;
198 if (mode == 3)
return xi1 * lm1 + me1;
200 double lm2 = lm2b - r * lm1;
201 double lmin = 0.5 * (lm1 + lm2 + exp(-lm1) + exp(-lm2));
202 const double ymax = exp(-lmin);
206 const double lm1w = lm1max - lm1min;
215 lm1 = (e3 * me1 / (me1 + me2) - me1) * xi1i;
218 gRandom->RndmArray(2, urndm);
219 lm1 = lm1min + lm1w * urndm[0];
220 lm2 = lm2b - r * lm1;
221 double l = 0.5 * (lm1 + lm2 + exp(-lm1) + exp(-lm2));
226 return xi1 * lm1 + me1;
230 double A,
double I,
double rho)
const
245 const double psq = p * p;
246 const double masq = mass * mass;
247 const double tote = psq + masq;
248 const double beta2 = psq / tote;
249 const double bgam2 = psq / masq;
250 const double gamma =
sqrt(tote) / mass;
251 const double alft = 0.1535e6 * rho * dx * Z / A;
252 const double k = log(
m_massE * alft / I / I) + 0.891;
253 const double k1 = k - log(dx);
254 const double alngam = log(gamma);
255 const double alggam = log10(gamma);
260 if (alggam > 3.6) irgn = 1;
264 }
else if (k1 < 7.) {
265 if (alggam > 3.6) irgn = 1;
269 }
else if (k1 < 8.) {
270 if (alggam > 3.6) irgn = 1;
274 }
else if (k1 < 9.) {
275 if (alggam > 3.6) irgn = 1;
279 }
else if (k1 < 10.) {
280 if (alggam > 3.6) irgn = 1;
284 }
else if (k1 < 11.) {
285 if (alggam > 4.0) irgn = 1;
290 if (alggam > 4.0) irgn = 1;
296 double delta = aa + alggam * (bb + cc * alggam);
297 delta = max(delta, 0.);
298 delta = min(delta, fabs(log(bgam2)));
300 double val = zi * zi * alft * (k + 2 * alngam - beta2 - delta) / beta2;
The Class for Energy deposit in the gas.
double m_i1
I of He-C2H6 gas.
double m_i0
I of wire+gas.
EDepInGas()
Singleton class.
void initialize()
Initialize theclass.
virtual ~EDepInGas()
Destructor.
static EDepInGas * m_pntr
Pointer that saves the instance of this class.
double m_z1
Z of He-C2H6 gas.
double m_i2
I of "wire gas".
double m_bk1[6][2]
coeffs b for density effect
double m_ak1[6][2]
coeffs a for density effect
double m_rho0
rho of wire+gas
static EDepInGas & getInstance()
Static method to get a reference to the EDepInGas instance.
double m_rho1
rho of He-C2H6 gas
const double m_massE
electron mass
double m_rho2
rho of "wire gas"
double getEDepInGas(int mode, int pdg, double p, double dx, double e3) const
Return the energy deosite in the gas.
double m_a1
A of He-C2H6 gas.
double m_z2
Z of "wire gas".
double m_ck1[6][2]
coeffs c for density effect
double m_z0
Z of wire+gas.
double m_a0
A of wire+gas.
double getMostProbabEDep(double p, double mass, double zi, double dx, double z, double a, double i, double rho) const
Return the energy deosite in the material.
double m_a2
A of "wire gas".
static const double eV
[electronvolt]
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.