Update
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / AddTaskHFEtpctofv2.C
1 AliAnalysisTask *AddTaskHFEtpctofv2(Int_t tpcCls=110, Double_t tpcClsr=50, Int_t tpcClspid=60, Double_t tpcsharedfraction=10, Int_t itsCls=4, Double_t chi2peritscl=36, Int_t pixellayer=2, Double_t dcaxy=100,Double_t dcaz=200, Double_t tofsig=30., Double_t tpceff=50., Int_t vzero=3, Int_t debuglevel=0, Bool_t algorithmMA=kFALSE, Bool_t massconstraint=kFALSE){
2
3   // libraries in case
4   gSystem->Load("libANALYSIS.so");
5   gSystem->Load("libANALYSISalice.so");
6   gSystem->Load("libPWGflowBase.so");
7   gSystem->Load("libPWGflowTasks.so");
8   
9   //
10   // Define TPC cut for 2011 data
11   //
12   Double_t tpcdedx[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; //0-5,5-10,10-20,20-30,30-40,40-50,50-60,60-100
13   // -0.2 0-5%
14   // -0.15 5-10%
15   // -0.1 10-20%
16   // -0.0 20-30%
17   // 0.156 30-40%
18   // 0.2 40-50%
19   // 0.2 50-60%
20   // 0.2 60-80% 
21   tpcdedx[0]=-0.2;
22   tpcdedx[1]=-0.15;
23   tpcdedx[2]=-0.1;
24   tpcdedx[3]=0.0;
25   tpcdedx[4]=0.156;
26   tpcdedx[5]=0.2;
27   tpcdedx[6]=0.2;
28   tpcdedx[7]=0.2;
29   if(TMath::Abs(tpceff-55)<0.01) {
30     tpcdedx[0]=-0.365;
31     tpcdedx[1]=-0.314;
32     tpcdedx[2]=-0.267;
33     tpcdedx[3]=-0.17;
34     tpcdedx[4]=-0.022;
35     tpcdedx[5]=-0.018;
36     tpcdedx[6]=0.018;
37     tpcdedx[7]=0.018;
38   }
39   if(TMath::Abs(tpceff-45)<0.01) {
40     tpcdedx[0]=-0.062;
41     tpcdedx[1]=-0.015;
42     tpcdedx[2]=0.035;
43     tpcdedx[3]=0.13;
44     tpcdedx[4]=0.278;
45     tpcdedx[5]=0.32;
46     tpcdedx[6]=0.32;
47     tpcdedx[7]=0.32;
48   }
49   if(TMath::Abs(tpceff-60)<0.01) {
50     tpcdedx[0]=-0.518;
51     tpcdedx[1]=-0.47;
52     tpcdedx[2]=-0.42;
53     tpcdedx[3]=-0.325;
54     tpcdedx[4]=-0.178;
55     tpcdedx[5]=-0.135;
56     tpcdedx[6]=-0.135;
57     tpcdedx[7]=-0.135;
58   }
59   if(TMath::Abs(tpceff-40)<0.01) {
60     tpcdedx[0]=0.09;
61     tpcdedx[1]=0.14;
62     tpcdedx[2]=0.188;
63     tpcdedx[3]=0.282;
64     tpcdedx[4]=0.43;
65     tpcdedx[5]=0.473;
66     tpcdedx[6]=0.473;
67     tpcdedx[7]=0.473;
68   }
69
70   // Name
71   TString appendixx(TString::Format("TPC%dr%dp%ds%dITS%dC%dPi%dDCAr%dz%dTOF%dTPCe%dV%dD%dec%dal%dm%d",tpcCls,(Int_t)tpcClsr,tpcClspid,(Int_t) tpcsharedfraction,itsCls,(Int_t) chi2peritscl,(Int_t) pixellayer,(Int_t) dcaxy,(Int_t)dcaz,(Int_t) tofsig,(Int_t)tpceff,vzero,debuglevel,(Int_t)algorithmMA,(Int_t)massconstraint));
72   printf("appendixx %s\n", appendixx.Data());
73   
74
75   //set config file name
76   TString configFile("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFE_FLOW_TOFTPC.C");
77   //TString configFile("/d/alice12/bailhache/AliRootInstallations/07_06_2012/AliRoot/PWGHF/hfe/macros/configs/PbPb/ConfigHFE_FLOW_TOFTPC.C");
78   TString checkconfig="ConfigHFE_FLOW_TOFTPC";
79   if (!gROOT->GetListOfGlobalFunctions()->FindObject(checkconfig.Data()))
80     gROOT->LoadMacro(configFile.Data());
81   
82   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
83   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
84   AliAnalysisTaskHFEFlow *task =  ConfigHFE_FLOW_TOFTPC(kFALSE,appendixx,tpcCls, tpcClsr, tpcClspid, tpcsharedfraction, itsCls, chi2peritscl, pixellayer, dcaxy, dcaz,tofsig,&tpcdedx[0],vzero,debuglevel,algorithmMA,massconstraint);
85   
86   task->SetNbBinsCentralityQCumulant(5);
87   //task->SetBinCentralityLess(0,0.0);
88   task->SetBinCentralityLess(0,0.0);
89   task->SetBinCentralityLess(1,10.0);
90   task->SetBinCentralityLess(2,20.0);
91   task->SetBinCentralityLess(3,40.0);
92   task->SetBinCentralityLess(4,50.0);
93   task->SetBinCentralityLess(5,60.0);
94   //task->SetBinCentralityLess(7,80.0);
95
96   task->SetHFEVZEROEventPlane(0x0);
97   task->SelectCollisionCandidates(AliVEvent::kSemiCentral); 
98   
99   mgr->AddTask(task);
100
101   TString containerName = mgr->GetCommonFileName();
102   containerName += ":";
103   containerName += appendixx.Data();
104
105   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
106   mgr->ConnectOutput(task,1, mgr->CreateContainer((const char*)(appendixx.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
107   mgr->ConnectInput(task,0, cinput );    
108
109   return NULL;
110
111   
112 }