forked from alisw/AliRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAliITSLegoPlot.C
53 lines (45 loc) · 1.8 KB
/
AliITSLegoPlot.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
void AliITSLegoPlot(Float_t nchtheta, Float_t nchphi, const char *inFile = "galice.root") {
// macro to visualize the lego plots generated by gAlive->RunLego
gROOT->Reset();
TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
if (!file->IsOpen()) {
cerr<<"Can't open "<<inFile<<" !" << endl;
return 1;
} // end if !file
Float_t theta = 10;
Float_t phi = 170;
Int_t ncont = 50;
TCanvas *cradl = new TCanvas("cradl","radl",10,10,800,600);
cradl->SetTheta(theta);
cradl->SetPhi(phi);
TH2F *hradl = (TH2F*)file->Get("hradl");
hradl->SetStats(kFALSE);
hradl->GetXaxis()->SetTitle("Phi (degrees)");
hradl->GetYaxis()->SetTitle("Theta (degrees)");
hradl->SetFillColor(2);
hradl->SetContour(ncont);
hradl->Draw("colz");
TCanvas *cradlx = new TCanvas("cradl1","radl",50,50,800,600);
hradl->ProjectionX();
hradl_px->SetStats(kFALSE);
// hradl_px->SetOptLogY();
// hradl_px->SetMinimum(0.001);
// hradl_px->SetMaximum(1);
hradl_px->Scale(1./nchtheta);
hradl_px->GetXaxis()->SetTitle("Phi (degrees)");
hradl_px->GetYaxis()->SetTitle("X/X0");
hradl_px->Draw();
// cout << "Average over Phi: " << hradl_px->GetSumOfWeights()/nchphi << " X/X0" << endl;
TCanvas *cradly = new TCanvas("cradl2","radl",100,100,800,600);
hradl->ProjectionY();
hradl_py->SetStats(kFALSE);
// hradl_py->SetOptLogY();
// hradl_py->SetMinimum(0.001);
// hradl_py->SetMaximum(1);
hradl_py->Scale(1./nchphi);
hradl_py->GetXaxis()->SetTitle("Theta (degrees)");
hradl_py->GetYaxis()->SetTitle("X/X0");
hradl_py->Draw();
// cout << "Average over Theta: " << hradl_py->GetSumOfWeights()/nchtheta << " X/X0" << endl;
cout << "Average: " << hradl_py->GetSumOfWeights()/nchtheta << " X/X0" << endl;
}