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