AliPhysics  b43479f (b43479f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskCFVertexingHFLctoV0bachelor.C
Go to the documentation of this file.
1 //DEFINITION OF A FEW CONSTANTS
2 const Double_t ptmin = 0.0;
3 const Double_t ptmax = 9999.0;
4 const Double_t etamin = -0.9;
5 const Double_t etamax = 0.9;
6 const Double_t ymin = -1.2 ;
7 const Double_t ymax = 1.2 ;
8 
9 const Double_t zmin = -15.;
10 const Double_t zmax = 15.;
11 const Float_t centmin = 0.;
12 const Float_t centmax = 100.;
13 const Float_t fakemin = -0.5;
14 const Float_t fakemax = 2.5;
15 const Float_t multmin = 0.;
16 const Float_t multmax = 102.;
17 
18 const Double_t cosPAV0min = 0.985;
19 const Double_t cosPAV0max = 1.005;
20 const Float_t onFlymin = -0.5;
21 const Float_t onFlymax = 1.5;
22 const Double_t pBachmin = 0.0;
23 const Double_t pBachmax = 30.0;
24 const Double_t ptV0min = 0.0;
25 const Double_t ptV0max = 30.0;
26 const Double_t yV0min =-1.2;
27 const Double_t yV0max = 1.2;
28 const Double_t dcaV0min = 0.0; // nSigma
29 const Double_t dcaV0max = 1.5; // nSigma
30 const Double_t cTV0min = 0.0; // micron
31 const Double_t cTV0max = 300; // micron
32 const Double_t cTmin = 0.0; // micron
33 const Double_t cTmax = 300; // micron
34 const Float_t cosPAmin =-1.05;
35 const Float_t cosPAmax = 1.05;
36 
37 
38 //----------------------------------------------------
39 
40 AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelor(const char* cutFile = "./LctoV0bachelorCuts.root",
41  Bool_t rejectIfNotFromQuark=kTRUE,
42  //Bool_t isKeepDfromB = kTRUE, Bool_t isKeepDfromBOnly = kFALSE, // all in
43  Bool_t isKeepDfromB = kFALSE, Bool_t isKeepDfromBOnly = kFALSE, // prompt
44  //Bool_t isKeepDfromB = kTRUE, Bool_t isKeepDfromBOnly = kTRUE, // no-prompt
45  Int_t configuration = AliCFTaskVertexingHF::kCheetah,
46  Int_t pdgCode = 4122, Char_t isSign = 2, Char_t lcToV0bachelorDecayMode = 0,
47  TString usercomment = "username",
48  Bool_t useWeight=kFALSE)
49 {
50 
51 
52  printf("Adding CF task using cuts from file %s\n",cutFile);
53  if (configuration == AliCFTaskVertexingHF::kSnail){
54  printf("The configuration is set to be SLOW --> all the variables will be used to fill the CF\n");
55  }
56  else if (configuration == AliCFTaskVertexingHF::kCheetah){
57  printf("The configuration is set to be FAST --> using only pt, y, ct, phi, zvtx, centrality, fake, multiplicity to fill the CF\n");
58  }
59  else{
60  printf("The configuration is not defined! returning\n");
61  return;
62  }
63 
64  gSystem->Sleep(2000);
65 
66  // isSign = 0 --> Lc+ only
67  // isSign = 1 --> Lc- only
68  // isSign = 2 --> Lc+ and Lc-
69 
70  TString expected;
71  if (isSign == 0 && pdgCode < 0){
72  AliError(Form("Error setting PDG code (%d) and sign (0 --> Lc+ only): they are not compatible, returning",pdgCode));
73  return 0x0;
74  }
75  else if (isSign == 1 && pdgCode > 0){
76  AliError(Form("Error setting PDG code (%d) and sign (1 --> Lc- only): they are not compatible, returning",pdgCode));
77  return 0x0;
78  }
79  else if (isSign > 2 || isSign < 0){
80  AliError(Form("Sign not valid (%d, possible values are 0, 1, 2), returning",isSign));
81  return 0x0;
82  }
83 
84  TFile* fileCuts = TFile::Open(cutFile);
85  AliRDHFCuts *cutsLctoV0 = (AliRDHFCutsLctoV0*)fileCuts->Get("LctoV0AnalysisCuts");
86 
87  // check that the fKeepD0fromB flag is set to true when the fKeepD0fromBOnly flag is true
88  // for now the binning is the same than for all D's
89  if (isKeepDfromBOnly) isKeepDfromB = true;
90 
91  Double_t massV0min = 0.47;
92  Double_t massV0max = 1.14;
93  if (lcToV0bachelorDecayMode==0) {
94  massV0min = 0.47 ;
95  massV0max = 0.53 ;
96  } else if (lcToV0bachelorDecayMode==1) {
97  massV0min = 1.09;
98  massV0max = 1.14;
99  }
100 
101  const Double_t phimin = 0.;
102  const Double_t phimax = 2.*TMath::Pi();
103  const Double_t phiV0min = 0.;
104  const Double_t phiV0max = 2.*TMath::Pi();
105 
106  const Int_t nbinZvtx = 30; //bins in centrality (total number)
107  const Int_t nbincent =18+1; //bins in centrality (total number)
108  const Int_t nbinfake = 3; //bins in fake
109  const Int_t nbinmult = 48; //bins in multiplicity (total number)
110 
111  const Int_t nbinpt = 11; //bins in pt from 0,1,2,3,4,5,6,8,12,17,25,35 GeV
112  const Int_t nbiny = 24; //bins in y Lc
113  const Int_t nbinphi = 18; //bins in phi Lc
114  const Int_t nbinonFly = 2; //bins in onFlyStatus x V0
115 
116  const Int_t nbinpBach = 300; //bins in pt from 0 to 30 GeV
117  const Int_t nbinptV0 = 300; //bins in pt from 0 to 30 GeV
118  const Int_t nbinyV0 = 24; //bins in y V0
119  const Int_t nbinphiV0 = 18; //bins in phi V0
120  const Int_t nbindcaV0 = 150; //bins in dcaV0
121  const Int_t nbininvMassV0 = 60; //bins in invMassV0
122  const Int_t nbinpointingV0 = 42; //bins in cosPointingAngleV0
123  const Int_t nbinpointing = 42; //bins in cosPointingAngle
124 
125  //const Int_t nbincTV0 = 15; //bins in cTV0
126  //const Int_t nbincT = 15; //bins in cT
127 
128  //the sensitive variables, their indices
129 
130  // variables' indices
131  const UInt_t ipT = 0;
132  const UInt_t iy = 1;
133  const UInt_t iphi = 2;
134  const UInt_t ionFly = 3;
135  const UInt_t iZvtx = 4;
136  const UInt_t icent = 5;
137  const UInt_t ifake = 6;
138  const UInt_t imult = 7;
139 
140  const UInt_t ipbach = 8;
141  const UInt_t ipTV0 = 9;
142  const UInt_t iyV0 = 10;
143  const UInt_t iphiV0 = 11;
144  const UInt_t iinvMassV0= 12;
145  const UInt_t idcaV0 = 13;
146  const UInt_t icosPAxV0 = 14;
147  const UInt_t icosPA = 15;
148  //const UInt_t icTv0 = 16;
149  //const UInt_t icT = 17;
150 
151  //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
152 
153  //arrays for the number of bins in each dimension
154 
155  //if ( configuration ==AliCFTaskVertexingHF::kSnail)
156  const Int_t nvarTot = 16 ; //number of variables on the grid
157  //if ( configuration ==AliCFTaskVertexingHF::kCheetah)
158  //const Int_t nvarTot = 8 ; //number of variables on the grid
159 
160  Int_t iBin[nvarTot];
161 
162  //OPTION 1: defining the pt, ptPi, ptK bins by hand...
163  iBin[ipT]=nbinpt;
164  iBin[iy]=nbiny;
165  iBin[iphi]=nbinphi;
166  iBin[ionFly]=nbinonFly;
167  iBin[iZvtx]=nbinZvtx;
168  iBin[icent]=nbincent;
169  iBin[ifake]=nbinfake;
170  iBin[imult]=nbinmult;
171 
172  iBin[ipbach]=nbinpBach;
173  iBin[ipTV0]=nbinptV0;
174  iBin[iyV0]=nbinyV0;
175  iBin[iphiV0]=nbinphiV0;
176  iBin[iinvMassV0]=nbininvMassV0;
177  iBin[idcaV0]=nbindcaV0;
178  iBin[icosPAxV0]=nbinpointingV0;
179  iBin[icosPA]=nbinpointing;
180  //iBin[icTv0]=nbincTV0;
181  //iBin[icT]=nbincT;
182 
183  // values for bin lower bounds
184 
185  // pt
186  Double_t *binLimpT=new Double_t[iBin[ipT]+1];
187  binLimpT[ 0]= 0.;
188  binLimpT[ 1]= 1.;
189  binLimpT[ 2]= 2.;
190  binLimpT[ 3]= 3.;
191  binLimpT[ 4]= 4.;
192  binLimpT[ 5]= 5.;
193  binLimpT[ 6]= 6.;
194  binLimpT[ 7]= 8.;
195  binLimpT[ 8]=12.;
196  binLimpT[ 9]=17.;
197  binLimpT[10]=25.;
198  binLimpT[11]=35.;
199 
200  // y
201  Double_t *binLimy=new Double_t[iBin[iy]+1];
202  for(Int_t i=0; i<=iBin[iy]; i++) binLimy[i]=(Double_t)ymin + (ymax-ymin)/iBin[iy]*(Double_t)i ;
203 
204  // phi
205  Double_t *binLimphi=new Double_t[iBin[iphi]+1];
206  for(Int_t i=0; i<=iBin[iphi]; i++) binLimphi[i]=(Double_t)phimin + (phimax-phimin)/iBin[iphi]*(Double_t)i ;
207 
208  // onTheFlyV0
209  Double_t *binLimonFlyV0=new Double_t[iBin[ionFly]+1];
210  for(Int_t i=0; i<=iBin[ionFly]; i++) binLimonFlyV0[i]=(Double_t)onFlymin + (onFlymax-onFlymin)/iBin[ionFly]*(Double_t)i ;
211 
212  // z Primary Vertex
213  Double_t *binLimzvtx=new Double_t[iBin[iZvtx]+1];
214  for(Int_t i=0; i<=nbinZvtx; i++) binLimzvtx[i]=(Double_t)zmin + (zmax-zmin)/iBin[iZvtx]*(Double_t)i ;
215 
216  // centrality
217  Double_t *binLimcent=new Double_t[iBin[icent]+1];
218  binLimcent[0]=centmin;
219  for(Int_t i=1; i<=iBin[icent]; i++) binLimcent[i]=centmin + (centmax-centmin)/iBin[icent]*(Double_t)i;
220 
221  // fake
222  Double_t *binLimfake=new Double_t[iBin[ifake]+1];
223  for(Int_t i=0; i<=iBin[ifake]; i++) binLimfake[i]=(Double_t)fakemin + (fakemax-fakemin)/iBin[ifake] * (Double_t)i;
224 
225  // multiplicity
226  Double_t *binLimmult=new Double_t[iBin[imult]+1];
227  for(Int_t i=0; i<=iBin[imult]; i++) binLimmult[i]=(Double_t)multmin + (multmax-multmin)/iBin[imult]*(Double_t)i ;
228 
229 
230  // pBach
231  Double_t *binLimpbach=new Double_t[iBin[ipbach]+1];
232  for(Int_t i=0; i<=iBin[ipbach]; i++) binLimpbach[i]=(Double_t)pBachmin + (pBachmax-pBachmin)/iBin[ipbach]*(Double_t)i ;
233 
234  // ptV0
235  Double_t *binLimpTV0=new Double_t[iBin[ipTV0]+1];
236  for(Int_t i=0; i<=iBin[ipTV0]; i++) binLimpTV0[i]=(Double_t)ptV0min + (ptV0max-ptV0min)/iBin[ipTV0]*(Double_t)i ;
237 
238  // yV0
239  Double_t *binLimyV0=new Double_t[iBin[iyV0]+1];
240  for(Int_t i=0; i<=iBin[iyV0]; i++) binLimyV0[i]=(Double_t)yV0min + (yV0max-yV0min)/iBin[iyV0]*(Double_t)i ;
241 
242  // phiV0
243  Double_t *binLimphiV0=new Double_t[iBin[iphiV0]+1];
244  for(Int_t i=0; i<=iBin[iphiV0]; i++) binLimphiV0[i]=(Double_t)phiV0min + (phiV0max-phiV0min)/iBin[iphiV0]*(Double_t)i ;
245 
246  // invMassV0
247  Double_t *binLimInvMassV0=new Double_t[iBin[iinvMassV0]+1];
248  for(Int_t i=0; i<=iBin[iinvMassV0]; i++) binLimInvMassV0[i]=(Double_t)massV0min + (massV0max-massV0min)/iBin[iinvMassV0]*(Double_t)i ;
249 
250  // dcaV0
251  Double_t *binLimdcaV0=new Double_t[iBin[idcaV0]+1];
252  for(Int_t i=0; i<=iBin[idcaV0]; i++) binLimdcaV0[i]=(Double_t)dcaV0min + (dcaV0max-dcaV0min)/iBin[idcaV0]*(Double_t)i ;
253 
254  // cosPointingAngleV0
255  Double_t *binLimcosPAV0=new Double_t[iBin[icosPAxV0]+1];
256  for(Int_t i=0; i<=iBin[icosPAxV0]; i++) binLimcosPAV0[i]=(Double_t)cosPAV0min + (cosPAV0max-cosPAV0min)/iBin[icosPAxV0]*(Double_t)i ;
257 
258  // cosPointingAngle
259  Double_t *binLimcosPA=new Double_t[iBin[icosPA]+1];
260  for(Int_t i=0; i<=iBin[icosPA]; i++) binLimcosPA[i]=(Double_t)cosPAmin + (cosPAmax-cosPAmin)/iBin[icosPA]*(Double_t)i ;
261 
262  /*
263  // cTV0
264  Double_t *binLimcTV0=new Double_t[iBin[icTv0]+1];
265  for(Int_t i=0; i<=iBin[icTv0]; i++) binLimcTV0[i]=(Double_t)cTV0min + (cTV0max-cTV0min)/iBin[icTv0]*(Double_t)i ;
266 
267  // cT
268  Double_t *binLimcT=new Double_t[iBin[icT]+1];
269  for(Int_t i=0; i<=iBin[icT]; i++) binLimcT[i]=(Double_t)cTmin + (cTmax-cTmin)/iBin[icT]*(Double_t)i ;
270  */
271 
272 
273  //one "container" for MC
274  TString nameContainer="";
275  if (!isKeepDfromB) {
276  nameContainer="CFHFccontainer0_CommonFramework_"+usercomment;
277  }
278  else if (isKeepDfromBOnly) {
279  nameContainer="CFHFccontainer0LcfromB_CommonFramework_"+usercomment;
280  }
281  else {
282  nameContainer="CFHFccontainer0allLc_CommonFramework_"+usercomment;
283  }
284 
285  //Setting up the container grid...
286 
287  //CONTAINER DEFINITION
288  Info("AliCFTaskVertexingHF","SETUP CONTAINER");
289  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
290 
291  AliCFContainer* container;
292  if (configuration == AliCFTaskVertexingHF::kSnail) {
293  container = new AliCFContainer(nameContainer,"container for tracks",nstep,nvarTot,iBin);
294  }
295  else if (configuration == AliCFTaskVertexingHF::kCheetah) {
296  container = new AliCFContainer(nameContainer,"container for tracks",nstep,8,iBin);
297  }
298 
299  //setting the bin limits
300  container -> SetBinLimits(ipT,binLimpT);
301  container -> SetBinLimits(iy,binLimy);
302  container -> SetBinLimits(iphi,binLimphi);
303  container -> SetBinLimits(ionFly,binLimonFlyV0);
304  container -> SetBinLimits(iZvtx,binLimzvtx);
305  container -> SetBinLimits(icent,binLimcent);
306  container -> SetBinLimits(ifake,binLimfake);
307  container -> SetBinLimits(imult,binLimmult);
308 
309  container -> SetVarTitle(ipT,"p_{T}(#Lambda_{c}) [GeV/c]");
310  container -> SetVarTitle(iy,"y(#Lambda_{c})");
311  container -> SetVarTitle(iphi,"#phi(#Lambda_{c}) [rad]");
312  container -> SetVarTitle(ionFly,"onTheFlyStatusV0");
313  container -> SetVarTitle(iZvtx,"z_{vtx} [cm]");
314  container -> SetVarTitle(icent,"centrality");
315  container -> SetVarTitle(ifake,"fake");
316  container -> SetVarTitle(imult,"multiplicity");
317 
318  if (configuration == AliCFTaskVertexingHF::kSnail) {
319  container -> SetBinLimits(ipbach,binLimpbach);
320  container -> SetBinLimits(ipTV0,binLimpTV0);
321  container -> SetBinLimits(iyV0,binLimyV0);
322  container -> SetBinLimits(iphiV0,binLimphiV0);
323  container -> SetBinLimits(iinvMassV0,binLimInvMassV0);
324  container -> SetBinLimits(idcaV0,binLimdcaV0);
325  container -> SetBinLimits(icosPAxV0,binLimcosPAV0);
326  container -> SetBinLimits(icosPA,binLimcosPA);
327  //container -> SetBinLimits(,binLimcTV0);
328  //container -> SetBinLimits(,binLimcT);
329 
330  container -> SetVarTitle(ipbach,"p(bachelor) [GeV/c]");
331  container -> SetVarTitle(ipTV0,"p_{T}(V0) [GeV/c]");
332  container -> SetVarTitle(iyV0,"y(V0)");
333  container -> SetVarTitle(iphiV0,"#varphi(V0) [rad]");
334  container -> SetVarTitle(iinvMassV0,"m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]");
335  container -> SetVarTitle(idcaV0,"DCA(V0) [n#sigma]");
336  container -> SetVarTitle(icosPAxV0,"cosine pointing angle(V0)");
337  container -> SetVarTitle(icosPA,"cosine pointing angle (#Lambda_{c})");
338  //container -> SetVarTitle(,"c#tau -V0-");
339  //container -> SetVarTitle(,"c#tau");
340  }
341 
342  container -> SetStepTitle(0, "MCLimAcc");
343  container -> SetStepTitle(1, "MC");
344  container -> SetStepTitle(2, "MCAcc");
345  container -> SetStepTitle(3, "RecoVertex");
346  container -> SetStepTitle(4, "RecoRefit");
347  container -> SetStepTitle(5, "Reco");
348  container -> SetStepTitle(6, "RecoAcc");
349  container -> SetStepTitle(7, "RecoITSCluster");
350  container -> SetStepTitle(8, "RecoCuts");
351  container -> SetStepTitle(9, "RecoPID");
352 
353  //return container;
354 
355  //CREATE THE CUTS -----------------------------------------------
356 
357  // Gen-Level kinematic cuts
358  AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts");
359 
360  //Particle-Level cuts:
361  AliCFParticleGenCuts* mcGenCuts = new AliCFParticleGenCuts("mcGenCuts","MC particle generation cuts");
362  Bool_t useAbsolute = kTRUE;
363  if (isSign != 2) {
364  useAbsolute = kFALSE;
365  }
366  mcGenCuts->SetRequirePdgCode(pdgCode, useAbsolute); // kTRUE set in order to include Lc-
367  mcGenCuts->SetAODMC(1); //special flag for reading MC in AOD tree (important)
368 
369  // Acceptance cuts:
370  AliCFAcceptanceCuts* accCuts = new AliCFAcceptanceCuts("accCuts", "Acceptance cuts");
371  AliCFTrackKineCuts * kineAccCuts = new AliCFTrackKineCuts("kineAccCuts","Kine-Acceptance cuts");
372  kineAccCuts->SetPtRange(ptmin,ptmax);
373  kineAccCuts->SetEtaRange(etamin,etamax);
374 
375  // Rec-Level kinematic cuts
376  AliCFTrackKineCuts *recKineCuts = new AliCFTrackKineCuts("recKineCuts","rec-level kine cuts");
377 
378  AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts","rec-level quality cuts");
379 
380  AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts","rec-level isPrimary cuts");
381 
382  printf("CREATE MC KINE CUTS\n");
383  TObjArray* mcList = new TObjArray(0) ;
384  mcList->AddLast(mcKineCuts);
385  mcList->AddLast(mcGenCuts);
386 
387  printf("CREATE ACCEPTANCE CUTS\n");
388  TObjArray* accList = new TObjArray(0) ;
389  accList->AddLast(kineAccCuts);
390 
391  printf("CREATE RECONSTRUCTION CUTS\n");
392  TObjArray* recList = new TObjArray(0) ; // not used!!
393  recList->AddLast(recKineCuts);
394  recList->AddLast(recQualityCuts);
395  recList->AddLast(recIsPrimaryCuts);
396 
397  TObjArray* emptyList = new TObjArray(0);
398 
399  //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK
400  printf("CREATE INTERFACE AND CUTS\n");
401  AliCFManager* man = new AliCFManager() ;
402  man->SetParticleContainer(container);
403  man->SetParticleCutsList(0 , mcList); // MC, Limited Acceptance
404  man->SetParticleCutsList(1 , mcList); // MC
405  man->SetParticleCutsList(2 , accList); // Acceptance
406  man->SetParticleCutsList(3 , emptyList); // Vertex
407  man->SetParticleCutsList(4 , emptyList); // Refit
408  man->SetParticleCutsList(5 , emptyList); // AOD
409  man->SetParticleCutsList(6 , emptyList); // AOD in Acceptance
410  man->SetParticleCutsList(7 , emptyList); // AOD with required n. of ITS clusters
411  man->SetParticleCutsList(8 , emptyList); // AOD Reco (PPR cuts implemented in Task)
412  man->SetParticleCutsList(9 , emptyList); // AOD Reco PID
413 
414  // Get the pointer to the existing analysis manager via the static access method.
415  //==============================================================================
416  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
417  if (!mgr) {
418  ::Error("AddTaskCompareHF", "No analysis manager to connect to.");
419  return NULL;
420  }
421  //CREATE THE TASK
422  printf("CREATE TASK\n");
423 
424  // create the task
425  AliCFTaskVertexingHF *task = new AliCFTaskVertexingHF("AliCFTaskVertexingHF",cutsLctoV0);
426  task->SetConfiguration(configuration);
427  task->SetFillFromGenerated(kFALSE);
428  task->SetCFManager(man); //here is set the CF manager
429  task->SetDecayChannel(22);//kLctoV0bachelor
430  switch (lcToV0bachelorDecayMode) {
431  case 0:
432  task->SetCountLctoK0Sp();
433  break;
434  case 1:
435  task->SetCountLctoLambdapi();
436  break;
437  }
438  task->SetUseWeight(useWeight);
439  task->SetSign(isSign);
440  task->SetCentralitySelection(kFALSE);
441  task->SetFakeSelection(0);
442  task->SetRejectCandidateIfNotFromQuark(rejectIfNotFromQuark); // put to false if you want to keep HIJING D0!!
443  task->SetUseMCVertex(kFALSE); // put to true if you want to do studies on pp
444 
445  if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2);
446  if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1);
447 
448  TF1* funcWeight = 0x0;
449  if (task->GetUseWeight()) {
450  funcWeight = (TF1*)fileCuts->Get("funcWeight");
451  if (funcWeight == 0x0){
452  Printf("FONLL Weights will be used");
453  }
454  else {
455  task->SetWeightFunction(funcWeight);
456  Printf("User-defined Weights will be used. The function being:");
457  task->GetWeightFunction()->Print();
458  }
459  }
460 
461  Printf("***************** CONTAINER SETTINGS *****************");
462  Printf("decay channel = %d",(Int_t)task->GetDecayChannel());
463  Printf("FillFromGenerated = %d",(Int_t)task->GetFillFromGenerated());
464  Printf("Dselection = %d",(Int_t)task->GetDselection());
465  Printf("UseWeight = %d",(Int_t)task->GetUseWeight());
466  if (task->GetUseWeight()) {
467  Printf("User-defined Weight function:");
468  task->GetWeightFunction()->Print();
469  }
470  else {
471  Printf("FONLL will be used for the weights");
472  }
473  Printf("Sign = %d",(Int_t)task->GetSign());
474  Printf("Centrality selection = %d",(Int_t)task->GetCentralitySelection());
475  Printf("Fake selection = %d",(Int_t)task->GetFakeSelection());
476  Printf("RejectCandidateIfNotFromQuark selection = %d",(Int_t)task->GetRejectCandidateIfNotFromQuark());
477  Printf("UseMCVertex selection = %d",(Int_t)task->GetUseMCVertex());
478  Printf("***************END CONTAINER SETTINGS *****************\n");
479 
480  //-----------------------------------------------------------//
481  // create correlation matrix for unfolding - only eta-pt //
482  //-----------------------------------------------------------//
483 
484  Bool_t AcceptanceUnf = kTRUE; // unfold at acceptance level, otherwise PPR
485 
486  Int_t thnDim[4];
487 
488  //first half : reconstructed
489  //second half : MC
490 
491  thnDim[0] = iBin[ipT];
492  thnDim[2] = iBin[ipT];
493  thnDim[1] = iBin[iy];
494  thnDim[3] = iBin[iy];
495 
496  TString nameCorr="";
497  if (!isKeepDfromB) {
498  nameCorr="CFHFcorr0_CommonFramework_"+usercomment;
499  }
500  else if (isKeepDfromBOnly) {
501  nameCorr= "CFHFcorr0KeepDfromBOnly_CommonFramework_"+usercomment;
502  }
503  else {
504  nameCorr="CFHFcorr0allLc_CommonFramework_"+usercomment;
505  }
506 
507  THnSparseD* correlation = new THnSparseD(nameCorr,"THnSparse with correlations",4,thnDim);
508  Double_t** binEdges = new Double_t[2];
509 
510  // set bin limits
511 
512  binEdges[0]= binLimpT;
513  binEdges[1]= binLimy;
514 
515  correlation->SetBinEdges(0,binEdges[0]);
516  correlation->SetBinEdges(2,binEdges[0]);
517 
518  correlation->SetBinEdges(1,binEdges[1]);
519  correlation->SetBinEdges(3,binEdges[1]);
520 
521  correlation->Sumw2();
522 
523  // correlation matrix ready
524  //------------------------------------------------//
525 
526  task->SetCorrelationMatrix(correlation); // correlation matrix for unfolding
527 
528  // Create and connect containers for input/output
529 
530  // ------ input data ------
531  AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
532 
533  // ----- output data -----
534 
535  TString outputfile = AliAnalysisManager::GetCommonFileName();
536  TString output1name="", output2name="", output3name="",output4name="";
537  output2name=nameContainer;
538  output3name=nameCorr;
539  if (!isKeepDfromB) {
540  outputfile += ":PWG3_D2H_CFtaskLctoK0Sp_CommonFramework_"+usercomment;
541  output1name="CFHFchist0_CommonFramework_"+usercomment;
542  output4name= "Cuts_CommonFramework_"+usercomment;
543  }
544  else if (isKeepDfromBOnly) {
545  outputfile += ":PWG3_D2H_CFtaskLctoK0SpKeepDfromBOnly_CommonFramework_"+usercomment;
546  output1name="CFHFchist0DfromB_CommonFramework_"+usercomment;
547  output4name= "Cuts_CommonFramework_DfromB_"+usercomment;
548  }
549  else {
550  outputfile += ":PWG3_D2H_CFtaskLctoK0SpKeepDfromB_CommonFramework_"+usercomment;
551  output1name="CFHFchist0allLc_CommonFramework_"+usercomment;
552  output4name= "Cuts_CommonFramework_allLc_"+usercomment;
553  }
554 
555  //now comes user's output objects :
556  // output TH1I for event counting
557  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1name, TH1I::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
558  // output Correction Framework Container (for acceptance & efficiency calculations)
559  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(output2name, AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
560  // Unfolding - correlation matrix
561  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(output3name, THnSparseD::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
562  // cuts
563  AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(output4name, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
564 
565  mgr->AddTask(task);
566 
567  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
568  mgr->ConnectOutput(task,1,coutput1);
569  mgr->ConnectOutput(task,2,coutput2);
570  mgr->ConnectOutput(task,3,coutput3);
571  mgr->ConnectOutput(task,4,coutput4);
572  return task;
573 
574 }
const Double_t cosPAV0min
const Double_t ptmin
const Float_t cosPAmax
void SetWeightFunction(TF1 *func)
const Double_t ymax
void SetRejectCandidateIfNotFromQuark(Bool_t opt)
const Double_t dcaV0max
void SetCFManager(AliCFManager *io)
CORRECTION FRAMEWORK RELATED FUNCTIONS.
const Double_t yV0max
void SetDecayChannel(Int_t decayChannel)
TSystem * gSystem
const Double_t ymin
void SetFillFromGenerated(Bool_t flag)
get corr manager
AliCFTaskVertexingHF * AddTaskCFVertexingHFLctoV0bachelor(const char *cutFile="./LctoV0bachelorCuts.root", Bool_t rejectIfNotFromQuark=kTRUE, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t configuration=AliCFTaskVertexingHF::kCheetah, Int_t pdgCode=4122, Char_t isSign=2, Char_t lcToV0bachelorDecayMode=0, TString usercomment="username", Bool_t useWeight=kFALSE)
void SetUseMCVertex(Bool_t opt)
const Float_t fakemax
const Double_t zmax
const Double_t ptV0min
const Double_t pBachmax
const Double_t etamax
const Float_t centmax
const Double_t pBachmin
const Double_t cTmin
const Double_t cTmax
const Double_t cTV0min
void SetCentralitySelection(Bool_t centSelec=kTRUE)
const Float_t onFlymax
const Double_t ptmax
const Float_t centmin
void SetUseWeight(Bool_t useWeight)
const Float_t fakemin
slow configuration, all variables
void SetConfiguration(Int_t configuration)
void SetDselection(UShort_t originDselection)
const Double_t zmin
TF1 * GetWeightFunction() const
void SetCorrelationMatrix(THnSparse *h)
UNFOLDING.
const Float_t cosPAmin
const Float_t onFlymin
const Double_t yV0min
void SetSign(Char_t isSign)
const Double_t dcaV0min
const Float_t multmax
Bool_t GetUseWeight() const
const Float_t multmin
const Double_t cosPAV0max
Bool_t GetFillFromGenerated() const
const Double_t etamin
void SetFakeSelection(Int_t fakeSel=0)
const Double_t phimin
const Double_t ptV0max
const Double_t cTV0max