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