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