Pluto v6.3.0
Loading...
Searching...
No Matches
DrawAllFermiDistributions.C
Go to the documentation of this file.
2{
3 gStyle->SetOptTitle(0);
4 gStyle->SetOptStat(0);
5 gStyle->SetPadBorderMode(0);
6 gStyle->SetFrameBorderMode(0);
7 gStyle->SetPalette(1);
8
9 TStopwatch timer;
10 timer.Start();
11 double t0=-1;
12 const char * percent="\%";
13 int cpc1=1;
14 int cpc2=1;
15 int cpc3=1;
16 int cpc4=1;
17 int cpc5=1;
18 int cpc6=1;
19
20 // const int Iterations = 100000000;
21 const int Iterations = 1000000;
22 const int Counter = Iterations/100;
23
24 double px1, py1, pz1;
25 double px2, py2, pz2;
26 double px3, py3, pz3;
27 double px4, py4, pz4;
28 double px5, py5, pz5;
29 double px6, py6, pz6;
30
31 TH1F * hD = new TH1F("hD" ,"Fermi Momentum Distribution inside D" ,1000,0.,1.);
32 TH1F * h3He = new TH1F("h3He" ,"Fermi Momentum Distribution inside 3He" ,1000,0.,1.);
33 TH1F * h4He = new TH1F("h4He" ,"Fermi Momentum Distribution inside 4He" ,1000,0.,1.);
34 TH1F * h7Li = new TH1F("h7Li" ,"Fermi Momentum Distribution inside 7Li" ,1000,0.,1.);
35 TH1F * h12C = new TH1F("h12C" ,"Fermi Momentum Distribution inside 12C" ,1000,0.,1.);
36 TH1F * h40Ca = new TH1F("h40Ca","Fermi Momentum Distribution inside 40Ca",1000,0.,1.);
37
38 TCanvas *c1 = new TCanvas("c1","Fermi Distribution inside different Nuclei",200,10,600,400);
39
40 TLegend *l1 = new TLegend(0.7,0.6,0.89,0.89);
41 l1->SetFillColor(0);
42 l1->AddEntry(hD,"D","l");
43 l1->AddEntry(h3He,"3He","l");
44 l1->AddEntry(h4He,"4He","l");
45 l1->AddEntry(h7Li,"7Li","l");
46 l1->AddEntry(h12C,"12C","l");
47 l1->AddEntry(h40Ca,"40Ca","l");
48
49 t0=timer.RealTime();
50
51 makeDistributionManager()->Exec("nucleus_fermi:gamma");
53 //------------------------------------------------------------------------------
54
55 // PFermiDistributions *fD = new PFermiDistributions("d");
56
57 // for (int i=0; i<Iterations; i++)
58 // {
59 // if (i%Counter==0)
60 // {
61 // printf(" %i%s of deuteron done in %f sec\n",cpc1-1,percent,timer.RealTime()-t0);
62 // ++cpc1;
63 // timer.Continue();
64 // }
65 // hD ->Fill(fD ->GetRandomFermiMomentum(px1,py1,pz1));
66 //}
67 //------------------------------------------------------------------------------
68
69 PFermiMomentumGA* f3He =
70 ((PFermiMomentumGA*)makeDistributionManager()->GetDistribution("gp_in_3He"));
71
72 for (int i=0; i<Iterations; i++)
73 {
74 if (i%Counter==0)
75 {
76 printf(" %i%s of helium-3 done in %f sec\n",cpc2-1,percent,timer.RealTime()-t0);
77 ++cpc2;
78 timer.Continue();
79 }
80 h3He ->Fill(f3He ->GetRandomFermiMomentum(px2,py2,pz2));
81 }
82 //------------------------------------------------------------------------------
83
84 PFermiMomentumGA* f4He =
85 ((PFermiMomentumGA*)makeDistributionManager()->GetDistribution("gn_in_4He"));
86 for (int i=0; i<Iterations; i++)
87 {
88 if (i%Counter==0)
89 {
90 printf(" %i%s of helium-4 done in %f sec\n",cpc3-1,percent,timer.RealTime()-t0);
91 ++cpc3;
92 timer.Continue();
93 }
94 h4He ->Fill(f4He ->GetRandomFermiMomentum(px3,py3,pz3));
95 }
96 //------------------------------------------------------------------------------
97
98 PFermiMomentumGA* f7Li =
99 ((PFermiMomentumGA*)makeDistributionManager()->GetDistribution("gn_in_7Li"));
100
101 for (int i=0; i<Iterations; i++)
102 {
103 if (i%Counter==0)
104 {
105 printf(" %i%s of lithium-7 done in %f sec\n",cpc4-1,percent,timer.RealTime()-t0);
106 ++cpc4;
107 timer.Continue();
108 }
109 h7Li ->Fill(f7Li ->GetRandomFermiMomentum(px4,py4,pz4));
110 }
111 //------------------------------------------------------------------------------
112
113 PFermiMomentumGA* f12C =
114 ((PFermiMomentumGA*)makeDistributionManager()->GetDistribution("gn_in_12C"));
115
116 for (int i=0; i<Iterations; i++)
117 {
118 if (i%Counter==0)
119 {
120 printf(" %i%s of carbon-12 done in %f sec\n",cpc5-1,percent,timer.RealTime()-t0);
121 ++cpc5;
122 timer.Continue();
123 }
124 h12C ->Fill(f12C->GetRandomFermiMomentum(px5,py5,pz5));
125 }
126 //------------------------------------------------------------------------------
127
128 PFermiMomentumGA* f40Ca =
129 ((PFermiMomentumGA*)makeDistributionManager()->GetDistribution("gn_in_40Ca"));
130
131 for (int i=0; i<Iterations; i++)
132 {
133 if (i%Counter==0)
134 {
135 printf(" %i%s of calcium-40 done in %f sec\n",cpc6-1,percent,timer.RealTime()-t0);
136 ++cpc6;
137 timer.Continue();
138 }
139 h40Ca->Fill(f40Ca->GetRandomFermiMomentum(px6,py6,pz6));
140 }
141 //------------------------------------------------------------------------------
142
143 // hD->Scale(1./hD->GetMaximum());
144 h3He->Scale(1./h3He->GetMaximum());
145 h4He->Scale(1./h4He->GetMaximum());
146 h7Li->Scale(1./h7Li->GetMaximum());
147 h12C->Scale(1./h12C->GetMaximum());
148 h40Ca->Scale(1./h40Ca->GetMaximum());
149
150
151 c1->cd(1);
152 hD ->SetLineColor(1);
153 hD ->SetLineWidth(2);
154 h3He ->SetLineColor(2);
155 h3He ->SetLineWidth(2);
156 h4He ->SetLineColor(3);
157 h4He ->SetLineWidth(2);
158 h7Li ->SetLineColor(4);
159 h7Li ->SetLineWidth(2);
160 h12C ->SetLineColor(5);
161 h12C ->SetLineWidth(2);
162 h40Ca->SetLineColor(6);
163 h40Ca->SetLineWidth(2);
164
165
166 hD->SetStats(kFALSE);
167 hD->SetLabelSize(.04,"X");
168 hD->SetLabelSize(.04,"Y");
169 hD->SetTitleSize(.04,"X");
170 hD->SetTitleSize(.04,"Y");
171 hD->SetLabelFont(41,"X");
172 hD->SetLabelFont(41,"Y");
173 hD->SetNdivisions(505,"X");
174 hD->SetNdivisions(505,"Y");
175 hD->GetXaxis()->CenterTitle(kTRUE);
176 hD->SetXTitle("#font[41]{ Fermi Momentum p_{f} [GeV]}");
177 hD->GetYaxis()->CenterTitle(kTRUE);
178 hD->SetYTitle("#font[41]{Counts [a.u.]}");
179 hD->SetTitleOffset(1.3,"X");
180 hD->SetTitleOffset(1.,"Y");
181 hD->Draw();
182 h3He ->Draw("same");
183 h4He ->Draw("same");
184 h7Li ->Draw("same");
185 h12C ->Draw("same");
186 h40Ca->Draw("same");
187
188 l1->Draw();
189 c1->Update();
190
191}
void DrawAllFermiDistributions()
PDistributionManager * makeDistributionManager()
new TCanvas()
Bool_t Exec(const char *command)
Double_t GetRandomFermiMomentum(Double_t &px, Double_t &py, Double_t &pz)