Return the energy deosite in the gas.
138{
141
142 if (mode == 0) return e3 * xi1 / (xi1 + xi2);
143
144 static TDatabasePDG* ptrTDatabasePDG = TDatabasePDG::Instance();
145 const double mass = ptrTDatabasePDG->GetParticle(pdg)->Mass();
146 const double chrg = fabs(ptrTDatabasePDG->GetParticle(pdg)->Charge() / 3);
147
149 if (mode == 2) {
151 return e3 * me1 / me0;
152 }
154 if (mode == 1) return e3 * me1 / (me1 + me2);
155
156
157
158
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;
162 xi1 *= buf;
163 xi2 *= buf;
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);
171
172 int itry = 0;
173
174
175 const double lm2b = (e3 - me1 - me2) * xi2i;
176 const double r = xi1 * xi2i;
177 double deltal = 0;
178 double lm1old = lm1;
179 while (itry <= 2 || fabs(lm1 - lm1old) > 0.001) {
180 ++itry;
181 lm1old = lm1;
182 if (itry > 50) {
183
184 break;
185 }
186 lm1 -= deltal;
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;
195
196 }
197
198 if (mode == 3) return xi1 * lm1 + me1;
199
200 double lm2 = lm2b - r * lm1;
201 double lmin = 0.5 * (lm1 + lm2 + exp(-lm1) + exp(-lm2));
202 const double ymax = exp(-lmin);
203
204
205
206 const double lm1w = lm1max - lm1min;
207 double y = 10;
208 double p = 1;
209 int jtry = 0;
210 double urndm[2];
211 while (y > p) {
212 ++jtry;
213 if (jtry > 500) {
214
215 lm1 = (e3 * me1 / (me1 + me2) - me1) * xi1i;
216 break;
217 }
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));
222 p = exp(-l);
223 y = ymax * urndm[1];
224 }
225
226 return xi1 * lm1 + me1;
227}
double m_i1
I of He-C2H6 gas.
double m_i0
I of wire+gas.
double m_z1
Z of He-C2H6 gas.
double m_i2
I of "wire gas".
double m_rho0
rho of wire+gas
double m_rho1
rho of He-C2H6 gas
double m_rho2
rho of "wire gas"
double m_a1
A of He-C2H6 gas.
double m_z2
Z of "wire gas".
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".