CbmRoot
LitAddMaterial.h
Go to the documentation of this file.
1 
17 #ifndef LITADDMATERIAL_H_
18 #define LITADDMATERIAL_H_
19 
20 #include "LitMath.h"
21 #include "LitTrackParam.h"
22 
23 namespace lit {
24  namespace parallel {
25 
33  template<class T>
34  inline void LitAddMaterial(LitTrackParam<T>& par, T siliconThickness) {
35  // Silicon properties
36  static const T SILICON_DENSITY = 2.33; // g*cm^-3
37  // static const T SILICON_A = 28.08855; // silicon atomic weight
38  // static const T SILICON_Z = 14.0; // silicon atomic number
39  static const T SILICON_Z_OVER_A =
40  0.4984; //2.006325; // Z/A ratio for silicon
41  static const T SILICON_RAD_LENGTH = 9.365; // cm
42  static const T SILICON_I = 173 * 1e-9; // mean excitation energy [GeV]
43  static const T SILICON_I_SQ =
44  SILICON_I * SILICON_I; // squared mean excitation energy
45 
46  static const T ZERO = 0.0, ONE = 1., TWO = 2.;
47  static const T mass = 0.105658369; // muon mass [GeV/c]
48  static const T massSq = 0.105658369 * 0.105658369; // muon mass squared
49  static const T C1_2 = 0.5, C1_3 = 1. / 3.;
50  static const T me = 0.000511; // Electron mass [GeV/c]
51  static const T ratio = me / mass;
52 
53  T p = sgn(par.Qp) / par.Qp; // Momentum [GeV/c]
54  T E = sqrt(massSq + p * p);
55  T beta = p / E;
56  T betaSq = beta * beta;
57  T gamma = E / mass;
58  T gammaSq = gamma * gamma;
59 
60  // Scale material thickness
61  T norm = sqrt(ONE + par.Tx * par.Tx + par.Ty * par.Ty);
62  T thickness = norm * siliconThickness;
63  T radThick = thickness / SILICON_RAD_LENGTH;
64  T sqrtRadThick = sqrt(radThick);
65  T logRadThick = log(radThick);
66 
67  /*
68  * Energy loss corrections
69  */
70 
71  // Bethe-Block
72  static const T K = 0.000307075; // GeV * g^-1 * cm^2
73  T Tmax = (2 * me * betaSq * gammaSq)
74  / (ONE + TWO * gamma * ratio + ratio * ratio);
75 
76  // density correction
77  T dc = ZERO;
78  if (p > 0.5) { // for particles above 1 Gev
79  static const T c7 = 28.816;
80  static const T c8 = 1e-9;
81  T hwp = c7 * sqrt(SILICON_DENSITY * SILICON_Z_OVER_A) * c8; // GeV
82  dc = log(hwp / SILICON_I) + log(beta * gamma) - C1_2;
83  }
84 
85  T bbLoss =
86  K * SILICON_Z_OVER_A * rcp(betaSq)
87  * (C1_2 * log(TWO * me * betaSq * gammaSq * Tmax / SILICON_I_SQ)
88  - betaSq - dc);
89 
90  // static const T bbc = 0.00354;
91  // T bbLoss = bbc * SILICON_Z_OVER_A;
92 
93  // Bethe-Heitler
94  // T bhLoss = (E * ratio * ratio)/(mat.X0 * mat.Rho);
95  T bhLoss = ZERO;
96 
97  // Pair production approximation
98  // static const T c3 = 7e-5;
99  // T ppLoss = c3 * E / (mat.X0 * mat.Rho);
100  T ppLoss = ZERO;
101 
102  // Integrated value of the energy loss
103  T energyLoss = (bbLoss + bhLoss + ppLoss) * SILICON_DENSITY * thickness;
104 
105  // Correct Q/p value due to energy loss
106  T Enew = E - energyLoss;
107  T pnew = sqrt(Enew * Enew - massSq);
108  par.Qp = sgn(par.Qp) * rcp(pnew);
109 
110 
111  // Calculate Q/p correction in the covariance matrix
112  T betanew = pnew / Enew;
113  T betaSqnew = betanew * betanew;
114  T gammanew = Enew / mass;
115  // T gammaSqnew = gammanew * gammanew;
116 
117  // Calculate xi factor (KeV).
118  static const T c4 = 153.5;
119  T XI = (c4 * SILICON_Z_OVER_A * thickness * SILICON_DENSITY) / betaSqnew;
120 
121  // Maximum energy transfer to atomic electron (KeV).
122  T etanew = betanew * gammanew;
123  T etaSqnew = etanew * etanew;
124  T F1 = TWO * me * etaSqnew;
125  T F2 = ONE + TWO * ratio * gammanew + ratio * ratio;
126  static const T c5 = 1e6;
127  T emax = c5 * F1 / F2;
128 
129  static const T c6 = 1e-12;
130  T dedxSq = XI * emax * (ONE - C1_2 * betaSqnew) * c6;
131 
132  T p2 = pnew * pnew;
133  T p6 = p2 * p2 * p2;
134  T qpCorr = (Enew * Enew * dedxSq) / p6;
135  par.C14 += qpCorr;
136  // end calculate Q/p correction in the covariance matrix
137 
138  /*
139  * End energy loss corrections
140  */
141 
142  /*
143  * Multiple scattering corrections
144  */
145 
146  T tx = par.Tx;
147  T ty = par.Ty;
148  T bcp = betanew * pnew;
149  //T bcp = beta * p;
150  static const T c1 = 0.0136, c2 = 0.038;
151  T theta = c1 * rcp(bcp) * sqrtRadThick * (ONE + c2 * logRadThick);
152  T thetaSq = theta * theta;
153 
154  T t = ONE + tx * tx + ty * ty;
155 
156  T Q33 = (1 + tx * tx) * t * thetaSq;
157  T Q44 = (1 + ty * ty) * t * thetaSq;
158  T Q34 = tx * ty * t * thetaSq;
159 
160  T T23 = thickness * thickness * C1_3;
161  T T2 = thickness * C1_2;
162 
163  par.C0 += Q33 * T23;
164  par.C1 += Q34 * T23;
165  par.C2 += Q33 * T2;
166  par.C3 += Q34 * T2;
167 
168  par.C5 += Q44 * T23;
169  par.C6 += Q34 * T2;
170  par.C7 += Q44 * T2;
171 
172  par.C9 += Q33;
173  par.C10 += Q34;
174 
175  par.C12 += Q44;
176 
177  /*
178  * End multiple scattering corrections
179  */
180  }
181 
182 
190  template<class T>
192  T siliconThickness) {
193  // Silicon properties
194  static const T SILICON_RAD_LENGTH = 9.365; // cm
195 
196  static const T ZERO = 0.0, ONE = 1., TWO = 2., THREE = 3., INF = 1.e5;
197  static const T C1_2 = 0.5, C1_3 = 1. / 3.;
198 
199  //scale material thickness
200  static const T C_LOG = log(THREE) / log(TWO);
201  T norm = sqrt(ONE + par.Tx * par.Tx + par.Ty * par.Ty);
202  T thickness = norm * siliconThickness;
203  T radThick = thickness / SILICON_RAD_LENGTH;
204  T sqrtRadThick = sqrt(radThick);
205  T logRadThick = log(radThick);
206 
207  // no material thickness scaling
208  // T thickness = mat.Thickness;
209  // T radThick = mat.RadThick;
210  // T sqrtRadThick = mat.SqrtRadThick;
211  // T logRadThick = mat.LogRadThick;
212 
213  /*
214  * Energy loss corrections
215  */
216  par.Qp *= exp(radThick);
217  // par.C14 += par.Qp * par.Qp * mat.ElLoss; // no thickness scaling
218  par.C14 +=
219  (exp(radThick * C_LOG) - exp(-TWO * radThick)); // thickness scaling
220  /*
221  * End of energy loss corrections
222  */
223 
224  /*
225  * Multiple scattering corrections
226  */
227  T pnew = sgn(par.Qp) / par.Qp; // Momentum [GeV/c]
228  T betanew = ONE;
229  T tx = par.Tx;
230  T ty = par.Ty;
231  T bcp = betanew * pnew;
232  static const T c1 = 0.0136, c2 = 0.038;
233  T theta = c1 * rcp(bcp) * sqrtRadThick * (ONE + c2 * logRadThick);
234  T thetaSq = theta * theta;
235 
236  T t = ONE + tx * tx + ty * ty;
237 
238  T Q33 = (1 + tx * tx) * t * thetaSq;
239  T Q44 = (1 + ty * ty) * t * thetaSq;
240  T Q34 = tx * ty * t * thetaSq;
241 
242  T T23 = thickness * thickness * C1_3;
243  T T2 = thickness * C1_2;
244 
245  par.C0 += Q33 * T23;
246  par.C1 += Q34 * T23;
247  par.C2 += Q33 * T2;
248  par.C3 += Q34 * T2;
249 
250  par.C5 += Q44 * T23;
251  par.C6 += Q34 * T2;
252  par.C7 += Q44 * T2;
253 
254  par.C9 += Q33;
255  par.C10 += Q34;
256 
257  par.C12 += Q44;
258 
259  /*
260  * End multiple scattering corrections
261  */
262  }
263 
264  } // namespace parallel
265 } // namespace lit
266 #endif /* LITADDMATERIAL_H_ */
exp
friend F32vec4 exp(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:134
lit::parallel::LitTrackParam::C2
T C2
Definition: LitTrackParam.h:100
LitMath.h
Useful math functions.
lit::parallel::LitTrackParam::C10
T C10
Definition: LitTrackParam.h:100
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
lit::parallel::LitAddMaterial
void LitAddMaterial(LitTrackParam< T > &par, T siliconThickness)
Definition: LitAddMaterial.h:34
lit::parallel::LitTrackParam::C0
T C0
Definition: LitTrackParam.h:100
LitTrackParam.h
Track parameters data class.
lit::parallel::LitTrackParam::C9
T C9
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam::C3
T C3
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam::C14
T C14
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam
Track parameters data class.
Definition: LitTrackParam.h:34
lit::parallel::LitTrackParam::C12
T C12
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam::Ty
T Ty
Definition: LitTrackParam.h:96
lit::parallel::LitTrackParam::Tx
T Tx
Definition: LitTrackParam.h:95
log
friend F32vec4 log(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:135
lit::parallel::LitAddMaterialElectron
void LitAddMaterialElectron(LitTrackParam< T > &par, T siliconThickness)
Definition: LitAddMaterial.h:191
lit::parallel::LitTrackParam::C5
T C5
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam::C1
T C1
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam::C7
T C7
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam::C6
T C6
Definition: LitTrackParam.h:100
lit::parallel::LitTrackParam::Qp
T Qp
Definition: LitTrackParam.h:97
lit::parallel::rcp
fscal rcp(const fscal &a)
Returns reciprocal.
Definition: LitMath.h:26
NS_L1TrackFitter::ZERO
const fvec ZERO
Definition: L1TrackFitter.cxx:32
NS_L1TrackFitter::ONE
const fvec ONE
Definition: L1TrackFitter.cxx:33
lit::parallel::sgn
fscal sgn(const fscal &a)
Returns sign of the input number.
Definition: LitMath.h:38
lit
Definition: LitTrackFinderNNVecElectron.h:19