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