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