Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7877285
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Subscribers
None
View Options
Index: trunk/example/gen_cucu_auau_pbpb_uu.C
===================================================================
--- trunk/example/gen_cucu_auau_pbpb_uu.C (revision 13)
+++ trunk/example/gen_cucu_auau_pbpb_uu.C (revision 14)
@@ -1,108 +1,112 @@
//
{
- gROOT->LoadMacro("runglauber_v2.0.C+");
+ gROOT->LoadMacro("../macros/runglauber_v2.0.C+");
bool get_from_file = true;
int nevt = 50000;
TNtuple *nt1,*nt2,*nt3,*nt4;
if (get_from_file)
{
cout << "Getting 3 ntuples from file." << endl;
TFile* fin = new TFile("gen_cucu_auau_pbpb_uu.root");
nt1 = (TNtuple*) fin->Get("nt_Au_Au");
nt2 = (TNtuple*) fin->Get("nt_Cu_Cu");
nt3 = (TNtuple*) fin->Get("nt_Pb_Pb");
nt4 = (TNtuple*) fin->Get("nt_U_U");
fin->ls();
}
else
{
TGlauberMC g1("Au","Au",42);
TGlauberMC g2("Cu","Cu",42);
TGlauberMC g3("Pb","Pb",64);
TGlauberMC g4("U","U",42);
g1.Run(nevt);
g2.Run(nevt);
g3.Run(nevt);
g4.Run(nevt);
nt1 = g1.GetNtuple();
nt2 = g2.GetNtuple();
nt3 = g3.GetNtuple();
nt4 = g4.GetNtuple();
}
TCanvas c("c","C",800,600);
gStyle->SetOptStat(0);
TProfile p1("p1",";N_{part};#LT#epsilon#GT;",100,0,500);
TProfile p2("p2",";N_{part};#LT#epsilon#GT;",100,0,500);
TProfile p3("p3",";N_{part};#LT#epsilon#GT;",100,0,500);
TProfile p4("p4",";N_{part};#LT#epsilon#GT;",100,0,500);
TProfile p1b("p1b",";N_{part};#LT#epsilon}#GT;",100,0,500);
TProfile p2b("p2b",";N_{part};#LT#epsilon}#GT;",100,0,500);
TProfile p3b("p3b",";N_{part};#LT#epsilon}#GT;",100,0,500);
TProfile p4b("p4b",";N_{part};#LT#epsilon}#GT;",100,0,500);
nt1->Draw("Ecc2:Npart>>p1");
nt2->Draw("Ecc2:Npart>>p2");
nt3->Draw("Ecc2:Npart>>p3");
nt4->Draw("Ecc2:Npart>>p4");
nt1->Draw("(VarY-VarX)/(VarY+VarX):Npart>>p1b");
nt2->Draw("(VarY-VarX)/(VarY+VarX):Npart>>p2b");
nt3->Draw("(VarY-VarX)/(VarY+VarX):Npart>>p3b");
nt4->Draw("(VarY-VarX)/(VarY+VarX):Npart>>p4b");
p1.Draw();
p1.SetMinimum(-0.1);
gPad->SetGridy(1);
p2.Draw("same");
p3.Draw("same");
p4.Draw("same");
p1b.Draw("same");
p2b.Draw("same");
p3b.Draw("same");
p4b.Draw("same");
p1.SetMarkerColor(2);
p2.SetMarkerColor(3);
p3.SetMarkerColor(4);
p4.SetMarkerColor(6);
+ p1.SetMarkerStyle(20);
+ p2.SetMarkerStyle(20);
+ p3.SetMarkerStyle(20);
+ p4.SetMarkerStyle(20);
p1b.SetMarkerColor(2);
p2b.SetMarkerColor(3);
p3b.SetMarkerColor(4);
p4b.SetMarkerColor(6);
p1b.SetMarkerStyle(24);
p2b.SetMarkerStyle(24);
p3b.SetMarkerStyle(24);
p4b.SetMarkerStyle(24);
TLegend* leg = new TLegend(.5,.6,.88,.88);
leg->AddEntry(&p1,"#epsilon_{2} RHIC Au+Au #sigma_{inel}=42 mb","P");
leg->AddEntry(&p2,"#epsilon_{2} RHIC Cu+Cu #sigma_{inel}=42 mb","P");
leg->AddEntry(&p3,"#epsilon_{2} LHC Pb+Pb #sigma_{inel}=64 mb","P");
- leg->AddEntry(&p4,"#epsilon_{2} RHIC U+U #sigma_{inel}=64 mb","P");
+ leg->AddEntry(&p4,"#epsilon_{2} RHIC U+U #sigma_{inel}=42 mb","P");
leg->AddEntry(&p1b,"#epsilon_{RP} RHIC Au+Au #sigma_{inel}=42 mb","P");
leg->AddEntry(&p2b,"#epsilon_{RP} RHIC Cu+Cu #sigma_{inel}=42 mb","P");
leg->AddEntry(&p3b,"#epsilon_{RP} LHC Pb+Pb #sigma_{inel}=64 mb","P");
leg->AddEntry(&p4b,"#epsilon_{RP} RHIC U+U #sigma_{inel}=42 mb","P");
leg->SetBorderSize(0);
leg->SetFillColor(0);
leg->Draw();
c.Print("gen_cucu_auau_pbpb_uu_fig.pdf");
c.Print("gen_cucu_auau_pbpb_uu_fig.root");
if (!get_from_file)
{
cout << "4 ntuples were generated here. writing them." << endl;
TFile* fout = new TFile("gen_cucu_auau_pbpb_uu.root","RECREATE");
fout->cd();
nt1->Write();
nt2->Write();
nt3->Write();
nt4->Write();
fout->Close();
}
- }
+}
Index: trunk/example/gen_cucu_auau_pbpb_uu_np.C
===================================================================
--- trunk/example/gen_cucu_auau_pbpb_uu_np.C (revision 0)
+++ trunk/example/gen_cucu_auau_pbpb_uu_np.C (revision 14)
@@ -0,0 +1,148 @@
+//
+{
+ gROOT->LoadMacro("../macros/runglauber_v2.0.C+");
+ bool get_from_file = true;
+ int nevt = 50000;
+
+ TNtuple *nt1,*nt2,*nt3,*nt4;
+
+ if (get_from_file)
+ {
+ cout << "Getting 3 ntuples from file." << endl;
+ TFile* fin = new TFile("gen_cucu_auau_pbpb_uu.root");
+ nt1 = (TNtuple*) fin->Get("nt_Au_Au");
+ nt2 = (TNtuple*) fin->Get("nt_Cu_Cu");
+ nt3 = (TNtuple*) fin->Get("nt_Pb_Pb");
+ nt4 = (TNtuple*) fin->Get("nt_U_U");
+ fin->ls();
+
+ }
+ else
+ {
+ TGlauberMC g1("Au","Au",42);
+ TGlauberMC g2("Cu","Cu",42);
+ TGlauberMC g3("Pb","Pb",64);
+ TGlauberMC g4("U","U",42);
+ g1.Run(nevt);
+ g2.Run(nevt);
+ g3.Run(nevt);
+ g4.Run(nevt);
+ nt1 = g1.GetNtuple();
+ nt2 = g2.GetNtuple();
+ nt3 = g3.GetNtuple();
+ nt4 = g4.GetNtuple();
+ }
+
+ TCanvas c("c","C",800,600);
+
+ gStyle->SetOptStat(0);
+ Bool_t doNp=0;
+ if (doNp) {
+ TH1F p1("p1",";N_{part}",100,0,500);
+ TH1F p2("p2",";N_{part}",100,0,500);
+ TH1F p3("p3",";N_{part}",100,0,500);
+ TH1F p4("p4",";N_{part}",100,0,500);
+ nt1->Draw("Npart>>p1");
+ nt2->Draw("Npart>>p2");
+ nt3->Draw("Npart>>p3");
+ nt4->Draw("Npart>>p4");
+ p1.SetXTitle("N_{part}");
+ p1.SetYTitle("P(N_{part})");
+ } else {
+ TH1F p1("p1",";N_{coll}",100,0,2200);
+ TH1F p2("p2",";N_{coll}",100,0,2200);
+ TH1F p3("p3",";N_{coll}",100,0,2200);
+ TH1F p4("p4",";N_{coll}",100,0,2200);
+ nt1->Draw("Ncoll>>p1");
+ nt2->Draw("Ncoll>>p2");
+ nt3->Draw("Ncoll>>p3");
+ nt4->Draw("Ncoll>>p4");
+ p1.SetXTitle("N_{coll}");
+ p1.SetYTitle("P(N_{coll})");
+ }
+
+ gPad->SetLogy(1);
+
+ p1.Scale(1./p1.GetEntries()/p1.GetBinWidth(1));
+ p2.Scale(1./p2.GetEntries()/p2.GetBinWidth(1));
+ p3.Scale(1./p3.GetEntries()/p3.GetBinWidth(1));
+ p4.Scale(1./p4.GetEntries()/p4.GetBinWidth(1));
+
+ if (doNp) {
+ p1.SetMinimum(0.0001);
+ } else {
+ p1.SetMinimum(0.00001);
+ }
+
+ p1.Draw("hist");
+ p2.Draw("same hist");
+ p3.Draw("same hist");
+ p4.Draw("same hist");
+ p1.SetLineColor(2);
+ p2.SetLineColor(3);
+ p3.SetLineColor(4);
+ p4.SetLineColor(6);
+ p1.SetLineWidth(3);
+ p2.SetLineWidth(3);
+ p3.SetLineWidth(3);
+ p4.SetLineWidth(3);
+
+ TLegend* leg = new TLegend(.5,.6,.88,.88);
+ leg->AddEntry(&p1,"RHIC Au+Au #sigma_{inel}=42 mb","l");
+ leg->AddEntry(&p2,"RHIC Cu+Cu #sigma_{inel}=42 mb","l");
+ leg->AddEntry(&p3,"LHC Pb+Pb #sigma_{inel}=64 mb","l");
+ leg->AddEntry(&p4,"RHIC U+U #sigma_{inel}=42 mb","l");
+ leg->SetBorderSize(0);
+ leg->SetFillColor(0);
+ leg->Draw();
+
+ return;
+
+
+
+ // p1b.Draw("same");
+ //p2b.Draw("same");
+ //p3b.Draw("same");
+ //p4b.Draw("same");
+ p1.SetMarkerColor(2);
+ p2.SetMarkerColor(3);
+ p3.SetMarkerColor(4);
+ p4.SetMarkerColor(6);
+ p1.SetMarkerColor(2);
+ p2.SetMarkerColor(3);
+ p3.SetMarkerColor(4);
+ p4.SetMarkerColor(6);
+
+ p1b.SetMarkerColor(2);
+ p2b.SetMarkerColor(3);
+ p3b.SetMarkerColor(4);
+ p4b.SetMarkerColor(6);
+ p1b.SetMarkerStyle(24);
+ p2b.SetMarkerStyle(24);
+ p3b.SetMarkerStyle(24);
+ p4b.SetMarkerStyle(24);
+
+ leg->AddEntry(&p1b,"#epsilon_{RP} RHIC Au+Au #sigma_{inel}=42 mb","P");
+ leg->AddEntry(&p2b,"#epsilon_{RP} RHIC Cu+Cu #sigma_{inel}=42 mb","P");
+ leg->AddEntry(&p3b,"#epsilon_{RP} LHC Pb+Pb #sigma_{inel}=64 mb","P");
+ leg->AddEntry(&p4b,"#epsilon_{RP} RHIC U+U #sigma_{inel}=42 mb","P");
+ leg->SetBorderSize(0);
+ leg->SetFillColor(0);
+ //leg->Draw();
+
+ //c.Print("gen_cucu_auau_pbpb_uu_fig.pdf");
+ //c.Print("gen_cucu_auau_pbpb_uu_fig.root");
+
+ if (!get_from_file)
+ {
+ cout << "4 ntuples were generated here. writing them." << endl;
+ TFile* fout = new TFile("gen_cucu_auau_pbpb_uu.root","RECREATE");
+ fout->cd();
+ nt1->Write();
+ nt2->Write();
+ nt3->Write();
+ nt4->Write();
+ fout->Close();
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 3:04 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3804902
Default Alt Text
(7 KB)
Attached To
rTGLAUBERMCSVN tglaubermcsvn
Event Timeline
Log In to Comment