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