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