320856849e30f4420b594a33dacb41323eecc44f
[u/mrichter/AliRoot.git] / PWGCF / FLOW / macros / AddTaskPidQC.C
1 AddTaskPidQC(Float_t etamin=-0.8,Float_t etamax=0.8){\r
2   gROOT->LoadMacro("$ALICE_ROOT/PWGCF/FLOW/macros/AddTaskFlowCentralityPIDQC.C");\r
3 \r
4   const Int_t ncentr = 9;\r
5   Int_t cmin[ncentr]={0,5,10,20,30,40,50,60,70};\r
6   Int_t cmax[ncentr]={5,10,20,30,40,50,60,70,80};\r
7 \r
8   for(Int_t i=0;i < ncentr;i++){\r
9     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kFALSE,AliPID::kPion,AliFlowTrackCuts::kTOFbayesian,0,2,1,etamin,etamax); // no pid + QA\r
10     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kPion,AliFlowTrackCuts::kTOFbayesian,0,2,0,etamin,etamax);\r
11     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kKaon,AliFlowTrackCuts::kTOFbayesian,0,2,0,etamin,etamax);\r
12     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTOFbayesian,-1,2,0,etamin,etamax);\r
13     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTOFbayesian,0,2,0,etamin,etamax);\r
14     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kPion,AliFlowTrackCuts::kTPCbayesian,0,2,0,etamin,etamax);\r
15     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kKaon,AliFlowTrackCuts::kTPCbayesian,0,2,0,etamin,etamax);\r
16     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTPCbayesian,-1,2,0,etamin,etamax);\r
17     AddTaskFlowCentralityPIDQC(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTPCbayesian,0,2,0,etamin,etamax);\r
18   }\r
19 }\r
20 \r
21 createQC4res(){\r
22   gSystem->Load("libVMC.so");\r
23   gSystem->Load("libPhysics.so");\r
24   gSystem->Load("libTree.so");\r
25   gSystem->Load("libMinuit.so");\r
26   gSystem->Load("libSTEERBase.so");\r
27   gSystem->Load("libANALYSIS.so");\r
28   gSystem->Load("libAOD.so");\r
29   gSystem->Load("libESD.so");\r
30   gSystem->Load("libANALYSIS.so");\r
31   gSystem->Load("libANALYSISalice.so");\r
32   gSystem->Load("libCORRFW.so");\r
33   gSystem->Load("libNetx.so");\r
34   gSystem->Load("libPWGflowBase.so");\r
35   \r
36   char name[200];\r
37   char *spe[4]={"pion","kaon","antipr","proton"};\r
38   char *tech[2]={"TOF","TPC"};\r
39   Int_t cmin[9]={0,5,10,20,30,40,50,60,70};\r
40   Int_t cmax[9]={5,10,20,30,40,50,60,70,80};\r
41   \r
42   TFile *f = new TFile("AnalysisResults.root");\r
43   TFile *fo = new TFile("resultsQC4.root","RECREATE");\r
44   TDirectory* directory = dynamic_cast<TDirectory*>(f->Get("outputQCanalysisTPCstandalone"));\r
45   TList* listTemp = directory->GetListOfKeys();\r
46   for(Int_t i=0;i < 9;i++){\r
47     TList* list2 = dynamic_cast<TList*>(directory->Get(listTemp->At(i*9)->GetName()));\r
48     AliFlowAnalysisWithQCumulants* sp2 = new AliFlowAnalysisWithQCumulants();\r
49     sp2->GetOutputHistograms(list2);\r
50     sp2->Finish();\r
51     AliFlowCommonHistResults* res2=sp2->GetCommonHistsResults4th();\r
52     TH1D *h2=res2->GetHistDiffFlowPtPOI();\r
53     sprintf(name,"v2QC4_%s_%i_%i","AllCharged",cmin[i],cmax[i]);\r
54     h2->SetName(name);\r
55     fo->cd();\r
56     h2->Write();\r
57     for(Int_t j=0;j < 2;j++){\r
58       for(Int_t k=0;k < 4;k++){\r
59         TList* list = dynamic_cast<TList*>(directory->Get(listTemp->At(i*9+j*4+k+1)->GetName()));\r
60         AliFlowAnalysisWithQCumulants* sp = new AliFlowAnalysisWithQCumulants();\r
61         sp->GetOutputHistograms(list);\r
62         sp->Finish();\r
63         AliFlowCommonHistResults* res=sp->GetCommonHistsResults4th();\r
64         TH1D *h=res->GetHistDiffFlowPtPOI();\r
65         sprintf(name,"v2QC4_%s_%i_%i%s",spe[k],cmin[i],cmax[i],tech[j]);\r
66         h->SetName(name);\r
67         fo->cd();\r
68         h->Write();\r
69       }\r
70     }\r
71   }\r
72   fo->Close();\r
73 }\r
74 \r
75 \r
76 \r
77 createQC2res(){\r
78   gSystem->Load("libVMC.so");\r
79   gSystem->Load("libPhysics.so");\r
80   gSystem->Load("libTree.so");\r
81   gSystem->Load("libMinuit.so");\r
82   gSystem->Load("libSTEERBase.so");\r
83   gSystem->Load("libANALYSIS.so");\r
84   gSystem->Load("libAOD.so");\r
85   gSystem->Load("libESD.so");\r
86   gSystem->Load("libANALYSIS.so");\r
87   gSystem->Load("libANALYSISalice.so");\r
88   gSystem->Load("libCORRFW.so");\r
89   gSystem->Load("libNetx.so");\r
90   gSystem->Load("libPWGflowBase.so");\r
91   \r
92   char name[200];\r
93   char *spe[4]={"pion","kaon","antipr","proton"};\r
94   char *tech[2]={"TOF","TPC"};\r
95   Int_t cmin[9]={0,5,10,20,30,40,50,60,70};\r
96   Int_t cmax[9]={5,10,20,30,40,50,60,70,80};\r
97   \r
98   TFile *f = new TFile("AnalysisResults.root");\r
99   TFile *fo = new TFile("resultsQC2.root","RECREATE");\r
100   TDirectory* directory = dynamic_cast<TDirectory*>(f->Get("outputQCanalysisTPCstandalone"));\r
101   TList* listTemp = directory->GetListOfKeys();\r
102   for(Int_t i=0;i < 9;i++){\r
103     TList* list2 = dynamic_cast<TList*>(directory->Get(listTemp->At(i*9)->GetName()));\r
104     AliFlowAnalysisWithQCumulants* sp2 = new AliFlowAnalysisWithQCumulants();\r
105     sp2->GetOutputHistograms(list2);\r
106     sp2->Finish();\r
107     AliFlowCommonHistResults* res2=sp2->GetCommonHistsResults2nd();\r
108     TH1D *h2=res2->GetHistDiffFlowPtPOI();\r
109     sprintf(name,"v2QC2_%s_%i_%i","AllCharged",cmin[i],cmax[i]);\r
110     h2->SetName(name);\r
111     fo->cd();\r
112     h2->Write();\r
113     for(Int_t j=0;j < 2;j++){\r
114       for(Int_t k=0;k < 4;k++){\r
115         TList* list = dynamic_cast<TList*>(directory->Get(listTemp->At(i*9+j*4+k+1)->GetName()));\r
116         AliFlowAnalysisWithQCumulants* sp = new AliFlowAnalysisWithQCumulants();\r
117         sp->GetOutputHistograms(list);\r
118         sp->Finish();\r
119         AliFlowCommonHistResults* res=sp->GetCommonHistsResults2nd();\r
120         TH1D *h=res->GetHistDiffFlowPtPOI();\r
121         sprintf(name,"v2QC2_%s_%i_%i%s",spe[k],cmin[i],cmax[i],tech[j]);\r
122         h->SetName(name);\r
123         fo->cd();\r
124         h->Write();\r
125       }\r
126     }\r
127   }\r
128   fo->Close();\r
129 }\r
130 \r
131 \r
132 \r