AliPhysics  608b256 (608b256)
PlotTimeForSMandBC_v2.C
Go to the documentation of this file.
1 void PlotTimeForSMandBC_v2(TString period="LHC15n"){
2  // TFile *file=new TFile("AnalysisResults_step2Merged.root");
3  TFile *file=new TFile("AnalysisResults.root");
4  TList *list=file->Get("chistolist");
5  // list->ls();
6  TH2F *hSMBC[80];
7  TH2F *hSM[20];
8  TH2F *hSMBCLG[80];
9  TH2F *hSMLG[20];
10 
11  char text[256];
12  for(Int_t j=0;j<20;j++){//SM loop
13  for(Int_t i=0;i<4;i++){//BC loop
14  sprintf(text,"SupMod%dBC%d",j,i);
15  hSMBC[j+i*20]=(TH2F *)list->FindObject(text);
16  sprintf(text,"SupMod%dBC%dLG",j,i);
17  hSMBCLG[j+i*20]=(TH2F *)list->FindObject(text);
18  }
19  sprintf(text,"SupMod%d",j);
20  hSM[j]=(TH2F *)list->FindObject(text);
21  sprintf(text,"SupMod%dLG",j);
22  hSMLG[j]=(TH2F *)list->FindObject(text);
23  }
24 
25  TH2F *hAll=hSM[0]->Clone("hAll");
26  hAll->Sumw2();
27  for(Int_t j=1;j<20;j++){//SM loop
28  hSM[j]->Sumw2();
29  hAll->Add(hSM[j],1.);
30  }
31  TH1F *hAll_pro=(TH1F*)hAll->ProjectionY("hAll_pro",1,100);
32  TH1F *hAll_pro1=(TH1F*)hAll->ProjectionY("hAll_pro1",1,5);
33  TH1F *hAll_pro2=(TH1F*)hAll->ProjectionY("hAll_pro2",6,10);
34  TH1F *hAll_pro3=(TH1F*)hAll->ProjectionY("hAll_pro3",11,25);
35  TH1F *hAll_pro4=(TH1F*)hAll->ProjectionY("hAll_pro4",26,100);
36 
37 
38 
39  TCanvas *c1=new TCanvas("c1","c1",800,600);
40  c1->Divide(5,4);
41  for(Int_t i=0;i<4;i++){//BC loop
42  for(Int_t j=0;j<20;j++){//SM loop
43  c1->cd(j+1)->SetLogz();
44  if(hSMBC[j+i*20])
45  hSMBC[j+i*20]->Draw("colz");
46  }
47  sprintf(text,"plots/AllSM_pass2_%s_BC%d.pdf",period.Data(),i);
48  c1->Print(text);
49  }
50  for(Int_t j=0;j<20;j++){//SM loop
51  c1->cd(j+1)->SetLogz();
52  if(hSM[j])
53  hSM[j]->Draw("colz");
54  }
55  sprintf(text,"plots/AllSMmerged_pass2_%s.pdf",period.Data());
56  c1->Print(text);
57 
58  TCanvas *c2=new TCanvas("c2","c2",800,600);
59  c2->Divide(5,4);
60  for(Int_t i=0;i<4;i++){//BC loop
61  for(Int_t j=0;j<20;j++){//SM loop
62  c2->cd(j+1)->SetLogz();
63  if(hSMBCLG[j+i*20])
64  hSMBCLG[j+i*20]->Draw("colz");
65  }
66  sprintf(text,"plots/AllSM_pass2_%s_BC%d_LG.pdf",period.Data(),i);
67  c2->Print(text);
68  }
69  for(Int_t j=0;j<20;j++){//SM loop
70  c2->cd(j+1)->SetLogz();
71  if(hSMLG[j])
72  hSMLG[j]->Draw("colz");
73  }
74  sprintf(text,"plots/AllSMmerged_pass2_%s_LG.pdf",period.Data());
75  c2->Print(text);
76 
77  //cout<< hAll->GetNbinsX()<<endl;//100 bins in a range 0-20 GeV
78  //1 bin is 0.2 GeV/c
79  TCanvas *c3=new TCanvas("c3","c3",800,600);
80  gPad->SetLogy();
81  gStyle->SetOptFit();
82  hAll_pro->SetMarkerStyle(20);
83  hAll_pro->Fit("gaus","","",-20.,20.);
84  hAll_pro->Draw();
85  sprintf(text,"plots/AllmergedFit_%s.pdf",period.Data());
86  c3->Print(text);
87 
88  TCanvas *c3a=new TCanvas("c3a","c3a",800,600);
89  gPad->SetLogz();
90  // gStyle->SetOptFit();
91  //hAll_pro->SetMarkerStyle(20);
92  //hAll_pro->Fit("gaus","","",-20.,20.);
93  hAll->Draw("colz");
94  sprintf(text,"plots/Allmerged_2D_%s.pdf",period.Data());
95  c3a->Print(text);
96 
97 
98  hAll_pro1->SetMarkerStyle(20);
99  hAll_pro2->SetMarkerStyle(20);
100  hAll_pro3->SetMarkerStyle(20);
101  hAll_pro4->SetMarkerStyle(20);
102 
103  TCanvas *c4=new TCanvas("c4","c4",800,600);
104  c4->Divide(2,2);
105  gStyle->SetOptFit();
106  c4->cd(1);
107  gPad->SetLogy();
108  hAll_pro1->Fit("gaus","","",-20.,20.);
109  hAll_pro1->Draw();
110  c4->cd(2);
111  gPad->SetLogy();
112  hAll_pro2->Fit("gaus","","",-20.,20.);
113  hAll_pro2->Draw();
114  c4->cd(3);
115  gPad->SetLogy();
116  hAll_pro3->Fit("gaus","","",-20.,20.);
117  hAll_pro3->Draw();
118  c4->cd(4);
119  gPad->SetLogy();
120  hAll_pro4->Fit("gaus","","",-20.,20.);
121  hAll_pro4->Draw();
122  sprintf(text,"plots/AllmergedFit_pTbins_%s.pdf",period.Data());
123  c4->Print(text);
124 
125 
126 }
Definition: External.C:236
TLatex * text[5]
option to what and if export to output file
int Int_t
Definition: External.C:63
void PlotTimeForSMandBC_v2(TString period="LHC15n")
TFile * file
TList with histograms for a given trigger.