]>
Commit | Line | Data |
---|---|---|
928c0b11 | 1 | const Double_t ymin = -1.2 ; |
2 | const Double_t ymax = 1.2 ; | |
3 | const Double_t cosminTS = -1.05; | |
4 | const Double_t cosmaxTS = 1.05; | |
5 | const Double_t cosmin = 0.7; | |
6 | const Double_t cosmax = 1.02; | |
367e9aa3 | 7 | const Double_t cTmin = 0; // micron |
928c0b11 | 8 | const Double_t cTmax = 300; // micron |
367e9aa3 | 9 | const Double_t dcamin = 0; // micron |
928c0b11 | 10 | const Double_t dcamax = 600; // micron |
11 | const Double_t d0xd0min = -80000; // micron | |
367e9aa3 | 12 | const Double_t d0xd0max = 100000; // micron |
13 | const Double_t phimin = 0.0; | |
14 | const Int_t mintrackrefsTPC = 2 ; | |
15 | const Int_t mintrackrefsITS = 3 ; | |
16 | const Int_t charge = 1 ; | |
17 | const Int_t minclustersTPC = 50 ; | |
18 | // cuts | |
19 | const Double_t ptmin = 0.1; | |
20 | const Double_t ptmax = 9999.; | |
21 | const Double_t etamin = -0.9; | |
22 | const Double_t etamax = 0.9; | |
23 | const Double_t zmin = -15; | |
24 | const Double_t zmax = 15; | |
928c0b11 | 25 | const Int_t minITSClusters = 5; |
26 | ||
27 | const Float_t centmin_0_10 = 0.; | |
28 | const Float_t centmax_0_10 = 10.; | |
ad02b758 | 29 | const Float_t centmin_10_60 = 10.; |
30 | const Float_t centmax_10_60 = 60.; | |
31 | const Float_t centmin_60_100 = 60.; | |
32 | const Float_t centmax_60_100 = 100.; | |
928c0b11 | 33 | const Float_t centmax = 100.; |
34 | const Float_t fakemin = -0.5; | |
ba223ad1 | 35 | const Float_t fakemax = 2.5.; |
928c0b11 | 36 | const Float_t cosminXY = 0.95; |
37 | const Float_t cosmaxXY = 1.0; | |
38 | const Float_t normDecLXYmin = 0; | |
39 | const Float_t normDecLXYmax = 20; | |
40 | const Float_t multmin_0_20 = 0; | |
41 | const Float_t multmax_0_20 = 20; | |
42 | const Float_t multmin_20_50 = 20; | |
43 | const Float_t multmax_20_50 = 50; | |
ba223ad1 | 44 | const Float_t multmin_50_80 = 50; |
45 | const Float_t multmax_50_80 = 80; | |
46 | const Float_t multmin_80_100 = 80; | |
47 | const Float_t multmax_80_100 = 100; | |
48 | ||
367e9aa3 | 49 | |
50 | //---------------------------------------------------- | |
51 | ||
8b530e87 | 52 | AliCFTaskVertexingHF *AddTaskCFVertexingHFCascade(const char* cutFile = "DStartoKpipiCuts010.root", TString cutObjectName="DStartoKpipiCuts", TString suffix="suf", Int_t configuration = AliCFTaskVertexingHF::kCheetah, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 413, Char_t isSign = 2, Bool_t useWeight=kTRUE, Bool_t useFlatPtWeight=kFALSE, Bool_t useZWeight=kFALSE, Bool_t useNchWeight=kFALSE, Bool_t isPPData=kFALSE) |
367e9aa3 | 53 | { |
928c0b11 | 54 | printf("Adding CF task using cuts from file %s\n",cutFile); |
55 | if (configuration == AliCFTaskVertexingHF::kSnail){ | |
56 | printf("The configuration is set to be SLOW --> all the variables will be used to fill the CF\n"); | |
57 | } | |
58 | else if (configuration == AliCFTaskVertexingHF::kCheetah){ | |
59 | printf("The configuration is set to be FAST --> using only pt, y, ct, phi, zvtx, centrality, fake, multiplicity to fill the CF\n"); | |
60 | } | |
61 | else{ | |
62 | printf("The configuration is not defined! returning\n"); | |
63 | return; | |
64 | } | |
65 | ||
66 | gSystem->Sleep(2000); | |
367e9aa3 | 67 | |
ba223ad1 | 68 | // isSign = 0 --> D* only |
69 | // isSign = 1 --> D*bar only | |
70 | // isSign = 2 --> D* + D*bar | |
367e9aa3 | 71 | |
72 | TString expected; | |
73 | if (isSign == 0 && pdgCode < 0){ | |
ba223ad1 | 74 | AliError(Form("Error setting PDG code (%d) and sign (0 --> D* only): they are not compatible, returning")); |
367e9aa3 | 75 | return 0x0; |
76 | } | |
77 | else if (isSign == 1 && pdgCode > 0){ | |
ba223ad1 | 78 | AliError(Form("Error setting PDG code (%d) and sign (1 --> D*bar only): they are not compatible, returning")); |
367e9aa3 | 79 | return 0x0; |
80 | } | |
81 | else if (isSign > 2 || isSign < 0){ | |
82 | AliError(Form("Sign not valid (%d, possible values are 0, 1, 2), returning")); | |
83 | return 0x0; | |
84 | } | |
85 | ||
4b29db6c | 86 | TFile* fileCuts = TFile::Open(cutFile); |
ba223ad1 | 87 | if(!fileCuts || (fileCuts && !fileCuts->IsOpen())){ |
88 | AliError("Wrong cut file"); | |
89 | return 0x0; | |
90 | } | |
91 | ||
8b530e87 | 92 | AliRDHFCutsDStartoKpipi *cutsDStartoKpi = (AliRDHFCutsDStartoKpipi*)fileCuts->Get(cutObjectName.Data()); |
367e9aa3 | 93 | |
94 | // check that the fKeepD0fromB flag is set to true when the fKeepD0fromBOnly flag is true | |
95 | // for now the binning is the same than for all D's | |
96 | if(isKeepDfromBOnly) isKeepDfromB = true; | |
97 | ||
98 | Double_t ptmin_0_6; | |
99 | Double_t ptmax_0_6; | |
100 | Double_t ptmin_6_8; | |
101 | Double_t ptmax_6_8; | |
102 | Double_t ptmin_8_16; | |
103 | Double_t ptmax_8_16; | |
104 | Double_t ptmin_16_24; | |
105 | Double_t ptmax_16_24; | |
106 | ||
107 | ptmin_0_6 = 0.0 ; | |
108 | ptmax_0_6 = 6.0 ; | |
109 | ptmin_6_8 = 6.0 ; | |
110 | ptmax_6_8 = 8.0 ; | |
111 | ptmin_8_16 = 8.0 ; | |
112 | ptmax_8_16 = 16.0 ; | |
113 | ptmin_16_24 = 16.0 ; | |
114 | ptmax_16_24 = 24.0 ; | |
115 | ||
ba223ad1 | 116 | |
367e9aa3 | 117 | //CONTAINER DEFINITION |
118 | Info("AliCFTaskVertexingHF","SETUP CONTAINER"); | |
367e9aa3 | 119 | const Double_t phimax = 2*TMath::Pi(); |
928c0b11 | 120 | 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 |
121 | ||
122 | //const UInt_t ipT, iy, icosThetaStar, ipTpi, ipTk, icT, idca, id0xd0, ipointing, iphi, izvtx, icent, ifake, ipointingXY, iNormDecayLXY, imult; | |
ba223ad1 | 123 | const Int_t nbiny = 24 ; //bins in y |
124 | const Int_t nbincosThetaStar = 42 ; //bins in cosThetaStar | |
125 | const Int_t nbincT = 15 ; //bins in cT | |
126 | const Int_t nbindca = 20 ; //bins in dca | |
127 | const Int_t nbind0xd0 = 90 ; //bins in d0xd0 | |
128 | const Int_t nbinpointing = 50 ; //bins in cosPointingAngle | |
129 | const Int_t nbinphi = 18 ; //bins in Phi | |
130 | const Int_t nbinzvtx = 30 ; //bins in z vertex | |
131 | const Int_t nbincent = 28; //bins in centrality | |
132 | const Int_t nbincent_0_10 = 4; //bins in centrality between 0 and 10 | |
133 | const Int_t nbincent_10_60 = 20; //bins in centrality between 10 and 60 | |
134 | const Int_t nbincent_60_100 = 4; //bins in centrality between 60 and 100 | |
135 | const Int_t nbinfake = 3; //bins in fake | |
136 | const Int_t nbinpointingXY = 50; //bins in cosPointingAngleXY | |
137 | const Int_t nbinnormDecayLXY = 20; //bins in NormDecayLengthXY | |
138 | const Int_t nbinmult = 49; //bins in multiplicity (total number) | |
139 | const Int_t nbinmult_0_20 = 20; //bins in multiplicity between 0 and 20 | |
140 | const Int_t nbinmult_20_50 = 15; //bins in multiplicity between 20 and 50 | |
141 | const Int_t nbinmult_50_80 = 10; //bins in multiplicity between 50 and 102 | |
142 | const Int_t nbinmult_80_100 = 4; //bins in multiplicity between 50 and 102 | |
143 | ||
367e9aa3 | 144 | |
928c0b11 | 145 | //the sensitive variables, their indices |
367e9aa3 | 146 | |
928c0b11 | 147 | const Int_t nvarTot = 16 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi, z, centrality, fake, cosPointingAngleXY, normDecayLengthXY, multiplicity |
148 | ||
149 | // variables' indices | |
150 | const UInt_t ipT = 0; | |
151 | const UInt_t iy = 1; | |
152 | const UInt_t icosThetaStar = 2; | |
153 | const UInt_t ipTpi = 3; | |
154 | const UInt_t ipTk = 4; | |
155 | const UInt_t icT = 5; | |
156 | const UInt_t idca = 6; | |
157 | const UInt_t id0xd0 = 7; | |
158 | const UInt_t ipointing = 8; | |
159 | const UInt_t iphi = 9; | |
160 | const UInt_t izvtx = 10; | |
161 | const UInt_t icent = 11; | |
162 | const UInt_t ifake = 12; | |
163 | const UInt_t ipointingXY = 13; | |
164 | const UInt_t inormDecayLXY = 14; | |
165 | const UInt_t imult = 15; | |
166 | ||
167 | //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 | |
168 | ||
367e9aa3 | 169 | //arrays for the number of bins in each dimension |
928c0b11 | 170 | Int_t iBin[nvarTot]; |
ba223ad1 | 171 | |
8b530e87 | 172 | const Int_t nbinpt = cutsDStartoKpi->GetNPtBins(); // bins in pT |
928c0b11 | 173 | iBin[ipT]=nbinpt; |
174 | iBin[ipTpi]=nbinpt; | |
175 | iBin[ipTk]=nbinpt; | |
176 | Double_t *binLimpT=new Double_t[iBin[ipT]+1]; | |
177 | Double_t *binLimpTpi=new Double_t[iBin[ipTpi]+1]; | |
178 | Double_t *binLimpTk=new Double_t[iBin[ipTk]+1]; | |
367e9aa3 | 179 | // values for bin lower bounds |
8b530e87 | 180 | Float_t* floatbinLimpT = cutsDStartoKpi->GetPtBinLimits(); |
928c0b11 | 181 | for (Int_t ibin0 = 0 ; ibin0<iBin[ipT]+1; ibin0++){ |
182 | binLimpT[ibin0] = (Double_t)floatbinLimpT[ibin0]; | |
183 | binLimpTpi[ibin0] = (Double_t)floatbinLimpT[ibin0]; | |
184 | binLimpTk[ibin0] = (Double_t)floatbinLimpT[ibin0]; | |
5b805cec | 185 | } |
928c0b11 | 186 | for(Int_t i=0; i<=nbinpt; i++) printf("binLimpT[%d]=%f\n",i,binLimpT[i]); |
187 | ||
188 | printf("pT: nbin (from cuts file) = %d\n",nbinpt); | |
189 | ||
367e9aa3 | 190 | // defining now the binning for the other variables: |
928c0b11 | 191 | |
ba223ad1 | 192 | AliLog::SetClassDebugLevel("AliCFManager",AliLog::kInfo); |
193 | ||
928c0b11 | 194 | iBin[iy]=nbiny; |
195 | iBin[icosThetaStar]=nbincosThetaStar; | |
196 | iBin[icT]=nbincT; | |
197 | iBin[idca]=nbindca; | |
198 | iBin[id0xd0]=nbind0xd0; | |
199 | iBin[ipointing]=nbinpointing; | |
200 | iBin[iphi]=nbinphi; | |
201 | iBin[izvtx]=nbinzvtx; | |
202 | iBin[icent]=nbincent; | |
203 | iBin[ifake]=nbinfake; | |
204 | iBin[ipointingXY]=nbinpointingXY; | |
205 | iBin[inormDecayLXY]=nbinnormDecayLXY; | |
206 | iBin[imult]=nbinmult; | |
367e9aa3 | 207 | |
208 | //arrays for lower bounds : | |
928c0b11 | 209 | Double_t *binLimy=new Double_t[iBin[iy]+1]; |
210 | Double_t *binLimcosThetaStar=new Double_t[iBin[icosThetaStar]+1]; | |
211 | Double_t *binLimcT=new Double_t[iBin[icT]+1]; | |
212 | Double_t *binLimdca=new Double_t[iBin[idca]+1]; | |
213 | Double_t *binLimd0xd0=new Double_t[iBin[id0xd0]+1]; | |
214 | Double_t *binLimpointing=new Double_t[iBin[ipointing]+1]; | |
215 | Double_t *binLimphi=new Double_t[iBin[iphi]+1]; | |
216 | Double_t *binLimzvtx=new Double_t[iBin[izvtx]+1]; | |
217 | Double_t *binLimcent=new Double_t[iBin[icent]+1]; | |
218 | Double_t *binLimfake=new Double_t[iBin[ifake]+1]; | |
219 | Double_t *binLimpointingXY=new Double_t[iBin[ipointingXY]+1]; | |
220 | Double_t *binLimnormDecayLXY=new Double_t[iBin[inormDecayLXY]+1]; | |
221 | Double_t *binLimmult=new Double_t[iBin[imult]+1]; | |
367e9aa3 | 222 | |
ba223ad1 | 223 | |
367e9aa3 | 224 | // y |
ba223ad1 | 225 | for(Int_t i=0; i<=nbiny; i++) binLimy[i]=(Double_t)ymin + (ymax-ymin) /nbiny*(Double_t)i ; |
367e9aa3 | 226 | |
ba223ad1 | 227 | // cosThetaStar |
228 | for(Int_t i=0; i<=nbincosThetaStar; i++) binLimcosThetaStar[i]=(Double_t)cosminTS + (cosmaxTS-cosminTS) /nbincosThetaStar*(Double_t)i ; | |
229 | ||
230 | // cT | |
231 | for(Int_t i=0; i<=nbincT; i++) binLimcT[i]=(Double_t)cTmin + (cTmax-cTmin) /nbincT*(Double_t)i ; | |
367e9aa3 | 232 | |
ba223ad1 | 233 | // dca |
234 | for(Int_t i=0; i<=nbindca; i++) binLimdca[i]=(Double_t)dcamin + (dcamax-dcamin) /nbindca*(Double_t)i ; | |
367e9aa3 | 235 | |
ba223ad1 | 236 | // d0xd0 |
237 | for(Int_t i=0; i<=nbind0xd0; i++) binLimd0xd0[i]=(Double_t)d0xd0min + (d0xd0max-d0xd0min) /nbind0xd0*(Double_t)i ; | |
367e9aa3 | 238 | |
ba223ad1 | 239 | // cosPointingAngle |
240 | for(Int_t i=0; i<=nbinpointing; i++) binLimpointing[i]=(Double_t)cosmin + (cosmax-cosmin) /nbinpointing*(Double_t)i ; | |
367e9aa3 | 241 | |
ba223ad1 | 242 | // Phi |
243 | for(Int_t i=0; i<=nbinphi; i++) binLimphi[i]=(Double_t)phimin + (phimax-phimin) /nbinphi*(Double_t)i ; | |
367e9aa3 | 244 | |
ba223ad1 | 245 | // z Primary Vertex |
246 | for(Int_t i=0; i<=nbinzvtx; i++) { | |
247 | binLimzvtx[i]=(Double_t)zmin + (zmax-zmin) /nbinzvtx*(Double_t)i ; | |
248 | } | |
928c0b11 | 249 | |
ba223ad1 | 250 | // centrality |
251 | for(Int_t i=0; i<=nbincent_0_10; i++) binLimcent[i]=(Double_t)centmin_0_10 + (centmax_0_10-centmin_0_10)/nbincent_0_10*(Double_t)i ; | |
252 | if (binLimcent[nbincent_0_10] != centmin_10_60) { | |
253 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for cent - 1st range - differs from expected!\n"); | |
254 | } | |
255 | for(Int_t i=0; i<=nbincent_10_60; i++) binLimcent[i+nbincent_0_10]=(Double_t)centmin_10_60 + (centmax_10_60-centmin_10_60)/nbincent_10_60*(Double_t)i ; | |
256 | if (binLimcent[nbincent_0_10+nbincent_10_60] != centmin_60_100) { | |
257 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for cent - 2st range - differs from expected!\n"); | |
258 | } | |
259 | for(Int_t i=0; i<=nbincent_60_100; i++) binLimcent[i+nbincent_0_10+nbincent_10_60]=(Double_t)centmin_60_100 + (centmax_60_100-centmin_60_100)/nbincent_60_100*(Double_t)i ; | |
928c0b11 | 260 | |
ba223ad1 | 261 | // fake |
262 | for(Int_t i=0; i<=nbinfake; i++) { | |
263 | binLimfake[i]=(Double_t)fakemin + (fakemax-fakemin)/nbinfake * (Double_t)i; | |
264 | } | |
265 | ||
266 | // cosPointingAngleXY | |
267 | for(Int_t i=0; i<=nbinpointingXY; i++) binLimpointingXY[i]=(Double_t)cosminXY + (cosmaxXY-cosminXY) /nbinpointingXY*(Double_t)i ; | |
268 | ||
269 | // normDecayLXY | |
270 | for(Int_t i=0; i<=nbinnormDecayLXY; i++) binLimnormDecayLXY[i]=(Double_t)normDecLXYmin + (normDecLXYmax-normDecLXYmin) /nbinnormDecayLXY*(Double_t)i ; | |
928c0b11 | 271 | |
928c0b11 | 272 | |
273 | // multiplicity | |
ba223ad1 | 274 | for(Int_t i=0; i<=nbinmult_0_20; i++) binLimmult[i]=(Double_t)multmin_0_20 + (multmax_0_20-multmin_0_20)/nbinmult_0_20*(Double_t)i ; |
275 | if (binLimmult[nbinmult_0_20] != multmin_20_50) { | |
276 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for mult - 1st range - differs from expected!\n"); | |
277 | } | |
278 | for(Int_t i=0; i<=nbinmult_20_50; i++) binLimmult[i+nbinmult_0_20]=(Double_t)multmin_20_50 + (multmax_20_50-multmin_20_50)/nbinmult_20_50*(Double_t)i ; | |
279 | if (binLimmult[nbinmult_0_20+nbinmult_20_50] != multmin_50_80) { | |
280 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for mult - 2nd range - differs from expected!\n"); | |
281 | } | |
282 | for(Int_t i=0; i<=nbinmult_50_80; i++) binLimmult[i+nbinmult_0_20+nbinmult_20_50]=(Double_t)multmin_50_80 + (multmax_50_80-multmin_50_80)/nbinmult_50_80*(Double_t)i ; | |
283 | if (binLimmult[nbinmult_0_20+nbinmult_20_50+nbinmult_50_80] != multmin_80_100) { | |
284 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for mult - 2nd range - differs from expected!\n"); | |
285 | } | |
286 | for(Int_t i=0; i<=nbinmult_80_100; i++) binLimmult[i+nbinmult_0_20+nbinmult_20_50+nbinmult_50_80]=(Double_t)multmin_80_100 + (multmax_80_100-multmin_80_100)/nbinmult_80_100*(Double_t)i ; | |
367e9aa3 | 287 | |
288 | //one "container" for MC | |
289 | TString nameContainer=""; | |
290 | if(!isKeepDfromB) { | |
ba223ad1 | 291 | nameContainer="CFHFccontainer0"; |
367e9aa3 | 292 | } |
293 | else if(isKeepDfromBOnly){ | |
ba223ad1 | 294 | nameContainer="CFHFccontainer0DfromB"; |
367e9aa3 | 295 | } |
296 | else { | |
ba223ad1 | 297 | nameContainer="CFHFccontainer0allD"; |
928c0b11 | 298 | } |
ba223ad1 | 299 | nameContainer += suffix; |
928c0b11 | 300 | //Setting up the container grid... |
301 | ||
302 | AliCFContainer* container; | |
303 | ||
304 | if (configuration == AliCFTaskVertexingHF::kSnail){ | |
305 | container = new AliCFContainer(nameContainer,"container for tracks",nstep,nvarTot,iBin); | |
306 | //setting the bin limits | |
307 | printf("pt\n"); | |
308 | container -> SetBinLimits(ipT,binLimpT); | |
309 | printf("y\n"); | |
310 | container -> SetBinLimits(iy,binLimy); | |
311 | printf("cts\n"); | |
312 | container -> SetBinLimits(icosThetaStar,binLimcosThetaStar); | |
313 | printf("ptPi\n"); | |
314 | container -> SetBinLimits(ipTpi,binLimpTpi); | |
315 | printf("ptK\n"); | |
316 | container -> SetBinLimits(ipTk,binLimpTk); | |
317 | printf("cT\n"); | |
318 | container -> SetBinLimits(icT,binLimcT); | |
319 | printf("dca\n"); | |
320 | container -> SetBinLimits(idca,binLimdca); | |
321 | printf("d0xd0\n"); | |
322 | container -> SetBinLimits(id0xd0,binLimd0xd0); | |
323 | printf("pointing\n"); | |
324 | container -> SetBinLimits(ipointing,binLimpointing); | |
325 | printf("phi\n"); | |
326 | container -> SetBinLimits(iphi,binLimphi); | |
327 | printf("z\n"); | |
328 | container -> SetBinLimits(izvtx,binLimzvtx); | |
329 | printf("cent\n"); | |
330 | container -> SetBinLimits(icent,binLimcent); | |
331 | printf("fake\n"); | |
332 | container -> SetBinLimits(ifake,binLimfake); | |
333 | printf("pointingXY\n"); | |
334 | container -> SetBinLimits(ipointingXY,binLimpointingXY); | |
335 | printf("normDecayLXY\n"); | |
336 | container -> SetBinLimits(inormDecayLXY,binLimnormDecayLXY); | |
337 | printf("multiplicity\n"); | |
338 | container -> SetBinLimits(imult,binLimmult); | |
339 | ||
340 | container -> SetVarTitle(ipT,"pt"); | |
341 | container -> SetVarTitle(iy,"y"); | |
342 | container -> SetVarTitle(icosThetaStar, "cosThetaStar"); | |
343 | container -> SetVarTitle(ipTpi, "ptpi"); | |
344 | container -> SetVarTitle(ipTk, "ptK"); | |
345 | container -> SetVarTitle(icT, "ct"); | |
346 | container -> SetVarTitle(idca, "dca"); | |
347 | container -> SetVarTitle(id0xd0, "d0xd0"); | |
348 | container -> SetVarTitle(ipointing, "pointing"); | |
349 | container -> SetVarTitle(iphi, "phi"); | |
350 | container -> SetVarTitle(izvtx, "zvtx"); | |
351 | container -> SetVarTitle(icent, "centrality"); | |
352 | container -> SetVarTitle(ifake, "fake"); | |
353 | container -> SetVarTitle(ipointingXY, "piointingXY"); | |
354 | container -> SetVarTitle(inormDecayLXY, "normDecayLXY"); | |
355 | container -> SetVarTitle(imult, "multiplicity"); | |
356 | } | |
357 | else if (configuration == AliCFTaskVertexingHF::kCheetah){ | |
358 | //arrays for the number of bins in each dimension | |
359 | const Int_t nvar = 8; | |
360 | ||
361 | const UInt_t ipTFast = 0; | |
362 | const UInt_t iyFast = 1; | |
363 | const UInt_t icTFast = 2; | |
364 | const UInt_t iphiFast = 3; | |
365 | const UInt_t izvtxFast = 4; | |
366 | const UInt_t icentFast = 5; | |
367 | const UInt_t ifakeFast = 6; | |
368 | const UInt_t imultFast = 7; | |
369 | ||
370 | Int_t iBinFast[nvar]; | |
371 | iBinFast[ipTFast] = iBin[ipT]; | |
372 | iBinFast[iyFast] = iBin[iy]; | |
373 | iBinFast[icTFast] = iBin[icT]; | |
374 | iBinFast[iphiFast] = iBin[iphi]; | |
375 | iBinFast[izvtxFast] = iBin[izvtx]; | |
376 | iBinFast[icentFast] = iBin[icent]; | |
377 | iBinFast[ifakeFast] = iBin[ifake]; | |
378 | iBinFast[imultFast] = iBin[imult]; | |
379 | ||
380 | container = new AliCFContainer(nameContainer,"container for tracks",nstep,nvar,iBinFast); | |
381 | printf("pt\n"); | |
382 | container -> SetBinLimits(ipTFast,binLimpT); | |
383 | printf("y\n"); | |
384 | container -> SetBinLimits(iyFast,binLimy); | |
385 | printf("ct\n"); | |
386 | container -> SetBinLimits(icTFast,binLimcT); | |
387 | printf("phi\n"); | |
388 | container -> SetBinLimits(iphiFast,binLimphi); | |
389 | printf("zvtx\n"); | |
390 | container -> SetBinLimits(izvtxFast,binLimzvtx); | |
391 | printf("centrality\n"); | |
392 | container -> SetBinLimits(icentFast,binLimcent); | |
393 | printf("fake\n"); | |
394 | container -> SetBinLimits(ifakeFast,binLimfake); | |
395 | printf("multiplicity\n"); | |
396 | container -> SetBinLimits(imultFast,binLimmult); | |
397 | ||
398 | container -> SetVarTitle(ipTFast,"pt"); | |
399 | container -> SetVarTitle(iyFast,"y"); | |
400 | container -> SetVarTitle(icTFast, "ct"); | |
401 | container -> SetVarTitle(iphiFast, "phi"); | |
402 | container -> SetVarTitle(izvtxFast, "zvtx"); | |
403 | container -> SetVarTitle(icentFast, "centrality"); | |
404 | container -> SetVarTitle(ifakeFast, "fake"); | |
405 | container -> SetVarTitle(imultFast, "multiplicity"); | |
367e9aa3 | 406 | } |
407 | ||
367e9aa3 | 408 | container -> SetStepTitle(0, "MCLimAcc"); |
409 | container -> SetStepTitle(1, "MC"); | |
410 | container -> SetStepTitle(2, "MCAcc"); | |
411 | container -> SetStepTitle(3, "RecoVertex"); | |
412 | container -> SetStepTitle(4, "RecoRefit"); | |
413 | container -> SetStepTitle(5, "Reco"); | |
414 | container -> SetStepTitle(6, "RecoAcc"); | |
415 | container -> SetStepTitle(7, "RecoITSCluster"); | |
416 | container -> SetStepTitle(8, "RecoCuts"); | |
928c0b11 | 417 | container -> SetStepTitle(9, "RecoPID"); |
367e9aa3 | 418 | |
928c0b11 | 419 | //return container; |
367e9aa3 | 420 | |
421 | //CREATE THE CUTS ----------------------------------------------- | |
422 | ||
423 | // Gen-Level kinematic cuts | |
424 | AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); | |
425 | ||
426 | //Particle-Level cuts: | |
427 | AliCFParticleGenCuts* mcGenCuts = new AliCFParticleGenCuts("mcGenCuts","MC particle generation cuts"); | |
428 | Bool_t useAbsolute = kTRUE; | |
429 | if (isSign != 2){ | |
430 | useAbsolute = kFALSE; | |
431 | } | |
432 | mcGenCuts->SetRequirePdgCode(pdgCode, useAbsolute); // kTRUE set in order to include D0_bar | |
433 | mcGenCuts->SetAODMC(1); //special flag for reading MC in AOD tree (important) | |
434 | ||
435 | // Acceptance cuts: | |
436 | AliCFAcceptanceCuts* accCuts = new AliCFAcceptanceCuts("accCuts", "Acceptance cuts"); | |
437 | AliCFTrackKineCuts *kineAccCuts = new AliCFTrackKineCuts("kineAccCuts","Kine-Acceptance cuts"); | |
438 | kineAccCuts->SetPtRange(ptmin,ptmax); | |
439 | kineAccCuts->SetEtaRange(etamin,etamax); | |
440 | ||
441 | // Rec-Level kinematic cuts | |
442 | AliCFTrackKineCuts *recKineCuts = new AliCFTrackKineCuts("recKineCuts","rec-level kine cuts"); | |
443 | ||
444 | AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts","rec-level quality cuts"); | |
445 | ||
446 | AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts","rec-level isPrimary cuts"); | |
447 | ||
448 | printf("CREATE MC KINE CUTS\n"); | |
449 | TObjArray* mcList = new TObjArray(0) ; | |
450 | mcList->AddLast(mcKineCuts); | |
451 | mcList->AddLast(mcGenCuts); | |
452 | ||
453 | printf("CREATE ACCEPTANCE CUTS\n"); | |
454 | TObjArray* accList = new TObjArray(0) ; | |
455 | accList->AddLast(kineAccCuts); | |
456 | ||
457 | printf("CREATE RECONSTRUCTION CUTS\n"); | |
458 | TObjArray* recList = new TObjArray(0) ; // not used!! | |
459 | recList->AddLast(recKineCuts); | |
460 | recList->AddLast(recQualityCuts); | |
461 | recList->AddLast(recIsPrimaryCuts); | |
462 | ||
463 | TObjArray* emptyList = new TObjArray(0); | |
464 | ||
465 | //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK | |
466 | printf("CREATE INTERFACE AND CUTS\n"); | |
467 | AliCFManager* man = new AliCFManager() ; | |
468 | man->SetParticleContainer(container); | |
469 | man->SetParticleCutsList(0 , mcList); // MC, Limited Acceptance | |
470 | man->SetParticleCutsList(1 , mcList); // MC | |
471 | man->SetParticleCutsList(2 , accList); // Acceptance | |
472 | man->SetParticleCutsList(3 , emptyList); // Vertex | |
473 | man->SetParticleCutsList(4 , emptyList); // Refit | |
474 | man->SetParticleCutsList(5 , emptyList); // AOD | |
475 | man->SetParticleCutsList(6 , emptyList); // AOD in Acceptance | |
476 | man->SetParticleCutsList(7 , emptyList); // AOD with required n. of ITS clusters | |
477 | man->SetParticleCutsList(8 , emptyList); // AOD Reco (PPR cuts implemented in Task) | |
478 | man->SetParticleCutsList(9 , emptyList); // AOD Reco PID | |
479 | ||
480 | // Get the pointer to the existing analysis manager via the static access method. | |
481 | //============================================================================== | |
482 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
483 | if (!mgr) { | |
484 | ::Error("AddTaskCompareHF", "No analysis manager to connect to."); | |
485 | return NULL; | |
486 | } | |
487 | //CREATE THE TASK | |
488 | printf("CREATE TASK\n"); | |
489 | ||
490 | // create the task | |
8b530e87 | 491 | AliCFTaskVertexingHF *task = new AliCFTaskVertexingHF("AliCFTaskVertexingHF",cutsDStartoKpi); |
928c0b11 | 492 | task->SetConfiguration(configuration); |
367e9aa3 | 493 | task->SetFillFromGenerated(kFALSE); |
494 | task->SetCFManager(man); //here is set the CF manager | |
495 | task->SetDecayChannel(21); | |
ba223ad1 | 496 | task->SetUseFlatPtWeight(useFlatPtWeight); |
497 | task->SetUseWeight(useWeight); | |
498 | task->SetUseZWeight(useZWeight); | |
367e9aa3 | 499 | task->SetSign(isSign); |
928c0b11 | 500 | task->SetCentralitySelection(kFALSE); |
501 | task->SetFakeSelection(0); | |
502 | task->SetRejectCandidateIfNotFromQuark(kTRUE); // put to false if you want to keep HIJING D0!! | |
503 | task->SetUseMCVertex(kFALSE); // put to true if you want to do studies on pp | |
ba223ad1 | 504 | //task->SetPtWeightsFromDataPbPb276overLHC12a17a(); |
505 | ||
928c0b11 | 506 | |
367e9aa3 | 507 | if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2); |
928c0b11 | 508 | if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1); |
367e9aa3 | 509 | |
5b37c6e5 | 510 | TF1* funcWeight = 0x0; |
511 | if (task->GetUseWeight()) { | |
928c0b11 | 512 | funcWeight = (TF1*)fileCuts->Get("funcWeight"); |
5b37c6e5 | 513 | if (funcWeight == 0x0){ |
514 | Printf("FONLL Weights will be used"); | |
515 | } | |
516 | else { | |
517 | task->SetWeightFunction(funcWeight); | |
518 | Printf("User-defined Weights will be used. The function being:"); | |
f174c850 | 519 | task->GetWeightFunction()->Print(); |
5b37c6e5 | 520 | } |
521 | } | |
522 | ||
ba223ad1 | 523 | if(useNchWeight){ |
524 | TH1F *hNchPrimaries = (TH1F*)fileCuts->Get("hGenPrimaryParticlesInelGt0"); | |
525 | if(hNchPrimaries) { | |
526 | task->SetUseNchWeight(kTRUE); | |
527 | task->SetMCNchHisto(hNchPrimaries); | |
528 | } else { | |
529 | AliFatal("Histogram for multiplicity weights not found"); | |
530 | return 0x0; | |
531 | } | |
532 | } | |
533 | ||
8b530e87 | 534 | Printf("***************** CONTAINER SETTINGS *****************"); |
535 | Printf("decay channel = %d",(Int_t)task->GetDecayChannel()); | |
536 | Printf("FillFromGenerated = %d",(Int_t)task->GetFillFromGenerated()); | |
537 | Printf("Dselection = %d",(Int_t)task->GetDselection()); | |
538 | Printf("UseWeight = %d",(Int_t)task->GetUseWeight()); | |
539 | if (task->GetUseWeight()) { | |
540 | if(funcWeight) Printf("User-defined Weight function"); | |
541 | else Printf("FONLL will be used for the weights"); | |
542 | } | |
543 | ||
544 | Printf("Use Nch weight = %d",(Int_t)task->GetUseNchWeight()); | |
545 | Printf("Sign = %d",(Int_t)task->GetSign()); | |
546 | Printf("Centrality selection = %d",(Int_t)task->GetCentralitySelection()); | |
547 | Printf("Fake selection = %d",(Int_t)task->GetFakeSelection()); | |
548 | Printf("RejectCandidateIfNotFromQuark selection = %d",(Int_t)task->GetRejectCandidateIfNotFromQuark()); | |
549 | Printf("UseMCVertex selection = %d",(Int_t)task->GetUseMCVertex()); | |
550 | Printf("***************END CONTAINER SETTINGS *****************\n"); | |
551 | ||
367e9aa3 | 552 | |
553 | //-----------------------------------------------------------// | |
554 | // create correlation matrix for unfolding - only eta-pt // | |
555 | //-----------------------------------------------------------// | |
556 | ||
557 | Bool_t AcceptanceUnf = kTRUE; // unfold at acceptance level, otherwise PPR | |
558 | ||
559 | Int_t thnDim[4]; | |
560 | ||
561 | //first half : reconstructed | |
562 | //second half : MC | |
563 | ||
564 | thnDim[0] = iBin[0]; | |
565 | thnDim[2] = iBin[0]; | |
566 | thnDim[1] = iBin[1]; | |
567 | thnDim[3] = iBin[1]; | |
568 | ||
569 | TString nameCorr=""; | |
570 | if(!isKeepDfromB) { | |
ba223ad1 | 571 | nameCorr="CFHFcorr0"; |
367e9aa3 | 572 | } |
573 | else if(isKeepDfromBOnly){ | |
ba223ad1 | 574 | nameCorr= "CFHFcorr0KeepDfromBOnly"; |
367e9aa3 | 575 | } |
576 | else { | |
ba223ad1 | 577 | nameCorr="CFHFcorr0allD"; |
367e9aa3 | 578 | |
579 | } | |
ba223ad1 | 580 | nameCorr += suffix; |
367e9aa3 | 581 | |
582 | THnSparseD* correlation = new THnSparseD(nameCorr,"THnSparse with correlations",4,thnDim); | |
583 | Double_t** binEdges = new Double_t[2]; | |
584 | ||
585 | // set bin limits | |
586 | ||
928c0b11 | 587 | binEdges[0]= binLimpT; |
588 | binEdges[1]= binLimy; | |
367e9aa3 | 589 | |
590 | correlation->SetBinEdges(0,binEdges[0]); | |
591 | correlation->SetBinEdges(2,binEdges[0]); | |
592 | ||
593 | correlation->SetBinEdges(1,binEdges[1]); | |
594 | correlation->SetBinEdges(3,binEdges[1]); | |
595 | ||
596 | correlation->Sumw2(); | |
597 | ||
598 | // correlation matrix ready | |
599 | //------------------------------------------------// | |
600 | ||
601 | task->SetCorrelationMatrix(correlation); // correlation matrix for unfolding | |
602 | ||
603 | // Create and connect containers for input/output | |
604 | ||
605 | // ------ input data ------ | |
606 | AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
607 | ||
608 | // ----- output data ----- | |
609 | ||
610 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
611 | TString output1name="", output2name="", output3name="",output4name=""; | |
612 | output2name=nameContainer; | |
613 | output3name=nameCorr; | |
ba223ad1 | 614 | output4name= "Cuts"; |
367e9aa3 | 615 | if(!isKeepDfromB) { |
ba223ad1 | 616 | outputfile += ":PWG3_D2H_CFtaskDstartoKpipi"; |
617 | output1name="CFHFchist0"; | |
618 | output3name+="_cOnly"; | |
619 | output4name+="_cOnly"; | |
367e9aa3 | 620 | } |
621 | else if(isKeepDfromBOnly){ | |
ba223ad1 | 622 | outputfile += ":PWG3_D2H_CFtaskDstartoKpiKeepDfromBOnly"; |
623 | output1name="CFHFchist0DfromB"; | |
624 | output3name+="_bOnly"; | |
625 | output4name+="_bOnly"; | |
367e9aa3 | 626 | } |
627 | else{ | |
ba223ad1 | 628 | outputfile += ":PWG3_D2H_CFtaskDstartoKpiKeepDfromB"; |
629 | output1name="CFHFchist0allD"; | |
630 | output3name+="_all"; | |
631 | output4name+="_all"; | |
367e9aa3 | 632 | } |
ba223ad1 | 633 | |
634 | outputfile += suffix; | |
635 | output1name += suffix; | |
636 | output4name += suffix; | |
367e9aa3 | 637 | |
638 | //now comes user's output objects : | |
639 | // output TH1I for event counting | |
640 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1name, TH1I::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
641 | // output Correction Framework Container (for acceptance & efficiency calculations) | |
642 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(output2name, AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
643 | // Unfolding - correlation matrix | |
644 | AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(output3name, THnSparseD::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
645 | // cuts | |
646 | AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(output4name, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); | |
647 | ||
648 | mgr->AddTask(task); | |
649 | ||
650 | mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); | |
651 | mgr->ConnectOutput(task,1,coutput1); | |
652 | mgr->ConnectOutput(task,2,coutput2); | |
653 | mgr->ConnectOutput(task,3,coutput3); | |
654 | mgr->ConnectOutput(task,4,coutput4); | |
655 | return task; | |
928c0b11 | 656 | |
367e9aa3 | 657 | } |