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