]>
Commit | Line | Data |
---|---|---|
85e55da4 | 1 | //DEFINITION OF A FEW CONSTANTS |
2 | const Double_t ymin = -2.1 ; | |
3 | const Double_t ymax = 2.1 ; | |
4 | // const Double_t ptmin_0_4 = 0.0 ; | |
5 | // const Double_t ptmax_0_4 = 4.0 ; | |
6 | // const Double_t ptmin_4_8 = 4.0 ; | |
7 | // const Double_t ptmax_4_8 = 8.0 ; | |
8 | // const Double_t ptmin_8_10 = 8.0 ; | |
9 | // const Double_t ptmax_8_10 = 10.0 ; | |
10 | const Double_t cosmin = -1.05; | |
11 | const Double_t cosmax = 1.05; | |
12 | const Double_t cTmin = 0; // micron | |
13 | const Double_t cTmax = 500; // micron | |
14 | const Double_t dcamin = 0; // micron | |
15 | const Double_t dcamax = 500; // micron | |
16 | const Double_t d0min = -1000; // micron | |
17 | const Double_t d0max = 1000; // micron | |
18 | const Double_t d0xd0min = -100000; // micron | |
19 | const Double_t d0xd0max = 100000; // micron | |
20 | const Double_t phimin = 0.0; | |
21 | //const Double_t phimax = 2Pi; // defined in the macro!!!!!!!!!!!!!! | |
22 | const Int_t mintrackrefsTPC = 2 ; | |
23 | const Int_t mintrackrefsITS = 3 ; | |
24 | const Int_t charge = 1 ; | |
85e55da4 | 25 | const Int_t minclustersTPC = 50 ; |
26 | // cuts | |
27 | const Double_t ptmin = 0.1; | |
28 | const Double_t ptmax = 9999.; | |
29 | const Double_t etamin = -0.9; | |
30 | const Double_t etamax = 0.9; | |
31 | const Double_t zmin = -15; | |
32 | const Double_t zmax = 15; | |
33 | const Int_t minITSClusters = 5; | |
34 | ||
35 | //---------------------------------------------------- | |
36 | ||
3ee5eb83 | 37 | AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./DplustoKpipiCuts.root",Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 411, Char_t isSign = 2) |
85e55da4 | 38 | { |
39 | printf("Addig CF task using cuts from file %s\n",cutFile); | |
40 | ||
3ee5eb83 | 41 | // isSign = 0 --> D0 only |
42 | // isSign = 1 --> D0bar only | |
43 | // isSign = 2 --> D0 + D0bar | |
44 | ||
45 | TString expected; | |
4e6f4183 | 46 | if (isSign == 0 && pdgCode < 0){ |
3ee5eb83 | 47 | AliError(Form("Error setting PDG code (%d) and sign (0 --> particle (%d) only): they are not compatible, returning",pdgCode)); |
48 | return 0x0; | |
49 | } | |
4e6f4183 | 50 | else if (isSign == 1 && pdgCode > 0){ |
3ee5eb83 | 51 | AliError(Form("Error setting PDG code (%d) and sign (1 --> antiparticle (%d) only): they are not compatible, returning",pdgCode)); |
52 | return 0x0; | |
53 | } | |
54 | else if (isSign > 2 || isSign < 0){ | |
55 | AliError(Form("Sign not valid (%d, possible values are 0, 1, 2), returning")); | |
56 | return 0x0; | |
57 | } | |
58 | ||
85e55da4 | 59 | TFile* fileCuts = new TFile(cutFile); |
60 | AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = (AliRDHFCutsDplustoKpipi*)fileCuts->Get("DplustoKpipiCuts"); | |
61 | ||
62 | // check that the fKeepD0fromB flag is set to true when the fKeepD0fromBOnly flag is true | |
63 | // for now the binning is the same than for all D's | |
64 | if(isKeepDfromBOnly) isKeepDfromB = true; | |
65 | ||
66 | ||
67 | /* | |
68 | Double_t ptmin_0_4; | |
69 | Double_t ptmax_0_4; | |
70 | Double_t ptmin_4_8; | |
71 | Double_t ptmax_4_8; | |
72 | Double_t ptmin_8_10; | |
73 | Double_t ptmax_8_10; | |
74 | ||
75 | if(!isKeepDfromB){ | |
76 | ptmin_0_4 = 0.0 ; | |
77 | ptmax_0_4 = 4.0 ; | |
78 | ptmin_4_8 = 4.0 ; | |
79 | ptmax_4_8 = 8.0 ; | |
80 | ptmin_8_10 = 8.0 ; | |
81 | ptmax_8_10 = 10.0 ; | |
82 | } else{ | |
83 | ptmin_0_4 = 0.0 ; | |
84 | ptmax_0_4 = 3.0 ; | |
85 | ptmin_4_8 = 3.0 ; | |
86 | ptmax_4_8 = 5.0 ; | |
87 | ptmin_8_10 = 5.0 ; | |
88 | ptmax_8_10 = 10.0 ; | |
89 | } | |
90 | */ | |
91 | ||
92 | //CONTAINER DEFINITION | |
93 | Info("AliCFTaskVertexingHF","SETUP CONTAINER"); | |
94 | //the sensitive variables, their indices | |
95 | UInt_t ipt = 0; | |
96 | UInt_t iy = 1; | |
97 | UInt_t iphi = 2; | |
98 | UInt_t icT = 3; | |
99 | UInt_t ipointing = 4; | |
100 | UInt_t iptpi = 5; | |
101 | UInt_t iptK = 6; | |
102 | UInt_t iptpi2 = 7; | |
103 | UInt_t id0pi = 8; | |
104 | UInt_t id0K = 9; | |
105 | UInt_t id0pi2 = 10; | |
106 | UInt_t iz = 11; | |
107 | ||
108 | const Double_t phimax = 2*TMath::Pi(); | |
109 | ||
110 | //Setting up the container grid... | |
111 | UInt_t nstep = 10; //number of selection steps: MC with limited acceptance, MC, Acceptance, Vertex, Refit, Reco (no cuts), RecoAcceptance, RecoITSClusters (RecoAcceptance included), RecoPPR (RecoAcceptance+RecoITSCluster included), RecoPID | |
112 | const Int_t nvar = 12 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi | |
113 | // const Int_t nbin0_0_4 = 8 ; //bins in pt from 0 to 4 GeV | |
114 | // const Int_t nbin0_4_8 = 4 ; //bins in pt from 4 to 8 GeV | |
115 | // const Int_t nbin0_8_10 = 1 ; //bins in pt from 8 to 10 GeV | |
116 | ||
117 | /* | |
118 | Int_t nbin0_0_4; | |
119 | Int_t nbin0_4_8; | |
120 | Int_t nbin0_8_10; | |
121 | if (!isKeepDfromB){ | |
122 | nbin0_0_4 = 8 ; //bins in pt from 0 to 4 GeV | |
123 | nbin0_4_8 = 4 ; //bins in pt from 4 to 8 GeV | |
124 | nbin0_8_10 = 1 ; //bins in pt from 8 to 10 GeV | |
125 | }else{ | |
126 | nbin0_0_4 = 3 ; //bins in pt from 0 to 3 GeV | |
127 | nbin0_4_8 = 1 ; //bins in pt from 3 to 5 GeV | |
128 | nbin0_8_10 = 1 ; //bins in pt from 5 to 10 GeV | |
129 | } | |
130 | */ | |
131 | const Int_t nbin0 = cutsDplustoKpipi->GetNPtBins(); // bins in pT | |
132 | printf("pT: nbin (from cuts file) = %d\n",nbin0); | |
133 | const Int_t nbin1 = 42 ; //bins in y | |
134 | const Int_t nbin2 = 20 ; //bins in phi | |
135 | const Int_t nbin3 = 24 ; //bins in cT | |
136 | const Int_t nbin4 = 1050 ; //bins in cosPointingAngle | |
137 | const Int_t nbin5_0_4 = 8 ; //bins in ptPi from 0 to 4 GeV | |
138 | const Int_t nbin5_4_8 = 4 ; //bins in ptPi from 4 to 8 GeV | |
139 | const Int_t nbin5_8_10 = 1 ; //bins in ptPi from 8 to 10 GeV | |
140 | const Int_t nbin6_0_4 = 8 ; //bins in ptKa from 0 to 4 GeV | |
141 | const Int_t nbin6_4_8 = 4 ; //bins in ptKa from 4 to 8 GeV | |
142 | const Int_t nbin6_8_10 = 1 ; //bins in ptKa from 8 to 10 GeV | |
143 | const Int_t nbin7_0_4 = 8 ; //bins in ptpi2 from 0 to 4 GeV | |
144 | const Int_t nbin7_4_8 = 4 ; //bins in ptpi2 from 4 to 8 GeV | |
145 | const Int_t nbin7_8_10 = 1 ; //bins in ptpi2 from 8 to 10 GeV | |
146 | const Int_t nbin8 = 100 ; //bins in d0pi | |
147 | const Int_t nbin9 = 100 ; //bins in d0K | |
148 | const Int_t nbin10 = 100 ; //bins in d0pi2 | |
149 | const Int_t nbin11 = 60 ; //bins in z vertex | |
150 | ||
151 | //arrays for the number of bins in each dimension | |
152 | Int_t iBin[nvar]; | |
153 | //iBin[0]=nbin0_0_4+nbin0_4_8+nbin0_8_10; | |
154 | iBin[0]=nbin0; | |
155 | iBin[1]=nbin1; | |
156 | iBin[2]=nbin2; | |
157 | // iBin[3]=nbin3_0_4+nbin3_4_8+nbin3_8_10; | |
158 | //iBin[4]=nbin4_0_4+nbin4_4_8+nbin4_8_10; | |
159 | iBin[3]=nbin3; | |
160 | iBin[4]=nbin4; | |
161 | iBin[5]=nbin0; | |
162 | iBin[6]=nbin0; | |
163 | iBin[7]=nbin0; | |
164 | iBin[8]=nbin8; | |
165 | iBin[9]=nbin9; | |
166 | iBin[10]=nbin10; | |
167 | iBin[11]=nbin11; | |
168 | ||
169 | ||
170 | //arrays for lower bounds : | |
171 | Double_t *binLim0=new Double_t[iBin[0]+1]; | |
172 | Double_t *binLim1=new Double_t[iBin[1]+1]; | |
173 | Double_t *binLim2=new Double_t[iBin[2]+1]; | |
174 | Double_t *binLim3=new Double_t[iBin[3]+1]; | |
175 | Double_t *binLim4=new Double_t[iBin[4]+1]; | |
176 | Double_t *binLim5=new Double_t[iBin[5]+1]; | |
177 | Double_t *binLim6=new Double_t[iBin[6]+1]; | |
178 | Double_t *binLim7=new Double_t[iBin[7]+1]; | |
179 | Double_t *binLim8=new Double_t[iBin[8]+1]; | |
180 | Double_t *binLim9=new Double_t[iBin[9]+1]; | |
181 | Double_t *binLim10=new Double_t[iBin[10]+1]; | |
182 | Double_t *binLim11=new Double_t[iBin[11]+1]; | |
183 | ||
184 | ||
185 | // checking limits | |
186 | /* | |
187 | if (ptmax_0_4 != ptmin_4_8) { | |
188 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","max lim 1st range != min lim 2nd range, please check!"); | |
189 | } | |
190 | if (ptmax_4_8 != ptmin_8_10) { | |
191 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","max lim 2nd range != min lim 3rd range, please check!"); | |
192 | } | |
193 | */ | |
194 | // values for bin lower bounds | |
195 | // pt | |
196 | Float_t* floatbinLim0 = cutsDplustoKpipi->GetPtBinLimits(); | |
197 | for (Int_t ibin0 = 0 ; ibin0<iBin[0]+1; ibin0++){ | |
198 | binLim0[ibin0] = (Double_t)floatbinLim0[ibin0]; | |
199 | binLim5[ibin0] = (Double_t)floatbinLim0[ibin0]; | |
200 | binLim6[ibin0] = (Double_t)floatbinLim0[ibin0]; | |
201 | binLim7[ibin0] = (Double_t)floatbinLim0[ibin0]; | |
202 | } | |
203 | for(Int_t i=0; i<=nbin0; i++) printf("binLim0[%d]=%f\n",i,binLim0[i]); | |
204 | ||
205 | /* | |
206 | for(Int_t i=0; i<=nbin0_0_4; i++) binLim0[i]=(Double_t)ptmin_0_4 + (ptmax_0_4-ptmin_0_4)/nbin0_0_4*(Double_t)i ; | |
207 | if (binLim0[nbin0_0_4] != ptmin_4_8) { | |
208 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for pt - 1st range - differs from expected!\n"); | |
209 | } | |
210 | for(Int_t i=0; i<=nbin0_4_8; i++) binLim0[i+nbin0_0_4]=(Double_t)ptmin_4_8 + (ptmax_4_8-ptmin_4_8)/nbin0_4_8*(Double_t)i ; | |
211 | if (binLim0[nbin0_0_4+nbin0_4_8] != ptmin_8_10) { | |
212 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for pt - 2nd range - differs from expected!\n"); | |
213 | } | |
214 | for(Int_t i=0; i<=nbin0_8_10; i++) binLim0[i+nbin0_0_4+nbin0_4_8]=(Double_t)ptmin_8_10 + (ptmax_8_10-ptmin_8_10)/nbin0_8_10*(Double_t)i ; | |
215 | */ | |
216 | ||
217 | // y | |
218 | for(Int_t i=0; i<=nbin1; i++) binLim1[i]=(Double_t)ymin + (ymax-ymin) /nbin1*(Double_t)i ; | |
219 | ||
220 | // cosThetaStar | |
221 | // for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)cosmin + (cosmax-cosmin) /nbin2*(Double_t)i ; | |
222 | // Phi | |
223 | for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)phimin + (phimax-phimin) /nbin2*(Double_t)i ; | |
224 | ||
225 | // cT | |
226 | for(Int_t i=0; i<=nbin3; i++) binLim3[i]=(Double_t)cTmin + (cTmax-cTmin) /nbin3*(Double_t)i ; | |
227 | ||
228 | // cosPointingAngle | |
229 | for(Int_t i=0; i<=nbin4; i++) binLim4[i]=(Double_t)cosmin + (cosmax-cosmin) /nbin4*(Double_t)i ; | |
230 | ||
231 | /* | |
232 | // ptPi | |
233 | for(Int_t i=0; i<=nbin3_0_4; i++) binLim3[i]=(Double_t)ptmin_0_4 + (ptmax_0_4-ptmin_0_4)/nbin3_0_4*(Double_t)i ; | |
234 | if (binLim3[nbin3_0_4] != ptmin_4_8) { | |
235 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptPi - 1st range - differs from expected!"); | |
236 | } | |
237 | for(Int_t i=0; i<=nbin3_4_8; i++) binLim3[i+nbin3_0_4]=(Double_t)ptmin_4_8 + (ptmax_4_8-ptmin_4_8)/nbin3_4_8*(Double_t)i ; | |
238 | if (binLim3[nbin3_0_4+nbin3_4_8] != ptmin_8_10) { | |
239 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptPi - 2nd range - differs from expected!\n"); | |
240 | } | |
241 | for(Int_t i=0; i<=nbin3_8_10; i++) binLim3[i+nbin3_0_4+nbin3_4_8]=(Double_t)ptmin_8_10 + (ptmax_8_10-ptmin_8_10)/nbin3_8_10*(Double_t)i ; | |
242 | ||
243 | // ptKa | |
244 | for(Int_t i=0; i<=nbin4_0_4; i++) binLim4[i]=(Double_t)ptmin_0_4 + (ptmax_0_4-ptmin_0_4)/nbin4_0_4*(Double_t)i ; | |
245 | if (binLim4[nbin4_0_4] != ptmin_4_8) { | |
246 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptKa - 1st range - differs from expected!"); | |
247 | } | |
248 | for(Int_t i=0; i<=nbin4_4_8; i++) binLim4[i+nbin4_0_4]=(Double_t)ptmin_4_8 + (ptmax_4_8-ptmin_4_8)/nbin4_4_8*(Double_t)i ; | |
249 | if (binLim4[nbin4_0_4+nbin4_4_8] != ptmin_8_10) { | |
250 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptKa - 2nd range - differs from expected!\n"); | |
251 | } | |
252 | for(Int_t i=0; i<=nbin4_8_10; i++) binLim4[i+nbin4_0_4+nbin4_4_8]=(Double_t)ptmin_8_10 + (ptmax_8_10-ptmin_8_10)/nbin4_8_10*(Double_t)i ; | |
253 | */ | |
254 | ||
255 | ||
256 | // dca | |
257 | //for(Int_t i=0; i<=nbin6; i++) binLim6[i]=(Double_t)dcamin + (dcamax-dcamin) /nbin6*(Double_t)i ; | |
258 | ||
259 | // d0pi | |
260 | for(Int_t i=0; i<=nbin8; i++) binLim8[i]=(Double_t)d0min + (d0max-d0min) /nbin8*(Double_t)i ; | |
261 | ||
262 | // d0K | |
263 | for(Int_t i=0; i<=nbin9; i++) binLim9[i]=(Double_t)d0min + (d0max-d0min) /nbin9*(Double_t)i ; | |
264 | ||
265 | // d0pi2 | |
266 | for(Int_t i=0; i<=nbin10; i++) binLim10[i]=(Double_t)d0min + (d0max-d0min) /nbin10*(Double_t)i ; | |
267 | ||
268 | ||
269 | ||
270 | ||
271 | ||
272 | // z Primary Vertex | |
273 | for(Int_t i=0; i<=nbin11; i++) { | |
274 | binLim11[i]=(Double_t)zmin + (zmax-zmin) /nbin11*(Double_t)i ; | |
275 | // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim12[i])); | |
276 | } | |
277 | ||
278 | // debugging printings | |
279 | //Info("AliCFHeavyFlavourTaskMultiVarMultiStep","Printing lower limits for bins in pt"); | |
280 | //for (Int_t i =0; i<= iBin[0]; i++){ | |
281 | // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim0[i])); | |
282 | //} | |
283 | //Info("Printing lower limits for bins in ptPi"); | |
284 | //for (Int_t i =0; i<= iBin[3]; i++){ | |
285 | // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim3[i])); | |
286 | //} | |
287 | //Info("Printing lower limits for bins in ptKa"); | |
288 | //for (Int_t i =0; i<= iBin[4]; i++){ | |
289 | // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim4[i])); | |
290 | // } | |
291 | ||
292 | //one "container" for MC | |
293 | TString nameContainer=""; | |
294 | if(!isKeepDfromB) { | |
669ad277 | 295 | nameContainer="CFHFccontainer0_3Prong_CommonFramework"; |
85e55da4 | 296 | } |
297 | else if(isKeepDfromBOnly){ | |
669ad277 | 298 | nameContainer="CFHFccontainer0DfromB_3Prong_CommonFramework"; |
85e55da4 | 299 | } |
300 | else { | |
669ad277 | 301 | nameContainer="CFHFccontainer0allD_3Prong_CommonFramework"; |
85e55da4 | 302 | } |
303 | ||
304 | AliCFContainer* container = new AliCFContainer(nameContainer,"container for tracks",nstep,nvar,iBin); | |
305 | //setting the bin limits | |
306 | printf("pt\n"); | |
307 | container -> SetBinLimits(ipt,binLim0); | |
308 | printf("y\n"); | |
309 | container -> SetBinLimits(iy,binLim1); | |
310 | printf("Phi\n"); | |
311 | container -> SetBinLimits(iphi,binLim2); | |
312 | printf("cT\n"); | |
313 | container -> SetBinLimits(icT,binLim3); | |
314 | printf("pointing angle\n"); | |
315 | container -> SetBinLimits(ipointing,binLim4); | |
316 | printf("ptpi\n"); | |
317 | container -> SetBinLimits(iptpi,binLim5); | |
318 | printf("ptK\n"); | |
319 | container -> SetBinLimits(iptK,binLim6); | |
320 | printf("ptpi2\n"); | |
321 | container -> SetBinLimits(iptpi2,binLim7); | |
322 | printf("d0pi\n"); | |
323 | container -> SetBinLimits(id0pi,binLim8); | |
324 | printf("d0K\n"); | |
325 | container -> SetBinLimits(id0K,binLim9); | |
326 | printf("d0pi2\n"); | |
327 | container -> SetBinLimits(id0pi2,binLim10); | |
328 | printf("z \n"); | |
329 | container -> SetBinLimits(iz,binLim11); | |
330 | ||
331 | ||
332 | container -> SetStepTitle(0, "MCLimAcc"); | |
333 | container -> SetStepTitle(1, "MC"); | |
334 | container -> SetStepTitle(2, "MCAcc"); | |
335 | container -> SetStepTitle(3, "RecoVertex"); | |
336 | container -> SetStepTitle(4, "RecoRefit"); | |
337 | container -> SetStepTitle(5, "Reco"); | |
338 | container -> SetStepTitle(6, "RecoAcc"); | |
339 | container -> SetStepTitle(7, "RecoITSCluster"); | |
340 | container -> SetStepTitle(8, "RecoCuts"); | |
341 | container -> SetStepTitle(8, "RecoPID"); | |
342 | ||
343 | container -> SetVarTitle(ipt,"pt"); | |
344 | container -> SetVarTitle(iy,"y"); | |
345 | container -> SetVarTitle(iphi, "phi"); | |
346 | container -> SetVarTitle(icT, "ct"); | |
347 | container -> SetVarTitle(ipointing, "pionting"); | |
348 | container -> SetVarTitle(iptpi, "ptpi"); | |
349 | container -> SetVarTitle(iptK, "ptK"); | |
350 | container -> SetVarTitle(iptpi2, "ptpi2"); | |
351 | container -> SetVarTitle(id0pi, "d0pi"); | |
352 | container -> SetVarTitle(id0K, "d0K"); | |
353 | container -> SetVarTitle(id0pi2, "d0pi2"); | |
354 | container -> SetVarTitle(iz, "z"); | |
355 | ||
356 | ||
357 | //CREATE THE CUTS ----------------------------------------------- | |
358 | ||
359 | // Gen-Level kinematic cuts | |
360 | AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); | |
361 | ||
362 | //Particle-Level cuts: | |
363 | AliCFParticleGenCuts* mcGenCuts = new AliCFParticleGenCuts("mcGenCuts","MC particle generation cuts"); | |
3ee5eb83 | 364 | Bool_t useAbsolute = kTRUE; |
365 | if (isSign != 2){ | |
366 | useAbsolute = kFALSE; | |
367 | } | |
368 | mcGenCuts->SetRequirePdgCode(pdgCode, useAbsolute); // kTRUE set in order to include antiparticle | |
85e55da4 | 369 | mcGenCuts->SetAODMC(1); //special flag for reading MC in AOD tree (important) |
370 | ||
371 | // Acceptance cuts: | |
372 | AliCFAcceptanceCuts* accCuts = new AliCFAcceptanceCuts("accCuts", "Acceptance cuts"); | |
373 | AliCFTrackKineCuts *kineAccCuts = new AliCFTrackKineCuts("kineAccCuts","Kine-Acceptance cuts"); | |
374 | kineAccCuts->SetPtRange(ptmin,ptmax); | |
375 | kineAccCuts->SetEtaRange(etamin,etamax); | |
376 | ||
377 | // Rec-Level kinematic cuts | |
378 | AliCFTrackKineCuts *recKineCuts = new AliCFTrackKineCuts("recKineCuts","rec-level kine cuts"); | |
379 | ||
380 | AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts","rec-level quality cuts"); | |
381 | ||
382 | AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts","rec-level isPrimary cuts"); | |
383 | ||
384 | printf("CREATE MC KINE CUTS\n"); | |
385 | TObjArray* mcList = new TObjArray(0) ; | |
386 | mcList->AddLast(mcKineCuts); | |
387 | mcList->AddLast(mcGenCuts); | |
388 | ||
389 | printf("CREATE ACCEPTANCE CUTS\n"); | |
390 | TObjArray* accList = new TObjArray(0) ; | |
391 | accList->AddLast(kineAccCuts); | |
392 | ||
393 | printf("CREATE RECONSTRUCTION CUTS\n"); | |
394 | TObjArray* recList = new TObjArray(0) ; // not used!! | |
395 | recList->AddLast(recKineCuts); | |
396 | recList->AddLast(recQualityCuts); | |
397 | recList->AddLast(recIsPrimaryCuts); | |
398 | ||
399 | TObjArray* emptyList = new TObjArray(0); | |
400 | ||
401 | //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK | |
402 | printf("CREATE INTERFACE AND CUTS\n"); | |
403 | AliCFManager* man = new AliCFManager() ; | |
404 | man->SetParticleContainer(container); | |
405 | man->SetParticleCutsList(0 , mcList); // MC, Limited Acceptance | |
406 | man->SetParticleCutsList(1 , mcList); // MC | |
407 | man->SetParticleCutsList(2 , accList); // Acceptance | |
408 | man->SetParticleCutsList(3 , emptyList); // Vertex | |
409 | man->SetParticleCutsList(4 , emptyList); // Refit | |
410 | man->SetParticleCutsList(5 , emptyList); // AOD | |
411 | man->SetParticleCutsList(6 , emptyList); // AOD in Acceptance | |
412 | man->SetParticleCutsList(7 , emptyList); // AOD with required n. of ITS clusters | |
413 | man->SetParticleCutsList(8 , emptyList); // AOD Reco (PPR cuts implemented in Task) | |
414 | man->SetParticleCutsList(9 , emptyList); // AOD Reco PID | |
415 | ||
416 | // Get the pointer to the existing analysis manager via the static access method. | |
417 | //============================================================================== | |
418 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
419 | if (!mgr) { | |
420 | ::Error("AddTaskCompareHF", "No analysis manager to connect to."); | |
421 | return NULL; | |
422 | } | |
423 | //CREATE THE TASK | |
424 | printf("CREATE TASK\n"); | |
425 | ||
426 | // create the task | |
427 | AliCFTaskVertexingHF *task = new AliCFTaskVertexingHF("AliCFTaskVertexingHF",cutsDplustoKpipi); | |
3ee5eb83 | 428 | task->SetFillFromGenerated(kFALSE); |
85e55da4 | 429 | task->SetDecayChannel(31); |
430 | task->SetUseWeight(kFALSE); | |
431 | task->SetCFManager(man); //here is set the CF manager | |
3ee5eb83 | 432 | task->SetSign(isSign); |
433 | if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2); | |
434 | if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1); | |
85e55da4 | 435 | |
3ee5eb83 | 436 | Printf("***************** CONTAINER SETTINGS *****************"); |
437 | Printf("decay channel = %d",(Int_t)task->GetDecayChannel()); | |
438 | Printf("FillFromGenerated = %d",(Int_t)task->GetFillFromGenerated()); | |
439 | Printf("Dselection = %d",(Int_t)task->GetDselection()); | |
440 | Printf("UseWeight = %d",(Int_t)task->GetUseWeight()); | |
441 | Printf("Sign = %d",(Int_t)task->GetSign()); | |
85e55da4 | 442 | |
443 | //-----------------------------------------------------------// | |
444 | // create correlation matrix for unfolding - only eta-pt // | |
445 | //-----------------------------------------------------------// | |
446 | ||
447 | Bool_t AcceptanceUnf = kTRUE; // unfold at acceptance level, otherwise PPR | |
448 | ||
449 | Int_t thnDim[4]; | |
450 | ||
451 | //first half : reconstructed | |
452 | //second half : MC | |
453 | ||
454 | thnDim[0] = iBin[0]; | |
455 | thnDim[2] = iBin[0]; | |
456 | thnDim[1] = iBin[1]; | |
457 | thnDim[3] = iBin[1]; | |
458 | ||
459 | TString nameCorr=""; | |
460 | if(!isKeepDfromB) { | |
669ad277 | 461 | nameCorr="CFHFcorr0_3Prong_CommonFramework"; |
85e55da4 | 462 | } |
3ee5eb83 | 463 | else if(isKeepDfromBOnly){ |
669ad277 | 464 | nameCorr= "CFHFcorr0KeepDfromBOnly_3Prong_CommonFramework"; |
85e55da4 | 465 | } |
466 | else { | |
669ad277 | 467 | nameCorr="CFHFcorr0allD_3Prong_CommonFramework"; |
85e55da4 | 468 | } |
469 | ||
470 | THnSparseD* correlation = new THnSparseD(nameCorr,"THnSparse with correlations",4,thnDim); | |
471 | Double_t** binEdges = new Double_t[2]; | |
472 | ||
473 | // set bin limits | |
474 | ||
475 | binEdges[0]= binLim0; | |
476 | binEdges[1]= binLim1; | |
477 | ||
478 | correlation->SetBinEdges(0,binEdges[0]); | |
479 | correlation->SetBinEdges(2,binEdges[0]); | |
480 | ||
481 | correlation->SetBinEdges(1,binEdges[1]); | |
482 | correlation->SetBinEdges(3,binEdges[1]); | |
483 | ||
484 | correlation->Sumw2(); | |
485 | ||
486 | // correlation matrix ready | |
487 | //------------------------------------------------// | |
488 | ||
489 | task->SetCorrelationMatrix(correlation); // correlation matrix for unfolding | |
490 | ||
491 | // Create and connect containers for input/output | |
492 | ||
493 | // ------ input data ------ | |
494 | AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
495 | ||
496 | // ----- output data ----- | |
497 | ||
498 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
499 | TString output1name="", output2name="", output3name="", output4name="";; | |
500 | output2name=nameContainer; | |
501 | output3name=nameCorr; | |
502 | if(!isKeepDfromB) { | |
669ad277 | 503 | outputfile += ":PWG3_D2H_CFtaskDplustoKpipi_CommonFramework"; |
504 | output1name="CFHFchist0_3Prong_CommonFramework"; | |
85e55da4 | 505 | } |
506 | else if(isKeepDfromBOnly){ | |
669ad277 | 507 | outputfile += ":PWG3_D2H_CFtaskDplustoKpipiKeepDfromBOnly_CommonFramework"; |
508 | output1name="CFHFchist0DfromB_3Prong_CommonFramework"; | |
85e55da4 | 509 | } |
510 | else{ | |
669ad277 | 511 | outputfile += ":PWG3_D2H_CFtaskDplustoKpipiKeepDfromB_CommonFramework"; |
512 | output1name="CFHFchist0allD_3Prong_CommonFramework"; | |
85e55da4 | 513 | } |
514 | ||
669ad277 | 515 | output4name= "Cuts_3Prong_CommonFramework"; |
85e55da4 | 516 | |
517 | //now comes user's output objects : | |
518 | // output TH1I for event counting | |
519 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1name, TH1I::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
520 | // output Correction Framework Container (for acceptance & efficiency calculations) | |
521 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(output2name, AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
522 | // Unfolding - correlation matrix | |
523 | AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(output3name, THnSparseD::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
524 | AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(output4name, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); | |
525 | ||
526 | mgr->AddTask(task); | |
527 | ||
528 | mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); | |
529 | mgr->ConnectOutput(task,1,coutput1); | |
530 | mgr->ConnectOutput(task,2,coutput2); | |
531 | mgr->ConnectOutput(task,3,coutput3); | |
532 | mgr->ConnectOutput(task,4,coutput4); | |
533 | ||
534 | return task; | |
535 | } | |
536 |