CbmRoot
CbmLitCheckEnergyLossMuons.cxx
Go to the documentation of this file.
2 
3 #include "CbmDrawHist.h"
4 #include "CbmUtils.h"
8 
9 #include "TCanvas.h"
10 #include <TAxis.h>
11 #include <TGraph.h>
12 
13 #include <boost/assign/list_of.hpp>
14 
15 #include <cstdlib>
16 
17 using boost::assign::list_of;
18 
20  : fMat("iron"), fOutputDir("./test/") {
21  fMom[0] = 47.04;
22  fMom[1] = 56.16;
23  fMom[2] = 68.02;
24  fMom[3] = 85.09;
25  fMom[4] = 100.3;
26  fMom[5] = 152.7;
27  fMom[6] = 176.4;
28  fMom[7] = 221.8;
29  fMom[8] = 286.8;
30  fMom[9] = 364.2;
31  fMom[10] = 391.7;
32  fMom[11] = 494.5;
33  fMom[12] = 899.5;
34  fMom[13] = 1101.;
35  fMom[14] = 1502.;
36  fMom[15] = 2103.;
37  fMom[16] = 3104.;
38  fMom[17] = 4104.;
39  fMom[18] = 8105.;
40  fMom[19] = 10110.;
41  fMom[20] = 14110.;
42  fMom[21] = 20110.;
43  fMom[22] = 30110.;
44  fMom[23] = 40110.;
45  fMom[24] = 80110.;
46  fMom[25] = 100100.;
47 }
48 
50 
53 
54  CreateGraphs();
55 
56  if (fMat == "iron") {
57  FillTableIron();
58  } else if (fMat == "tungsten") {
60  } else if (fMat == "carbon") {
62  }
63 
64  CalcEloss();
65 
66  DrawGraphs();
67 }
68 
70  TCanvas* c1 =
71  new TCanvas("mean_energy_loss_muons", "mean_energy_loss_muons", 700, 500);
72 
73  fTable[0]->GetXaxis()->SetLimits(45, 100102);
74  fTable[0]->SetMinimum(0.1);
75  fTable[0]->SetMaximum(10.);
76 
77  DrawGraph(list_of(fTable[0])(fTable[1])(fTable[2])(fTable[3])(fCalc[0])(
78  fCalc[1])(fCalc[2])(fCalc[3]),
79  list_of("total (table)")("ionization (table)")(
80  "bremsstrahlung (table)")("pair production (table)")(
81  "total (calculation)")("ionization (calculation)")(
82  "bremsstrahlung (calculation)")("pair production (calculation)"),
83  kLog,
84  kLog,
85  true,
86  0.20,
87  0.97,
88  0.9,
89  0.7);
90 
92 }
93 
95  CbmLitMaterialInfo material;
96  if (fMat == "tungsten") {
97  material.SetA(183.84);
98  material.SetZ(74.0);
99  material.SetRho(19.3);
100  material.SetRL(0.35);
101  } else if (fMat == "iron") {
102  material.SetA(55.85);
103  material.SetZ(26.0);
104  material.SetRho(7.87);
105  material.SetRL(1.757622);
106  } else if (fMat == "carbon") {
107  material.SetA(12.0107);
108  material.SetZ(6);
109  material.SetRho(2.265);
110  material.SetRL(18.8);
111  } else {
112  exit(0);
113  }
114 
116  CbmLitTrackParam par;
117  for (Int_t i = 0; i < 26; i++) {
118  par.SetQp(1. / (fMom[i] * 1e-3));
119  fCalc[1]->SetPoint(i, fMom[i], me.BetheBloch(&par, &material) * 1e3);
120  fCalc[2]->SetPoint(i, fMom[i], me.BetheHeitler(&par, &material) * 1e3);
121  fCalc[3]->SetPoint(i, fMom[i], me.PairProduction(&par, &material) * 1e3);
122  fCalc[0]->SetPoint(i, fMom[i], me.dEdx(&par, &material) * 1e3);
123  }
124 }
125 
127  for (int i = 0; i < 4; i++) {
128  fTable[i] = new TGraph();
129  fTable[i]->GetXaxis()->SetTitle("Momentum [MeV/c]");
130  fTable[i]->GetYaxis()->SetTitle("Energy loss [Mev*cm^2/g]");
131  fCalc[i] = new TGraph();
132  fCalc[i]->GetXaxis()->SetTitle("Momentum [MeV/c]");
133  fCalc[i]->GetYaxis()->SetTitle("Energy loss [Mev*cm^2/g]");
134  }
135 }
136 
138  Double_t table_iron[26][4] = {
139  //ion //brems //pair //total
140  {5.494, 0.000, 0.000, 5.494}, {4.321, 0.000, 0.000, 4.321},
141  {3.399, 0.000, 0.000, 3.399}, {2.654, 0.000, 0.000, 2.654},
142  {2.274, 0.000, 0.000, 2.274}, {1.717, 0.000, 0.000, 1.717},
143 
144  {1.616, 0.000, 0.000, 1.616}, {1.516, 0.000, 0.000, 1.516},
145  {1.463, 0.000, 0.000, 1.463}, {1.451, 0.000, 0.000, 1.451},
146  {1.452, 0.000, 0.000, 1.453}, {1.467, 0.000, 0.000, 1.467},
147  {1.548, 0.000, 0.000, 1.548},
148 
149  {1.581, 0.001, 0.000, 1.582}, {1.635, 0.001, 0.000, 1.637},
150  {1.694, 0.002, 0.001, 1.697}, {1.760, 0.003, 0.002, 1.767},
151  {1.806, 0.004, 0.004, 1.816}, {1.911, 0.010, 0.011, 1.936},
152 
153  {1.942, 0.014, 0.015, 1.975}, {1.987, 0.021, 0.024, 2.039},
154  {2.032, 0.033, 0.039, 2.113}, {2.080, 0.054, 0.068, 2.214},
155  {2.112, 0.076, 0.099, 2.303}, {2.184, 0.171, 0.236, 2.623},
156  {2.207, 0.221, 0.310, 2.777}};
157 
158  for (Int_t i = 0; i < 26; i++) {
159  fTable[1]->SetPoint(i, fMom[i], table_iron[i][0]);
160  fTable[2]->SetPoint(i, fMom[i], table_iron[i][1]);
161  fTable[3]->SetPoint(i, fMom[i], table_iron[i][2]);
162  fTable[0]->SetPoint(i, fMom[i], table_iron[i][3]);
163  }
164 }
165 
167  Double_t table_tungsten[26][4] = {
168  //ion //brems //pair //total
169  {4.000, 0.000, 0.000, 4.00}, {3.185, 0.000, 0.000, 3.185},
170  {2.534, 0.000, 0.000, 2.534}, {2.000, 0.000, 0.000, 2.000},
171  {1.726, 0.000, 0.000, 1.726}, {1.323, 0.000, 0.000, 1.323},
172 
173  {1.251, 0.000, 0.000, 1.251}, {1.182, 0.000, 0.000, 1.182},
174  {1.149, 0.000, 0.000, 1.149}, {1.145, 0.000, 0.000, 1.145},
175  {1.150, 0.000, 0.000, 1.150}, {1.168, 0.000, 0.000, 1.168},
176  {1.247, 0.001, 0.000, 1.249},
177 
178  {1.279, 0.001, 0.000, 1.281}, {1.329, 0.002, 0.001, 1.333},
179  {1.384, 0.004, 0.002, 1.391}, {1.446, 0.006, 0.005, 1.459},
180  {1.489, 0.009, 0.009, 1.509}, {1.587, 0.023, 0.026, 1.640},
181 
182  {1.616, 0.031, 0.036, 1.687}, {1.658, 0.047, 0.057, 1.768},
183  {1.700, 0.073, 0.092, 1.874}, {1.745, 0.120, 0.159, 2.035},
184  {1.774, 0.169, 0.231, 2.190}, {1.840, 0.383, 0.548, 2.800},
185  {1.860, 0.496, 0.717, 3.110}};
186 
187  for (Int_t i = 0; i < 26; i++) {
188  fTable[1]->SetPoint(i, fMom[i], table_tungsten[i][0]);
189  fTable[2]->SetPoint(i, fMom[i], table_tungsten[i][1]);
190  fTable[3]->SetPoint(i, fMom[i], table_tungsten[i][2]);
191  fTable[0]->SetPoint(i, fMom[i], table_tungsten[i][3]);
192  }
193 }
194 
196  Double_t table_carbon[26][4] = {
197  //ion //brems //pair //total
198  {7.119, 0.000, 0.000, 7.119}, {5.551, 0.000, 0.000, 5.551},
199  {4.332, 0.000, 0.000, 4.332}, {3.356, 0.000, 0.000, 3.356},
200  {2.861, 0.000, 0.000, 2.861}, {2.127, 0.000, 0.000, 2.127},
201 
202  {1.992, 0.000, 0.000, 1.992}, {1.854, 0.000, 0.000, 1.854},
203  {1.775, 0.000, 0.000, 1.775}, {1.745, 0.000, 0.000, 1.745},
204  {1.745, 0.000, 0.000, 1.745}, {1.751, 0.000, 0.000, 1.751},
205  {1.819, 0.000, 0.000, 1.820},
206 
207  {1.850, 0.000, 0.000, 1.851}, {1.900, 0.000, 0.000, 1.901},
208  {1.955, 0.000, 0.000, 1.957}, {2.018, 0.001, 0.001, 2.021},
209  {2.062, 0.001, 0.001, 2.066}, {2.161, 0.003, 0.003, 2.171},
210 
211  {2.191, 0.004, 0.004, 2.204}, {2.234, 0.006, 0.007, 2.254},
212  {2.278, 0.010, 0.011, 2.308}, {2.326, 0.016, 0.019, 2.374},
213  {2.359, 0.022, 0.028, 2.427}, {2.434, 0.050, 0.068, 2.587},
214  {2.458, 0.065, 0.089, 2.655}};
215 
216  for (Int_t i = 0; i < 26; i++) {
217  fTable[1]->SetPoint(i, fMom[i], table_carbon[i][0]);
218  fTable[2]->SetPoint(i, fMom[i], table_carbon[i][1]);
219  fTable[3]->SetPoint(i, fMom[i], table_carbon[i][2]);
220  fTable[0]->SetPoint(i, fMom[i], table_carbon[i][3]);
221  }
222 }
223 
CbmLitTrackParam.h
Data class for track parameters.
CbmLitMaterialInfo::SetZ
void SetZ(litfloat Z)
Definition: CbmLitMaterialInfo.h:83
CbmLitTrackParam
Data class for track parameters.
Definition: CbmLitTrackParam.h:29
CbmLitCheckEnergyLossMuons::~CbmLitCheckEnergyLossMuons
virtual ~CbmLitCheckEnergyLossMuons()
Definition: CbmLitCheckEnergyLossMuons.cxx:49
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmLitTrackParam::SetQp
void SetQp(litfloat qp)
Definition: CbmLitTrackParam.h:69
CbmDrawHist.h
Helper functions for drawing 1D and 2D histograms and graphs.
CbmLitMaterialInfo
Definition: CbmLitMaterialInfo.h:19
DrawGraph
void DrawGraph(TGraph *graph, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
Definition: CbmDrawHist.cxx:151
CbmLitCheckEnergyLossMuons::fTable
TGraph * fTable[4]
Definition: CbmLitCheckEnergyLossMuons.h:29
CbmLitMaterialEffectsImp::PairProduction
litfloat PairProduction(const CbmLitTrackParam *par, const CbmLitMaterialInfo *mat) const
Definition: CbmLitMaterialEffectsImp.cxx:315
CbmLitCheckEnergyLossMuons::FillTableCarbon
void FillTableCarbon()
Definition: CbmLitCheckEnergyLossMuons.cxx:195
CbmLitMaterialEffectsImp
Calculation of multiple scattering and energy loss.
Definition: CbmLitMaterialEffectsImp.h:23
CbmLitCheckEnergyLossMuons
Definition: CbmLitCheckEnergyLossMuons.h:11
CbmLitMaterialEffectsImp::dEdx
litfloat dEdx(const CbmLitTrackParam *par, const CbmLitMaterialInfo *mat) const
Definition: CbmLitMaterialEffectsImp.cxx:161
ClassImp
ClassImp(CbmLitCheckEnergyLossMuons)
CbmLitMaterialInfo::SetRL
void SetRL(litfloat rl)
Definition: CbmLitMaterialInfo.h:77
CbmLitMaterialInfo::SetRho
void SetRho(litfloat rho)
Definition: CbmLitMaterialInfo.h:80
CbmLitCheckEnergyLossMuons::CreateGraphs
void CreateGraphs()
Definition: CbmLitCheckEnergyLossMuons.cxx:126
CbmLitCheckEnergyLossMuons::CbmLitCheckEnergyLossMuons
CbmLitCheckEnergyLossMuons()
Definition: CbmLitCheckEnergyLossMuons.cxx:19
CbmLitCheckEnergyLossMuons::DrawGraphs
void DrawGraphs()
Definition: CbmLitCheckEnergyLossMuons.cxx:69
CbmUtils.h
CbmLitCheckEnergyLossMuons::FillTableTungsten
void FillTableTungsten()
Definition: CbmLitCheckEnergyLossMuons.cxx:166
CbmLitCheckEnergyLossMuons::Check
virtual void Check()
Definition: CbmLitCheckEnergyLossMuons.cxx:51
CbmLitCheckEnergyLossMuons::fMom
Double_t fMom[26]
Definition: CbmLitCheckEnergyLossMuons.h:28
CbmLitMaterialInfo::SetA
void SetA(litfloat A)
Definition: CbmLitMaterialInfo.h:86
CbmLitCheckEnergyLossMuons::fMat
std::string fMat
Definition: CbmLitCheckEnergyLossMuons.h:31
CbmLitMaterialEffectsImp::BetheBloch
litfloat BetheBloch(const CbmLitTrackParam *par, const CbmLitMaterialInfo *mat) const
Definition: CbmLitMaterialEffectsImp.cxx:170
SetDefaultDrawStyle
void SetDefaultDrawStyle()
Definition: CbmDrawHist.cxx:33
Cbm::SaveCanvasAsImage
void SaveCanvasAsImage(TCanvas *c, const std::string &dir, const std::string &option)
Definition: CbmUtils.cxx:20
CbmLitCheckEnergyLossMuons::fCalc
TGraph * fCalc[4]
Definition: CbmLitCheckEnergyLossMuons.h:30
CbmLitCheckEnergyLossMuons::FillTableIron
void FillTableIron()
Definition: CbmLitCheckEnergyLossMuons.cxx:137
CbmLitMaterialInfo.h
CbmLitCheckEnergyLossMuons.h
CbmLitMaterialEffectsImp::BetheHeitler
litfloat BetheHeitler(const CbmLitTrackParam *par, const CbmLitMaterialInfo *mat) const
Definition: CbmLitMaterialEffectsImp.cxx:301
kLog
@ kLog
Definition: CbmDrawHist.h:78
CbmLitMaterialEffectsImp.h
Calculation of multiple scattering and energy loss.
CbmLitCheckEnergyLossMuons::CalcEloss
void CalcEloss()
Definition: CbmLitCheckEnergyLossMuons.cxx:94
CbmLitCheckEnergyLossMuons::fOutputDir
string fOutputDir
Definition: CbmLitCheckEnergyLossMuons.h:33