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