AliPhysics  608b256 (608b256)
CompareTime3Stages_v1.C
Go to the documentation of this file.
2  //
3  // QA macro after step1 of Time Calibration
4  // thre is a memory leak somewhere - to be checked where
5  //
6  char tmpin[256];
7  Int_t runno[]={
8  259867, 259703, 259091, 260187, 259954, 259471, 259470, 259379, 259095
9 
10  };
11  Int_t nruns=9;//160;//172;
12 
13  for (Int_t i=0;i<nruns;i++){
14  sprintf(tmpin,"%d/AnalysisResults.root",runno[i]);
15  CompareTime3Stages_1file(tmpin,Form("%d",runno[i]));
16  }
17 }
18 
19 void CompareTime3Stages_1file(TString filename="timeResults.root",TString period="LHC15i"){
20  TFile *file=new TFile(filename.Data());
21  TList *list=file->Get("chistolist");
22  // list->ls();
23  TH2F *hRawTime[4];
24  TH2F *hRawTimeCorr[4];
25  TH2F *hTime[4];
26 
27  char text[256];
28  for(Int_t i=0;i<4;i++){//BC loop
29  sprintf(text,"RawTimeVsIdBC%d",i);
30  hRawTime[i]=(TH2F *)list->FindObject(text);
31  sprintf(text,"RawCorrTimeVsIdBC%d",i);
32  hRawTimeCorr[i]=(TH2F *)list->FindObject(text);
33  sprintf(text,"TimeVsIdBC%d",i);
34  hTime[i]=(TH2F *)list->FindObject(text);
35 
36  if(hRawTime[i]!=0) hRawTime[i]->SetMarkerColor(i+1);
37  if(hRawTimeCorr[i]!=0) hRawTimeCorr[i]->SetMarkerColor(i+1);
38  if(hTime[i]!=0) hTime[i]->SetMarkerColor(i+1);
39 
40  }
41 
42  TCanvas *c1=new TCanvas("c1","c1",1200,400);
43  c1->Divide(3,1);
44  c1->cd(1);
45  if(hRawTime[0]!=0) hRawTime[0]->Draw();
46  c1->cd(2);
47  if(hRawTimeCorr[0]!=0) hRawTimeCorr[0]->Draw();
48  c1->cd(3);
49  if(hTime[0]!=0) hTime[0]->Draw();
50  for(Int_t i=1;i<4;i++){//BC loop
51  c1->cd(1);
52  if(hRawTime[i]!=0) hRawTime[i]->Draw("same");
53  c1->cd(2);
54  if(hRawTimeCorr[i]!=0) hRawTimeCorr[i]->Draw("same");
55  c1->cd(3);
56  if(hTime[0]!=0) hTime[i]->Draw("same");
57  }
58 
59 // sprintf(text,"plots/RawTimeCompare_%s.pdf",period.Data());
60 // c1->Print(text);
61  sprintf(text,"plots/RawTimeCompare_%s.jpg",period.Data());
62  c1->Print(text);
63 
64  TCanvas *c2=new TCanvas("c2","c2",800,800);
65  c2->Divide(2,2);
66  for(Int_t i=0;i<4;i++){//BC loop
67  c2->cd(i+1)->SetLogz();
68  if(hRawTime[i]!=0) hRawTime[i]->Draw("colz");
69  }
70 // sprintf(text,"plots/RawTimeCompareBC_%s.pdf",period.Data());
71 // c2->Print(text);
72  sprintf(text,"plots/RawTimeCompareBC_%s.jpg",period.Data());
73  c2->Print(text);
74 
75  delete c1;
76  delete c2;
77 
78  delete list;
79 
80  file->Close();
81  delete file;
82 
83 }
const char * filename
Definition: TestFCM.C:1
Definition: External.C:236
void CompareTime3Stages_v1()
TLatex * text[5]
option to what and if export to output file
int Int_t
Definition: External.C:63
void CompareTime3Stages_1file(TString filename="timeResults.root", TString period="LHC15i")
TFile * file
TList with histograms for a given trigger.