930843af9da4fb5912c4c761252ea26d1321c450
[u/mrichter/AliRoot.git] / PWGCF / FLOW / macros / AddTaskPidVZEROSP.C
1 AddTaskPidVZEROSP(Float_t etamin=-0.8,Float_t etamax=0.8){\r
2   gROOT->LoadMacro("$ALICE_ROOT/PWGCF/FLOW/macros/AddTaskFlowCentralityPIDSP.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     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kFALSE,AliPID::kPion,AliFlowTrackCuts::kTOFbayesian,0,2,0,etamin,etamax); // no pid\r
10     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kPion,AliFlowTrackCuts::kTOFbayesian,0,2,0,etamin,etamax);\r
11     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kKaon,AliFlowTrackCuts::kTOFbayesian,0,2,0,etamin,etamax);\r
12     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTOFbayesian,-1,2,0,etamin,etamax);\r
13     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTOFbayesian,0,2,0,etamin,etamax);\r
14     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kPion,AliFlowTrackCuts::kTPCbayesian,0,2,0,etamin,etamax);\r
15     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kKaon,AliFlowTrackCuts::kTPCbayesian,0,2,0,etamin,etamax);\r
16     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTPCbayesian,-1,2,0,etamin,etamax);\r
17     AddTaskFlowCentralityPIDSP(cmin[i],cmax[i],"AnalysisResults",kTRUE,AliPID::kProton,AliFlowTrackCuts::kTPCbayesian,0,2,0,etamin,etamax);\r
18   }\r
19 }\r
20 \r
21 createSPres(){\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("results.root","RECREATE");\r
44   TDirectory* directory = dynamic_cast<TDirectory*>(f->Get("outputSPanalysisTPCstandalone"));\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     AliFlowAnalysisWithScalarProduct* sp2 = new AliFlowAnalysisWithScalarProduct();\r
49     sp2->GetOutputHistograms(list2);\r
50     sp2->Finish();\r
51     AliFlowCommonHistResults* res2=sp2->GetCommonHistsRes();\r
52     TH1D *h2=res2->GetHistDiffFlowPtPOI();\r
53     sprintf(name,"v2SP_%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         AliFlowAnalysisWithScalarProduct* sp = new AliFlowAnalysisWithScalarProduct();\r
61         sp->GetOutputHistograms(list);\r
62         sp->Finish();\r
63         AliFlowCommonHistResults* res=sp->GetCommonHistsRes();\r
64         TH1D *h=res->GetHistDiffFlowPtPOI();\r
65         sprintf(name,"v2SP_%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 \r