CbmRoot
LxTBMatEffs.h
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 
7 /*
8  * File: LxTBMatEffs.h
9  * Author: Timur Ablyazimov
10  *
11  * Created on 15 Mar 2016
12  */
13 
14 #ifndef LXTBMATEFFS_H
15 #define LXTBMATEFFS_H
16 
17 #include <cmath>
18 
19 static scaltype gMuonMass = 0;
21 
22 struct LxTbAbsorber {
23  scaltype zCoord; // Z-coordinate of the absorber beginning.
25  scaltype radLength; // Radiation length
26  scaltype rho; // Density
27  scaltype Z; // Atomic number
28  scaltype A; // Atomic weight
29 
30  //LxTbAbsorber(scaltype w, scaltype rl, scaltype d, scaltype z, scaltype a) : width(w), radLength(rl), rho(d), Z(z), A(a) {}
31 };
32 
33 static inline scaltype CalcI(scaltype Z) {
34  // mean excitation energy in eV
35  if (Z > 16.) {
36  return 10 * Z;
37  } else {
38  return 16 * std::pow(Z, 0.9);
39  }
40 }
41 
42 static inline scaltype BetheBloch(scaltype E, const LxTbAbsorber* mat) {
43  scaltype K = 0.000307075; // GeV * g^-1 * cm^2
44  scaltype z = 1.; //(par->GetQp() > 0.) ? 1 : -1.;
45  scaltype Z = mat->Z;
46  scaltype A = mat->A;
47 
48  scaltype M = gMuonMass;
49  //scaltype p = std::abs(1. / par->GetQp()); //GeV
50  //scaltype E = std::sqrt(M * M + p * p);
51 
52  scaltype p = std::sqrt(E * E - M * M); //GeV
53  scaltype beta = p / E;
54  scaltype betaSq = beta * beta;
55  scaltype gamma = E / M;
56  scaltype gammaSq = gamma * gamma;
57 
58  scaltype I = CalcI(Z) * 1e-9; // GeV
59 
60  scaltype me = gElectronMass; // GeV
61  scaltype ratio = me / M;
62  scaltype Tmax =
63  (2 * me * betaSq * gammaSq) / (1 + 2 * gamma * ratio + ratio * ratio);
64 
65  // density correction
66  scaltype dc = 0.;
67  if (p > 0.5) { // for particles above 1 Gev
68  scaltype rho = mat->rho;
69  scaltype hwp = 28.816 * std::sqrt(rho * Z / A) * 1e-9; // GeV
70  dc = std::log(hwp / I) + std::log(beta * gamma) - 0.5;
71  }
72 
73  return K * z * z * (Z / A) * (1. / betaSq)
74  * (0.5 * std::log(2 * me * betaSq * gammaSq * Tmax / (I * I)) - betaSq
75  - dc);
76 }
77 
78 static inline scaltype
80  return BetheBloch(E, mat) * mat->rho * L;
81 
82  /*scaltype result = 0;
83 
84  if (L < 10)
85  {
86  result = BetheBloch(E, mat) * mat->rho * L;
87 
88  if (result <= 0)
89  return 0;
90 
91  if (result > E - gMuonMass)
92  result = E - gMuonMass;
93 
94  return result;
95  }
96 
97  scaltype delta = 10;
98 
99  for (scaltype l = 10; l <= L;)
100  {
101  scaltype r = BetheBloch(E, mat) * mat->rho * delta;
102 
103  if (r <= 0)
104  return result;
105 
106  if (r > E - gMuonMass)
107  r = E - gMuonMass;
108 
109  result += r;
110  E -= r;
111  delta = L - l;
112 
113  if (delta < 0.5)
114  break;
115  else if (delta < 10)
116  l = L;
117  else
118  l += 10;
119  }
120 
121  return result;*/
122 }
123 
124 static inline scaltype
126  //scaltype p = std::abs(1. / par->GetQp()); //GeV
127  scaltype muMass = gMuonMass;
128  //scaltype E = std::sqrt(muMass * muMass + p * p);
129  //scaltype p = std::abs(1. / par->GetQp()); //GeV
130  scaltype p = std::sqrt(E * E - muMass * muMass); //GeV
131  scaltype beta = p / E;
132  //scaltype x = mat->GetLength(); //cm
133  scaltype X0 = mat->radLength; //cm
134  scaltype bcp = beta * p;
135  scaltype z = 1.;
136 
137  scaltype theta = 0.0136 * (1. / bcp) * z * std::sqrt(x / X0)
138  * (1. + 0.038 * std::log(x / X0));
139  return theta / std::sqrt(2.0);
140  //return theta * theta;
141 }
142 
143 #endif /* LXTBMATEFFS_H */
gMuonMass
static scaltype gMuonMass
Definition: LxTBMatEffs.h:19
LxTbAbsorber::Z
scaltype Z
Definition: LxTBMatEffs.h:27
scaltype
#define scaltype
Definition: CbmGlobalTrackingDefs.h:17
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
LxTbAbsorber::zCoord
scaltype zCoord
Definition: LxTBMatEffs.h:23
LxTbAbsorber::radLength
scaltype radLength
Definition: LxTBMatEffs.h:25
log
friend F32vec4 log(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:135
gElectronMass
static scaltype gElectronMass
Definition: LxTBMatEffs.h:20
CalcI
static scaltype CalcI(scaltype Z)
Definition: LxTBMatEffs.h:33
CalcThetaPrj
static scaltype CalcThetaPrj(scaltype E, scaltype x, const LxTbAbsorber *mat)
Definition: LxTBMatEffs.h:125
LxTbAbsorber::width
scaltype width
Definition: LxTBMatEffs.h:24
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
LxTbAbsorber::A
scaltype A
Definition: LxTBMatEffs.h:28
LxTbAbsorber
Definition: LxTBMatEffs.h:22
EnergyLoss
static scaltype EnergyLoss(scaltype E, scaltype L, const LxTbAbsorber *mat)
Definition: LxTBMatEffs.h:79
BetheBloch
static scaltype BetheBloch(scaltype E, const LxTbAbsorber *mat)
Definition: LxTBMatEffs.h:42
LxTbAbsorber::rho
scaltype rho
Definition: LxTBMatEffs.h:26