AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSELambdacTMVA.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id: AliAnalysisTaskSELambdacTMVA.cxx$ */
17 
18 //*************************************************************************
19 // AliAnalysisTaskSE for the Lambdac candidates, for TMVA analysis,
20 // and checks on MC generated and reconstructed Lambdac
21 //
22 // Modified from AliAnalysisTaskSELambdac
23 // Authors: Jaime Norman (jaime.norman@cern.ch)
24 // Marcel Figueredo (marcel.figueredo@cern.ch)
25 //*************************************************************************
26 
27 
28 #include <TClonesArray.h>
29 #include <TNtuple.h>
30 #include <TCanvas.h>
31 #include <TList.h>
32 #include <TString.h>
33 #include <TH1F.h>
34 #include <TH2F.h>
35 #include <TDatabasePDG.h>
36 
37 #include <AliAnalysisDataSlot.h>
38 #include <AliAnalysisDataContainer.h>
39 #include "AliAnalysisManager.h"
40 #include "AliAODHandler.h"
41 #include "AliAODEvent.h"
42 #include "AliAODVertex.h"
43 #include "AliAODTrack.h"
44 #include "AliAODMCHeader.h"
45 #include "AliAODMCParticle.h"
47 #include "AliAnalysisVertexingHF.h"
48 #include "AliAnalysisTaskSE.h"
50 #include "AliKFParticle.h"
51 #include "AliAODPidHF.h"
52 #include "AliRDHFCutsLctopKpi.h"
53 #include "AliRDHFCuts.h"
54 #include "AliKFVertex.h"
55 #include "AliESDVertex.h"
56 //#include "AliAODpidUtil.h"
57 #include "AliAODPid.h"
58 #include "AliInputEventHandler.h"
59 #include "AliPID.h"
61 #include "AliVertexingHFUtils.h"
62 #include "AliCFVertexingHF3Prong.h"
63 #include "AliCFTaskVertexingHF.h"
64 #include "AliLog.h"
65 
69 
70  //________________________________________________________________________
72  AliAnalysisTaskSE(),
73  fOutput(0),
74  fHistNEvents(0),
75  fHistNEventsRejTM(0),
76  fhSelectBit(0),
77  fhSelectionBits(0),
78  fhSelectionBitsSigc(0),
79  fhSelectionBitsSigb(0),
80  fhSetIsLc(0),
81  fhPIDmassLcPt(0),
82  fhPIDmassLcPtSig(0),
83  fhPIDmassLcPtSigc(0),
84  fhPIDmassLcPtSigb(0),
85  fhMCmassLcPt(0),
86  fhMCmassLcPtSig(0),
87  fhMCmassLcPtSigc(0),
88  fhMCmassLcPtSigb(0),
89  fhProbmassLcPt(0),
90  fhProbmassLcPtSig(0),
91  fhProbmassLcPtSigc(0),
92  fhProbmassLcPtSigb(0),
93  fhIsLcResonantGen(0),
94  fhIsLcResonantReco(0),
95  fhIsLcGen(0),
96  fhIsLcReco(0),
97  fhRecoPDGmom(0),
98  fhPtMisIdpKpi(0),
99  fhPtMisIdpiKp(0),
100  fhPtCorrId(0),
101  fhInvMassMisIdpKpi(0),
102  fhInvMassMisIdpiKp(0),
103  fhPtMisIdpKpiProb(0),
104  fhPtMisIdpiKpProb(0),
105  fhPtCorrIdProb(0),
106  fhInvMassMisIdpKpiProb(0),
107  fhInvMassMisIdpiKpProb(0),
108  fNtupleLambdac(0),
109  fNtupleLambdacReco(0),
110  fFuncWeightPythia(0),
111  fFuncWeightFONLL7overLHC10f6a(0),
112  fFuncWeightFONLL5overLHC13d3(0),
113  fFuncWeightFONLL5overLHC10f6a(0),
114  fFuncWeightFONLL5overLHC13d3Lc(0),
115  fFuncWeightFONLL7overLHC11b2Lc(0),
116  fFuncWeightFONLL7overLHC10f7aLc(0),
117  fUseNchWeight(kFALSE),
118  fHistoMCNch(0x0),
119  fIsLc(0),
120  fIsLcResonant(0),
121  fPtLc(0.),
122  fUpmasslimit(2.486),
123  fLowmasslimit(2.086),
124  fRDCutsAnalysis(0),
125  fListCuts(0),
126  fFillNtuple(0),
127  fFillNtupleReco(0),
128  fKeepLcNotFromQuark(kFALSE),
129  fKeepBkgNt(kTRUE),
130  fSyst(2),
131  fReadMC(kFALSE),
132  fMCPid(kFALSE),
133  fRealPid(kFALSE),
134  fResPid(kTRUE),
135  fUseKF(kFALSE),
136  fAnalysis(kFALSE),
137  fVHF(0),
138  fLcCut(kFALSE),
139  fLcPIDCut(kFALSE),
140  fIsHijing(kFALSE),
141  fNentries(0),
142  fPIDResponse(0),
143  fCounter(0),
144  fVertUtil(0)
145 
146 {
147  //
149  //
150 
151  for(Int_t i=0;i<12;i++) {
152  fhNBkgNI[i]=0x0;
153  fhNLc[i]=0x0;
154  fhNLcc[i]=0x0;
155  fhNLcNonRc[i]=0x0;
156  fhNLcL1520c[i]=0x0;
157  fhNLcKstarc[i]=0x0;
158  fhNLcDeltac[i]=0x0;
159  fhNLcb[i]=0x0;
160  fhNLcNonRb[i]=0x0;
161  fhNLcL1520b[i]=0x0;
162  fhNLcKstarb[i]=0x0;
163  fhNLcDeltab[i]=0x0;
164 
165  fhPtEtaBkgNI[i]=0x0;
166  fhPtEtaLc[i]=0x0;
167  fhPtEtaLcc[i]=0x0;
168  fhPtEtaLcNonRc[i]=0x0;
169  fhPtEtaLcL1520c[i]=0x0;
170  fhPtEtaLcKstarc[i]=0x0;
171  fhPtEtaLcDeltac[i]=0x0;
172  fhPtEtaLcb[i]=0x0;
173  fhPtEtaLcNonRb[i]=0x0;
174  fhPtEtaLcL1520b[i]=0x0;
175  fhPtEtaLcKstarb[i]=0x0;
176  fhPtEtaLcDeltab[i]=0x0;
177 
178  fhPtYBkgNI[i]=0x0;
179  fhPtYLc[i]=0x0;
180  fhPtYLcc[i]=0x0;
181  fhPtYLcNonRc[i]=0x0;
182  fhPtYLcL1520c[i]=0x0;
183  fhPtYLcKstarc[i]=0x0;
184  fhPtYLcDeltac[i]=0x0;
185  fhPtYLcb[i]=0x0;
186  fhPtYLcNonRb[i]=0x0;
187  fhPtYLcL1520b[i]=0x0;
188  fhPtYLcKstarb[i]=0x0;
189  fhPtYLcDeltab[i]=0x0;
190 
191  fhPtPhiBkgNI[i]=0x0;
192  fhPtPhiLc[i]=0x0;
193  fhPtPhiLcc[i]=0x0;
194  fhPtPhiLcNonRc[i]=0x0;
195  fhPtPhiLcL1520c[i]=0x0;
196  fhPtPhiLcKstarc[i]=0x0;
197  fhPtPhiLcDeltac[i]=0x0;
198  fhPtPhiLcb[i]=0x0;
199  fhPtPhiLcNonRb[i]=0x0;
200  fhPtPhiLcL1520b[i]=0x0;
201  fhPtPhiLcKstarb[i]=0x0;
202  fhPtPhiLcDeltab[i]=0x0;
203 
204  }
205 }
206 
207 //________________________________________________________________________
208 AliAnalysisTaskSELambdacTMVA::AliAnalysisTaskSELambdacTMVA(const char *name,Int_t fillNtuple,Int_t fillNtupleReco,AliRDHFCutsLctopKpi *lccutsana):
209  AliAnalysisTaskSE(name),
210  fOutput(0),
211  fHistNEvents(0),
212  fHistNEventsRejTM(0),
213  fhSelectBit(0),
214  fhSelectionBits(0),
215  fhSelectionBitsSigc(0),
216  fhSelectionBitsSigb(0),
217  fhSetIsLc(0),
218  fhPIDmassLcPt(0),
219  fhPIDmassLcPtSig(0),
220  fhPIDmassLcPtSigc(0),
221  fhPIDmassLcPtSigb(0),
222  fhMCmassLcPt(0),
223  fhMCmassLcPtSig(0),
224  fhMCmassLcPtSigc(0),
225  fhMCmassLcPtSigb(0),
226  fhProbmassLcPt(0),
227  fhProbmassLcPtSig(0),
228  fhProbmassLcPtSigc(0),
229  fhProbmassLcPtSigb(0),
230  fhIsLcResonantGen(0),
231  fhIsLcResonantReco(0),
232  fhIsLcGen(0),
233  fhIsLcReco(0),
234  fhRecoPDGmom(0),
235  fhPtMisIdpKpi(0),
236  fhPtMisIdpiKp(0),
237  fhPtCorrId(0),
238  fhInvMassMisIdpKpi(0),
239  fhInvMassMisIdpiKp(0),
240  fhPtMisIdpKpiProb(0),
241  fhPtMisIdpiKpProb(0),
242  fhPtCorrIdProb(0),
243  fhInvMassMisIdpKpiProb(0),
244  fhInvMassMisIdpiKpProb(0),
245  fNtupleLambdac(0),
246  fNtupleLambdacReco(0),
247  fFuncWeightPythia(0),
248  fFuncWeightFONLL7overLHC10f6a(0),
249  fFuncWeightFONLL5overLHC13d3(0),
250  fFuncWeightFONLL5overLHC10f6a(0),
251  fFuncWeightFONLL5overLHC13d3Lc(0),
252  fFuncWeightFONLL7overLHC11b2Lc(0),
253  fFuncWeightFONLL7overLHC10f7aLc(0),
254  fUseNchWeight(kFALSE),
255  fHistoMCNch(0x0),
256  fIsLc(0),
257  fIsLcResonant(0),
258  fPtLc(0.),
259  fUpmasslimit(2.486),
260  fLowmasslimit(2.086),
261  fRDCutsAnalysis(lccutsana),
262  fListCuts(0),
263  fFillNtuple(fillNtuple),
264  fFillNtupleReco(fillNtupleReco),
265  fKeepLcNotFromQuark(kFALSE),
266  fKeepBkgNt(kTRUE),
267  fSyst(2),
268  fReadMC(kFALSE),
269  fMCPid(kFALSE),
270  fRealPid(kFALSE),
271  fResPid(kTRUE),
272  fUseKF(kFALSE),
273  fAnalysis(kFALSE),
274  fVHF(0),
275  fLcCut(kFALSE),
276  fLcPIDCut(kFALSE),
277  fIsHijing(kFALSE),
278  fNentries(0),
279  fPIDResponse(0),
280  fCounter(0),
281  fVertUtil(0)
282 {
283  //
286  //
287  for(Int_t i=0;i<12;i++) {
288  fhNBkgNI[i]=0x0;
289  fhNLc[i]=0x0;
290  fhNLcc[i]=0x0;
291  fhNLcNonRc[i]=0x0;
292  fhNLcL1520c[i]=0x0;
293  fhNLcKstarc[i]=0x0;
294  fhNLcDeltac[i]=0x0;
295  fhNLcb[i]=0x0;
296  fhNLcNonRb[i]=0x0;
297  fhNLcL1520b[i]=0x0;
298  fhNLcKstarb[i]=0x0;
299  fhNLcDeltab[i]=0x0;
300 
301  fhPtEtaBkgNI[i]=0x0;
302  fhPtEtaLc[i]=0x0;
303  fhPtEtaLcc[i]=0x0;
304  fhPtEtaLcNonRc[i]=0x0;
305  fhPtEtaLcL1520c[i]=0x0;
306  fhPtEtaLcKstarc[i]=0x0;
307  fhPtEtaLcDeltac[i]=0x0;
308  fhPtEtaLcb[i]=0x0;
309  fhPtEtaLcNonRb[i]=0x0;
310  fhPtEtaLcL1520b[i]=0x0;
311  fhPtEtaLcKstarb[i]=0x0;
312  fhPtEtaLcDeltab[i]=0x0;
313 
314  fhPtYBkgNI[i]=0x0;
315  fhPtYLc[i]=0x0;
316  fhPtYLcc[i]=0x0;
317  fhPtYLcNonRc[i]=0x0;
318  fhPtYLcL1520c[i]=0x0;
319  fhPtYLcKstarc[i]=0x0;
320  fhPtYLcDeltac[i]=0x0;
321  fhPtYLcb[i]=0x0;
322  fhPtYLcNonRb[i]=0x0;
323  fhPtYLcL1520b[i]=0x0;
324  fhPtYLcKstarb[i]=0x0;
325  fhPtYLcDeltab[i]=0x0;
326 
327  fhPtPhiBkgNI[i]=0x0;
328  fhPtPhiLc[i]=0x0;
329  fhPtPhiLcc[i]=0x0;
330  fhPtPhiLcNonRc[i]=0x0;
331  fhPtPhiLcL1520c[i]=0x0;
332  fhPtPhiLcKstarc[i]=0x0;
333  fhPtPhiLcDeltac[i]=0x0;
334  fhPtPhiLcb[i]=0x0;
335  fhPtPhiLcNonRb[i]=0x0;
336  fhPtPhiLcL1520b[i]=0x0;
337  fhPtPhiLcKstarb[i]=0x0;
338  fhPtPhiLcDeltab[i]=0x0;
339 
340  }
342 
343  DefineOutput(1,TList::Class()); //My private output
344  DefineOutput(2,TList::Class());
345  DefineOutput(3,TH1F::Class());
346  DefineOutput(4,AliNormalizationCounter::Class());
347  if (fFillNtuple) {
348  // Output slot #2 writes into a TNtuple container
349  DefineOutput(5,TNtuple::Class()); //My private output
350  }
351  if(fFillNtupleReco) DefineOutput(6,TNtuple::Class()); //My private output
352 }
353 
354 
355 //________________________________________________________________________
357 {
358  //
360  //
361 
362  if (fOutput) {
363  delete fOutput;
364  fOutput = 0;
365  }
366 
367 
368  if (fVHF) {
369  delete fVHF;
370  fVHF = 0;
371  }
372 
373  if(fRDCutsAnalysis){
374  delete fRDCutsAnalysis;
375  fRDCutsAnalysis = 0;
376  }
377 
378  if (fListCuts) {
379  delete fListCuts;
380  fListCuts = 0;
381  }
382  if (fNentries){
383  delete fNentries;
384  fNentries = 0;
385  }
386  /*
387  if (fUtilPid){
388  delete fUtilPid;
389  fUtilPid = 0;
390  }
391  */
392  if (fPIDResponse) {
393  delete fPIDResponse;
394  }
395  if(fCounter){
396  delete fCounter;
397  fCounter = 0;
398  }
399  if(fVertUtil) {
400  delete fVertUtil;
401  fVertUtil = 0;
402  }
403 
404 }
405 
406 
407 
408 //_________________________________________________________________
410 {
411  //
413  //
414 
415  if (fDebug > 1) printf("AnalysisTaskSELambdac::Init() \n");
416 
417  fListCuts=new TList();
418  fListCuts->SetOwner();
419 
421  PostData(2,fListCuts);
422 
423  return;
424 }
425 
426 //________________________________________________________________________
428 {
429  //
431  //
432 
433  if (fDebug > 1) printf("AnalysisTaskSELambdac::UserCreateOutputObjects() \n");
434 
435  // Several histograms are more conveniently managed in a TList
436  fOutput = new TList();
437  fOutput->SetOwner();
438  fOutput->SetName("OutputHistos");
439 
440  TString hisname,histitle;
441 
442  //Lc bit QA
443  fhSelectBit = new TH1F("hSelectBit","hSelectBit",5,-0.5,4.5);
444  fhSelectBit->GetXaxis()->SetBinLabel(2,"All");
445  fhSelectBit->GetXaxis()->SetBinLabel(3,"SelectionMap");
446  fhSelectBit->GetXaxis()->SetBinLabel(4,"!LcCut");
447  fhSelectBit->GetXaxis()->SetBinLabel(5,"!LcPID");
448  fhSelectBit->GetXaxis()->SetNdivisions(1,kFALSE);
449  fOutput->Add(fhSelectBit);
450 
451  fHistNEvents = new TH1F("fHistNEvents", "Number of processed events; ; Events",3,-0.5,2.5);
452  fHistNEvents->GetXaxis()->SetBinLabel(2,"N events");
453  fHistNEvents->GetXaxis()->SetBinLabel(3,"N events (after selection)");
454  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
455  fHistNEvents->Sumw2();
456  fOutput->Add(fHistNEvents);
457 
458  fhPIDmassLcPt = new TH2F("hPIDmassLcPt","hPIDmassLcPt;3-Prong p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
459  fhPIDmassLcPtSig = new TH2F("hPIDmassLcPtSig","hPIDmassLcPtSig;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
460  fhPIDmassLcPtSigc = new TH2F("hPIDmassLcPtSigc","hPIDmassLcPtSigc;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
461  fhPIDmassLcPtSigb = new TH2F("hPIDmassLcPtSigb","hPIDmassLcPtSigb;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
462  fhMCmassLcPt = new TH2F("hMCmassLcPt","hMCmassLcPt;3-Prong p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
463  fhMCmassLcPtSig = new TH2F("hMCmassLcPtSig","hMCmassLcPtSig;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
464  fhMCmassLcPtSigc = new TH2F("hMCmassLcPtSigc","hMCmassLcPtSigc;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
465  fhMCmassLcPtSigb = new TH2F("hMCmassLcPtSigb","hMCmassLcPtSigb;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
466  fhProbmassLcPt = new TH2F("hProbmassLcPt","hProbmassLcPt;3-Prong p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
467  fhProbmassLcPtSig = new TH2F("hProbmassLcPtSig","hProbmassLcPtSig;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
468  fhProbmassLcPtSigc = new TH2F("hProbmassLcPtSigc","hProbmassLcPtSigc;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
469  fhProbmassLcPtSigb = new TH2F("hProbmassLcPtSigb","hProbmassLcPtSigb;3-Prong signal p_{T} GeV/c;Invariant mass pK#pi (GeV/c)",150,0.,15.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
470  fOutput->Add(fhPIDmassLcPt);
474  fOutput->Add(fhMCmassLcPt);
475  fOutput->Add(fhMCmassLcPtSig);
478  fOutput->Add(fhProbmassLcPt);
482 
483  fhIsLcResonantGen = new TH1F("hIsLcResonantGen","IsLcResonant flag gen",6,-1.5,4.5);
484  fhIsLcResonantReco = new TH1F("hIsLcResonantReco","IsLcResonant flag reco",6,-1.5,4.5);
485  fhIsLcGen = new TH1F("hIsLcGen","IsLc flag gen",4,-1.5,2.5);
486  fhIsLcReco = new TH1F("hIsLcReco","IsLc flag reco",4,-1.5,2.5);
489  fOutput->Add(fhIsLcGen);
490  fOutput->Add(fhIsLcReco);
491 
492  fhRecoPDGmom = new TH1F("hRecoPDGmom","pdg of mother reco. MatchToMCLambdac",7,-0.5,6.5);
493  fOutput->Add(fhRecoPDGmom);
494 
495  fhSetIsLc = new TH1F("hSetIsLc","Check candidates before/after rec. set is Lc",2,-0.5,1.5);
496  fOutput->Add(fhSetIsLc);
497 
498  fhSelectionBits = new TH2F("hSelectionBits","Reconstruction + selection bit",13,-0.5,12.5,150,0,15);
499  fhSelectionBits->GetXaxis()->SetBinLabel(2,"D0toKpiCuts");
500  fhSelectionBits->GetXaxis()->SetBinLabel(3,"D0toKpiPID");
501  fhSelectionBits->GetXaxis()->SetBinLabel(4,"D0fromDstarCuts");
502  fhSelectionBits->GetXaxis()->SetBinLabel(5,"D0fromDstarPID");
503  fhSelectionBits->GetXaxis()->SetBinLabel(6,"DplusCuts");
504  fhSelectionBits->GetXaxis()->SetBinLabel(7,"DplusPID");
505  fhSelectionBits->GetXaxis()->SetBinLabel(8,"DsCuts");
506  fhSelectionBits->GetXaxis()->SetBinLabel(9,"DsPID");
507  fhSelectionBits->GetXaxis()->SetBinLabel(10,"LcCuts");
508  fhSelectionBits->GetXaxis()->SetBinLabel(11,"LcPID");
509  fhSelectionBits->GetXaxis()->SetBinLabel(12,"DstarCuts");
510  fhSelectionBits->GetXaxis()->SetBinLabel(13,"DstarPID");
511  fhSelectionBits->GetYaxis()->SetTitle("p_{T} (GeV/c)");
512  fhSelectionBits->GetXaxis()->SetNdivisions(1,kFALSE);
513  fOutput->Add(fhSelectionBits);
514 
515  fhSelectionBitsSigc = new TH2F("hSelectionBitsSigc","Reconstruction + selection bit from c",13,-0.5,12.5,150,0,15);
516  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(2,"D0toKpiCuts");
517  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(3,"D0toKpiPID");
518  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(4,"D0fromDstarCuts");
519  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(5,"D0fromDstarPID");
520  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(6,"DplusCuts");
521  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(7,"DplusPID");
522  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(8,"DsCuts");
523  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(9,"DsPID");
524  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(10,"LcCuts");
525  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(11,"LcPID");
526  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(12,"DstarCuts");
527  fhSelectionBitsSigc->GetXaxis()->SetBinLabel(13,"DstarPID");
528  fhSelectionBitsSigc->GetYaxis()->SetTitle("p_{T} (GeV/c)");
529  fhSelectionBitsSigc->GetXaxis()->SetNdivisions(1,kFALSE);
531 
532  fhSelectionBitsSigb = new TH2F("hSelectionBitsSigb","Reconstruction + selection bit from b",13,-0.5,13.5,150,0,15);
533  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(2,"D0toKpiCuts");
534  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(3,"D0toKpiPID");
535  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(4,"D0fromDstarCuts");
536  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(5,"D0fromDstarPID");
537  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(6,"DplusCuts");
538  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(7,"DplusPID");
539  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(8,"DsCuts");
540  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(9,"DsPID");
541  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(10,"LcCuts");
542  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(11,"LcPID");
543  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(12,"DstarCuts");
544  fhSelectionBitsSigb->GetXaxis()->SetBinLabel(13,"DstarPID");
545  fhSelectionBitsSigb->GetYaxis()->SetTitle("p_{T} (GeV/c)");
546  fhSelectionBitsSigb->GetXaxis()->SetNdivisions(1,kFALSE);
548 
549 // enum ESele {kD0toKpiCuts,kD0toKpiPID,kD0fromDstarCuts,kD0fromDstarPID,kDplusCuts,kDplusPID,kDsCuts,kDsPID,kLcCuts,kLcPID,kDstarCuts,kDstarPID};
550 
551  TString stepnames[12] = {"GeneratedLimAcc","GeneratedAll","Generated","GeneratedAcc","Reco3Prong","LcBit","IsSelectedTracks","IsInFidAcc","PtRange","IsSelectedCandidate","IsSelectedPID","IsSelectedNtuple"};
552  for(Int_t i=0;i<12;i++) { // histograms for efficiency cross check
553  //Lc vs Pt histograms
554  hisname.Form("hNBkgNI%i",i);
555  histitle.Form("N Bkg not injected %s",stepnames[i].Data());
556  fhNBkgNI[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
557  hisname.Form("hNLc%i",i);
558  histitle.Form("N Lc %s",stepnames[i].Data());
559  fhNLc[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
560  hisname.Form("hNLcc%i",i);
561  histitle.Form("N Lc from c %s",stepnames[i].Data());
562  fhNLcc[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
563  hisname.Form("hNLcNonRc%i",i);
564  histitle.Form("N Lc non resonant from c %s",stepnames[i].Data());
565  fhNLcNonRc[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
566  hisname.Form("hNLcL1520c%i",i);
567  histitle.Form("N Lc -> L(1520) + p from c %s",stepnames[i].Data());
568  fhNLcL1520c[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
569  hisname.Form("hNLcKstarc%i",i);
570  histitle.Form("N Lc -> K* + pi from c %s",stepnames[i].Data());
571  fhNLcKstarc[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
572  hisname.Form("hNLcDeltac%i",i);
573  histitle.Form("N Lc -> Delta + K from c %s",stepnames[i].Data());
574  fhNLcDeltac[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
575  hisname.Form("hNLcb%i",i);
576  histitle.Form("N Lc from b %s",stepnames[i].Data());
577  fhNLcb[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
578  hisname.Form("hNLcNonRb%i",i);
579  histitle.Form("N Lc non resonant from b %s",stepnames[i].Data());
580  fhNLcNonRb[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
581  hisname.Form("hNLcL1520b%i",i);
582  histitle.Form("N Lc -> L(1520) + p from b %s",stepnames[i].Data());
583  fhNLcL1520b[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
584  hisname.Form("hNLcKstarb%i",i);
585  histitle.Form("N Lc -> K* + pi from b %s",stepnames[i].Data());
586  fhNLcKstarb[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
587  hisname.Form("hNLcDeltab%i",i);
588  histitle.Form("N Lc -> Delta + K from b %s",stepnames[i].Data());
589  fhNLcDeltab[i] = new TH1F(hisname.Data(),histitle.Data(),100,0,20);
590  fOutput->Add(fhNBkgNI[i]);
591  fOutput->Add(fhNLc[i]);
592  fOutput->Add(fhNLcc[i]);
593  fOutput->Add(fhNLcNonRc[i]);
594  fOutput->Add(fhNLcL1520c[i]);
595  fOutput->Add(fhNLcKstarc[i]);
596  fOutput->Add(fhNLcDeltac[i]);
597  fOutput->Add(fhNLcb[i]);
598  fOutput->Add(fhNLcNonRb[i]);
599  fOutput->Add(fhNLcL1520b[i]);
600  fOutput->Add(fhNLcKstarb[i]);
601  fOutput->Add(fhNLcDeltab[i]);
602 
603  //Pt vs eta histograms
604  hisname.Form("hPtEtaBkgNI%i",i);
605  histitle.Form("Pt vs #eta Bkg not injected %s",stepnames[i].Data());
606  fhPtEtaBkgNI[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
607  hisname.Form("hPtEtaLc%i",i);
608  histitle.Form("Pt vs #eta Lc %s",stepnames[i].Data());
609  fhPtEtaLc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
610  hisname.Form("hPtEtaLcc%i",i);
611  histitle.Form("Pt vs #eta Lc from c %s",stepnames[i].Data());
612  fhPtEtaLcc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
613  hisname.Form("hPtEtaLcNonRc%i",i);
614  histitle.Form("Pt vs #eta Lc non resonant from c %s",stepnames[i].Data());
615  fhPtEtaLcNonRc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
616  hisname.Form("hPtEtaLcL1520c%i",i);
617  histitle.Form("Pt vs #eta Lc -> L(1520) + p from c %s",stepnames[i].Data());
618  fhPtEtaLcL1520c[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
619  hisname.Form("hPtEtaLcKstarc%i",i);
620  histitle.Form("Pt vs #eta Lc -> K* + pi from c %s",stepnames[i].Data());
621  fhPtEtaLcKstarc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
622  hisname.Form("hPtEtaLcDeltac%i",i);
623  histitle.Form("Pt vs #eta Lc -> Delta + K from c %s",stepnames[i].Data());
624  fhPtEtaLcDeltac[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
625  hisname.Form("hPtEtaLcb%i",i);
626  histitle.Form("Pt vs #eta Lc from b %s",stepnames[i].Data());
627  fhPtEtaLcb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
628  hisname.Form("hPtEtaLcNonRb%i",i);
629  histitle.Form("Pt vs #eta Lc non resonant from b %s",stepnames[i].Data());
630  fhPtEtaLcNonRb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
631  hisname.Form("hPtEtaLcL1520b%i",i);
632  histitle.Form("Pt vs #eta Lc -> L(1520) + p from b %s",stepnames[i].Data());
633  fhPtEtaLcL1520b[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
634  hisname.Form("hPtEtaLcKstarb%i",i);
635  histitle.Form("Pt vs #eta Lc -> K* + pi from b %s",stepnames[i].Data());
636  fhPtEtaLcKstarb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
637  hisname.Form("hPtEtaLcDeltab%i",i);
638  histitle.Form("Pt vs #eta Lc -> Delta + K from b %s",stepnames[i].Data());
639  fhPtEtaLcDeltab[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
640  fOutput->Add(fhPtEtaBkgNI[i]);
641  fOutput->Add(fhPtEtaLc[i]);
642  fOutput->Add(fhPtEtaLcc[i]);
643  fOutput->Add(fhPtEtaLcNonRc[i]);
644  fOutput->Add(fhPtEtaLcL1520c[i]);
645  fOutput->Add(fhPtEtaLcKstarc[i]);
646  fOutput->Add(fhPtEtaLcDeltac[i]);
647  fOutput->Add(fhPtEtaLcb[i]);
648  fOutput->Add(fhPtEtaLcNonRb[i]);
649  fOutput->Add(fhPtEtaLcL1520b[i]);
650  fOutput->Add(fhPtEtaLcKstarb[i]);
651  fOutput->Add(fhPtEtaLcDeltab[i]);
652 
653  //Pt vs Y histograms
654  hisname.Form("hPtYBkgNI%i",i);
655  histitle.Form("Pt vs Y Bkg not injected %s",stepnames[i].Data());
656  fhPtYBkgNI[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
657  hisname.Form("hPtYLc%i",i);
658  histitle.Form("Pt vs Y Lc %s",stepnames[i].Data());
659  fhPtYLc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
660  hisname.Form("hPtYLcc%i",i);
661  histitle.Form("Pt vs Y Lc from c %s",stepnames[i].Data());
662  fhPtYLcc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
663  hisname.Form("hPtYLcNonRc%i",i);
664  histitle.Form("Pt vs Y Lc non resonant from c %s",stepnames[i].Data());
665  fhPtYLcNonRc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
666  hisname.Form("hPtYLcL1520c%i",i);
667  histitle.Form("Pt vs Y Lc -> L(1520) + p from c %s",stepnames[i].Data());
668  fhPtYLcL1520c[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
669  hisname.Form("hPtYLcKstarc%i",i);
670  histitle.Form("Pt vs Y Lc -> K* + pi from c %s",stepnames[i].Data());
671  fhPtYLcKstarc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
672  hisname.Form("hPtYLcDeltac%i",i);
673  histitle.Form("Pt vs Y Lc -> Delta + K from c %s",stepnames[i].Data());
674  fhPtYLcDeltac[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
675  hisname.Form("hPtYLcb%i",i);
676  histitle.Form("Pt vs Y Lc from b %s",stepnames[i].Data());
677  fhPtYLcb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
678  hisname.Form("hPtYLcNonRb%i",i);
679  histitle.Form("Pt vs Y Lc non resonant from b %s",stepnames[i].Data());
680  fhPtYLcNonRb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
681  hisname.Form("hPtYLcL1520b%i",i);
682  histitle.Form("Pt vs Y Lc -> L(1520) + p from b %s",stepnames[i].Data());
683  fhPtYLcL1520b[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
684  hisname.Form("hPtYLcKstarb%i",i);
685  histitle.Form("Pt vs Y Lc -> K* + pi from b %s",stepnames[i].Data());
686  fhPtYLcKstarb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
687  hisname.Form("hPtYLcDeltab%i",i);
688  histitle.Form("Pt vs Y Lc -> Delta + K from b %s",stepnames[i].Data());
689  fhPtYLcDeltab[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,200,-10,10);
690  fOutput->Add(fhPtYBkgNI[i]);
691  fOutput->Add(fhPtYLc[i]);
692  fOutput->Add(fhPtYLcc[i]);
693  fOutput->Add(fhPtYLcNonRc[i]);
694  fOutput->Add(fhPtYLcL1520c[i]);
695  fOutput->Add(fhPtYLcKstarc[i]);
696  fOutput->Add(fhPtYLcDeltac[i]);
697  fOutput->Add(fhPtYLcb[i]);
698  fOutput->Add(fhPtYLcNonRb[i]);
699  fOutput->Add(fhPtYLcL1520b[i]);
700  fOutput->Add(fhPtYLcKstarb[i]);
701  fOutput->Add(fhPtYLcDeltab[i]);
702 
703  //Pt vs phi histograms
704  hisname.Form("hPtPhiBkgNI%i",i);
705  histitle.Form("Pt vs #phi Bkg not injected %s",stepnames[i].Data());
706  fhPtPhiBkgNI[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
707  hisname.Form("hPtPhiLc%i",i);
708  histitle.Form("Pt vs #phi Lc %s",stepnames[i].Data());
709  fhPtPhiLc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
710  hisname.Form("hPtPhiLcc%i",i);
711  histitle.Form("Pt vs #phi Lc from c %s",stepnames[i].Data());
712  fhPtPhiLcc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
713  hisname.Form("hPtPhiLcNonRc%i",i);
714  histitle.Form("Pt vs #phi Lc non resonant from c %s",stepnames[i].Data());
715  fhPtPhiLcNonRc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
716  hisname.Form("hPtPhiLcL1520c%i",i);
717  histitle.Form("Pt vs #phi Lc -> L(1520) + p from c %s",stepnames[i].Data());
718  fhPtPhiLcL1520c[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
719  hisname.Form("hPtPhiLcKstarc%i",i);
720  histitle.Form("Pt vs #phi Lc -> K* + pi from c %s",stepnames[i].Data());
721  fhPtPhiLcKstarc[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
722  hisname.Form("hPtPhiLcDeltac%i",i);
723  histitle.Form("Pt vs #phi Lc -> Delta + K from c %s",stepnames[i].Data());
724  fhPtPhiLcDeltac[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
725  hisname.Form("hPtPhiLcb%i",i);
726  histitle.Form("Pt vs #phi Lc from b %s",stepnames[i].Data());
727  fhPtPhiLcb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
728  hisname.Form("hPtPhiLcNonRb%i",i);
729  histitle.Form("Pt vs #phi Lc non resonant from b %s",stepnames[i].Data());
730  fhPtPhiLcNonRb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
731  hisname.Form("hPtPhiLcL1520b%i",i);
732  histitle.Form("Pt vs #phi Lc -> L(1520) + p from b %s",stepnames[i].Data());
733  fhPtPhiLcL1520b[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
734  hisname.Form("hPtPhiLcKstarb%i",i);
735  histitle.Form("Pt vs #phi Lc -> K* + pi from b %s",stepnames[i].Data());
736  fhPtPhiLcKstarb[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
737  hisname.Form("hPtPhiLcDeltab%i",i);
738  histitle.Form("Pt vs #phi Lc -> Delta + K from b %s",stepnames[i].Data());
739  fhPtPhiLcDeltab[i] = new TH2F(hisname.Data(),histitle.Data(),20,0,20,70,0,7);
740  fOutput->Add(fhPtPhiBkgNI[i]);
741  fOutput->Add(fhPtPhiLc[i]);
742  fOutput->Add(fhPtPhiLcc[i]);
743  fOutput->Add(fhPtPhiLcNonRc[i]);
744  fOutput->Add(fhPtPhiLcL1520c[i]);
745  fOutput->Add(fhPtPhiLcKstarc[i]);
746  fOutput->Add(fhPtPhiLcDeltac[i]);
747  fOutput->Add(fhPtPhiLcb[i]);
748  fOutput->Add(fhPtPhiLcNonRb[i]);
749  fOutput->Add(fhPtPhiLcL1520b[i]);
750  fOutput->Add(fhPtPhiLcKstarb[i]);
751  fOutput->Add(fhPtPhiLcDeltab[i]);
752  }
753 
754 
755  fhPtMisIdpKpi = new TH1F("hMisIdpKpi","pKpi id'd as piKp",30,0,30);
756  fhPtMisIdpiKp = new TH1F("hMisIdpiKp","piKp id'd as pKpi",30,0,30);
757  fhPtCorrId = new TH1F("hCorrId","Correctly id'd pKpi",30,0,30);
758  fOutput->Add(fhPtMisIdpKpi);
759  fOutput->Add(fhPtMisIdpiKp);
760  fOutput->Add(fhPtCorrId);
761  fhInvMassMisIdpKpi = new TH2F("hInvMassIdpKpi","inv mass pKpi id'd as piKp",300,0.,30.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
762  fhInvMassMisIdpiKp = new TH2F("hInvMassIdpiKp","inv mass piKp id'd as pKpi",300,0.,30.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
765 
766  fhPtMisIdpKpiProb = new TH1F("hMisIdpKpiProb","pKpi id'd as piKp, most prob. PID",30,0,30);
767  fhPtMisIdpiKpProb = new TH1F("hMisIdpiKpProb","piKp id'd as pKpi, most prob. PID",30,0,30);
768  fhPtCorrIdProb = new TH1F("hCorrIdProb","Correctly id'd pKpi, most prob. PID",30,0,30);
771  fOutput->Add(fhPtCorrIdProb);
772  fhInvMassMisIdpKpiProb = new TH2F("hInvMassIdpKpiProb","inv mass pKpi id'd as piKp most prob. PID",300,0.,30.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
773  fhInvMassMisIdpiKpProb = new TH2F("hInvMassIdpiKpProb","inv mass piKp id'd as pKpi most prob. PID",300,0.,30.,(fUpmasslimit-fLowmasslimit)/0.002,fLowmasslimit,fUpmasslimit);
776 
777 
778  // weight function from ratio of flat value (1/30) to pythia
779  // use to normalise to flat distribution (should lead to flat pT distribution
780  fFuncWeightPythia=new TF1("funcWeightPythia","1./(30. *[0]*x/TMath::Power(1.+(TMath::Power((x/[1]),[3])),[2]))",0.15,30);
781  fFuncWeightPythia->SetParameters(0.36609,1.94635,1.40463,2.5);
782 
783  // weight function from the ratio of the LHC10f6a MC
784  // and FONLL calculations for pp data
785  fFuncWeightFONLL7overLHC10f6a=new TF1("funcWeightFONLL7overLHC10f6a","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,40.);
786  fFuncWeightFONLL7overLHC10f6a->SetParameters(2.41522e+01,4.92146e+00,6.72495e+00,2.5,6.15361e-03,4.78995e+00,-4.29135e-01,3.99421e-01,-1.57220e-02);
787 
788  // weight function from the ratio of the LHC13d3 MC
789  // and FONLL calculations for pp data
790  fFuncWeightFONLL5overLHC13d3=new TF1("funcWeightFONLL5overLHC13d3","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,30.);
791  fFuncWeightFONLL5overLHC13d3->SetParameters(2.94999e+00,3.47032e+00,2.81278e+00,2.5,1.93370e-02,3.86865e+00,-1.54113e-01,8.86944e-02,2.56267e-02);
792 
793  // weight function from the ratio of the LHC10f6a MC
794  // and FONLL calculations for pp data
795  fFuncWeightFONLL5overLHC10f6a=new TF1("funcWeightFONLL5overLHC10f6a","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,40.);
796  fFuncWeightFONLL5overLHC10f6a->SetParameters(2.77730e+01,4.78942e+00,7.45378e+00,2.5,9.86255e-02,2.30120e+00,-4.16435e-01,3.43770e-01,-2.29380e-02);
797 
798  // weight function from the ratio of the LHC13d3 MC
799  // and FONLL calculations for pPb data, Lc
800  fFuncWeightFONLL5overLHC13d3Lc=new TF1("funcWeightFONLL5overLHC13d3Lc","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,20.);
801  fFuncWeightFONLL5overLHC13d3Lc->SetParameters(5.94428e+01,1.63585e+01,9.65555e+00,6.71944e+00,8.88338e-02,2.40477e+00,-4.88649e-02,-6.78599e-01,-2.10951e-01);
802 
803  // weight function from the ratio of the LHC11b2 MC
804  // and FONLL calculations for pp data, Lc
805  fFuncWeightFONLL7overLHC11b2Lc=new TF1("funcWeightFONLL7overLHC11b2Lc","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",1.,20.);
806  fFuncWeightFONLL7overLHC11b2Lc->SetParameters(2.11879e+02,3.73290e+00,2.01235e+01,1.41508e+00,1.06268e-01,1.86285e+00,-4.52956e-02,-9.90631e-01,-1.31615e+00);
807 
808  // weight function from the ratio of the LHC107a MC
809  // and FONLL calculations for pp data, Lc
810  fFuncWeightFONLL7overLHC10f7aLc=new TF1("funcWeightFONLL7overLHC10f7aLc","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",01.,20.);
811  fFuncWeightFONLL7overLHC10f7aLc->SetParameters(2.84268e+02,2.18850e+01,2.36298e+01,7.46144e+00,1.69747e-01,1.66993e+00,-5.54726e-02,-1.53869e+00,-1.18404e+00);
812 
813 
821 
822 
823  // fhChi2 = new TH1F("fhChi2", "Chi2",100,0.,10.);
824  // fhChi2->Sumw2();
825  // fOutput->Add(fhChi2);
826 
827  fNentries=new TH1F("fNentries", "n Events/Candidates QA", 16,0.5,16.5);
828 
829  //Event and candidate QA - entries at each step
830  fNentries->GetXaxis()->SetBinLabel(1,"nEventsRejTM");
831  fNentries->GetXaxis()->SetBinLabel(2,"nEventsNoVtx");
832  fNentries->GetXaxis()->SetBinLabel(3,"nEventsRejCutPileup");
833  fNentries->GetXaxis()->SetBinLabel(4,"nLcGen");
834  fNentries->GetXaxis()->SetBinLabel(5,"nLcGenFidAcc");
835  fNentries->GetXaxis()->SetBinLabel(6,"nCandReco3Prong");
836  fNentries->GetXaxis()->SetBinLabel(7,"nCandLcBit");
837  fNentries->GetXaxis()->SetBinLabel(8,"nCandIsSelTracks");
838  fNentries->GetXaxis()->SetBinLabel(9,"nCandIsInFidAcc");
839  fNentries->GetXaxis()->SetBinLabel(10,"ptbin=-1");
840  fNentries->GetXaxis()->SetBinLabel(11,"nCandIsSelCand");
841  fNentries->GetXaxis()->SetBinLabel(12,"PID=0");
842  fNentries->GetXaxis()->SetBinLabel(13,"PID=1");
843  fNentries->GetXaxis()->SetBinLabel(14,"PID=2");
844  fNentries->GetXaxis()->SetBinLabel(15,"PID=3");
845  fNentries->GetXaxis()->SetBinLabel(16,"nLcSelected");
846  fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
847 
848  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
849  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
850  fPIDResponse = inputHandler->GetPIDResponse();
851 
856  fRDCutsAnalysis->GetPidHF()->SetOldPid(kFALSE);
859  }
860 
861 
862  PostData(1,fOutput);
863  PostData(3,fNentries);
864 
865  TString normName="NormalizationCounter";
866  AliAnalysisDataContainer *cont = GetOutputSlot(4)->GetContainer();
867  if(cont)normName=(TString)cont->GetName();
868  fCounter = new AliNormalizationCounter(normName.Data());
869  fCounter->Init();
870  PostData(4,fCounter);
871  if (fFillNtuple) {
872  //basic ntuple
873  TString ntName="fNtupleLambdac";
874  AliAnalysisDataContainer *contnt = GetOutputSlot(5)->GetContainer();
875  if(contnt)ntName=(TString)contnt->GetName();
876  if(fFillNtuple==1) fNtupleLambdac = new TNtuple(ntName.Data(), "Lc", "isLcBkg:InvMasspKpi:InvMasspiKp:Charge:PtTr0:PtTr1:PtTr2:PtLc:CosP:DecayL:DecayLSig:Dist12:SigVert:DCA:DecayLXY:DecayLXYSig:isLcResonant:selectionPID:Tr0Ppi:Tr0PK:Tr0Pp:Tr1Ppi:Tr1PK:Tr1Pp:Tr2Ppi:Tr2PK:Tr2Pp");
877  //more variables
878  else if(fFillNtuple==2) fNtupleLambdac = new TNtuple(ntName.Data(), "Lc", "isLcBkg:InvMasspKpi:InvMasspiKp:Charge:PtTr0:PtTr1:PtTr2:PtLc:CosP:DecayL:DecayLSig:Dist12:SigVert:DCATr0:DecayLXY:DecayLXYSig:isLcResonant:selectionPID:Tr0Ppi:Tr0PK:Tr0Pp:Tr1Ppi:Tr1PK:Tr1Pp:Tr2Ppi:Tr2PK:Tr2Pp:d00:d01:d02:d0Squared:d00Sig:d01Sig:d02Sig:d00SigResidual:d01SigResidual:d02SigResidual:CosPXY:DCATr1:DCATr2:Dist23:RunNumber");
879  //weights
880  else if(fFillNtuple==3) fNtupleLambdac = new TNtuple(ntName.Data(), "Lc", "isLcBkg:InvMasspKpi:InvMasspiKp:Charge:PtTr0:PtTr1:PtTr2:PtLc:CosP:DecayL:DecayLSig:Dist12:SigVert:DCATr0:DecayLXY:DecayLXYSig:isLcResonant:selectionPID:Tr0Ppi:Tr0PK:Tr0Pp:Tr1Ppi:Tr1PK:Tr1Pp:Tr2Ppi:Tr2PK:Tr2Pp:d00:d01:d02:d0Squared:d00Sig:d01Sig:d02Sig:d00SigResidual:d01SigResidual:d02SigResidual:CosPXY:DCATr1:DCATr2:Dist23:RunNumber:PtLcMC:weightsPythia:weights7LHC106a:weights5LHC10f6a:weights5LHC13d3:weights5LHC13d3Lc:weights7LHC11b2Lc:weights7LHC10f7aLc:multiplicity:weightsMultiplicity");
881  //2 prong decay products
882  else if(fFillNtuple==4) fNtupleLambdac = new TNtuple(ntName.Data(), "Lc", "isLcBkg:InvMasspKpi:InvMasspiKp:Charge:PtTr0:PtTr1:PtTr2:PtLc:CosP:DecayL:DecayLSig:Dist12:SigVert:DCATr0:DecayLXY:DecayLXYSig:isLcResonant:selectionPID:Tr0Ppi:Tr0PK:Tr0Pp:Tr1Ppi:Tr1PK:Tr1Pp:Tr2Ppi:Tr2PK:Tr2Pp:d00:d01:d02:d0Squared:d00Sig:d01Sig:d02Sig:d00SigResidual:d01SigResidual:d02SigResidual:CosPXY:DCATr1:DCATr2:Dist23:RunNumber:PtLcMC:weightsPythia:weights7LHC106a:weights5LHC10f6a:weights5LHC13d3:weights5LHC13d3Lc:weights7LHC11b2Lc:weights7LHC10f7aLc:multiplicity:weightsMultiplicity:InvMasspK:InvMassKpi:InvMassppi:InvMassKp:InvMasspiK:InvMasspip");
883  else AliFatal("Invalid fill ntuple argument");
884  PostData(5,fNtupleLambdac);
885 
886  }
887  if(fFillNtupleReco) {
888  //Reco ntuple
889  TString ntName="fNtupleLambdacReco";
890  AliAnalysisDataContainer *contntrec = GetOutputSlot(6)->GetContainer();
891  if(contntrec)ntName=(TString)contntrec->GetName();
892  fNtupleLambdacReco = new TNtuple(ntName.Data(), "Lc Reco", "isLcBkg:PtLc:PtLcMC:PtTr0:PtTr1:PtTr2:PtTr0MC:PtTr1MC:PtTr2MC:isTOFTr0:isTOFTr1:isTOFTr2:selectionCand:selectionPID:selectionPIDprob");
893  PostData(6,fNtupleLambdacReco);
894  }
895 
896  return;
897 }
898 
899 //________________________________________________________________________
900 void AliAnalysisTaskSELambdacTMVA::UserExec(Option_t */*option*/)
901 {
902  //
905  //
906  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
907  //tmp
908  fHistNEvents->Fill(1); // count event
909  // Post the data already here
910 
911 
912  TClonesArray *array3Prong = 0;
913  TClonesArray *arrayLikeSign =0;
914  if(!aod && AODEvent() && IsStandardAOD()) {
915  // In case there is an AOD handler writing a standard AOD, use the AOD
916  // event in memory rather than the input (ESD) event.
917  aod = dynamic_cast<AliAODEvent*> (AODEvent());
918  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
919  // have to taken from the AOD event hold by the AliAODExtension
920  AliAODHandler* aodHandler = (AliAODHandler*)
921  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
922  if(aodHandler->GetExtensions()) {
923  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
924  AliAODEvent *aodFromExt = ext->GetAOD();
925  array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
926  arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject("LikeSign3Prong");
927  }
928  } else if(aod) {
929  array3Prong=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
930  arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject("LikeSign3Prong");
931  }
932 
933  if(!aod) return;
934 
935  TClonesArray *arrayMC=0;
936  AliAODMCHeader *mcHeader=0;
937 
938  // load MC particles
939  if(fReadMC){
940 
941  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
942  if(!arrayMC) {
943  AliError("AliAnalysisTaskSELambdacTMVA::UserExec: MC particles branch not found!\n");
944  return;
945  }
946 
947 
948  // load MC header
949  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
950  if(!mcHeader) {
951  AliError("AliAnalysisTaskSELambdacTMVA::UserExec: MC header branch not found!\n");
952  return;
953  }
954  //if(TString(AliAODMCHeader::StdBranchName()).Contains("LHC15f2")) {
955  // AliInfo("LHC15f2 - fIsHijing==kTRUE");
956  // fIsHijing=kTRUE;
957  //}
958  //else {
959  // AliInfo("Not LHC15f2 - fIsHijing==kFALSE");
960  // fIsHijing=kFALSE;
961  //}
962  }
963 
964 
965  if(!array3Prong || !aod) {
966  AliError("AliAnalysisTaskSELambdacTMVA::UserExec: Charm3Prong branch not found!\n");
967  return;
968  }
969  if(!arrayLikeSign) {
970  AliDebug(2,"AliAnalysisTaskSELambdacTMVA::UserExec: LikeSign3Prong branch not found!\n");
971  // return;
972  }
973 
974  //Trigger mask = 0 rejection for LHC13d3
975  Int_t runnumber = aod->GetRunNumber();
976  if (aod->GetTriggerMask() == 0 && (runnumber >= 195344 && runnumber <= 195677)){
977  Int_t nentriesTM = arrayMC->GetEntriesFast();
978  AliDebug(2,Form("Event rejected because of null trigger mask, n entries = %i",nentriesTM));
979  fNentries->Fill(1);
980  return;
981  }
982 
983  // fix for temporary bug in ESDfilter
984  // the AODs with null vertex pointer didn't pass the PhysSel
985  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
986  if(!vtx1 || TMath::Abs(aod->GetMagneticField())<0.001) {
987  fNentries->Fill(2);
988  //return;
989  }
991  TString trigclass=aod->GetFiredTriggerClasses();
992  //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL"))
993 
994  //Bool_t isThereA3prongWithGoodTracks = kFALSE;
995  //Bool_t isThereA3ProngLcKine = kFALSE;
996  //Bool_t isThereA3ProngLcKineANDpid = kFALSE;
997  //Bool_t isThereA3ProngLcMC = kFALSE;
998  //Bool_t isThereA3ProngCyes = kFALSE;
999  //Bool_t isThereA3ProngByes = kFALSE;
1000  //Bool_t isThereA3ProngJPsi = kFALSE;
1001 
1002  Int_t n3Prong = array3Prong->GetEntriesFast();
1003  Int_t nSelectedloose[1]={0};
1004  Int_t nSelectedtight[1]={0};
1005 
1006  //MC Generated level
1007  //loop over MC particles to find Lc generated
1008  Bool_t isInFidAcc = kFALSE;
1009  Bool_t isInAcc = kFALSE;
1010  if(fReadMC) {
1011  // Event selection as done is CF task
1012  Double_t zPrimVertex = vtx1 ->GetZ();
1013  Double_t zMCVertex = mcHeader->GetVtxZ();
1014  if (TMath::Abs(zMCVertex) > fRDCutsAnalysis->GetMaxVtxZ()){
1015  return;
1016  }
1017  for (Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++) {
1018  fIsLc=0;
1019  fIsLcResonant=0;
1020  AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iPart));
1021  if (!mcPart){
1022  AliError("Failed casting particle from MC array!, Skipping particle");
1023  continue;
1024  }
1025  //Check whether particle is Lc
1026  SetIsLcGen(mcPart,arrayMC);
1027  if(fIsLc==0) continue;
1028  //-- is Lc --
1029  isInFidAcc = fRDCutsAnalysis->IsInFiducialAcceptance(mcPart->Pt(),mcPart->Y());
1030  fCandidateVars[0] = mcPart->Pt();
1031  fCandidateVars[1] = mcPart->Eta();
1032  fCandidateVars[2] = mcPart->Y();
1033  fCandidateVars[3] = mcPart->Phi();
1034  Int_t imother = -1;
1035  if(!fIsHijing) imother=mcPart->GetMother();
1036  if(imother>0) { //found mother
1037  AliAODMCParticle* mcPartMother = dynamic_cast<AliAODMCParticle*>(arrayMC->At(imother));
1038  if(!mcPart){
1039  AliError("Failed casting mother particle, Skipping particle");
1040  continue;
1041  }
1042  }
1043 
1044  //Check daughters
1045  SetLambdacDaugh(mcPart,arrayMC,isInAcc);
1046  if(fIsLcResonant>=1 && (fIsHijing || imother>0)) { //if signal, and is LHC15f2 or has mother
1047  AliDebug(2,"Lc has p K pi in final state");
1049  fNentries->Fill(4);
1050  if(isInFidAcc){
1051  fNentries->Fill(5);
1052  if((TMath::Abs(mcPart->Y()) < 0.5)) {//limited acceptance
1053  AliDebug(2,"Lc in limited acceptance");
1055  }
1056  FillEffHists(kGenerated); //MC generated ---> Should be within fiducial acceptance
1057  if(isInAcc) FillEffHists(kGeneratedAcc); //all daughters in acceptance
1058  }
1059  }
1060  else if(fIsLcResonant==0){
1061  AliError("no p K pi final state");
1062  // TClonesArray *ares = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1063  // Int_t nentriesres = ares->GetEntriesFast();
1064  // for(Int_t ires=0;ires<nentriesres;ires++) {
1065  // AliAODMCParticle* mcPartRes = dynamic_cast<AliAODMCParticle*>(ares->At(ires));
1066  // Printf("%i",ires);
1067  // mcPartRes->Print();
1068  // }
1069  // TIter next(aod->GetList());
1070  // while (TObject *obj = next())
1071  // obj->Print();
1072  }
1073  else AliError(Form("Not pKpi or background - should not happen! fIsLcResonant = %i",fIsLcResonant));
1074  fhIsLcResonantGen->Fill(Double_t(fIsLcResonant));
1075  fhIsLcGen->Fill(Double_t(fIsLc));
1076  }
1077  }
1078 
1079 
1080  fHistNEvents->Fill(2); // count event after event selection (as CF task)
1081 
1082  Bool_t isEvSelAnCuts=fRDCutsAnalysis->IsEventSelected(aod);
1083  if(!isEvSelAnCuts){ //reject if not selected with analysis cut
1084  if(fRDCutsAnalysis->GetWhyRejection()==1) // rejected for pileup
1085  fNentries->Fill(3);
1086  return;
1087  }
1088 
1089  //
1090  //Reconstruction level
1091  //loop over 3 prong candidates
1092  //
1093 
1094  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
1095  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
1096  //(AliAODEvent *aod,AliAODRecoDecayHF3Prong *part,TClonesArray *arrayMC)
1097  fhSetIsLc->Fill(0);
1098  SetIsLcReco(d,arrayMC);
1099  fhSetIsLc->Fill(1);
1100  fhIsLcResonantReco->Fill(Double_t(fIsLcResonant));
1101  fhIsLcReco->Fill(Double_t(fIsLc));
1102  fCandidateVars[0] = d->Pt();
1103  fCandidateVars[1] = d->Eta();
1104  fCandidateVars[2] = d->Y(4122);
1105  fCandidateVars[3] = d->Phi();
1106 
1108  fNentries->Fill(6);
1109 
1110  Bool_t unsetvtx=kFALSE;
1111  if(!d->GetOwnPrimaryVtx()){
1112  d->SetOwnPrimaryVtx(vtx1);
1113  unsetvtx=kTRUE;
1114  }
1115 
1116 
1117 
1118  //add histogram with filter bit
1119  //one at start of task, one at filter bit selection
1120  //check every bit, bit vs pT
1121  //Filter bit selection and QA:
1122  fhSelectBit->Fill(1);
1123  if(d->GetSelectionMap()){
1124  // enum ESele {kD0toKpiCuts,kD0toKpiPID,kD0fromDstarCuts,kD0fromDstarPID,kDplusCuts,kDplusPID,kDsCuts,kDsPID,kLcCuts,kLcPID,kDstarCuts,kDstarPID};
1128 
1129  fhSelectBit->Fill(2);
1132  if(fLcCut&&!d->HasSelectionBit(AliRDHFCuts::kLcCuts)) continue;
1133  if(fLcPIDCut&&!d->HasSelectionBit(AliRDHFCuts::kLcPID)) continue;
1134  }
1136  fNentries->Fill(7);
1137 
1138  //track selection
1139  Int_t isSelectedTracks = fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kTracks,aod);
1140  if(!isSelectedTracks) continue;
1142  fNentries->Fill(8);
1143 
1144  //isThereA3prongWithGoodTracks=kTRUE;
1145 
1146  if (fRDCutsAnalysis->IsInFiducialAcceptance(d->Pt(),d->Y(4122))) {fNentries->Fill(9);}else{continue;}
1148 
1149  Int_t ptbin=fRDCutsAnalysis->PtBin(d->Pt());
1150  if(ptbin==-1) {fNentries->Fill(10); continue;} //out of bounds
1152 
1153  //Fill reco ntuple
1154  if(fReadMC && fIsLc>=1 && fFillNtupleReco) FillRecoNtuple(aod,d,arrayMC);
1155  //idproton, pion using isSelectedPID
1156  //Bool_t isPID=fRDCutsAnalysis->GetIsUsePID();
1157  Int_t isSelectedPID=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kPID,aod);
1158 
1159  if(isSelectedPID==0 ) fNentries->Fill(12);
1160  else if(isSelectedPID==1) fNentries->Fill(13);
1161  else if(isSelectedPID==2) fNentries->Fill(14);
1162  else fNentries->Fill(15);
1163  if(isSelectedPID>0) FillEffHists(kIsSelectedPID);
1164  //PID selection using maximum probability configuration
1165  Int_t selectionProb = GetPIDselectionMaxProb(d);
1166 
1167  Int_t selection=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kCandidate,aod);
1168  if(!selection) continue;
1170  fNentries->Fill(11);
1171 
1172  FillMassHists(aod,d,arrayMC,selection,selectionProb);
1173 
1174 
1175  if(fFillNtuple) FillNtuple(aod,d,arrayMC,selection);
1177  if(fIsLc>=1 && fIsLc <= 2) fNentries->Fill(16);
1178  if(unsetvtx) d->UnsetOwnPrimaryVtx();
1179  }
1180  fCounter->StoreCandidates(aod,nSelectedloose[0],kTRUE);
1181  fCounter->StoreCandidates(aod,nSelectedtight[0],kFALSE);
1182 
1183  PostData(1,fOutput);
1184  PostData(3,fNentries);
1185  PostData(4,fCounter);
1186 
1187  return;
1188 }
1189 
1190 
1191 
1192 //________________________________________________________________________
1194 {
1195  //
1197  //
1198 
1199  if (fDebug > 1) printf("AnalysisTaskSELambdac: Terminate() \n");
1200 
1201  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1202  if (!fOutput) {
1203  AliError("ERROR: fOutput not available\n");
1204  return;
1205  }
1206  //fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1207 
1208  if(fFillNtuple){
1209  fNtupleLambdac = dynamic_cast<TNtuple*>(GetOutputData(5));
1210  }
1211  if(fFillNtupleReco){
1212  fNtupleLambdacReco = dynamic_cast<TNtuple*>(GetOutputData(6));
1213  }
1214 
1215 
1216  return;
1217 }
1218 
1219 //________________________________________________________________________
1221 
1222  //
1224  //
1225 
1226  Int_t lambdacLab[3]={0,0,0};
1227  // Int_t pdgs[3]={0,0,0};
1228  for(Int_t i=0;i<3;i++){
1229  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1230  Int_t lab=daugh->GetLabel();
1231  if(lab<0) return 0;
1232  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab);
1233  if(!part) continue;
1234  // pdgs[i]=part->GetPdgCode();
1235  Int_t partPdgcode = TMath::Abs(part->GetPdgCode());
1236  if(partPdgcode==211 || partPdgcode==321 || partPdgcode==2212){
1237  Int_t motherLabel=part->GetMother();
1238  if(motherLabel<0) return 0;
1239  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(motherLabel);
1240  if(!motherPart) continue;
1241  Int_t motherPdg = TMath::Abs(motherPart->GetPdgCode());
1242  if(motherPdg==4122) {
1243  if(GetLambdacDaugh(motherPart,arrayMC)){lambdacLab[i]=motherLabel;continue;}
1244  }
1245  if(motherPdg==313 || motherPdg==2224 || motherPdg==3124){
1246  Int_t granMotherLabel=motherPart->GetMother();
1247  if(granMotherLabel<0) return 0;
1248  AliAODMCParticle *granMotherPart = (AliAODMCParticle*)arrayMC->At(granMotherLabel);
1249  if(!granMotherPart) continue;
1250  Int_t granMotherPdg = TMath::Abs(granMotherPart->GetPdgCode());
1251  if(granMotherPdg ==4122) {
1252  if(GetLambdacDaugh(granMotherPart,arrayMC)) {lambdacLab[i]=granMotherLabel;continue;}
1253  }
1254  }
1255  }
1256  }
1257 
1258  if(lambdacLab[0]==lambdacLab[1] && lambdacLab[1]==lambdacLab[2]) {return lambdacLab[0];}
1259  return 0;
1260 
1261 }
1262 
1263 //-----------------------------
1264 
1265 Int_t AliAnalysisTaskSELambdacTMVA::LambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC, Bool_t &IsInAcc) const {
1266 
1267  //
1271  //
1272 
1273  Int_t numberOfLambdac=0;
1274  IsInAcc=kTRUE;
1275  if(TMath::Abs(part->GetPdgCode())!=4122) return 0;
1276  // Int_t daughTmp[2];
1277  // daughTmp[0]=part->GetDaughter(0);
1278  // daughTmp[1]=part->GetDaughter(1);
1279  Int_t nDaugh = (Int_t)part->GetNDaughters();
1280  if(nDaugh<2) return 0;
1281  if(nDaugh>3) return 0;
1282  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)arrayMC->At(part->GetDaughter(0));
1283  if(!pdaugh1) {return 0;}
1284  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
1285  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)arrayMC->At(part->GetDaughter(1));
1286  if(!pdaugh2) {return 0;}
1287  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
1288 
1289  AliDebug(2,"Is non resonant?");
1290  if(nDaugh==3){
1291  Int_t thirdDaugh=part->GetDaughter(1)-1;
1292  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)arrayMC->At(thirdDaugh);
1293  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
1294  if((number1==321 && number2==211 && number3==2212) ||
1295  (number1==211 && number2==321 && number3==2212) ||
1296  (number1==211 && number2==2212 && number3==321) ||
1297  (number1==321 && number2==2212 && number3==211) ||
1298  (number1==2212 && number2==321 && number3==211) ||
1299  (number1==2212 && number2==211 && number3==321)) {
1300  numberOfLambdac++;
1301  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1302  || TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1303  || TMath::Abs(pdaugh3->Eta()) > 0.9 || pdaugh3->Pt() < 0.1) IsInAcc=kFALSE;
1304  AliDebug(2,"Lc decays non-resonantly");
1305  return 1;
1306  }
1307  }
1308 
1309  if(nDaugh==2){
1310 
1311  //Lambda resonant
1312 
1313  //Lambda -> p K*0
1314  //
1315  Int_t nfiglieK=0;
1316 
1317  if((number1==2212 && number2==313)){
1318  nfiglieK=pdaugh2->GetNDaughters();
1319  if(nfiglieK!=2) return 0;
1320  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1321  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1322  if(!pdaughK1) return 0;
1323  if(!pdaughK2) return 0;
1324  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) {
1325  numberOfLambdac++;
1326  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1327  || TMath::Abs(pdaughK1->Eta()) > 0.9 || pdaughK1->Pt() < 0.1
1328  || TMath::Abs(pdaughK2->Eta()) > 0.9 || pdaughK2->Pt() < 0.1) IsInAcc=kFALSE;
1329  AliDebug(2,"Lc decays via K* p");
1330  return 3;
1331  }
1332  }
1333 
1334  if((number1==313 && number2==2212)){
1335  nfiglieK=pdaugh1->GetNDaughters();
1336  if(nfiglieK!=2) return 0;
1337  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1338  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1339  if(!pdaughK1) return 0;
1340  if(!pdaughK2) return 0;
1341  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) {
1342  numberOfLambdac++;
1343  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1344  || TMath::Abs(pdaughK1->Eta()) > 0.9 || pdaughK1->Pt() < 0.1
1345  || TMath::Abs(pdaughK2->Eta()) > 0.9 || pdaughK2->Pt() < 0.1) IsInAcc=kFALSE;
1346  AliDebug(2,"Lc decays via K* p");
1347  return 3;
1348  }
1349  }
1350 
1351  //Lambda -> Delta++ k
1352  Int_t nfiglieDelta=0;
1353  if(number1==321 && number2==2224){
1354  nfiglieDelta=pdaugh2->GetNDaughters();
1355  if(nfiglieDelta!=2) return 0;
1356  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1357  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1358  if(!pdaughD1) return 0;
1359  if(!pdaughD2) return 0;
1360  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) {
1361  numberOfLambdac++;
1362  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1363  || TMath::Abs(pdaughD1->Eta()) > 0.9 || pdaughD1->Pt() < 0.1
1364  || TMath::Abs(pdaughD2->Eta()) > 0.9 || pdaughD2->Pt() < 0.1) IsInAcc=kFALSE;
1365  AliDebug(2,"Lc decays via Delta++ k");
1366  return 4;
1367  }
1368  }
1369  if(number1==2224 && number2==321){
1370  nfiglieDelta=pdaugh1->GetNDaughters();
1371  if(nfiglieDelta!=2) return 0;
1372  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1373  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1374  if(!pdaughD1) return 0;
1375  if(!pdaughD2) return 0;
1376  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) {
1377  numberOfLambdac++;
1378  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1379  || TMath::Abs(pdaughD1->Eta()) > 0.9 || pdaughD1->Pt() < 0.1
1380  || TMath::Abs(pdaughD2->Eta()) > 0.9 || pdaughD2->Pt() < 0.1) IsInAcc=kFALSE;
1381  AliDebug(2,"Lc decays via Delta++ k");
1382  return 4;
1383  }
1384  }
1385 
1386 
1387  //Lambdac -> Lambda(1520) pi
1388  Int_t nfiglieLa=0;
1389  if(number1==3124 && number2==211){
1390  nfiglieLa=pdaugh1->GetNDaughters();
1391  if(nfiglieLa!=2) return 0;
1392  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1393  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1394  if(!pdaughL1) return 0;
1395  if(!pdaughL2) return 0;
1396  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) {
1397  numberOfLambdac++;
1398  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1399  || TMath::Abs(pdaughL1->Eta()) > 0.9 || pdaughL1->Pt() < 0.1
1400  || TMath::Abs(pdaughL2->Eta()) > 0.9 || pdaughL2->Pt() < 0.1) IsInAcc=kFALSE;
1401  AliDebug(2,"Lc decays via Lambda(1520) pi");
1402  return 2;
1403  }
1404  }
1405  if(number1==211 && number2==3124){
1406  nfiglieLa=pdaugh2->GetNDaughters();
1407  if(nfiglieLa!=2) return 0;
1408  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1409  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1410  if(!pdaughL1) return 0;
1411  if(!pdaughL2) return 0;
1412  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) {
1413  numberOfLambdac++;
1414  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1415  || TMath::Abs(pdaughL1->Eta()) > 0.9 || pdaughL1->Pt() < 0.1
1416  || TMath::Abs(pdaughL2->Eta()) > 0.9 || pdaughL2->Pt() < 0.1) IsInAcc=kFALSE;
1417  AliDebug(2,"Lc decays via Lambda(1520) pi");
1418  return 2;
1419  }
1420  }
1421  }
1422 
1423  if(numberOfLambdac>0) {return -100; AliDebug(2,"Lc decays via one of 4 resonances!");}
1424  return 0;
1425 }
1426 
1427 //-----------------------------
1428 
1429 void AliAnalysisTaskSELambdacTMVA::SetIsLcGen(AliAODMCParticle *mcPart, TClonesArray *arrayMC) {
1430 
1431  //
1434  //
1435 
1436  fIsLc=0;
1437  if(TMath::Abs(mcPart->GetPdgCode())==4122) {
1438  AliDebug(2,"Found Lc! now check mother");
1439  fIsLc=1;
1440  Int_t pdgMom = 0;
1441  pdgMom=fVertUtil->CheckOrigin(arrayMC,mcPart,fKeepLcNotFromQuark ? kFALSE : kTRUE);
1442  if(pdgMom == 5){
1443  AliDebug(2,"Lc comes from b");
1444  fIsLc=2;
1445  }
1446  else if(pdgMom==4) {
1447  fIsLc=1;
1448  }
1449  else {
1450  fIsLc=0;
1451  fhIsLcResonantGen->Fill(-1);
1452  }
1453  }
1454 }
1455 
1456 
1457 //-----------------------------
1458 
1460  TClonesArray *arrayMC) {
1461 
1462  //
1466  //
1467 
1468  Int_t labDp=-1;
1469  fIsLc = 0;
1470  fIsLcResonant=0;
1471  if(!fReadMC) return;
1472  else{ //MC, check if Lc prompt or non prompt
1473  Int_t pdgCand =4122;
1474  Int_t pdgDaughter[3]={-1,-1,-1};
1475  pdgDaughter[0]=2212;
1476  pdgDaughter[1]=321;
1477  pdgDaughter[2]=211;
1478 
1479  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
1480  if(labDp>=0){
1481  AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1482  Int_t pdgMom=fVertUtil->CheckOrigin(arrayMC,partDp,fKeepLcNotFromQuark ? kFALSE : kTRUE);
1483  fhRecoPDGmom->Fill(pdgMom);
1484  if(pdgMom == 4) fIsLc=1;
1485  else if(pdgMom == 5) fIsLc=2;
1486  else fIsLc=0;
1487  Bool_t dummy = kTRUE;
1488  if(fIsLc>0) SetLambdacDaugh(partDp, arrayMC, dummy);
1489  }
1490 
1491  }
1492 }
1493 
1494 //---------------------------
1495 
1496 void AliAnalysisTaskSELambdacTMVA::FillMassHists(AliAODEvent *aod, AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Int_t selection, Int_t selectionProb) {
1498  Bool_t IsInjected = 0;
1499  Double_t invMassLcpKpi = d->InvMassLcpKpi();
1500  Double_t invMassLcpiKp = d->InvMassLcpiKp();
1501  Bool_t ispKpiMC = 0;
1502  Bool_t ispiKpMC = 0;
1503 
1504  if(fReadMC) {
1505  ispKpiMC = IspKpiMC(d,arrayMC);
1506  ispiKpMC = IspiKpMC(d,arrayMC);
1507  AliAODMCHeader *mcHeader2 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1508  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(d,mcHeader2,arrayMC); //for dedicated MC set to 0
1509 
1510  //signal
1511  if(fIsLc>=1) {
1512  //MC PID
1513  fhMCmassLcPtSig->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1514  if(fIsLc==1) fhMCmassLcPtSigc->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1515  else if(fIsLc==2) fhMCmassLcPtSigb->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1516  //Real PID
1517  if(selection==1){
1518  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpKpi);
1519  if(fIsLc==1) fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpKpi);
1520  else if(fIsLc==2) fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpKpi);
1521  }
1522  else if(selection==2){
1523  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpiKp);
1524  if(fIsLc==1) fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpiKp);
1525  else if(fIsLc==2) fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpiKp);
1526  }
1527  else if(selection==3){
1528  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpiKp,0.5);
1529  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpKpi,0.5);
1530  if(fIsLc==1) {
1531  fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpiKp,0.5);
1532  fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpKpi,0.5);
1533  }
1534  else if(fIsLc==2) {
1535  fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpiKp,0.5);
1536  fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpKpi,0.5);
1537  }
1538  }
1539  //max prob PID
1540  if(selectionProb==1) {
1541  fhProbmassLcPtSig->Fill(d->Pt(), invMassLcpKpi);
1542  if(fIsLc==1)fhProbmassLcPtSigc->Fill(d->Pt(), invMassLcpKpi);
1543  if(fIsLc==2)fhProbmassLcPtSigb->Fill(d->Pt(), invMassLcpKpi);
1544  }
1545  else if(selectionProb==2) {
1546  fhProbmassLcPtSig->Fill(d->Pt(), invMassLcpiKp);
1547  if(fIsLc==1)fhProbmassLcPtSigc->Fill(d->Pt(), invMassLcpiKp);
1548  if(fIsLc==2)fhProbmassLcPtSigb->Fill(d->Pt(), invMassLcpiKp);
1549  }
1550 
1551  // mis id'd signal candidates
1552  if(ispKpiMC && selection==2){ //RDHF PID
1553  fhPtMisIdpKpi->Fill(fCandidateVars[0]);
1554  fhInvMassMisIdpKpi->Fill(fCandidateVars[0],invMassLcpiKp);
1555  }
1556  else if(ispiKpMC && selection==1){
1557  fhPtMisIdpiKp->Fill(fCandidateVars[0]);
1558  fhInvMassMisIdpiKp->Fill(fCandidateVars[0],invMassLcpKpi);
1559  }
1560  else fhPtCorrId->Fill(fCandidateVars[0]);
1561 
1562  if(ispKpiMC && selectionProb==2){ //PID using max prob. criteria
1564  fhInvMassMisIdpKpiProb->Fill(fCandidateVars[0],invMassLcpiKp);
1565  }
1566  else if(ispiKpMC && selectionProb==1){
1568  fhInvMassMisIdpiKpProb->Fill(fCandidateVars[0],invMassLcpKpi);
1569  }
1570  else fhPtCorrIdProb->Fill(fCandidateVars[0]);
1571 
1572  }
1573  }
1574  //Bkg
1575  if(!fReadMC || (fIsLc==0 && (!IsInjected || fSyst ==0))) { //data or non-injected background or pp background
1576  //MC PID
1577  if(fReadMC) fhMCmassLcPt->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1578  //Real PID
1579  if(selection==1){
1580  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpKpi);
1581  }
1582  else if(selection==2){
1583  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpiKp);
1584  }
1585  else if(selection==3){
1586  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpiKp,0.5);
1587  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpKpi,0.5);
1588  }
1589  //max prob PID
1590  if(selectionProb==1) fhProbmassLcPt->Fill(d->Pt(),invMassLcpKpi);
1591  else if(selectionProb==2) fhProbmassLcPt->Fill(d->Pt(),invMassLcpiKp);
1592  }
1593 }
1594 
1595 //---------------------------
1596 
1598  TClonesArray *arrayMC, Int_t selection)
1599 {
1600  //
1602  //
1603 
1604  if(fReadMC && !fKeepBkgNt && fIsLc==0) return; //don't continue if bkg and only want signal
1605 
1606  Bool_t IsInjected = 0;
1607  Bool_t IsLc = 0;
1608  Bool_t IsLcfromLb = 0;
1609 
1610  if(fReadMC){
1611  AliAODMCHeader *mcHeader3 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1612  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(part,mcHeader3,arrayMC); //for dedicated MC set to 0
1613  }
1614  if(fIsLc>=1 && fIsLc<=2) IsLc=kTRUE;
1615  if(fIsLc==2) IsLcfromLb=kTRUE;
1616  if(fReadMC && IsInjected && !IsLc && fSyst >=1 ) return; //dont fill if injected bkg, pPb or PbPb
1617 
1618  Double_t invMasspKpi=-1.;
1619  Double_t invMasspiKp=-1.;
1620  //apply MC PID
1621  if(fReadMC && fMCPid){
1622  if(IspKpiMC(part,arrayMC)) invMasspKpi=part->InvMassLcpKpi();
1623  else if(IspiKpMC(part,arrayMC)) invMasspiKp=part->InvMassLcpiKp();
1624  //else return;
1625  }
1626  // apply realistic PID
1627  if(fRealPid){
1628  if(selection==1 || selection==3) invMasspKpi=part->InvMassLcpKpi();
1629  else if(selection>=2) invMasspiKp=part->InvMassLcpiKp();
1630  }
1631  // Float_t centrality=fRDCutsAnalysis->GetCentrality(aod);
1632  // Int_t runNumber=aod->GetRunNumber();
1633 
1634  //fill ntuple
1635  // 1 - loose pid
1636  // 2 - bayesian pid
1637  Float_t tmp[58];
1638  //Is Lc
1639  if(!IsInjected && IsLc==0) tmp[0]=0; //non-injected bkg
1640  else if(IsLc==1 && !IsLcfromLb) tmp[0]=1; //prompt Lc
1641  else if(IsLc==1 && IsLcfromLb) tmp[0]=2; //non-prompt Lc
1642  else if(IsInjected && IsLc==0) tmp[0]=3; //injected bkg
1643  else tmp[0]=-99; //should not happen
1644 
1645  //invariant mass
1646  tmp[2]=part->InvMassLcpiKp();
1647  tmp[1]=part->InvMassLcpKpi();
1648  tmp[3]=part->Charge();
1649  //pt of decay products
1650  tmp[4]=part->PtProng(0);
1651  tmp[5]=part->PtProng(1); //pt kaon
1652  tmp[6]=part->PtProng(2);
1653  Float_t ptLc=part->Pt();
1654  tmp[7]=ptLc;
1655  tmp[8]=part->CosPointingAngle();
1656  tmp[9]=part->DecayLength();
1657  tmp[10]=part->NormalizedDecayLength();
1658  tmp[11]=TMath::Min(part->GetDist12toPrim(),part->GetDist23toPrim());
1659  tmp[12]=part->GetSigmaVert();
1660  Double_t dcas[3]={0};
1661  part->GetDCAs(dcas);
1662  tmp[13]=TMath::Max(dcas[0],TMath::Max(dcas[1],dcas[2]));
1663  tmp[14]=part->DecayLengthXY();
1664  tmp[15]=part->NormalizedDecayLengthXY();
1665 
1666  //Check resonant decays for efficiencies
1667  tmp[16]=fIsLcResonant; // bkg
1668  //PID selection
1669  tmp[17]=selection;
1670  //FONLL weights
1671 
1672  AliVTrack *track0=dynamic_cast<AliVTrack*>(part->GetDaughter(0));
1673  AliVTrack *track1=dynamic_cast<AliVTrack*>(part->GetDaughter(1));
1674  AliVTrack *track2=dynamic_cast<AliVTrack*>(part->GetDaughter(2));
1675  if(fRDCutsAnalysis->GetPidHF()->GetUseCombined()) {//check this
1676  //bayesian probabilities
1677  Double_t prob0[AliPID::kSPECIES];
1678  Double_t prob1[AliPID::kSPECIES];
1679  Double_t prob2[AliPID::kSPECIES];
1680 
1681  if (!track0 || !track1 || !track2) {
1682  AliError("AliVTrack missing - wont fill Ntuple");
1683  return;
1684  }
1685  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track0,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob0);
1686  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track1,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob1);
1687  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track2,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob2);
1688  //if(prob0[AliPID::kPion] < 0.3 && prob0[AliPID::kProton] < 0.3) return;
1689  //if(prob1[AliPID::kKaon] < 0.3) return;
1690  //if(prob2[AliPID::kPion] < 0.3 && prob2[AliPID::kProton] < 0.3) return;
1691  tmp[18]=prob0[AliPID::kPion]; //track 0, pion
1692  tmp[19]=prob0[AliPID::kKaon]; //kaon
1693  tmp[20]=prob0[AliPID::kProton]; //proton
1694  tmp[21]=prob1[AliPID::kPion]; //track 1, pion
1695  tmp[22]=prob1[AliPID::kKaon]; //kaon
1696  tmp[23]=prob1[AliPID::kProton]; //proton
1697  tmp[24]=prob2[AliPID::kPion]; //track 2, pion
1698  tmp[25]=prob2[AliPID::kKaon]; //kaon
1699  tmp[26]=prob2[AliPID::kProton]; //proton
1700  }
1701  else {
1702  //fill w 0
1703  for(Int_t iprob=18;iprob<=26;iprob++) {
1704  tmp[iprob]=-1;
1705  }
1706  }
1707  if(fFillNtuple>=2) { //fill with further variables
1708  Double_t d00 = part->Getd0Prong(0);
1709  Double_t d01 = part->Getd0Prong(1);
1710  Double_t d02 = part->Getd0Prong(2);
1711  Double_t d0err0 = part->Getd0errProng(0);
1712  Double_t d0err1 = part->Getd0errProng(1);
1713  Double_t d0err2 = part->Getd0errProng(2);
1714  tmp[27]=d00;
1715  tmp[28]=d01;
1716  tmp[29]=d02;
1717  tmp[30]=d00*d00 + d01*d01 + d02*d02;
1718  tmp[31]=d00/d0err0;
1719  tmp[32]=d01/d0err1;
1720  tmp[33]=d02/d0err2;
1721  Double_t dd0,edd0;
1722  Double_t dd1,edd1;
1723  Double_t dd2,edd2;
1724  part->Getd0MeasMinusExpProng(0,aod->GetMagneticField(),dd0,edd0);
1725  part->Getd0MeasMinusExpProng(1,aod->GetMagneticField(),dd1,edd1);
1726  part->Getd0MeasMinusExpProng(2,aod->GetMagneticField(),dd2,edd2);
1727  Double_t ns0=dd0/edd0;
1728  Double_t ns1=dd1/edd1;
1729  Double_t ns2=dd2/edd2;
1730  tmp[34]=ns0;
1731  tmp[35]=ns1;
1732  tmp[36]=ns2;
1733  tmp[37]=part->CosPointingAngleXY();
1734  tmp[13]=dcas[0];
1735  tmp[38]=dcas[1];
1736  tmp[39]=dcas[2];
1737  tmp[11]=part->GetDist12toPrim();
1738  tmp[40]=part->GetDist23toPrim();
1739  Int_t runNumber=aod->GetRunNumber();
1740  tmp[41]=(Float_t)runNumber;
1741 
1742  if(fFillNtuple>=3) { //fill with weights
1743  Double_t ptLcMC=-1;
1744  //D meson weights
1745  Double_t weightPythia=-1,weight7LHC10f6a=-1,weight5LHC10f6a=-1,weight5LHC13d3=-1;
1746  //Lc weights
1747  Double_t weight7LHC10f7aLc=-1,weight7LHC11b2Lc=-1,weight5LHC13d3Lc=-1;
1748  if(IsLc) {
1749  //Get MC Lc to get true pT
1750  Int_t labDp = -1;
1751  Int_t pdgCand =4122;
1752  Int_t pdgDaughter[3]={-1,-1,-1};
1753  pdgDaughter[0]=2212;
1754  pdgDaughter[1]=321;
1755  pdgDaughter[2]=211;
1756  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
1757  if(labDp>=0){
1758  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(labDp);
1759  ptLcMC = motherPart->Pt();
1760  weightPythia = fFuncWeightPythia->Eval(ptLcMC);
1761  weight7LHC10f6a = fFuncWeightFONLL7overLHC10f6a->Eval(ptLcMC);
1762  weight5LHC10f6a = fFuncWeightFONLL5overLHC10f6a->Eval(ptLcMC);
1763  weight5LHC13d3 = fFuncWeightFONLL5overLHC13d3->Eval(ptLcMC);
1764  weight5LHC13d3Lc = fFuncWeightFONLL5overLHC13d3Lc->Eval(ptLcMC);
1765  weight7LHC11b2Lc = fFuncWeightFONLL7overLHC11b2Lc->Eval(ptLcMC);
1766  weight7LHC10f7aLc = fFuncWeightFONLL7overLHC10f7aLc->Eval(ptLcMC);
1767  }
1768  }
1769  tmp[42]=ptLcMC;
1770  tmp[43]=weightPythia;
1771  tmp[44]=weight7LHC10f6a;
1772  tmp[45]=weight5LHC10f6a;
1773  tmp[46]=weight5LHC13d3;
1774  tmp[47]=weight5LHC13d3Lc;
1775  tmp[48]=weight7LHC11b2Lc;
1776  tmp[49]=weight7LHC10f7aLc;
1777 
1778  //Multiplicity weights
1779  Double_t multWeight = 1.;
1780  Double_t nTracklets = 0.;
1781  if(fUseNchWeight){
1782  //tracklets within |eta| < 1.
1783  nTracklets = static_cast<Int_t>(fVertUtil->GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
1784  multWeight *= GetNchWeight(static_cast<Int_t>(nTracklets));
1785  AliDebug(2,Form("Using Nch weights, Mult=%f Weight=%f\n",nTracklets,multWeight));
1786  }
1787  tmp[50]=nTracklets;
1788  tmp[51]=multWeight;
1789 
1790 
1791  if(fFillNtuple>=4) { //fill with invariant mass of 2 prongs
1792  tmp[52]=part->InvMass2Prongs(1,0,321,2212); //inv mass pK
1793  tmp[53]=part->InvMass2Prongs(2,1,211,321); //inv mass Kpi
1794  tmp[54]=part->InvMass2Prongs(2,0,211,2212);//inv mass ppi
1795  tmp[55]=part->InvMass2Prongs(1,2,321,2212); //inv mass Kp
1796  tmp[56]=part->InvMass2Prongs(0,1,211,321); //inv mass piK
1797  tmp[57]=part->InvMass2Prongs(0,2,211,2212);//inv mass pip
1798  }
1799  }
1800  }
1801  fNtupleLambdac->Fill(tmp);
1802  PostData(5,fNtupleLambdac);
1803 
1804  return;
1805 }
1806 
1807 //---------------------------
1808 
1810 
1811  //
1814  //
1815 
1816  //fill according to kStep - hArray[nSteps]
1817  if(!fIsLc) {
1818  fhNBkgNI[kStep]->Fill(fCandidateVars[0]);
1819  fhPtEtaBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1820  fhPtYBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1821  fhPtPhiBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1822  }
1823 
1824  else{
1825  fhNLc[kStep]->Fill(fCandidateVars[0]);
1826  fhPtEtaLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1827  fhPtYLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1828  fhPtPhiLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1829 
1830  if(fIsLc==1) { //prompt Lc
1831  fhNLcc[kStep]->Fill(fCandidateVars[0]);
1832  fhPtEtaLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1833  fhPtYLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1834  fhPtPhiLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1835  if(fIsLcResonant==1){
1836  fhNLcNonRc[kStep]->Fill(fCandidateVars[0]);
1837  fhPtEtaLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1838  fhPtYLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1839  fhPtPhiLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1840  }
1841  else if(fIsLcResonant==2){
1842  fhNLcL1520c[kStep]->Fill(fCandidateVars[0]);
1843  fhPtEtaLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1844  fhPtYLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1845  fhPtPhiLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1846  }
1847  else if(fIsLcResonant==3){
1848  fhNLcKstarc[kStep]->Fill(fCandidateVars[0]);
1849  fhPtEtaLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1850  fhPtYLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1851  fhPtPhiLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1852  }
1853  else if(fIsLcResonant==4){
1854  fhNLcDeltac[kStep]->Fill(fCandidateVars[0]);
1855  fhPtEtaLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1856  fhPtYLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1857  fhPtPhiLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1858  }
1859  }
1860  else if(fIsLc==2) { //non-prompt Lc
1861  fhNLcb[kStep]->Fill(fCandidateVars[0]);
1862  fhPtEtaLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1863  fhPtYLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1864  fhPtPhiLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1865  if(fIsLcResonant==1){
1866  fhNLcNonRb[kStep]->Fill(fCandidateVars[0]);
1867  fhPtEtaLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1868  fhPtYLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1869  fhPtPhiLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1870  }
1871  else if(fIsLcResonant==2){
1872  fhNLcL1520b[kStep]->Fill(fCandidateVars[0]);
1873  fhPtEtaLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1874  fhPtYLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1875  fhPtPhiLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1876  }
1877  else if(fIsLcResonant==3){
1878  fhNLcKstarb[kStep]->Fill(fCandidateVars[0]);
1879  fhPtEtaLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1880  fhPtYLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1881  fhPtPhiLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1882  }
1883  else if(fIsLcResonant==4){
1884  fhNLcDeltab[kStep]->Fill(fCandidateVars[0]);
1885  fhPtEtaLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1886  fhPtYLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1887  fhPtPhiLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1888  }
1889  }
1890  }
1891 }
1892 
1893 //-----------------------------
1894 
1896 
1897  //
1899  //
1900 
1901  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1902  for(Int_t i=0;i<3;i++){
1903  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1904  lab[i]=daugh->GetLabel();
1905  if(lab[i]<0) return kFALSE;
1906  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1907  if(!part) return kFALSE;
1908  pdgs[i]=TMath::Abs(part->GetPdgCode());
1909  }
1910 
1911  if(pdgs[0]==2212 && pdgs[1]==321 && pdgs[2]==211) return kTRUE;
1912 
1913  return kFALSE;
1914 }
1915 //-----------------------------
1917 
1918  //
1920  //
1921 
1922  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1923  for(Int_t i=0;i<3;i++){
1924  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1925  lab[i]=daugh->GetLabel();
1926  if(lab[i]<0) return kFALSE;
1927  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1928  if(!part) return kFALSE;
1929  pdgs[i]=TMath::Abs(part->GetPdgCode());
1930  }
1931 
1932  if(pdgs[2]==2212 && pdgs[1]==321 && pdgs[0]==211) {return kTRUE;}
1933 
1934  return kFALSE;
1935 }
1936 
1938  if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) hSelectionBits->Fill(1,fCandidateVars[0]);
1939  if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiPID)) hSelectionBits->Fill(2,fCandidateVars[0]);
1940  if(d->HasSelectionBit(AliRDHFCuts::kD0fromDstarCuts)) hSelectionBits->Fill(3,fCandidateVars[0]);
1941  if(d->HasSelectionBit(AliRDHFCuts::kD0fromDstarPID)) hSelectionBits->Fill(4,fCandidateVars[0]);
1942  if(d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) hSelectionBits->Fill(5,fCandidateVars[0]);
1943  if(d->HasSelectionBit(AliRDHFCuts::kDplusPID)) hSelectionBits->Fill(6,fCandidateVars[0]);
1944  if(d->HasSelectionBit(AliRDHFCuts::kDsCuts)) hSelectionBits->Fill(7,fCandidateVars[0]);
1945  if(d->HasSelectionBit(AliRDHFCuts::kDsPID)) hSelectionBits->Fill(8,fCandidateVars[0]);
1946  if(d->HasSelectionBit(AliRDHFCuts::kLcCuts)) hSelectionBits->Fill(9,fCandidateVars[0]);
1947  if(d->HasSelectionBit(AliRDHFCuts::kLcPID)) hSelectionBits->Fill(10,fCandidateVars[0]);
1948  if(d->HasSelectionBit(AliRDHFCuts::kDstarCuts)) hSelectionBits->Fill(11,fCandidateVars[0]);
1949  if(d->HasSelectionBit(AliRDHFCuts::kDstarPID)) hSelectionBits->Fill(12,fCandidateVars[0]);
1950 }
1951 
1952 //-----------------------------
1953 
1955 
1956  Int_t selection = 0;
1957 
1958  if(fRDCutsAnalysis->GetPidHF()->GetUseCombined()) {//check this
1959  AliVTrack *track0=dynamic_cast<AliVTrack*>(part->GetDaughter(0));
1960  AliVTrack *track1=dynamic_cast<AliVTrack*>(part->GetDaughter(1));
1961  AliVTrack *track2=dynamic_cast<AliVTrack*>(part->GetDaughter(2));
1962  //bayesian probabilities
1963  Double_t prob0[AliPID::kSPECIES];
1964  Double_t prob1[AliPID::kSPECIES];
1965  Double_t prob2[AliPID::kSPECIES];
1966 
1967  if (!track0 || !track1 || !track2) {
1968  AliError("AliVTrack missing");
1969  return 0;
1970  }
1971  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track0,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob0);
1972  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track1,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob1);
1973  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track2,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob2);
1974  if(prob0[AliPID::kProton] * prob1[AliPID::kKaon] * prob2[AliPID::kPion] > prob2[AliPID::kProton] * prob1[AliPID::kKaon] * prob0[AliPID::kPion]) selection = 1; // pKpi
1975  else selection = 2; // piKp
1976  }
1977  return selection;
1978 }
1979 
1981  //
1982  // calculates the Nch weight using the measured and generateed Nch distributions
1983  //
1984  if(nch<=0) return 0.;
1985  if(!fHistoMCNch) { AliError("Input histos to evaluate Nch weights missing"); return 0.; }
1986  Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1987  Double_t weight = pMC;
1988  return weight;
1989 }
1990 
1992  TClonesArray *arrayMC)
1993 {
1994  //
1998  //
1999 
2000  Bool_t IsInjected = 0;
2001  Bool_t IsLc = 0;
2002  Bool_t IsLcfromLb = 0;
2003 
2004  if(fReadMC){
2005  AliAODMCHeader *mcHeader3 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
2006  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(part,mcHeader3,arrayMC); //for dedicated MC set to 0
2007  }
2008  if(fIsLc>=1 && fIsLc<=2) IsLc=kTRUE;
2009  if(fIsLc==2) IsLcfromLb=kTRUE;
2010  if(fReadMC && IsInjected && !IsLc && fSyst >=1 ) return; //dont fill if injected bkg, pPb or PbPb
2011 
2012  Float_t tmp[15];
2013  //Is Lc
2014  if(!IsInjected && IsLc==0) tmp[0]=0; //non-injected bkg
2015  else if(IsLc==1 && !IsLcfromLb) tmp[0]=1; //prompt Lc
2016  else if(IsLc==1 && IsLcfromLb) tmp[0]=2; //non-prompt Lc
2017  else if(IsInjected && IsLc==0) tmp[0]=3; //injected bkg
2018  else tmp[0]=-99; //should not happen
2019  tmp[1]=part->Pt();
2020  //Get MC Lc to get true pT
2021  Float_t ptLcMC=0;
2022  Int_t labDp = -1;
2023  Int_t pdgCand =4122;
2024  Int_t pdgDaughter[3]={-1,-1,-1};
2025  pdgDaughter[0]=2212;
2026  pdgDaughter[1]=321;
2027  pdgDaughter[2]=211;
2028  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
2029  if(labDp>=0){
2030  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(labDp);
2031  ptLcMC = motherPart->Pt();
2032  }
2033  tmp[2]=ptLcMC;
2034 
2035  tmp[3]=part->PtProng(0);
2036  tmp[4]=part->PtProng(1); //pt kaon
2037  tmp[5]=part->PtProng(2);
2038  // Is the track good for TOF PID (for pp proton GEANT3/FLUKA correction)
2039  // and MC pt of each track
2040  Bool_t isTOFpid[3];
2041  Float_t MCpt[3];
2042  for(Int_t i=0;i<3;i++) {
2043  AliAODTrack *daugh=(AliAODTrack*)part->GetDaughter(i);
2044  Int_t daughLab= daugh->GetLabel();
2045  if(daughLab<0) continue;
2046  else{
2047  AliAODMCParticle* pdaugh = dynamic_cast<AliAODMCParticle*>(arrayMC->At(daughLab));
2048  isTOFpid[i] = fRDCutsAnalysis->GetPidHF()->CheckTOFPIDStatus(daugh);
2049  MCpt[i] = pdaugh->Pt();
2050  }
2051  }
2052  tmp[6]=MCpt[0];
2053  tmp[7]=MCpt[1];
2054  tmp[8]=MCpt[2];
2055  tmp[9]=isTOFpid[0];
2056  tmp[10]=isTOFpid[1];
2057  tmp[11]=isTOFpid[2];
2058 
2059  // Selection
2060  Int_t selectionCand=fRDCutsAnalysis->IsSelected(part,AliRDHFCuts::kCandidate,aod);
2061  Int_t selectionPID=fRDCutsAnalysis->IsSelected(part,AliRDHFCuts::kPID,aod);
2062  Int_t selectionPIDprob = GetPIDselectionMaxProb(part);
2063  tmp[12]=selectionCand;
2064  tmp[13]=selectionPID;
2065  tmp[14]=selectionPIDprob;
2066 
2067 // Bool_t ispKpiMC = IspKpiMC(part,arrayMC);
2068 // Bool_t ispiKpMC = IspiKpMC(part,arrayMC);
2069 
2070 // tmp[15] = ispKpiMC?1:ispiKpMC?2:0;
2071 
2072  fNtupleLambdacReco->Fill(tmp);
2073  PostData(6,fNtupleLambdacReco);
2074 }
Double_t NormalizedDecayLengthXY() const
Double_t NormalizedDecayLength() const
Bool_t fLcCut
Vertexer heavy flavour (used to pass the cuts)
TH2F * fhMCmassLcPtSig
!Lc signal invariant mass vs pt
TH2F * fhPtYLcNonRb[12]
! hist. for n Lc from b non resonant, pT vs rapidity
Bool_t fRealPid
flag for access to MC
TH2F * fhInvMassMisIdpKpiProb
! hist for inv mass pKpi signal mis id'd as piKp most prob PID
TH1F * fhIsLcGen
!hist for resonant flag gen
TH2F * fhPtPhiLcDeltac[12]
! hist. for n Lc from c Delta++ + K, pT vs phi
TH2F * fhPtEtaLcDeltab[12]
! hist. for n Lc from b Delta++ + K, pT vs eta
TH2F * fhPtPhiLc[12]
! hist. for n Lc tot., pT vs phi
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
void FillSelectionBits(AliAODRecoDecayHF3Prong *d, TH2F *hSelectionBits)
TH2F * fhProbmassLcPtSigb
!Lc from b signal invariant mass vs pt
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
TH2F * fhPtEtaBkgNI[12]
! hist. for n bkg, pT vs eta
Bool_t HasSelectionBit(Int_t i) const
TH1F * fhNLcL1520c[12]
! hist. for n Lc from c L1520 + pi, pT
Bool_t GetUseCombined()
Definition: AliAODPidHF.h:165
TH1F * fhNLcb[12]
! hist. for n Lc tot. from b, pT
TH2F * fhPIDmassLcPtSig
!Lc signal invariant mass vs pt
virtual void Terminate(Option_t *option)
Bool_t CheckTOFPIDStatus(AliAODTrack *track) const
Int_t GetPIDselectionMaxProb(AliAODRecoDecayHF3Prong *part)
TList * fOutput
! list send on output slot 0
void FillNtuple(AliAODEvent *aod, AliAODRecoDecayHF3Prong *part, TClonesArray *arrayMC, Int_t selection)
TH2F * fhInvMassMisIdpKpi
! hist for inv mass pKpi signal mis id'd as piKp
Int_t LambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC, Bool_t &isInAcc) const
TH2F * fhPtPhiLcc[12]
! hist. for n Lc tot. from c, pT vs phi
TH2F * fhPIDmassLcPtSigb
!Lc from b signal invariant mass vs pt
TH2F * fhProbmassLcPtSigc
!Lc from c signal invariant mass vs pt
Float_t fUpmasslimit
pt of Lc candidate
TF1 * fFuncWeightFONLL7overLHC10f7aLc
! weight function for FONLL vs p prod. Lc
Float_t fCandidateVars[4]
is Lc resonant - 1=non resonant, 2=via L1520 + pi, 3=via K* + p, 4=via Delta++ + K ...
TH2F * fhPtYLc[12]
! hist. for n Lc tot., pT vs rapidity
Int_t GetWhyRejection() const
Definition: AliRDHFCuts.h:294
Double_t CosPointingAngleXY() const
void FillRecoNtuple(AliAODEvent *aod, AliAODRecoDecayHF3Prong *part, TClonesArray *arrayMC)
TF1 * fFuncWeightFONLL7overLHC11b2Lc
! weight function for FONLL vs p prod. Lc
ULong_t GetSelectionMap() const
TH1F * fhPtMisIdpiKpProb
! hist for pt pKpi signal mis id'd as piKp most prob PID
void FillMassHists(AliAODEvent *aod, AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Int_t selection, Int_t selectionProb)
TH2F * fhPtYLcNonRc[12]
! hist. for n Lc from c non resonant, pT vs rapidity
TH2F * fhPtYLcc[12]
! hist. for n Lc tot. from c, pT vs rapidity
AliPIDResponse * fPIDResponse
histo with number of entries
TH1F * fhPtCorrId
! hist for correctly id'd pKpi
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:241
Bool_t fKeepLcNotFromQuark
filling ntuple type reco
TH2F * fhPtEtaLc[12]
! hist. for n Lc tot., pT vs eta
TH2F * fhPtEtaLcKstarc[12]
! hist. for n Lc from c K* + p, pT vs eta
TNtuple * fNtupleLambdacReco
! output ntuple after reconstruction
TH2F * fhPtEtaLcL1520c[12]
! hist. for n Lc from c L1520 + pi, pT vs eta
TH2F * fhPtEtaLcNonRc[12]
! hist. for n Lc from c non resonant, pT vs eta
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
TH2F * fhPtYLcDeltab[12]
! hist. for n Lc from b Delta++ + K, pT vs rapidity
AliNormalizationCounter * fCounter
!AliNormalizationCounter on output slot 7
TF1 * fFuncWeightPythia
! weight function for Pythia vs pPb prod.
void SetLambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC, Bool_t &isInAcc)
Int_t fFillNtupleReco
filling ntuple type
Bool_t fReadMC
flag for collision system. 0=pp, 1=PbPb, 2=pPb
TH2F * fhPtPhiLcKstarc[12]
! hist. for n Lc from c K* + p, pT vs phi
TH1F * fhNLcDeltac[12]
! hist. for n Lc from c Delta++ + K, pT
Int_t MatchToMCLambdac(AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC) const
TH2F * fhInvMassMisIdpiKpProb
! hist for inv mass pKpi signal mis id'd as piKp most prob PID
TH2F * fhMCmassLcPt
!Lc Bkg+signal invariant mass vs pt
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
TH2F * fhPtEtaLcL1520b[12]
! hist. for n Lc from b L1520 + pi, pT vs eta
Int_t fSyst
flag to keep background in
TH2F * fhPtYLcDeltac[12]
! hist. for n Lc from c Delta++ + K, pT vs rapidity
TH2F * fhPIDmassLcPtSigc
!Lc from c signal invariant mass vs pt
TH2F * fhPtYLcL1520b[12]
! hist. for n Lc from b L1520 + pi, pT vs rapidity
TH2F * fhPtPhiLcb[12]
! hist. for n Lc tot. from b, pT vs phi
AliPIDCombined * GetPidCombined() const
Definition: AliAODPidHF.h:161
TH2F * fhProbmassLcPtSig
!Lc signal invariant mass vs pt
TH2F * fhSelectionBits
! hist for ALL Filter bits
TH2F * fhInvMassMisIdpiKp
! hist for inv mass pKpi signal mis id'd as piKp
TNtuple * fNtupleLambdac
! output ntuple
TH2F * fhPtPhiLcL1520c[12]
! hist. for n Lc from c L1520 + pi, pT vs phi
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
TH1F * fhNLcc[12]
! hist. for n Lc tot. from c, pT
TH1F * fhSelectBit
! hist for Filter Bit
TH1F * fhIsLcResonantGen
!hist for resonant flag gen
TH2F * fhSelectionBitsSigb
! hist for ALL Filter bits Lc from b
Bool_t IspiKpMC(AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC) const
TH2F * fhPtYBkgNI[12]
! hist. for n bkg, pT vs rapidity
AliAODVertex * GetOwnPrimaryVtx() const
TH2F * fhPtPhiLcDeltab[12]
! hist. for n Lc from b Delta++ + K, pT vs phi
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
AliAODPidHF * GetPidprot() const
TH1F * fhNLcKstarb[12]
! hist. for n Lc from b K* + p, pT
TH1F * fNentries
flag for whether Lc is from Hijing
AliAnalysisVertexingHF * fVHF
apply analysis cuts
Bool_t fKeepBkgNt
flag to keep Lc not from quark
Double_t Getd0errProng(Int_t ip) const
prongs
TH1F * fhNBkgNI[12]
! hist. for n bkg, pT
TH2F * fhPIDmassLcPt
!Lc Bkg+signal invariant mass vs pt
TH2F * fhPtPhiLcNonRb[12]
! hist. for n Lc from b non resonant, pT vs phi
TH2F * fhPtEtaLcc[12]
! hist. for n Lc tot. from c, pT vs eta
TH2F * fhMCmassLcPtSigc
!Lc from c signal invariant mass vs pt
Bool_t IspKpiMC(AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC) const
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
Float_t fLowmasslimit
upper inv mass limit for histos
Bool_t IsCandidateInjected(AliAODRecoDecayHF *cand, AliAODMCHeader *header, TClonesArray *arrayMC)
TH2F * fhProbmassLcPt
!Lc Bkg+signal invariant mass vs pt
TH1F * fhPtMisIdpiKp
! hist for pt pKpi signal mis id'd as piKp
void GetDCAs(Double_t dca[3]) const
AliAODPidHF * GetPidpion() const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Bool_t GetLambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC) const
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Double_t DecayLengthXY() const
virtual void UserExec(Option_t *option)
TH2F * fhPtPhiLcL1520b[12]
! hist. for n Lc from b L1520 + pi, pT vs phi
TH1F * fhSetIsLc
! hist for before/after reco check MC LC
TH2F * fhPtEtaLcDeltac[12]
! hist. for n Lc from c Delta++ + K, pT vs eta
TH2F * fhPtPhiBkgNI[12]
! hist. for n bkg, pT vs phi
TH1F * fHistNEvents
!hist. for No. of events
TH2F * fhPtYLcb[12]
! hist. for n Lc tot. from b, pT vs rapidity
Bool_t IsEventSelected(AliVEvent *event)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
TH2F * fhPtPhiLcKstarb[12]
! hist. for n Lc from b K* + p, pT vs phi
TF1 * fFuncWeightFONLL5overLHC10f6a
! weight function for FONLL vs p prod.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
void SetOldPid(Bool_t oldPid)
Definition: AliAODPidHF.h:108
TH2F * fhPtYLcKstarb[12]
! hist. for n Lc from b K* + p, pT vs rapidity
TH2F * fhPtYLcL1520c[12]
! hist. for n Lc from c L1520 + pi, pT vs rapidity
TF1 * fFuncWeightFONLL7overLHC10f6a
! weight function for FONLL vs p prod.
TH1F * fhNLcL1520b[12]
! hist. for n Lc from b L1520 + pi, pT
TH1F * fhPtMisIdpKpiProb
! hist for pt pKpi signal mis id'd as piKp most prob PID
TH1F * fhNLcNonRc[12]
! hist. for n Lc from c non resonant, pT
TH2F * fhPtEtaLcb[12]
! hist. for n Lc tot. from b, pT vs eta
void SetIsLcReco(AliAODRecoDecayHF3Prong *part, TClonesArray *arrayMC)
TH1F * fhIsLcReco
!hist for resonant flag reco
Bool_t GetIsUsePID() const
Definition: AliRDHFCuts.h:254
TH2F * fhPtPhiLcNonRc[12]
! hist. for n Lc from c non resonant, pT vs phi
TH1F * fhIsLcResonantReco
!hist for resonant flag reco
TH1F * fhNLcNonRb[12]
! hist. for n Lc from b non resonant, pT
TH2F * fhPtYLcKstarc[12]
! hist. for n Lc from c K* + p, pT vs rapidity
TH2F * fhMCmassLcPtSigb
!Lc from b signal invariant mass vs pt
Double_t CosPointingAngle() const
TH1F * fhPtMisIdpKpi
! hist for pt pKpi signal mis id'd as piKp
TH1F * fhNLc[12]
! hist. for n Lc tot., pT
TF1 * fFuncWeightFONLL5overLHC13d3Lc
! weight function for FONLL vs pPb prod. Lc
TH1F * fhNLcKstarc[12]
! hist. for n Lc from c K* + p, pT
void SetIsLcGen(AliAODMCParticle *partMC, TClonesArray *arrayMC)
Int_t fIsLcResonant
is MC Lc - 0=not Lc, 1=Lc from c, 2=Lc from b
Int_t PtBin(Double_t pt) const
TH1F * fhNLcDeltab[12]
! hist. for n Lc from b Delta++ + K, pT
Double_t DecayLength() const
TH1F * fHistoMCNch
flag for using multiplicity weights
TH2F * fhSelectionBitsSigc
! hist for ALL Filter bits Lc from c
TH2F * fhPtEtaLcNonRb[12]
! hist. for n Lc from b non resonant, pT vs eta
TH2F * fhPtEtaLcKstarb[12]
! hist. for n Lc from b K* + p, pT vs eta
Bool_t fIsHijing
flag for Lc filter bit PID
TF1 * fFuncWeightFONLL5overLHC13d3
! weight function for FONLL vs pPb prod.
Bool_t fMCPid
flag for access to MC
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111
Class with functions useful for different D2H analyses //.
TH1F * fhPtCorrIdProb
! hist for correctly id'd pKpi most prob PID
Bool_t fLcPIDCut
flag for Lc filter bit cut
AliRDHFCutsLctopKpi * fRDCutsAnalysis
lower inv mass limit for histos