AliPhysics  ec7afe5 (ec7afe5)
 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  //________________________________________________________________________
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  // fhChi2 = new TH1F("fhChi2", "Chi2",100,0.,10.);
814  // fhChi2->Sumw2();
815  // fOutput->Add(fhChi2);
816 
817  fNentries=new TH1F("fNentries", "n Events/Candidates QA", 16,0.5,16.5);
818 
819  //Event and candidate QA - entries at each step
820  fNentries->GetXaxis()->SetBinLabel(1,"nEventsRejTM");
821  fNentries->GetXaxis()->SetBinLabel(2,"nEventsNoVtx");
822  fNentries->GetXaxis()->SetBinLabel(3,"nEventsRejCutPileup");
823  fNentries->GetXaxis()->SetBinLabel(4,"nLcGen");
824  fNentries->GetXaxis()->SetBinLabel(5,"nLcGenFidAcc");
825  fNentries->GetXaxis()->SetBinLabel(6,"nCandReco3Prong");
826  fNentries->GetXaxis()->SetBinLabel(7,"nCandLcBit");
827  fNentries->GetXaxis()->SetBinLabel(8,"nCandIsSelTracks");
828  fNentries->GetXaxis()->SetBinLabel(9,"nCandIsInFidAcc");
829  fNentries->GetXaxis()->SetBinLabel(10,"ptbin=-1");
830  fNentries->GetXaxis()->SetBinLabel(11,"nCandIsSelCand");
831  fNentries->GetXaxis()->SetBinLabel(12,"PID=0");
832  fNentries->GetXaxis()->SetBinLabel(13,"PID=1");
833  fNentries->GetXaxis()->SetBinLabel(14,"PID=2");
834  fNentries->GetXaxis()->SetBinLabel(15,"PID=3");
835  fNentries->GetXaxis()->SetBinLabel(16,"nLcSelected");
836  fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
837 
838  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
839  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
840  fPIDResponse = inputHandler->GetPIDResponse();
841 
846  fRDCutsAnalysis->GetPidHF()->SetOldPid(kFALSE);
849  }
850 
851 
852  PostData(1,fOutput);
853  PostData(3,fNentries);
854 
855  TString normName="NormalizationCounter";
856  AliAnalysisDataContainer *cont = GetOutputSlot(4)->GetContainer();
857  if(cont)normName=(TString)cont->GetName();
858  fCounter = new AliNormalizationCounter(normName.Data());
859  fCounter->Init();
860  PostData(4,fCounter);
861  if (fFillNtuple) {
862  //basic ntuple
863  TString ntName="fNtupleLambdac";
864  AliAnalysisDataContainer *contnt = GetOutputSlot(5)->GetContainer();
865  if(contnt)ntName=(TString)contnt->GetName();
866  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");
867  //more variables
868  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");
869  //weights
870  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");
871  //2 prong decay products
872  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");
873  else AliFatal("Invalid fill ntuple argument");
874  PostData(5,fNtupleLambdac);
875 
876  }
877  if(fFillNtupleReco) {
878  //Reco ntuple
879  TString ntName="fNtupleLambdacReco";
880  AliAnalysisDataContainer *contntrec = GetOutputSlot(6)->GetContainer();
881  if(contntrec)ntName=(TString)contntrec->GetName();
882  fNtupleLambdacReco = new TNtuple(ntName.Data(), "Lc Reco", "isLcBkg:PtLc:PtLcMC:PtTr0:PtTr1:PtTr2:PtTr0MC:PtTr1MC:PtTr2MC:isTOFTr0:isTOFTr1:isTOFTr2:selectionCand:selectionPID:selectionPIDprob:Charge");
883  PostData(6,fNtupleLambdacReco);
884  }
885 
886  return;
887 }
888 
889 //________________________________________________________________________
891 {
892  //
895  //
896  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
897  //tmp
898  fHistNEvents->Fill(1); // count event
899  // Post the data already here
900 
901 
902  TClonesArray *array3Prong = 0;
903  TClonesArray *arrayLikeSign =0;
904  if(!aod && AODEvent() && IsStandardAOD()) {
905  // In case there is an AOD handler writing a standard AOD, use the AOD
906  // event in memory rather than the input (ESD) event.
907  aod = dynamic_cast<AliAODEvent*> (AODEvent());
908  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
909  // have to taken from the AOD event hold by the AliAODExtension
910  AliAODHandler* aodHandler = (AliAODHandler*)
911  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
912  if(aodHandler->GetExtensions()) {
913  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
914  AliAODEvent *aodFromExt = ext->GetAOD();
915  array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
916  arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject("LikeSign3Prong");
917  }
918  } else if(aod) {
919  array3Prong=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
920  arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject("LikeSign3Prong");
921  }
922 
923  if(!aod) return;
924 
925  TClonesArray *arrayMC=0;
926  AliAODMCHeader *mcHeader=0;
927 
928  // load MC particles
929  if(fReadMC){
930 
931  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
932  if(!arrayMC) {
933  AliError("AliAnalysisTaskSELambdacTMVA::UserExec: MC particles branch not found!\n");
934  return;
935  }
936 
937 
938  // load MC header
939  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
940  if(!mcHeader) {
941  AliError("AliAnalysisTaskSELambdacTMVA::UserExec: MC header branch not found!\n");
942  return;
943  }
944  //if(TString(AliAODMCHeader::StdBranchName()).Contains("LHC15f2")) {
945  // AliInfo("LHC15f2 - fIsHijing==kTRUE");
946  // fIsHijing=kTRUE;
947  //}
948  //else {
949  // AliInfo("Not LHC15f2 - fIsHijing==kFALSE");
950  // fIsHijing=kFALSE;
951  //}
952  }
953 
954 
955  if(!array3Prong || !aod) {
956  AliError("AliAnalysisTaskSELambdacTMVA::UserExec: Charm3Prong branch not found!\n");
957  return;
958  }
959  if(!arrayLikeSign) {
960  AliDebug(2,"AliAnalysisTaskSELambdacTMVA::UserExec: LikeSign3Prong branch not found!\n");
961  // return;
962  }
963 
964  //Trigger mask = 0 rejection for LHC13d3
965  Int_t runnumber = aod->GetRunNumber();
966  if (aod->GetTriggerMask() == 0 && (runnumber >= 195344 && runnumber <= 195677)){
967  Int_t nentriesTM = arrayMC->GetEntriesFast();
968  AliDebug(2,Form("Event rejected because of null trigger mask, n entries = %i",nentriesTM));
969  fNentries->Fill(1);
970  return;
971  }
972 
973  // fix for temporary bug in ESDfilter
974  // the AODs with null vertex pointer didn't pass the PhysSel
975  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
976  if(!vtx1 || TMath::Abs(aod->GetMagneticField())<0.001) {
977  fNentries->Fill(2);
978  //return;
979  }
981  TString trigclass=aod->GetFiredTriggerClasses();
982  //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL"))
983 
984  //Bool_t isThereA3prongWithGoodTracks = kFALSE;
985  //Bool_t isThereA3ProngLcKine = kFALSE;
986  //Bool_t isThereA3ProngLcKineANDpid = kFALSE;
987  //Bool_t isThereA3ProngLcMC = kFALSE;
988  //Bool_t isThereA3ProngCyes = kFALSE;
989  //Bool_t isThereA3ProngByes = kFALSE;
990  //Bool_t isThereA3ProngJPsi = kFALSE;
991 
992  Int_t n3Prong = array3Prong->GetEntriesFast();
993  Int_t nSelectedloose[1]={0};
994  Int_t nSelectedtight[1]={0};
995 
996  //MC Generated level
997  //loop over MC particles to find Lc generated
998  Bool_t isInFidAcc = kFALSE;
999  Bool_t isInAcc = kFALSE;
1000  if(fReadMC) {
1001  // Event selection as done is CF task
1002  Double_t zPrimVertex = vtx1 ->GetZ();
1003  Double_t zMCVertex = mcHeader->GetVtxZ();
1004  if (TMath::Abs(zMCVertex) > fRDCutsAnalysis->GetMaxVtxZ()){
1005  return;
1006  }
1007  for (Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++) {
1008  fIsLc=0;
1009  fIsLcResonant=0;
1010  AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iPart));
1011  if (!mcPart){
1012  AliError("Failed casting particle from MC array!, Skipping particle");
1013  continue;
1014  }
1015  //Check whether particle is Lc
1016  SetIsLcGen(mcPart,arrayMC);
1017  if(fIsLc==0) continue;
1018  //-- is Lc --
1019  isInFidAcc = fRDCutsAnalysis->IsInFiducialAcceptance(mcPart->Pt(),mcPart->Y());
1020  fCandidateVars[0] = mcPart->Pt();
1021  fCandidateVars[1] = mcPart->Eta();
1022  fCandidateVars[2] = mcPart->Y();
1023  fCandidateVars[3] = mcPart->Phi();
1024  Int_t imother = -1;
1025  if(!fIsHijing) imother=mcPart->GetMother();
1026  if(imother>0) { //found mother
1027  AliAODMCParticle* mcPartMother = dynamic_cast<AliAODMCParticle*>(arrayMC->At(imother));
1028  if(!mcPart){
1029  AliError("Failed casting mother particle, Skipping particle");
1030  continue;
1031  }
1032  }
1033 
1034  //Check daughters
1035  SetLambdacDaugh(mcPart,arrayMC,isInAcc);
1036  if(fIsLcResonant>=1 && (fIsHijing || imother>0)) { //if signal, and is LHC15f2 or has mother
1037  AliDebug(2,"Lc has p K pi in final state");
1039  fNentries->Fill(4);
1040  if(isInFidAcc){
1041  fNentries->Fill(5);
1042  if((TMath::Abs(mcPart->Y()) < 0.5)) {//limited acceptance
1043  AliDebug(2,"Lc in limited acceptance");
1045  }
1046  FillEffHists(kGenerated); //MC generated ---> Should be within fiducial acceptance
1047  if(isInAcc) FillEffHists(kGeneratedAcc); //all daughters in acceptance
1048  }
1049  }
1050  else if(fIsLcResonant==0){
1051  AliError("no p K pi final state");
1052  // TClonesArray *ares = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1053  // Int_t nentriesres = ares->GetEntriesFast();
1054  // for(Int_t ires=0;ires<nentriesres;ires++) {
1055  // AliAODMCParticle* mcPartRes = dynamic_cast<AliAODMCParticle*>(ares->At(ires));
1056  // Printf("%i",ires);
1057  // mcPartRes->Print();
1058  // }
1059  // TIter next(aod->GetList());
1060  // while (TObject *obj = next())
1061  // obj->Print();
1062  }
1063  else AliError(Form("Not pKpi or background - should not happen! fIsLcResonant = %i",fIsLcResonant));
1065  fhIsLcGen->Fill(Double_t(fIsLc));
1066  }
1067  }
1068 
1069 
1070  fHistNEvents->Fill(2); // count event after event selection (as CF task)
1071 
1072  Bool_t isEvSelAnCuts=fRDCutsAnalysis->IsEventSelected(aod);
1073  if(!isEvSelAnCuts){ //reject if not selected with analysis cut
1074  if(fRDCutsAnalysis->GetWhyRejection()==1) // rejected for pileup
1075  fNentries->Fill(3);
1076  return;
1077  }
1078 
1079  //
1080  //Reconstruction level
1081  //loop over 3 prong candidates
1082  //
1083 
1084  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
1085  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
1086  //(AliAODEvent *aod,AliAODRecoDecayHF3Prong *part,TClonesArray *arrayMC)
1087  fhSetIsLc->Fill(0);
1088  SetIsLcReco(d,arrayMC);
1089  fhSetIsLc->Fill(1);
1091  fhIsLcReco->Fill(Double_t(fIsLc));
1092  fCandidateVars[0] = d->Pt();
1093  fCandidateVars[1] = d->Eta();
1094  fCandidateVars[2] = d->Y(4122);
1095  fCandidateVars[3] = d->Phi();
1096 
1098  fNentries->Fill(6);
1099 
1100  Bool_t unsetvtx=kFALSE;
1101  if(!d->GetOwnPrimaryVtx()){
1102  d->SetOwnPrimaryVtx(vtx1);
1103  unsetvtx=kTRUE;
1104  }
1105 
1106 
1107 
1108  //add histogram with filter bit
1109  //one at start of task, one at filter bit selection
1110  //check every bit, bit vs pT
1111  //Filter bit selection and QA:
1112  fhSelectBit->Fill(1);
1113  if(d->GetSelectionMap()){
1114  // enum ESele {kD0toKpiCuts,kD0toKpiPID,kD0fromDstarCuts,kD0fromDstarPID,kDplusCuts,kDplusPID,kDsCuts,kDsPID,kLcCuts,kLcPID,kDstarCuts,kDstarPID};
1118 
1119  fhSelectBit->Fill(2);
1122  if(fLcCut&&!d->HasSelectionBit(AliRDHFCuts::kLcCuts)) continue;
1123  if(fLcPIDCut&&!d->HasSelectionBit(AliRDHFCuts::kLcPID)) continue;
1124  }
1126  fNentries->Fill(7);
1127 
1128  //track selection
1129  Int_t isSelectedTracks = fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kTracks,aod);
1130  if(!isSelectedTracks) continue;
1132  fNentries->Fill(8);
1133 
1134  //isThereA3prongWithGoodTracks=kTRUE;
1135 
1136  if (fRDCutsAnalysis->IsInFiducialAcceptance(d->Pt(),d->Y(4122))) {fNentries->Fill(9);}else{continue;}
1138 
1139  Int_t ptbin=fRDCutsAnalysis->PtBin(d->Pt());
1140  if(ptbin==-1) {fNentries->Fill(10); continue;} //out of bounds
1142 
1143  //Fill reco ntuple
1144  if(fReadMC && fIsLc>=1 && fFillNtupleReco) FillRecoNtuple(aod,d,arrayMC);
1145  //idproton, pion using isSelectedPID
1146  //Bool_t isPID=fRDCutsAnalysis->GetIsUsePID();
1147  Int_t isSelectedPID=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kPID,aod);
1148 
1149  if(isSelectedPID==0 ) fNentries->Fill(12);
1150  else if(isSelectedPID==1) fNentries->Fill(13);
1151  else if(isSelectedPID==2) fNentries->Fill(14);
1152  else fNentries->Fill(15);
1153  if(isSelectedPID>0) FillEffHists(kIsSelectedPID);
1154  //PID selection using maximum probability configuration
1155  Int_t selectionProb = GetPIDselectionMaxProb(d);
1156 
1158  if(!selection) continue;
1160  fNentries->Fill(11);
1161 
1162  FillMassHists(aod,d,arrayMC,selection,selectionProb);
1163 
1164 
1165  if(fFillNtuple) FillNtuple(aod,d,arrayMC,selection);
1167  if(fIsLc>=1 && fIsLc <= 2) fNentries->Fill(16);
1168  if(unsetvtx) d->UnsetOwnPrimaryVtx();
1169  }
1170  fCounter->StoreCandidates(aod,nSelectedloose[0],kTRUE);
1171  fCounter->StoreCandidates(aod,nSelectedtight[0],kFALSE);
1172 
1173  PostData(1,fOutput);
1174  PostData(3,fNentries);
1175  PostData(4,fCounter);
1176 
1177  return;
1178 }
1179 
1180 
1181 
1182 //________________________________________________________________________
1184 {
1185  //
1187  //
1188 
1189  if (fDebug > 1) printf("AnalysisTaskSELambdac: Terminate() \n");
1190 
1191  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1192  if (!fOutput) {
1193  AliError("ERROR: fOutput not available\n");
1194  return;
1195  }
1196  //fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1197 
1198  if(fFillNtuple){
1199  fNtupleLambdac = dynamic_cast<TNtuple*>(GetOutputData(5));
1200  }
1201  if(fFillNtupleReco){
1202  fNtupleLambdacReco = dynamic_cast<TNtuple*>(GetOutputData(6));
1203  }
1204 
1205 
1206  return;
1207 }
1208 
1209 //________________________________________________________________________
1211 
1212  //
1214  //
1215 
1216  Int_t lambdacLab[3]={0,0,0};
1217  // Int_t pdgs[3]={0,0,0};
1218  for(Int_t i=0;i<3;i++){
1219  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1220  Int_t lab=daugh->GetLabel();
1221  if(lab<0) return 0;
1222  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab);
1223  if(!part) continue;
1224  // pdgs[i]=part->GetPdgCode();
1225  Int_t partPdgcode = TMath::Abs(part->GetPdgCode());
1226  if(partPdgcode==211 || partPdgcode==321 || partPdgcode==2212){
1227  Int_t motherLabel=part->GetMother();
1228  if(motherLabel<0) return 0;
1229  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(motherLabel);
1230  if(!motherPart) continue;
1231  Int_t motherPdg = TMath::Abs(motherPart->GetPdgCode());
1232  if(motherPdg==4122) {
1233  if(GetLambdacDaugh(motherPart,arrayMC)){lambdacLab[i]=motherLabel;continue;}
1234  }
1235  if(motherPdg==313 || motherPdg==2224 || motherPdg==3124){
1236  Int_t granMotherLabel=motherPart->GetMother();
1237  if(granMotherLabel<0) return 0;
1238  AliAODMCParticle *granMotherPart = (AliAODMCParticle*)arrayMC->At(granMotherLabel);
1239  if(!granMotherPart) continue;
1240  Int_t granMotherPdg = TMath::Abs(granMotherPart->GetPdgCode());
1241  if(granMotherPdg ==4122) {
1242  if(GetLambdacDaugh(granMotherPart,arrayMC)) {lambdacLab[i]=granMotherLabel;continue;}
1243  }
1244  }
1245  }
1246  }
1247 
1248  if(lambdacLab[0]==lambdacLab[1] && lambdacLab[1]==lambdacLab[2]) {return lambdacLab[0];}
1249  return 0;
1250 
1251 }
1252 
1253 //-----------------------------
1254 
1255 Int_t AliAnalysisTaskSELambdacTMVA::LambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC, Bool_t &IsInAcc) const {
1256 
1257  //
1261  //
1262 
1263  Int_t numberOfLambdac=0;
1264  IsInAcc=kTRUE;
1265  if(TMath::Abs(part->GetPdgCode())!=4122) return 0;
1266  // Int_t daughTmp[2];
1267  // daughTmp[0]=part->GetDaughter(0);
1268  // daughTmp[1]=part->GetDaughter(1);
1269  Int_t nDaugh = (Int_t)part->GetNDaughters();
1270  if(nDaugh<2) return 0;
1271  if(nDaugh>3) return 0;
1272  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)arrayMC->At(part->GetDaughter(0));
1273  if(!pdaugh1) {return 0;}
1274  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
1275  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)arrayMC->At(part->GetDaughter(1));
1276  if(!pdaugh2) {return 0;}
1277  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
1278 
1279  AliDebug(2,"Is non resonant?");
1280  if(nDaugh==3){
1281  Int_t thirdDaugh=part->GetDaughter(1)-1;
1282  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)arrayMC->At(thirdDaugh);
1283  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
1284  if((number1==321 && number2==211 && number3==2212) ||
1285  (number1==211 && number2==321 && number3==2212) ||
1286  (number1==211 && number2==2212 && number3==321) ||
1287  (number1==321 && number2==2212 && number3==211) ||
1288  (number1==2212 && number2==321 && number3==211) ||
1289  (number1==2212 && number2==211 && number3==321)) {
1290  numberOfLambdac++;
1291  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1292  || TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1293  || TMath::Abs(pdaugh3->Eta()) > 0.9 || pdaugh3->Pt() < 0.1) IsInAcc=kFALSE;
1294  AliDebug(2,"Lc decays non-resonantly");
1295  return 1;
1296  }
1297  }
1298 
1299  if(nDaugh==2){
1300 
1301  //Lambda resonant
1302 
1303  //Lambda -> p K*0
1304  //
1305  Int_t nfiglieK=0;
1306 
1307  if((number1==2212 && number2==313)){
1308  nfiglieK=pdaugh2->GetNDaughters();
1309  if(nfiglieK!=2) return 0;
1310  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1311  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1312  if(!pdaughK1) return 0;
1313  if(!pdaughK2) return 0;
1314  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) {
1315  numberOfLambdac++;
1316  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1317  || TMath::Abs(pdaughK1->Eta()) > 0.9 || pdaughK1->Pt() < 0.1
1318  || TMath::Abs(pdaughK2->Eta()) > 0.9 || pdaughK2->Pt() < 0.1) IsInAcc=kFALSE;
1319  AliDebug(2,"Lc decays via K* p");
1320  return 3;
1321  }
1322  }
1323 
1324  if((number1==313 && number2==2212)){
1325  nfiglieK=pdaugh1->GetNDaughters();
1326  if(nfiglieK!=2) return 0;
1327  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1328  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1329  if(!pdaughK1) return 0;
1330  if(!pdaughK2) return 0;
1331  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) {
1332  numberOfLambdac++;
1333  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1334  || TMath::Abs(pdaughK1->Eta()) > 0.9 || pdaughK1->Pt() < 0.1
1335  || TMath::Abs(pdaughK2->Eta()) > 0.9 || pdaughK2->Pt() < 0.1) IsInAcc=kFALSE;
1336  AliDebug(2,"Lc decays via K* p");
1337  return 3;
1338  }
1339  }
1340 
1341  //Lambda -> Delta++ k
1342  Int_t nfiglieDelta=0;
1343  if(number1==321 && number2==2224){
1344  nfiglieDelta=pdaugh2->GetNDaughters();
1345  if(nfiglieDelta!=2) return 0;
1346  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1347  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1348  if(!pdaughD1) return 0;
1349  if(!pdaughD2) return 0;
1350  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) {
1351  numberOfLambdac++;
1352  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1353  || TMath::Abs(pdaughD1->Eta()) > 0.9 || pdaughD1->Pt() < 0.1
1354  || TMath::Abs(pdaughD2->Eta()) > 0.9 || pdaughD2->Pt() < 0.1) IsInAcc=kFALSE;
1355  AliDebug(2,"Lc decays via Delta++ k");
1356  return 4;
1357  }
1358  }
1359  if(number1==2224 && number2==321){
1360  nfiglieDelta=pdaugh1->GetNDaughters();
1361  if(nfiglieDelta!=2) return 0;
1362  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1363  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1364  if(!pdaughD1) return 0;
1365  if(!pdaughD2) return 0;
1366  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) {
1367  numberOfLambdac++;
1368  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1369  || TMath::Abs(pdaughD1->Eta()) > 0.9 || pdaughD1->Pt() < 0.1
1370  || TMath::Abs(pdaughD2->Eta()) > 0.9 || pdaughD2->Pt() < 0.1) IsInAcc=kFALSE;
1371  AliDebug(2,"Lc decays via Delta++ k");
1372  return 4;
1373  }
1374  }
1375 
1376 
1377  //Lambdac -> Lambda(1520) pi
1378  Int_t nfiglieLa=0;
1379  if(number1==3124 && number2==211){
1380  nfiglieLa=pdaugh1->GetNDaughters();
1381  if(nfiglieLa!=2) return 0;
1382  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1383  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1384  if(!pdaughL1) return 0;
1385  if(!pdaughL2) return 0;
1386  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) {
1387  numberOfLambdac++;
1388  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1389  || TMath::Abs(pdaughL1->Eta()) > 0.9 || pdaughL1->Pt() < 0.1
1390  || TMath::Abs(pdaughL2->Eta()) > 0.9 || pdaughL2->Pt() < 0.1) IsInAcc=kFALSE;
1391  AliDebug(2,"Lc decays via Lambda(1520) pi");
1392  return 2;
1393  }
1394  }
1395  if(number1==211 && number2==3124){
1396  nfiglieLa=pdaugh2->GetNDaughters();
1397  if(nfiglieLa!=2) return 0;
1398  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1399  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1400  if(!pdaughL1) return 0;
1401  if(!pdaughL2) return 0;
1402  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) {
1403  numberOfLambdac++;
1404  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1405  || TMath::Abs(pdaughL1->Eta()) > 0.9 || pdaughL1->Pt() < 0.1
1406  || TMath::Abs(pdaughL2->Eta()) > 0.9 || pdaughL2->Pt() < 0.1) IsInAcc=kFALSE;
1407  AliDebug(2,"Lc decays via Lambda(1520) pi");
1408  return 2;
1409  }
1410  }
1411  }
1412 
1413  if(numberOfLambdac>0) {return -100; AliDebug(2,"Lc decays via one of 4 resonances!");}
1414  return 0;
1415 }
1416 
1417 //-----------------------------
1418 
1419 void AliAnalysisTaskSELambdacTMVA::SetIsLcGen(AliAODMCParticle *mcPart, TClonesArray *arrayMC) {
1420 
1421  //
1424  //
1425 
1426  fIsLc=0;
1427  if(TMath::Abs(mcPart->GetPdgCode())==4122) {
1428  AliDebug(2,"Found Lc! now check mother");
1429  fIsLc=1;
1430  Int_t pdgMom = 0;
1431  pdgMom=fVertUtil->CheckOrigin(arrayMC,mcPart,fKeepLcNotFromQuark ? kFALSE : kTRUE);
1432  if(pdgMom == 5){
1433  AliDebug(2,"Lc comes from b");
1434  fIsLc=2;
1435  }
1436  else if(pdgMom==4) {
1437  fIsLc=1;
1438  }
1439  else {
1440  fIsLc=0;
1441  fhIsLcResonantGen->Fill(-1);
1442  }
1443  }
1444 }
1445 
1446 
1447 //-----------------------------
1448 
1450  TClonesArray *arrayMC) {
1451 
1452  //
1456  //
1457 
1458  Int_t labDp=-1;
1459  fIsLc = 0;
1460  fIsLcResonant=0;
1461  if(!fReadMC) return;
1462  else{ //MC, check if Lc prompt or non prompt
1463  Int_t pdgCand =4122;
1464  Int_t pdgDaughter[3]={-1,-1,-1};
1465  pdgDaughter[0]=2212;
1466  pdgDaughter[1]=321;
1467  pdgDaughter[2]=211;
1468 
1469  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
1470  if(labDp>=0){
1471  AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1472  Int_t pdgMom=fVertUtil->CheckOrigin(arrayMC,partDp,fKeepLcNotFromQuark ? kFALSE : kTRUE);
1473  fhRecoPDGmom->Fill(pdgMom);
1474  if(pdgMom == 4) fIsLc=1;
1475  else if(pdgMom == 5) fIsLc=2;
1476  else fIsLc=0;
1477  Bool_t dummy = kTRUE;
1478  if(fIsLc>0) SetLambdacDaugh(partDp, arrayMC, dummy);
1479  }
1480 
1481  }
1482 }
1483 
1484 //---------------------------
1485 
1486 void AliAnalysisTaskSELambdacTMVA::FillMassHists(AliAODEvent *aod, AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Int_t selection, Int_t selectionProb) {
1488  Bool_t IsInjected = 0;
1489  Double_t invMassLcpKpi = d->InvMassLcpKpi();
1490  Double_t invMassLcpiKp = d->InvMassLcpiKp();
1491  Bool_t ispKpiMC = 0;
1492  Bool_t ispiKpMC = 0;
1493 
1494  if(fReadMC) {
1495  ispKpiMC = IspKpiMC(d,arrayMC);
1496  ispiKpMC = IspiKpMC(d,arrayMC);
1497  AliAODMCHeader *mcHeader2 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1498  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(d,mcHeader2,arrayMC); //for dedicated MC set to 0
1499 
1500  //signal
1501  if(fIsLc>=1) {
1502  //MC PID
1503  fhMCmassLcPtSig->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1504  if(fIsLc==1) fhMCmassLcPtSigc->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1505  else if(fIsLc==2) fhMCmassLcPtSigb->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1506  //Real PID
1507  if(selection==1){
1508  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpKpi);
1509  if(fIsLc==1) fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpKpi);
1510  else if(fIsLc==2) fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpKpi);
1511  }
1512  else if(selection==2){
1513  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpiKp);
1514  if(fIsLc==1) fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpiKp);
1515  else if(fIsLc==2) fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpiKp);
1516  }
1517  else if(selection==3){
1518  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpiKp,0.5);
1519  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpKpi,0.5);
1520  if(fIsLc==1) {
1521  fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpiKp,0.5);
1522  fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpKpi,0.5);
1523  }
1524  else if(fIsLc==2) {
1525  fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpiKp,0.5);
1526  fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpKpi,0.5);
1527  }
1528  }
1529  //max prob PID
1530  if(selectionProb==1) {
1531  fhProbmassLcPtSig->Fill(d->Pt(), invMassLcpKpi);
1532  if(fIsLc==1)fhProbmassLcPtSigc->Fill(d->Pt(), invMassLcpKpi);
1533  if(fIsLc==2)fhProbmassLcPtSigb->Fill(d->Pt(), invMassLcpKpi);
1534  }
1535  else if(selectionProb==2) {
1536  fhProbmassLcPtSig->Fill(d->Pt(), invMassLcpiKp);
1537  if(fIsLc==1)fhProbmassLcPtSigc->Fill(d->Pt(), invMassLcpiKp);
1538  if(fIsLc==2)fhProbmassLcPtSigb->Fill(d->Pt(), invMassLcpiKp);
1539  }
1540 
1541  // mis id'd signal candidates
1542  if(ispKpiMC && selection==2){ //RDHF PID
1543  fhPtMisIdpKpi->Fill(fCandidateVars[0]);
1544  fhInvMassMisIdpKpi->Fill(fCandidateVars[0],invMassLcpiKp);
1545  }
1546  else if(ispiKpMC && selection==1){
1547  fhPtMisIdpiKp->Fill(fCandidateVars[0]);
1548  fhInvMassMisIdpiKp->Fill(fCandidateVars[0],invMassLcpKpi);
1549  }
1550  else fhPtCorrId->Fill(fCandidateVars[0]);
1551 
1552  if(ispKpiMC && selectionProb==2){ //PID using max prob. criteria
1554  fhInvMassMisIdpKpiProb->Fill(fCandidateVars[0],invMassLcpiKp);
1555  }
1556  else if(ispiKpMC && selectionProb==1){
1558  fhInvMassMisIdpiKpProb->Fill(fCandidateVars[0],invMassLcpKpi);
1559  }
1560  else fhPtCorrIdProb->Fill(fCandidateVars[0]);
1561 
1562  }
1563  }
1564  //Bkg
1565  if(!fReadMC || (fIsLc==0 && (!IsInjected || fSyst ==0))) { //data or non-injected background or pp background
1566  //MC PID
1567  if(fReadMC) fhMCmassLcPt->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1568  //Real PID
1569  if(selection==1){
1570  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpKpi);
1571  }
1572  else if(selection==2){
1573  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpiKp);
1574  }
1575  else if(selection==3){
1576  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpiKp,0.5);
1577  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpKpi,0.5);
1578  }
1579  //max prob PID
1580  if(selectionProb==1) fhProbmassLcPt->Fill(d->Pt(),invMassLcpKpi);
1581  else if(selectionProb==2) fhProbmassLcPt->Fill(d->Pt(),invMassLcpiKp);
1582  }
1583 }
1584 
1585 //---------------------------
1586 
1588  TClonesArray *arrayMC, Int_t selection)
1589 {
1590  //
1592  //
1593 
1594  if(fReadMC && !fKeepBkgNt && fIsLc==0) return; //don't continue if bkg and only want signal
1595 
1596  Bool_t IsInjected = 0;
1597  Bool_t IsLc = 0;
1598  Bool_t IsLcfromLb = 0;
1599 
1600  if(fReadMC){
1601  AliAODMCHeader *mcHeader3 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1602  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(part,mcHeader3,arrayMC); //for dedicated MC set to 0
1603  }
1604  if(fIsLc>=1 && fIsLc<=2) IsLc=kTRUE;
1605  if(fIsLc==2) IsLcfromLb=kTRUE;
1606  if(fReadMC && IsInjected && !IsLc && fSyst >=1 ) return; //dont fill if injected bkg, pPb or PbPb
1607 
1608  Double_t invMasspKpi=-1.;
1609  Double_t invMasspiKp=-1.;
1610  //apply MC PID
1611  if(fReadMC && fMCPid){
1612  if(IspKpiMC(part,arrayMC)) invMasspKpi=part->InvMassLcpKpi();
1613  else if(IspiKpMC(part,arrayMC)) invMasspiKp=part->InvMassLcpiKp();
1614  //else return;
1615  }
1616  // apply realistic PID
1617  if(fRealPid){
1618  if(selection==1 || selection==3) invMasspKpi=part->InvMassLcpKpi();
1619  else if(selection>=2) invMasspiKp=part->InvMassLcpiKp();
1620  }
1621  // Float_t centrality=fRDCutsAnalysis->GetCentrality(aod);
1622  // Int_t runNumber=aod->GetRunNumber();
1623 
1624  //fill ntuple
1625  // 1 - loose pid
1626  // 2 - bayesian pid
1627  Float_t tmp[58];
1628  //Is Lc
1629  if(!IsInjected && IsLc==0) tmp[0]=0; //non-injected bkg
1630  else if(IsLc==1 && !IsLcfromLb) tmp[0]=1; //prompt Lc
1631  else if(IsLc==1 && IsLcfromLb) tmp[0]=2; //non-prompt Lc
1632  else if(IsInjected && IsLc==0) tmp[0]=3; //injected bkg
1633  else tmp[0]=-99; //should not happen
1634 
1635  //invariant mass
1636  tmp[2]=part->InvMassLcpiKp();
1637  tmp[1]=part->InvMassLcpKpi();
1638  tmp[3]=part->Charge();
1639  //pt of decay products
1640  tmp[4]=part->PtProng(0);
1641  tmp[5]=part->PtProng(1); //pt kaon
1642  tmp[6]=part->PtProng(2);
1643  Float_t ptLc=part->Pt();
1644  tmp[7]=ptLc;
1645  tmp[8]=part->CosPointingAngle();
1646  tmp[9]=part->DecayLength();
1647  tmp[10]=part->NormalizedDecayLength();
1648  tmp[11]=TMath::Min(part->GetDist12toPrim(),part->GetDist23toPrim());
1649  tmp[12]=part->GetSigmaVert();
1650  Double_t dcas[3]={0};
1651  part->GetDCAs(dcas);
1652  tmp[13]=TMath::Max(dcas[0],TMath::Max(dcas[1],dcas[2]));
1653  tmp[14]=part->DecayLengthXY();
1654  tmp[15]=part->NormalizedDecayLengthXY();
1655 
1656  //Check resonant decays for efficiencies
1657  tmp[16]=fIsLcResonant; // bkg
1658  //PID selection
1659  tmp[17]=selection;
1660  //FONLL weights
1661 
1662  AliVTrack *track0=dynamic_cast<AliVTrack*>(part->GetDaughter(0));
1663  AliVTrack *track1=dynamic_cast<AliVTrack*>(part->GetDaughter(1));
1664  AliVTrack *track2=dynamic_cast<AliVTrack*>(part->GetDaughter(2));
1665  if(fRDCutsAnalysis->GetPidHF()->GetUseCombined()) {//check this
1666  //bayesian probabilities
1667  Double_t prob0[AliPID::kSPECIES];
1668  Double_t prob1[AliPID::kSPECIES];
1669  Double_t prob2[AliPID::kSPECIES];
1670 
1671  if (!track0 || !track1 || !track2) {
1672  AliError("AliVTrack missing - wont fill Ntuple");
1673  return;
1674  }
1675  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track0,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob0);
1676  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track1,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob1);
1677  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track2,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob2);
1678  //if(prob0[AliPID::kPion] < 0.3 && prob0[AliPID::kProton] < 0.3) return;
1679  //if(prob1[AliPID::kKaon] < 0.3) return;
1680  //if(prob2[AliPID::kPion] < 0.3 && prob2[AliPID::kProton] < 0.3) return;
1681  tmp[18]=prob0[AliPID::kPion]; //track 0, pion
1682  tmp[19]=prob0[AliPID::kKaon]; //kaon
1683  tmp[20]=prob0[AliPID::kProton]; //proton
1684  tmp[21]=prob1[AliPID::kPion]; //track 1, pion
1685  tmp[22]=prob1[AliPID::kKaon]; //kaon
1686  tmp[23]=prob1[AliPID::kProton]; //proton
1687  tmp[24]=prob2[AliPID::kPion]; //track 2, pion
1688  tmp[25]=prob2[AliPID::kKaon]; //kaon
1689  tmp[26]=prob2[AliPID::kProton]; //proton
1690  }
1691  else {
1692  //fill w 0
1693  for(Int_t iprob=18;iprob<=26;iprob++) {
1694  tmp[iprob]=-1;
1695  }
1696  }
1697  if(fFillNtuple>=2) { //fill with further variables
1698  Double_t d00 = part->Getd0Prong(0);
1699  Double_t d01 = part->Getd0Prong(1);
1700  Double_t d02 = part->Getd0Prong(2);
1701  Double_t d0err0 = part->Getd0errProng(0);
1702  Double_t d0err1 = part->Getd0errProng(1);
1703  Double_t d0err2 = part->Getd0errProng(2);
1704  tmp[27]=d00;
1705  tmp[28]=d01;
1706  tmp[29]=d02;
1707  tmp[30]=d00*d00 + d01*d01 + d02*d02;
1708  tmp[31]=d00/d0err0;
1709  tmp[32]=d01/d0err1;
1710  tmp[33]=d02/d0err2;
1711  Double_t dd0,edd0;
1712  Double_t dd1,edd1;
1713  Double_t dd2,edd2;
1714  part->Getd0MeasMinusExpProng(0,aod->GetMagneticField(),dd0,edd0);
1715  part->Getd0MeasMinusExpProng(1,aod->GetMagneticField(),dd1,edd1);
1716  part->Getd0MeasMinusExpProng(2,aod->GetMagneticField(),dd2,edd2);
1717  Double_t ns0=dd0/edd0;
1718  Double_t ns1=dd1/edd1;
1719  Double_t ns2=dd2/edd2;
1720  tmp[34]=ns0;
1721  tmp[35]=ns1;
1722  tmp[36]=ns2;
1723  tmp[37]=part->CosPointingAngleXY();
1724  tmp[13]=dcas[0];
1725  tmp[38]=dcas[1];
1726  tmp[39]=dcas[2];
1727  tmp[11]=part->GetDist12toPrim();
1728  tmp[40]=part->GetDist23toPrim();
1729  Int_t runNumber=aod->GetRunNumber();
1730  tmp[41]=(Float_t)runNumber;
1731 
1732  if(fFillNtuple>=3) { //fill with weights
1733  Double_t ptLcMC=-1;
1734  //D meson weights
1735  Double_t weightPythia=-1,weight7LHC10f6a=-1,weight5LHC10f6a=-1,weight5LHC13d3=-1;
1736  //Lc weights
1737  Double_t weight7LHC10f7aLc=-1,weight7LHC11b2Lc=-1,weight5LHC13d3Lc=-1;
1738  if(IsLc) {
1739  //Get MC Lc to get true pT
1740  Int_t labDp = -1;
1741  Int_t pdgCand =4122;
1742  Int_t pdgDaughter[3]={-1,-1,-1};
1743  pdgDaughter[0]=2212;
1744  pdgDaughter[1]=321;
1745  pdgDaughter[2]=211;
1746  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
1747  if(labDp>=0){
1748  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(labDp);
1749  ptLcMC = motherPart->Pt();
1750  weightPythia = fFuncWeightPythia->Eval(ptLcMC);
1751  weight7LHC10f6a = fFuncWeightFONLL7overLHC10f6a->Eval(ptLcMC);
1752  weight5LHC10f6a = fFuncWeightFONLL5overLHC10f6a->Eval(ptLcMC);
1753  weight5LHC13d3 = fFuncWeightFONLL5overLHC13d3->Eval(ptLcMC);
1754  weight5LHC13d3Lc = fFuncWeightFONLL5overLHC13d3Lc->Eval(ptLcMC);
1755  weight7LHC11b2Lc = fFuncWeightFONLL7overLHC11b2Lc->Eval(ptLcMC);
1756  weight7LHC10f7aLc = fFuncWeightFONLL7overLHC10f7aLc->Eval(ptLcMC);
1757  }
1758  }
1759  tmp[42]=ptLcMC;
1760  tmp[43]=weightPythia;
1761  tmp[44]=weight7LHC10f6a;
1762  tmp[45]=weight5LHC10f6a;
1763  tmp[46]=weight5LHC13d3;
1764  tmp[47]=weight5LHC13d3Lc;
1765  tmp[48]=weight7LHC11b2Lc;
1766  tmp[49]=weight7LHC10f7aLc;
1767 
1768  //Multiplicity weights
1769  Double_t multWeight = 1.;
1770  Double_t nTracklets = 0.;
1771  if(fUseNchWeight){
1772  //tracklets within |eta| < 1.
1773  nTracklets = static_cast<Int_t>(fVertUtil->GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
1774  multWeight *= GetNchWeight(static_cast<Int_t>(nTracklets));
1775  AliDebug(2,Form("Using Nch weights, Mult=%f Weight=%f\n",nTracklets,multWeight));
1776  }
1777  tmp[50]=nTracklets;
1778  tmp[51]=multWeight;
1779 
1780 
1781  if(fFillNtuple>=4) { //fill with invariant mass of 2 prongs
1782  tmp[52]=part->InvMass2Prongs(1,0,321,2212); //inv mass pK
1783  tmp[53]=part->InvMass2Prongs(2,1,211,321); //inv mass Kpi
1784  tmp[54]=part->InvMass2Prongs(2,0,211,2212);//inv mass ppi
1785  tmp[55]=part->InvMass2Prongs(1,2,321,2212); //inv mass Kp
1786  tmp[56]=part->InvMass2Prongs(0,1,211,321); //inv mass piK
1787  tmp[57]=part->InvMass2Prongs(0,2,211,2212);//inv mass pip
1788  }
1789  }
1790  }
1791  fNtupleLambdac->Fill(tmp);
1792  PostData(5,fNtupleLambdac);
1793 
1794  return;
1795 }
1796 
1797 //---------------------------
1798 
1800 
1801  //
1804  //
1805 
1806  //fill according to kStep - hArray[nSteps]
1807  if(!fIsLc) {
1808  fhNBkgNI[kStep]->Fill(fCandidateVars[0]);
1809  fhPtEtaBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1810  fhPtYBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1811  fhPtPhiBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1812  }
1813 
1814  else{
1815  fhNLc[kStep]->Fill(fCandidateVars[0]);
1816  fhPtEtaLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1817  fhPtYLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1818  fhPtPhiLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1819 
1820  if(fIsLc==1) { //prompt Lc
1821  fhNLcc[kStep]->Fill(fCandidateVars[0]);
1822  fhPtEtaLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1823  fhPtYLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1824  fhPtPhiLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1825  if(fIsLcResonant==1){
1826  fhNLcNonRc[kStep]->Fill(fCandidateVars[0]);
1827  fhPtEtaLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1828  fhPtYLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1829  fhPtPhiLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1830  }
1831  else if(fIsLcResonant==2){
1832  fhNLcL1520c[kStep]->Fill(fCandidateVars[0]);
1833  fhPtEtaLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1834  fhPtYLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1835  fhPtPhiLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1836  }
1837  else if(fIsLcResonant==3){
1838  fhNLcKstarc[kStep]->Fill(fCandidateVars[0]);
1839  fhPtEtaLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1840  fhPtYLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1841  fhPtPhiLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1842  }
1843  else if(fIsLcResonant==4){
1844  fhNLcDeltac[kStep]->Fill(fCandidateVars[0]);
1845  fhPtEtaLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1846  fhPtYLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1847  fhPtPhiLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1848  }
1849  }
1850  else if(fIsLc==2) { //non-prompt Lc
1851  fhNLcb[kStep]->Fill(fCandidateVars[0]);
1852  fhPtEtaLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1853  fhPtYLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1854  fhPtPhiLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1855  if(fIsLcResonant==1){
1856  fhNLcNonRb[kStep]->Fill(fCandidateVars[0]);
1857  fhPtEtaLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1858  fhPtYLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1859  fhPtPhiLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1860  }
1861  else if(fIsLcResonant==2){
1862  fhNLcL1520b[kStep]->Fill(fCandidateVars[0]);
1863  fhPtEtaLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1864  fhPtYLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1865  fhPtPhiLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1866  }
1867  else if(fIsLcResonant==3){
1868  fhNLcKstarb[kStep]->Fill(fCandidateVars[0]);
1869  fhPtEtaLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1870  fhPtYLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1871  fhPtPhiLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1872  }
1873  else if(fIsLcResonant==4){
1874  fhNLcDeltab[kStep]->Fill(fCandidateVars[0]);
1875  fhPtEtaLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1876  fhPtYLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1877  fhPtPhiLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1878  }
1879  }
1880  }
1881 }
1882 
1883 //-----------------------------
1884 
1886 
1887  //
1889  //
1890 
1891  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1892  for(Int_t i=0;i<3;i++){
1893  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1894  lab[i]=daugh->GetLabel();
1895  if(lab[i]<0) return kFALSE;
1896  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1897  if(!part) return kFALSE;
1898  pdgs[i]=TMath::Abs(part->GetPdgCode());
1899  }
1900 
1901  if(pdgs[0]==2212 && pdgs[1]==321 && pdgs[2]==211) return kTRUE;
1902 
1903  return kFALSE;
1904 }
1905 //-----------------------------
1907 
1908  //
1910  //
1911 
1912  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1913  for(Int_t i=0;i<3;i++){
1914  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1915  lab[i]=daugh->GetLabel();
1916  if(lab[i]<0) return kFALSE;
1917  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1918  if(!part) return kFALSE;
1919  pdgs[i]=TMath::Abs(part->GetPdgCode());
1920  }
1921 
1922  if(pdgs[2]==2212 && pdgs[1]==321 && pdgs[0]==211) {return kTRUE;}
1923 
1924  return kFALSE;
1925 }
1926 
1928  if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) hSelectionBits->Fill(1,fCandidateVars[0]);
1929  if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiPID)) hSelectionBits->Fill(2,fCandidateVars[0]);
1930  if(d->HasSelectionBit(AliRDHFCuts::kD0fromDstarCuts)) hSelectionBits->Fill(3,fCandidateVars[0]);
1931  if(d->HasSelectionBit(AliRDHFCuts::kD0fromDstarPID)) hSelectionBits->Fill(4,fCandidateVars[0]);
1932  if(d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) hSelectionBits->Fill(5,fCandidateVars[0]);
1933  if(d->HasSelectionBit(AliRDHFCuts::kDplusPID)) hSelectionBits->Fill(6,fCandidateVars[0]);
1934  if(d->HasSelectionBit(AliRDHFCuts::kDsCuts)) hSelectionBits->Fill(7,fCandidateVars[0]);
1935  if(d->HasSelectionBit(AliRDHFCuts::kDsPID)) hSelectionBits->Fill(8,fCandidateVars[0]);
1936  if(d->HasSelectionBit(AliRDHFCuts::kLcCuts)) hSelectionBits->Fill(9,fCandidateVars[0]);
1937  if(d->HasSelectionBit(AliRDHFCuts::kLcPID)) hSelectionBits->Fill(10,fCandidateVars[0]);
1938  if(d->HasSelectionBit(AliRDHFCuts::kDstarCuts)) hSelectionBits->Fill(11,fCandidateVars[0]);
1939  if(d->HasSelectionBit(AliRDHFCuts::kDstarPID)) hSelectionBits->Fill(12,fCandidateVars[0]);
1940 }
1941 
1942 //-----------------------------
1943 
1945 
1946  Int_t selection = 0;
1947 
1948  if(fRDCutsAnalysis->GetPidHF()->GetUseCombined()) {//check this
1949  AliVTrack *track0=dynamic_cast<AliVTrack*>(part->GetDaughter(0));
1950  AliVTrack *track1=dynamic_cast<AliVTrack*>(part->GetDaughter(1));
1951  AliVTrack *track2=dynamic_cast<AliVTrack*>(part->GetDaughter(2));
1952  //bayesian probabilities
1953  Double_t prob0[AliPID::kSPECIES];
1954  Double_t prob1[AliPID::kSPECIES];
1955  Double_t prob2[AliPID::kSPECIES];
1956 
1957  if (!track0 || !track1 || !track2) {
1958  AliError("AliVTrack missing");
1959  return 0;
1960  }
1961  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track0,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob0);
1962  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track1,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob1);
1963  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track2,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob2);
1964  if(prob0[AliPID::kProton] * prob1[AliPID::kKaon] * prob2[AliPID::kPion] > prob2[AliPID::kProton] * prob1[AliPID::kKaon] * prob0[AliPID::kPion]) selection = 1; // pKpi
1965  else selection = 2; // piKp
1966  }
1967  return selection;
1968 }
1969 
1971  //
1972  // calculates the Nch weight using the measured and generateed Nch distributions
1973  //
1974  if(nch<=0) return 0.;
1975  if(!fHistoMCNch) { AliError("Input histos to evaluate Nch weights missing"); return 0.; }
1976  Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1977  Double_t weight = pMC;
1978  return weight;
1979 }
1980 
1982  TClonesArray *arrayMC)
1983 {
1984  //
1988  //
1989 
1990  Bool_t IsInjected = 0;
1991  Bool_t IsLc = 0;
1992  Bool_t IsLcfromLb = 0;
1993 
1994  if(fReadMC){
1995  AliAODMCHeader *mcHeader3 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1996  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(part,mcHeader3,arrayMC); //for dedicated MC set to 0
1997  }
1998  if(fIsLc>=1 && fIsLc<=2) IsLc=kTRUE;
1999  if(fIsLc==2) IsLcfromLb=kTRUE;
2000  //if(fReadMC && IsInjected && !IsLc && fSyst >=1 ) return; //dont fill if injected bkg, pPb or PbPb
2001 
2002  Float_t tmp[16];
2003  //Is Lc
2004  if(!IsInjected && IsLc==0) tmp[0]=0; //non-injected bkg
2005  else if(IsLc==1 && !IsLcfromLb) tmp[0]=1; //prompt Lc
2006  else if(IsLc==1 && IsLcfromLb) tmp[0]=2; //non-prompt Lc
2007  else if(IsInjected && IsLc==0) tmp[0]=3; //injected bkg
2008  else tmp[0]=-99; //should not happen
2009  tmp[1]=part->Pt();
2010  //Get MC Lc to get true pT
2011  Float_t ptLcMC=0;
2012  Int_t labDp = -1;
2013  Int_t pdgCand =4122;
2014  Int_t pdgDaughter[3]={-1,-1,-1};
2015  pdgDaughter[0]=2212;
2016  pdgDaughter[1]=321;
2017  pdgDaughter[2]=211;
2018  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
2019  if(labDp>=0){
2020  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(labDp);
2021  ptLcMC = motherPart->Pt();
2022  }
2023  tmp[2]=ptLcMC;
2024 
2025  tmp[3]=part->PtProng(0);
2026  tmp[4]=part->PtProng(1); //pt kaon
2027  tmp[5]=part->PtProng(2);
2028  // Is the track good for TOF PID (for pp proton GEANT3/FLUKA correction)
2029  // and MC pt of each track
2030  Bool_t isTOFpid[3];
2031  Float_t MCpt[3];
2032  for(Int_t i=0;i<3;i++) {
2033  AliAODTrack *daugh=(AliAODTrack*)part->GetDaughter(i);
2034  Int_t daughLab= daugh->GetLabel();
2035  if(daughLab<0) continue;
2036  else{
2037  AliAODMCParticle* pdaugh = dynamic_cast<AliAODMCParticle*>(arrayMC->At(daughLab));
2038  isTOFpid[i] = fRDCutsAnalysis->GetPidHF()->CheckTOFPIDStatus(daugh);
2039  MCpt[i] = pdaugh->Pt();
2040  }
2041  }
2042  tmp[6]=MCpt[0];
2043  tmp[7]=MCpt[1];
2044  tmp[8]=MCpt[2];
2045  tmp[9]=isTOFpid[0];
2046  tmp[10]=isTOFpid[1];
2047  tmp[11]=isTOFpid[2];
2048 
2049  // Selection
2050  Int_t selectionCand=fRDCutsAnalysis->IsSelected(part,AliRDHFCuts::kCandidate,aod);
2051  Int_t selectionPID=fRDCutsAnalysis->IsSelected(part,AliRDHFCuts::kPID,aod);
2052  Int_t selectionPIDprob = GetPIDselectionMaxProb(part);
2053  tmp[12]=selectionCand;
2054  tmp[13]=selectionPID;
2055  tmp[14]=selectionPIDprob;
2056  tmp[15]=part->Charge();
2057 
2058 // Bool_t ispKpiMC = IspKpiMC(part,arrayMC);
2059 // Bool_t ispiKpMC = IspiKpMC(part,arrayMC);
2060 
2061 // tmp[15] = ispKpiMC?1:ispiKpMC?2:0;
2062 
2063  fNtupleLambdacReco->Fill(tmp);
2064  PostData(6,fNtupleLambdacReco);
2065 }
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
double Double_t
Definition: External.C:58
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)
Definition: External.C:236
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:304
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:247
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:237
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
int Int_t
Definition: External.C:63
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
float Float_t
Definition: External.C:68
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:260
const char Option_t
Definition: External.C:48
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
bool Bool_t
Definition: External.C:53
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