Add const to SolenoidField() method for correct overwriting from the parent class
[u/mrichter/AliRoot.git] / ZDC / testGen.C
CommitLineData
f0f09a34 1void testGen()
2{
3gROOT.Reset();
4//
5// ************* Parameters for AliGenHIJING generator **************
6//
7AliGenZDC *gener = new AliGenZDC();
8gener->SetParticle(kProton);
9gener->SetMomentum(2760.);
0ff3ad02 10gener->SetDirection(0,0,0,1);
f0f09a34 11gener->SetFermi(1);
12gener->SetDiv(0.000032,0.0001,2);
13gener->Init();
14//
15// ************* Creating canvas, pads & histograms **************
16//
17TCanvas *c1 = new TCanvas("c1","Nucleon Momentum in LAB RS",0,10,580,700);
18c1->SetFillColor(38);
19pad11 = new TPad("pad11"," ",0.01,0.51,0.49,0.99);
20pad12 = new TPad("pad12"," ",0.51,0.51,0.99,0.99);
21pad13 = new TPad("pad13"," ",0.01,0.01,0.99,0.49);
22pad11->SetFillColor(18);
23pad12->SetFillColor(18);
24pad13->SetFillColor(18);
25pad11->Draw();
26pad12->Draw();
27pad13->Draw();
28
29TCanvas *c2 = new TCanvas("c2","Nucleon Momentum with Fermi and Divergence",600,10,600,700);
30c2->SetFillColor(38);
31pad21 = new TPad("pad21"," ",0.01,0.51,0.49,0.99);
32pad22 = new TPad("pad22"," ",0.51,0.51,0.99,0.99);
33pad23 = new TPad("pad23"," ",0.01,0.01,0.99,0.49);
34pad21->SetFillColor(10);
35pad22->SetFillColor(10);
36pad23->SetFillColor(10);
37pad21->Draw();
38pad22->Draw();
39pad23->Draw();
40
41TH1F *hpx = new TH1F("hpx","Nucleon momentum Px",100,-1.,1.);
42TH1F *hpy = new TH1F("hpy","Nucleon momentum Py",100,-1.,1.);
43TH1F *hpz = new TH1F("hpz","Nucleon momentum Pz",100,2000.,3000.);
44
45TH1F *hpbx = new TH1F("hpbx","Px with Fermi and Divergence",100,-1.,1.);
46TH1F *hpby = new TH1F("hpby","Py with Fermi and Divergence",100,-1.,1.);
47TH1F *hpbz = new TH1F("hpbz","Pz with Fermi and Divergence",100,0.,6000.);
48
49// ************* Generation of events **************
50//
51for(Int_t i=0; i<=1000; i++){
52 gener->Generate();
53 //
54 // ************* Getting momenta **************
55 //
56 Double_t px = gener->GetInMomentum(0);
57 Double_t py = gener->GetInMomentum(1);
58 Double_t pz = gener->GetInMomentum(2);
59// printf("Initial momentum -> px = %f, py = %f, pz = %f \n", px,py,pz);
60 Double_t ptrackx = gener->GetTrackMomentum(0);
61 Double_t ptracky = gener->GetTrackMomentum(1);
62 Double_t ptrackz = gener->GetTrackMomentum(2);
63// printf("Track momentum -> px = %f, py = %f, pz = %f \n\n", ptrackx,ptracky,ptrackz);
64 //
65 // ************* Filling histograms **************
66 //
67 hpx->Fill(px);
68 hpy->Fill(py);
69 hpz->Fill(pz);
70 hpbx->Fill(ptrackx);
71 hpby->Fill(ptracky);
72 hpbz->Fill(ptrackz);
73 //
74 // ************* Drawing histograms **************
75 //
76 pad11->cd();
77// pad11->GetFrame()->SetFillColor(10);
78// pad11->GetFrame()->SetBorderMode(-1);
79// pad11->GetFrame()->SetBorderSize(12);
80 hpx->Draw();
81
82 pad12->cd();
83// pad12->GetFrame()->SetFillColor(10);
84// pad12->GetFrame()->SetBorderMode(-1);
85// pad12->GetFrame()->SetBorderSize(12);
86 hpy->Draw();
87
88 pad13->cd();
89// pad13->GetFrame()->SetFillColor(10);
90// pad13->GetFrame()->SetBorderMode(-1);
91// pad13->GetFrame()->SetBorderSize(12);
92 hpz->Draw();
93
94 pad21->cd();
95// pad21->GetFrame()->SetFillColor(10);
96// pad21->GetFrame()->SetBorderMode(-1);
97// pad21->GetFrame()->SetBorderSize(12);
98 hpbx->Draw();
99
100 pad22->cd();
101// pad22->GetFrame()->SetFillColor(10);
102// pad22->GetFrame()->SetBorderMode(-1);
103// pad22->GetFrame()->SetBorderSize(12);
104 hpby->Draw();
105
106 pad23->cd();
107// pad23->GetFrame()->SetFillColor(10);
108// pad23->GetFrame()->SetBorderMode(-1);
109// pad23->GetFrame()->SetBorderSize(12);
110 hpbz->Draw();
111}
112}