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