Formatting changes.
[u/mrichter/AliRoot.git] / MUON / abso_dedx.C
CommitLineData
a9e2aefa 1void abso_dedx()
2{
3 TGeant3 *geant3 = (TGeant3*)gMC;
4 Float_t tkin[100], valPb[100], valW[100], val1[100], val2[100];
5 Float_t val3[100], val4[100], val5[100], pcut[5];
6 Int_t ipart=5;
7 char chmeca[4];
8 strcpy(chmeca,"LOSS");
9 Int_t ixst, i;
10 Int_t kdim=100;
11
12 for (i=0; i< kdim; i++) {
13 tkin[i]=Float_t(i+1)*2.;
14 }
15// Carbon
16 geant3->Gftmat( 4, ipart, chmeca, kdim, tkin, val1, pcut, ixst);
17// Concrete
18 geant3->Gftmat(25, ipart, chmeca, kdim, tkin, val2, pcut, ixst);
19// Ch2
20 geant3->Gftmat(28, ipart, chmeca, kdim, tkin, val3, pcut, ixst);
21// Lead
22 geant3->Gftmat(16, ipart, chmeca, kdim, tkin, val4, pcut, ixst);
23// W
24 geant3->Gftmat(13, ipart, chmeca, kdim, tkin, val5, pcut, ixst);
25
26 for (i=0; i< kdim; i++) {
27 valPb[i]=(225.*val1[i]+153.*val2[i]+15.*val3[i]+20*val4[i])/1000.;
28 }
29
30 for (i=0; i< kdim; i++) {
31 valW[i]=(225.*val1[i]+153.*val2[i]+35*val5[i])/1000.;
32 }
33
34
35 TGraph* dedx1 = new TGraph(kdim, tkin, valPb);
36 TGraph* dedx2 = new TGraph(kdim, tkin, valW);
37
38 TCanvas *c1=new TCanvas("c1","dedx",400,10,600,700);
39 dedx1->SetFillColor(42);
40 dedx1->SetMarkerColor(4);
41 dedx1->SetMarkerStyle(21);
42 dedx1->Draw("AC");
43 dedx1->GetHistogram()->SetXTitle("Kinetic Energy (GeV)");
44 dedx1->GetHistogram()->SetYTitle("Mean Energy Loss (GeV)");
45
46 TCanvas *c2=new TCanvas("c2","dedx",400,10,600,700);
47 dedx2->SetFillColor(42);
48 dedx2->SetMarkerColor(4);
49 dedx2->SetMarkerStyle(21);
50 dedx2->Draw("AC");
51 dedx2->GetHistogram()->SetXTitle("Kinetic Energy (GeV)");
52 dedx2->GetHistogram()->SetYTitle("Mean Energy Loss (GeV)");
53
54 }