Dplus task used AliAODPidHF via AliRDHFCutsDplustoKpipi (Renu, Francesco)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / macros / AddTaskDplus.C
CommitLineData
73173a6a 1AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kFALSE,
2 Bool_t readMC=kFALSE)
95e5b6b5 3{
4 //
5 // Test macro for the AliAnalysisTaskSE for D+ candidates
6
7 //Invariant mass histogram and
8 // association with MC truth (using MC info in AOD)
9 // R. Bala, bala@to.infn.it
10 // Get the pointer to the existing analysis manager via the static access method.
11 //==============================================================================
12 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
13 if (!mgr) {
14 ::Error("AddTaskDplus", "No analysis manager to connect to.");
15 return NULL;
16 }
17
18 //ptbins
73173a6a 19 const Int_t nptbins=14;
95e5b6b5 20 Float_t* ptbins;
21 ptbins=new Float_t[nptbins+1];
22 ptbins[0]=0.;
73173a6a 23 ptbins[1]=1.;
24 ptbins[2]=2.;
25 ptbins[3]=3.;
26 ptbins[4]=4.;
27 ptbins[5]=5.;
28 ptbins[6]=6.;
29 ptbins[7]=7.;
30 ptbins[8]=8.;
31 ptbins[9]=9.;
32 ptbins[10]=10.;
33 ptbins[11]=12.;
34 ptbins[12]=15.;
35 ptbins[13]=20.;
36 ptbins[14]=99999.;
95e5b6b5 37 const Int_t nvars=12;
38
39
40
41
42 Float_t** prodcutsval;
43 prodcutsval=new Float_t*[nvars];
44 for(Int_t ic=0;ic<nvars;ic++){prodcutsval[ic]=new Float_t[nptbins];}
45 for(Int_t ipt=0;ipt<nptbins;ipt++){
46 prodcutsval[0][ipt]=0.2;
47 prodcutsval[1][ipt]=0.4;
48 prodcutsval[2][ipt]=0.4;
49 prodcutsval[3][ipt]=0.;
50 prodcutsval[4][ipt]=0.;
51 prodcutsval[5][ipt]=0.01;
52 prodcutsval[6][ipt]=0.06;
53 prodcutsval[7][ipt]=0.02;
54 prodcutsval[8][ipt]=0.;
55 prodcutsval[9][ipt]=0.85;
56 prodcutsval[10][ipt]=0.;
57 prodcutsval[11][ipt]=10000000.0;
58
59 }
60
61
62
63 Float_t** anacutsval;
64 anacutsval=new Float_t*[nvars];
73173a6a 65
95e5b6b5 66 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
67 //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
68 Int_t ic=0;
69 for(Int_t ipt=0;ipt<nptbins;ipt++){
70 anacutsval[ic][ipt]=0.2;
71 }
72 Int_t ic=1;
73 for(Int_t ipt=0;ipt<nptbins;ipt++){
74 anacutsval[ic][ipt]=0.4;
75 }
76 Int_t ic=2;
77 for(Int_t ipt=0;ipt<nptbins;ipt++){
78 anacutsval[ic][ipt]=0.4;
79 }
80 Int_t ic=3;
81 for(Int_t ipt=0;ipt<nptbins;ipt++){
82 anacutsval[ic][ipt]=0.;
83 }
84 Int_t ic=4;
85 for(Int_t ipt=0;ipt<nptbins;ipt++){
86 anacutsval[ic][ipt]=0.;
87 }
88 Int_t ic=5;
89 for(Int_t ipt=0;ipt<nptbins;ipt++){
90 anacutsval[ic][ipt]=0.01;
91 }
92 Int_t ic=11;
93 for(Int_t ipt=0;ipt<nptbins;ipt++){
94 anacutsval[ic][ipt]=10000000000.;
95 }
96 anacutsval[6][0]=0.022100;
73173a6a 97 anacutsval[6][1]=0.022100;
98 anacutsval[6][2]=0.034;
99 anacutsval[6][3]=0.020667;
100 anacutsval[6][4]=0.020667;
101 anacutsval[6][5]=0.023333;
102 anacutsval[6][6]=0.023333;
103 anacutsval[6][7]=0.023333;
104 anacutsval[6][8]=0.023333;
105 anacutsval[6][9]=0.023333;
106 anacutsval[6][10]=0.023333;
107 anacutsval[6][11]=0.023333;
108 anacutsval[6][12]=0.023333;
109 anacutsval[6][13]=0.023333;
110 anacutsval[6][14]=0.023333;
111
95e5b6b5 112 anacutsval[7][0]=0.08;
73173a6a 113 anacutsval[7][1]=0.08;
114 anacutsval[7][2]=0.09;
115 anacutsval[7][3]=0.095;
116 anacutsval[7][4]=0.095;
117 anacutsval[7][5]=0.115;
118 anacutsval[7][6]=0.115;
119 anacutsval[7][7]=0.115;
120 anacutsval[7][8]=0.115;
121 anacutsval[7][9]=0.115;
122 anacutsval[7][10]=0.115;
123 anacutsval[7][11]=0.115;
124 anacutsval[7][12]=0.115;
125 anacutsval[7][13]=0.115;
126 anacutsval[7][14]=0.115;
127
95e5b6b5 128
129 anacutsval[8][0]=0.5;
73173a6a 130 anacutsval[8][1]=0.5;
131 anacutsval[8][2]=1.0;
95e5b6b5 132 anacutsval[8][3]=0.5;
73173a6a 133 anacutsval[8][4]=0.5;
134 anacutsval[8][5]=0.5;
135 anacutsval[8][6]=0.5;
136 anacutsval[8][7]=0.5;
137 anacutsval[8][8]=0.5;
138 anacutsval[8][9]=0.5;
139 anacutsval[8][10]=0.5;
140 anacutsval[8][11]=0.5;
141 anacutsval[8][12]=0.5;
142 anacutsval[8][13]=0.5;
143 anacutsval[8][14]=0.5;
144
95e5b6b5 145
146 anacutsval[9][0]=0.979;
73173a6a 147 anacutsval[9][1]=0.979;
148 anacutsval[9][2]= 0.9975;//0.99 ; 0.9975;
149 anacutsval[9][3]= 0.995; //0.99; //0.995;
150 anacutsval[9][4]= 0.995; //0.99; //0.995;
151 anacutsval[9][5]=0.9975; //0.99;
152 anacutsval[9][6]=0.9975;
153 anacutsval[9][7]=0.9975;
154 anacutsval[9][8]=0.9975;
155 anacutsval[9][9]=0.9975;
156 anacutsval[9][10]=0.9975;
157 anacutsval[9][11]=0.9975;
158 anacutsval[9][12]=0.9975;
159 anacutsval[9][13]=0.9975;
160 anacutsval[9][14]=0.9975;
95e5b6b5 161
162 anacutsval[10][0]=0.0055;
73173a6a 163 anacutsval[10][1]=0.0055;
164 anacutsval[10][2]=0.0028;//0.00400
95e5b6b5 165 anacutsval[10][3]=0.000883;
73173a6a 166 anacutsval[10][4]=0.000883;
167 anacutsval[10][5]=0.000883;
168 anacutsval[10][6]=0.000883;
169 anacutsval[10][7]=0.000883;
170 anacutsval[10][8]=0.000883;
171 anacutsval[10][9]=0.000883;
172 anacutsval[10][10]=0.000883;
173 anacutsval[10][11]=0.000883;
174 anacutsval[10][12]=0.000883;
175 anacutsval[10][13]=0.000883;
176 anacutsval[10][14]=0.000883;
177
95e5b6b5 178
179
180//Production cuts
181
182 AliRDHFCutsDplustoKpipi *prodcuts = new AliRDHFCutsDplustoKpipi();
183 prodcuts->SetPtBins(nptbins+1,ptbins);
184 prodcuts->SetCuts(nvars,nptbins,prodcutsval);
185
186 //Analysis cuts
187 AliRDHFCutsDplustoKpipi *analysiscuts = new AliRDHFCutsDplustoKpipi();
188 analysiscuts->SetPtBins(nptbins+1,ptbins);
189 analysiscuts->SetCuts(nvars,nptbins,anacutsval);
73173a6a 190 analysiscuts->SetUsePID(kTRUE);
191
192 // analysiscuts->SetTPCPID(kTRUE);
193 //analysiscuts->SetTOFPID(kTRUE);
95e5b6b5 194
195 // Aanalysis task
196 AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",analysiscuts,prodcuts,storeNtuple);
197 dplusTask->SetReadMC(readMC);
198 dplusTask->SetDoLikeSign(kTRUE);
73173a6a 199 // dplusTask->SetUseTPCpid(kTRUE);
200 //dplusTask->SetUseTOFpid(kTRUE);
95e5b6b5 201 dplusTask->SetDebugLevel(0);
73173a6a 202 dplusTask->SetMassLimits(0.2);
95e5b6b5 203 mgr->AddTask(dplusTask);
204
205 // Create containers for input/output
206
207 AliAnalysisDataContainer *cinputDplus = mgr->CreateContainer("cinputDplus",TChain::Class(),
208 AliAnalysisManager::kInputContainer);
209 TString outputfile = AliAnalysisManager::GetCommonFileName();
210 outputfile += ":PWG3_D2H_InvMassDplus";
211
212 AliAnalysisDataContainer *coutputDplusCuts = mgr->CreateContainer("coutputDplusCuts",TList::Class(),
213 AliAnalysisManager::kOutputContainer,
214 outputfile.Data());
215
216 AliAnalysisDataContainer *coutputDplus = mgr->CreateContainer("coutputDplus",TList::Class(),
217 AliAnalysisManager::kOutputContainer,
218 outputfile.Data());
219
220 if(storeNtuple){
221 AliAnalysisDataContainer *coutputDplus2 = mgr->CreateContainer("coutputDplus2",TNtuple::Class(),
222 AliAnalysisManager::kOutputContainer,
223 "InvMassDplus_nt1.root");
224
225 coutputDplus2->SetSpecialOutput();
226 }
227 mgr->ConnectInput(dplusTask,0,mgr->GetCommonInputContainer());
228
229 mgr->ConnectOutput(dplusTask,1,coutputDplus);
230
231 mgr->ConnectOutput(dplusTask,2,coutputDplusCuts);
232
233 if(storeNtuple){
234 mgr->ConnectOutput(dplusTask,3,coutputDplus2);
235 }
236 return dplusTask;
237}