AliPhysics  608b256 (608b256)
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),
213  fhSelectBit(0),
214  fhSelectionBits(0),
217  fhSetIsLc(0),
218  fhPIDmassLcPt(0),
219  fhPIDmassLcPtSig(0),
222  fhMCmassLcPt(0),
223  fhMCmassLcPtSig(0),
224  fhMCmassLcPtSigc(0),
225  fhMCmassLcPtSigb(0),
226  fhProbmassLcPt(0),
232  fhIsLcGen(0),
233  fhIsLcReco(0),
234  fhRecoPDGmom(0),
235  fhPtMisIdpKpi(0),
236  fhPtMisIdpiKp(0),
237  fhPtCorrId(0),
242  fhPtCorrIdProb(0),
245  fNtupleLambdac(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 = 0;
1156  if(fRDCutsAnalysis->GetPidHF()) selectionProb = GetPIDselectionMaxProb(d);
1157 
1159  if(!selection) continue;
1161  fNentries->Fill(11);
1162 
1163  FillMassHists(aod,d,arrayMC,selection,selectionProb);
1164 
1165 
1166  if(fFillNtuple) FillNtuple(aod,d,arrayMC,selection);
1168  if(fIsLc>=1 && fIsLc <= 2) fNentries->Fill(16);
1169  if(unsetvtx) d->UnsetOwnPrimaryVtx();
1170  }
1171  fCounter->StoreCandidates(aod,nSelectedloose[0],kTRUE);
1172  fCounter->StoreCandidates(aod,nSelectedtight[0],kFALSE);
1173 
1174  PostData(1,fOutput);
1175  PostData(3,fNentries);
1176  PostData(4,fCounter);
1177 
1178  return;
1179 }
1180 
1181 
1182 
1183 //________________________________________________________________________
1185 {
1186  //
1188  //
1189 
1190  if (fDebug > 1) printf("AnalysisTaskSELambdac: Terminate() \n");
1191 
1192  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1193  if (!fOutput) {
1194  AliError("ERROR: fOutput not available\n");
1195  return;
1196  }
1197  //fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1198 
1199  if(fFillNtuple){
1200  fNtupleLambdac = dynamic_cast<TNtuple*>(GetOutputData(5));
1201  }
1202  if(fFillNtupleReco){
1203  fNtupleLambdacReco = dynamic_cast<TNtuple*>(GetOutputData(6));
1204  }
1205 
1206 
1207  return;
1208 }
1209 
1210 //________________________________________________________________________
1212 
1213  //
1215  //
1216 
1217  Int_t lambdacLab[3]={0,0,0};
1218  // Int_t pdgs[3]={0,0,0};
1219  for(Int_t i=0;i<3;i++){
1220  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1221  Int_t lab=daugh->GetLabel();
1222  if(lab<0) return 0;
1223  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab);
1224  if(!part) continue;
1225  // pdgs[i]=part->GetPdgCode();
1226  Int_t partPdgcode = TMath::Abs(part->GetPdgCode());
1227  if(partPdgcode==211 || partPdgcode==321 || partPdgcode==2212){
1228  Int_t motherLabel=part->GetMother();
1229  if(motherLabel<0) return 0;
1230  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(motherLabel);
1231  if(!motherPart) continue;
1232  Int_t motherPdg = TMath::Abs(motherPart->GetPdgCode());
1233  if(motherPdg==4122) {
1234  if(GetLambdacDaugh(motherPart,arrayMC)){lambdacLab[i]=motherLabel;continue;}
1235  }
1236  if(motherPdg==313 || motherPdg==2224 || motherPdg==3124){
1237  Int_t granMotherLabel=motherPart->GetMother();
1238  if(granMotherLabel<0) return 0;
1239  AliAODMCParticle *granMotherPart = (AliAODMCParticle*)arrayMC->At(granMotherLabel);
1240  if(!granMotherPart) continue;
1241  Int_t granMotherPdg = TMath::Abs(granMotherPart->GetPdgCode());
1242  if(granMotherPdg ==4122) {
1243  if(GetLambdacDaugh(granMotherPart,arrayMC)) {lambdacLab[i]=granMotherLabel;continue;}
1244  }
1245  }
1246  }
1247  }
1248 
1249  if(lambdacLab[0]==lambdacLab[1] && lambdacLab[1]==lambdacLab[2]) {return lambdacLab[0];}
1250  return 0;
1251 
1252 }
1253 
1254 //-----------------------------
1255 
1256 Int_t AliAnalysisTaskSELambdacTMVA::LambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC, Bool_t &IsInAcc) const {
1257 
1258  //
1262  //
1263 
1264  Int_t numberOfLambdac=0;
1265  IsInAcc=kTRUE;
1266  if(TMath::Abs(part->GetPdgCode())!=4122) return 0;
1267  // Int_t daughTmp[2];
1268  // daughTmp[0]=part->GetDaughterLabel(0);
1269  // daughTmp[1]=part->GetDaughterLabel(1);
1270  Int_t nDaugh = (Int_t)part->GetNDaughters();
1271  if(nDaugh<2) return 0;
1272  if(nDaugh>3) return 0;
1273  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)arrayMC->At(part->GetDaughterLabel(0));
1274  if(!pdaugh1) {return 0;}
1275  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
1276  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)arrayMC->At(part->GetDaughterLabel(1));
1277  if(!pdaugh2) {return 0;}
1278  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
1279 
1280  AliDebug(2,"Is non resonant?");
1281  if(nDaugh==3){
1282  Int_t thirdDaugh=part->GetDaughterLabel(1)-1;
1283  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)arrayMC->At(thirdDaugh);
1284  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
1285  if((number1==321 && number2==211 && number3==2212) ||
1286  (number1==211 && number2==321 && number3==2212) ||
1287  (number1==211 && number2==2212 && number3==321) ||
1288  (number1==321 && number2==2212 && number3==211) ||
1289  (number1==2212 && number2==321 && number3==211) ||
1290  (number1==2212 && number2==211 && number3==321)) {
1291  numberOfLambdac++;
1292  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1293  || TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1294  || TMath::Abs(pdaugh3->Eta()) > 0.9 || pdaugh3->Pt() < 0.1) IsInAcc=kFALSE;
1295  AliDebug(2,"Lc decays non-resonantly");
1296  return 1;
1297  }
1298  }
1299 
1300  if(nDaugh==2){
1301 
1302  //Lambda resonant
1303 
1304  //Lambda -> p K*0
1305  //
1306  Int_t nfiglieK=0;
1307 
1308  if((number1==2212 && number2==313)){
1309  nfiglieK=pdaugh2->GetNDaughters();
1310  if(nfiglieK!=2) return 0;
1311  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughterLabel(0));
1312  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughterLabel(1));
1313  if(!pdaughK1) return 0;
1314  if(!pdaughK2) return 0;
1315  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) {
1316  numberOfLambdac++;
1317  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1318  || TMath::Abs(pdaughK1->Eta()) > 0.9 || pdaughK1->Pt() < 0.1
1319  || TMath::Abs(pdaughK2->Eta()) > 0.9 || pdaughK2->Pt() < 0.1) IsInAcc=kFALSE;
1320  AliDebug(2,"Lc decays via K* p");
1321  return 3;
1322  }
1323  }
1324 
1325  if((number1==313 && number2==2212)){
1326  nfiglieK=pdaugh1->GetNDaughters();
1327  if(nfiglieK!=2) return 0;
1328  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughterLabel(0));
1329  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughterLabel(1));
1330  if(!pdaughK1) return 0;
1331  if(!pdaughK2) return 0;
1332  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) {
1333  numberOfLambdac++;
1334  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1335  || TMath::Abs(pdaughK1->Eta()) > 0.9 || pdaughK1->Pt() < 0.1
1336  || TMath::Abs(pdaughK2->Eta()) > 0.9 || pdaughK2->Pt() < 0.1) IsInAcc=kFALSE;
1337  AliDebug(2,"Lc decays via K* p");
1338  return 3;
1339  }
1340  }
1341 
1342  //Lambda -> Delta++ k
1343  Int_t nfiglieDelta=0;
1344  if(number1==321 && number2==2224){
1345  nfiglieDelta=pdaugh2->GetNDaughters();
1346  if(nfiglieDelta!=2) return 0;
1347  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughterLabel(0));
1348  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughterLabel(1));
1349  if(!pdaughD1) return 0;
1350  if(!pdaughD2) return 0;
1351  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) {
1352  numberOfLambdac++;
1353  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1354  || TMath::Abs(pdaughD1->Eta()) > 0.9 || pdaughD1->Pt() < 0.1
1355  || TMath::Abs(pdaughD2->Eta()) > 0.9 || pdaughD2->Pt() < 0.1) IsInAcc=kFALSE;
1356  AliDebug(2,"Lc decays via Delta++ k");
1357  return 4;
1358  }
1359  }
1360  if(number1==2224 && number2==321){
1361  nfiglieDelta=pdaugh1->GetNDaughters();
1362  if(nfiglieDelta!=2) return 0;
1363  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughterLabel(0));
1364  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughterLabel(1));
1365  if(!pdaughD1) return 0;
1366  if(!pdaughD2) return 0;
1367  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) {
1368  numberOfLambdac++;
1369  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1370  || TMath::Abs(pdaughD1->Eta()) > 0.9 || pdaughD1->Pt() < 0.1
1371  || TMath::Abs(pdaughD2->Eta()) > 0.9 || pdaughD2->Pt() < 0.1) IsInAcc=kFALSE;
1372  AliDebug(2,"Lc decays via Delta++ k");
1373  return 4;
1374  }
1375  }
1376 
1377 
1378  //Lambdac -> Lambda(1520) pi
1379  Int_t nfiglieLa=0;
1380  if(number1==3124 && number2==211){
1381  nfiglieLa=pdaugh1->GetNDaughters();
1382  if(nfiglieLa!=2) return 0;
1383  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughterLabel(0));
1384  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughterLabel(1));
1385  if(!pdaughL1) return 0;
1386  if(!pdaughL2) return 0;
1387  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) {
1388  numberOfLambdac++;
1389  if( TMath::Abs(pdaugh2->Eta()) > 0.9 || pdaugh2->Pt() < 0.1
1390  || TMath::Abs(pdaughL1->Eta()) > 0.9 || pdaughL1->Pt() < 0.1
1391  || TMath::Abs(pdaughL2->Eta()) > 0.9 || pdaughL2->Pt() < 0.1) IsInAcc=kFALSE;
1392  AliDebug(2,"Lc decays via Lambda(1520) pi");
1393  return 2;
1394  }
1395  }
1396  if(number1==211 && number2==3124){
1397  nfiglieLa=pdaugh2->GetNDaughters();
1398  if(nfiglieLa!=2) return 0;
1399  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughterLabel(0));
1400  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughterLabel(1));
1401  if(!pdaughL1) return 0;
1402  if(!pdaughL2) return 0;
1403  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) {
1404  numberOfLambdac++;
1405  if( TMath::Abs(pdaugh1->Eta()) > 0.9 || pdaugh1->Pt() < 0.1
1406  || TMath::Abs(pdaughL1->Eta()) > 0.9 || pdaughL1->Pt() < 0.1
1407  || TMath::Abs(pdaughL2->Eta()) > 0.9 || pdaughL2->Pt() < 0.1) IsInAcc=kFALSE;
1408  AliDebug(2,"Lc decays via Lambda(1520) pi");
1409  return 2;
1410  }
1411  }
1412  }
1413 
1414  if(numberOfLambdac>0) {return -100; AliDebug(2,"Lc decays via one of 4 resonances!");}
1415  return 0;
1416 }
1417 
1418 //-----------------------------
1419 
1420 void AliAnalysisTaskSELambdacTMVA::SetIsLcGen(AliAODMCParticle *mcPart, TClonesArray *arrayMC) {
1421 
1422  //
1425  //
1426 
1427  fIsLc=0;
1428  if(TMath::Abs(mcPart->GetPdgCode())==4122) {
1429  AliDebug(2,"Found Lc! now check mother");
1430  fIsLc=1;
1431  Int_t pdgMom = 0;
1432  pdgMom=fVertUtil->CheckOrigin(arrayMC,mcPart,fKeepLcNotFromQuark ? kFALSE : kTRUE);
1433  if(pdgMom == 5){
1434  AliDebug(2,"Lc comes from b");
1435  fIsLc=2;
1436  }
1437  else if(pdgMom==4) {
1438  fIsLc=1;
1439  }
1440  else {
1441  fIsLc=0;
1442  fhIsLcResonantGen->Fill(-1);
1443  }
1444  }
1445 }
1446 
1447 
1448 //-----------------------------
1449 
1451  TClonesArray *arrayMC) {
1452 
1453  //
1457  //
1458 
1459  Int_t labDp=-1;
1460  fIsLc = 0;
1461  fIsLcResonant=0;
1462  if(!fReadMC) return;
1463  else{ //MC, check if Lc prompt or non prompt
1464  Int_t pdgCand =4122;
1465  Int_t pdgDaughter[3]={-1,-1,-1};
1466  pdgDaughter[0]=2212;
1467  pdgDaughter[1]=321;
1468  pdgDaughter[2]=211;
1469 
1470  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
1471  if(labDp>=0){
1472  AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1473  Int_t pdgMom=fVertUtil->CheckOrigin(arrayMC,partDp,fKeepLcNotFromQuark ? kFALSE : kTRUE);
1474  fhRecoPDGmom->Fill(pdgMom);
1475  if(pdgMom == 4) fIsLc=1;
1476  else if(pdgMom == 5) fIsLc=2;
1477  else fIsLc=0;
1478  Bool_t dummy = kTRUE;
1479  if(fIsLc>0) SetLambdacDaugh(partDp, arrayMC, dummy);
1480  }
1481 
1482  }
1483 }
1484 
1485 //---------------------------
1486 
1487 void AliAnalysisTaskSELambdacTMVA::FillMassHists(AliAODEvent *aod, AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Int_t selection, Int_t selectionProb) {
1489  Bool_t IsInjected = 0;
1490  Double_t invMassLcpKpi = d->InvMassLcpKpi();
1491  Double_t invMassLcpiKp = d->InvMassLcpiKp();
1492  Bool_t ispKpiMC = 0;
1493  Bool_t ispiKpMC = 0;
1494 
1495  if(fReadMC) {
1496  ispKpiMC = IspKpiMC(d,arrayMC);
1497  ispiKpMC = IspiKpMC(d,arrayMC);
1498  AliAODMCHeader *mcHeader2 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1499  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(d,mcHeader2,arrayMC); //for dedicated MC set to 0
1500 
1501  //signal
1502  if(fIsLc>=1) {
1503  //MC PID
1504  fhMCmassLcPtSig->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1505  if(fIsLc==1) fhMCmassLcPtSigc->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1506  else if(fIsLc==2) fhMCmassLcPtSigb->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1507  //Real PID
1508  if(selection==1){
1509  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpKpi);
1510  if(fIsLc==1) fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpKpi);
1511  else if(fIsLc==2) fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpKpi);
1512  }
1513  else if(selection==2){
1514  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpiKp);
1515  if(fIsLc==1) fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpiKp);
1516  else if(fIsLc==2) fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpiKp);
1517  }
1518  else if(selection==3){
1519  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpiKp,0.5);
1520  fhPIDmassLcPtSig->Fill(d->Pt(),invMassLcpKpi,0.5);
1521  if(fIsLc==1) {
1522  fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpiKp,0.5);
1523  fhPIDmassLcPtSigc->Fill(d->Pt(),invMassLcpKpi,0.5);
1524  }
1525  else if(fIsLc==2) {
1526  fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpiKp,0.5);
1527  fhPIDmassLcPtSigb->Fill(d->Pt(),invMassLcpKpi,0.5);
1528  }
1529  }
1530  //max prob PID
1531  if(selectionProb==1) {
1532  fhProbmassLcPtSig->Fill(d->Pt(), invMassLcpKpi);
1533  if(fIsLc==1)fhProbmassLcPtSigc->Fill(d->Pt(), invMassLcpKpi);
1534  if(fIsLc==2)fhProbmassLcPtSigb->Fill(d->Pt(), invMassLcpKpi);
1535  }
1536  else if(selectionProb==2) {
1537  fhProbmassLcPtSig->Fill(d->Pt(), invMassLcpiKp);
1538  if(fIsLc==1)fhProbmassLcPtSigc->Fill(d->Pt(), invMassLcpiKp);
1539  if(fIsLc==2)fhProbmassLcPtSigb->Fill(d->Pt(), invMassLcpiKp);
1540  }
1541 
1542  // mis id'd signal candidates
1543  if(ispKpiMC && selection==2){ //RDHF PID
1544  fhPtMisIdpKpi->Fill(fCandidateVars[0]);
1545  fhInvMassMisIdpKpi->Fill(fCandidateVars[0],invMassLcpiKp);
1546  }
1547  else if(ispiKpMC && selection==1){
1548  fhPtMisIdpiKp->Fill(fCandidateVars[0]);
1549  fhInvMassMisIdpiKp->Fill(fCandidateVars[0],invMassLcpKpi);
1550  }
1551  else fhPtCorrId->Fill(fCandidateVars[0]);
1552 
1553  if(ispKpiMC && selectionProb==2){ //PID using max prob. criteria
1555  fhInvMassMisIdpKpiProb->Fill(fCandidateVars[0],invMassLcpiKp);
1556  }
1557  else if(ispiKpMC && selectionProb==1){
1559  fhInvMassMisIdpiKpProb->Fill(fCandidateVars[0],invMassLcpKpi);
1560  }
1561  else fhPtCorrIdProb->Fill(fCandidateVars[0]);
1562 
1563  }
1564  }
1565  //Bkg
1566  if(!fReadMC || (fIsLc==0 && (!IsInjected || fSyst ==0))) { //data or non-injected background or pp background
1567  //MC PID
1568  if(fReadMC) fhMCmassLcPt->Fill(d->Pt(),ispKpiMC ? invMassLcpKpi : invMassLcpiKp);
1569  //Real PID
1570  if(selection==1){
1571  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpKpi);
1572  }
1573  else if(selection==2){
1574  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpiKp);
1575  }
1576  else if(selection==3){
1577  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpiKp,0.5);
1578  fhPIDmassLcPt->Fill(d->Pt(),invMassLcpKpi,0.5);
1579  }
1580  //max prob PID
1581  if(selectionProb==1) fhProbmassLcPt->Fill(d->Pt(),invMassLcpKpi);
1582  else if(selectionProb==2) fhProbmassLcPt->Fill(d->Pt(),invMassLcpiKp);
1583  }
1584 }
1585 
1586 //---------------------------
1587 
1589  TClonesArray *arrayMC, Int_t selection)
1590 {
1591  //
1593  //
1594 
1595  if(fReadMC && !fKeepBkgNt && fIsLc==0) return; //don't continue if bkg and only want signal
1596 
1597  Bool_t IsInjected = 0;
1598  Bool_t IsLc = 0;
1599  Bool_t IsLcfromLb = 0;
1600 
1601  if(fReadMC){
1602  AliAODMCHeader *mcHeader3 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1603  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(part,mcHeader3,arrayMC); //for dedicated MC set to 0
1604  }
1605  if(fIsLc>=1 && fIsLc<=2) IsLc=kTRUE;
1606  if(fIsLc==2) IsLcfromLb=kTRUE;
1607  if(fReadMC && IsInjected && !IsLc && fSyst >=1 ) return; //dont fill if injected bkg, pPb or PbPb
1608 
1609  Double_t invMasspKpi=-1.;
1610  Double_t invMasspiKp=-1.;
1611  //apply MC PID
1612  if(fReadMC && fMCPid){
1613  if(IspKpiMC(part,arrayMC)) invMasspKpi=part->InvMassLcpKpi();
1614  else if(IspiKpMC(part,arrayMC)) invMasspiKp=part->InvMassLcpiKp();
1615  //else return;
1616  }
1617  // apply realistic PID
1618  if(fRealPid){
1619  if(selection==1 || selection==3) invMasspKpi=part->InvMassLcpKpi();
1620  else if(selection>=2) invMasspiKp=part->InvMassLcpiKp();
1621  }
1622  // Float_t centrality=fRDCutsAnalysis->GetCentrality(aod);
1623  // Int_t runNumber=aod->GetRunNumber();
1624 
1625  //fill ntuple
1626  // 1 - loose pid
1627  // 2 - bayesian pid
1628  Float_t tmp[58];
1629  //Is Lc
1630  if(!IsInjected && IsLc==0) tmp[0]=0; //non-injected bkg
1631  else if(IsLc==1 && !IsLcfromLb) tmp[0]=1; //prompt Lc
1632  else if(IsLc==1 && IsLcfromLb) tmp[0]=2; //non-prompt Lc
1633  else if(IsInjected && IsLc==0) tmp[0]=3; //injected bkg
1634  else tmp[0]=-99; //should not happen
1635 
1636  //invariant mass
1637  tmp[2]=part->InvMassLcpiKp();
1638  tmp[1]=part->InvMassLcpKpi();
1639  tmp[3]=part->Charge();
1640  //pt of decay products
1641  tmp[4]=part->PtProng(0);
1642  tmp[5]=part->PtProng(1); //pt kaon
1643  tmp[6]=part->PtProng(2);
1644  Float_t ptLc=part->Pt();
1645  tmp[7]=ptLc;
1646  tmp[8]=part->CosPointingAngle();
1647  tmp[9]=part->DecayLength();
1648  tmp[10]=part->NormalizedDecayLength();
1649  tmp[11]=TMath::Min(part->GetDist12toPrim(),part->GetDist23toPrim());
1650  tmp[12]=part->GetSigmaVert();
1651  Double_t dcas[3]={0};
1652  part->GetDCAs(dcas);
1653  tmp[13]=TMath::Max(dcas[0],TMath::Max(dcas[1],dcas[2]));
1654  tmp[14]=part->DecayLengthXY();
1655  tmp[15]=part->NormalizedDecayLengthXY();
1656 
1657  //Check resonant decays for efficiencies
1658  tmp[16]=fIsLcResonant; // bkg
1659  //PID selection
1660  tmp[17]=selection;
1661  //FONLL weights
1662 
1663  AliVTrack *track0=dynamic_cast<AliVTrack*>(part->GetDaughter(0));
1664  AliVTrack *track1=dynamic_cast<AliVTrack*>(part->GetDaughter(1));
1665  AliVTrack *track2=dynamic_cast<AliVTrack*>(part->GetDaughter(2));
1666  // PID
1667  // fill w -1
1668  for(Int_t iprob=18;iprob<=26;iprob++) {
1669  tmp[iprob]=-1;
1670  }
1671  if(fRDCutsAnalysis->GetIsUsePID() ) {
1672  if(fRDCutsAnalysis->GetPidHF()->GetUseCombined()) {//check this
1673  //bayesian probabilities
1674  Double_t prob0[AliPID::kSPECIES];
1675  Double_t prob1[AliPID::kSPECIES];
1676  Double_t prob2[AliPID::kSPECIES];
1677 
1678  if (!track0 || !track1 || !track2) {
1679  AliError("AliVTrack missing - wont fill Ntuple");
1680  return;
1681  }
1682  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track0,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob0);
1683  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track1,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob1);
1684  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track2,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob2);
1685  //if(prob0[AliPID::kPion] < 0.3 && prob0[AliPID::kProton] < 0.3) return;
1686  //if(prob1[AliPID::kKaon] < 0.3) return;
1687  //if(prob2[AliPID::kPion] < 0.3 && prob2[AliPID::kProton] < 0.3) return;
1688  tmp[18]=prob0[AliPID::kPion]; //track 0, pion
1689  tmp[19]=prob0[AliPID::kKaon]; //kaon
1690  tmp[20]=prob0[AliPID::kProton]; //proton
1691  tmp[21]=prob1[AliPID::kPion]; //track 1, pion
1692  tmp[22]=prob1[AliPID::kKaon]; //kaon
1693  tmp[23]=prob1[AliPID::kProton]; //proton
1694  tmp[24]=prob2[AliPID::kPion]; //track 2, pion
1695  tmp[25]=prob2[AliPID::kKaon]; //kaon
1696  tmp[26]=prob2[AliPID::kProton]; //proton
1697  }
1698  }
1699  if(fFillNtuple>=2) { //fill with further variables
1700  Double_t d00 = part->Getd0Prong(0);
1701  Double_t d01 = part->Getd0Prong(1);
1702  Double_t d02 = part->Getd0Prong(2);
1703  Double_t d0err0 = part->Getd0errProng(0);
1704  Double_t d0err1 = part->Getd0errProng(1);
1705  Double_t d0err2 = part->Getd0errProng(2);
1706  tmp[27]=d00;
1707  tmp[28]=d01;
1708  tmp[29]=d02;
1709  tmp[30]=d00*d00 + d01*d01 + d02*d02;
1710  tmp[31]=d00/d0err0;
1711  tmp[32]=d01/d0err1;
1712  tmp[33]=d02/d0err2;
1713  Double_t dd0,edd0;
1714  Double_t dd1,edd1;
1715  Double_t dd2,edd2;
1716  part->Getd0MeasMinusExpProng(0,aod->GetMagneticField(),dd0,edd0);
1717  part->Getd0MeasMinusExpProng(1,aod->GetMagneticField(),dd1,edd1);
1718  part->Getd0MeasMinusExpProng(2,aod->GetMagneticField(),dd2,edd2);
1719  Double_t ns0=dd0/edd0;
1720  Double_t ns1=dd1/edd1;
1721  Double_t ns2=dd2/edd2;
1722  tmp[34]=ns0;
1723  tmp[35]=ns1;
1724  tmp[36]=ns2;
1725  tmp[37]=part->CosPointingAngleXY();
1726  tmp[13]=dcas[0];
1727  tmp[38]=dcas[1];
1728  tmp[39]=dcas[2];
1729  tmp[11]=part->GetDist12toPrim();
1730  tmp[40]=part->GetDist23toPrim();
1731  Int_t runNumber=aod->GetRunNumber();
1732  tmp[41]=(Float_t)runNumber;
1733 
1734  if(fFillNtuple>=3) { //fill with weights
1735  Double_t ptLcMC=-1;
1736  //D meson weights
1737  Double_t weightPythia=-1,weight7LHC10f6a=-1,weight5LHC10f6a=-1,weight5LHC13d3=-1;
1738  //Lc weights
1739  Double_t weight7LHC10f7aLc=-1,weight7LHC11b2Lc=-1,weight5LHC13d3Lc=-1;
1740  if(IsLc) {
1741  //Get MC Lc to get true pT
1742  Int_t labDp = -1;
1743  Int_t pdgCand =4122;
1744  Int_t pdgDaughter[3]={-1,-1,-1};
1745  pdgDaughter[0]=2212;
1746  pdgDaughter[1]=321;
1747  pdgDaughter[2]=211;
1748  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
1749  if(labDp>=0){
1750  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(labDp);
1751  ptLcMC = motherPart->Pt();
1752  weightPythia = fFuncWeightPythia->Eval(ptLcMC);
1753  weight7LHC10f6a = fFuncWeightFONLL7overLHC10f6a->Eval(ptLcMC);
1754  weight5LHC10f6a = fFuncWeightFONLL5overLHC10f6a->Eval(ptLcMC);
1755  weight5LHC13d3 = fFuncWeightFONLL5overLHC13d3->Eval(ptLcMC);
1756  weight5LHC13d3Lc = fFuncWeightFONLL5overLHC13d3Lc->Eval(ptLcMC);
1757  weight7LHC11b2Lc = fFuncWeightFONLL7overLHC11b2Lc->Eval(ptLcMC);
1758  weight7LHC10f7aLc = fFuncWeightFONLL7overLHC10f7aLc->Eval(ptLcMC);
1759  }
1760  }
1761  tmp[42]=ptLcMC;
1762  tmp[43]=weightPythia;
1763  tmp[44]=weight7LHC10f6a;
1764  tmp[45]=weight5LHC10f6a;
1765  tmp[46]=weight5LHC13d3;
1766  tmp[47]=weight5LHC13d3Lc;
1767  tmp[48]=weight7LHC11b2Lc;
1768  tmp[49]=weight7LHC10f7aLc;
1769 
1770  //Multiplicity weights
1771  Double_t multWeight = 1.;
1772  Double_t nTracklets = 0.;
1773  if(fUseNchWeight){
1774  //tracklets within |eta| < 1.
1775  nTracklets = static_cast<Int_t>(fVertUtil->GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
1776  multWeight *= GetNchWeight(static_cast<Int_t>(nTracklets));
1777  AliDebug(2,Form("Using Nch weights, Mult=%f Weight=%f\n",nTracklets,multWeight));
1778  }
1779  tmp[50]=nTracklets;
1780  tmp[51]=multWeight;
1781 
1782 
1783  if(fFillNtuple>=4) { //fill with invariant mass of 2 prongs
1784  tmp[52]=part->InvMass2Prongs(1,0,321,2212); //inv mass pK
1785  tmp[53]=part->InvMass2Prongs(2,1,211,321); //inv mass Kpi
1786  tmp[54]=part->InvMass2Prongs(2,0,211,2212);//inv mass ppi
1787  tmp[55]=part->InvMass2Prongs(1,2,321,2212); //inv mass Kp
1788  tmp[56]=part->InvMass2Prongs(0,1,211,321); //inv mass piK
1789  tmp[57]=part->InvMass2Prongs(0,2,211,2212);//inv mass pip
1790  }
1791  }
1792  }
1793  fNtupleLambdac->Fill(tmp);
1794  PostData(5,fNtupleLambdac);
1795 
1796  return;
1797 }
1798 
1799 //---------------------------
1800 
1802 
1803  //
1806  //
1807 
1808  //fill according to kStep - hArray[nSteps]
1809  if(!fIsLc) {
1810  fhNBkgNI[kStep]->Fill(fCandidateVars[0]);
1811  fhPtEtaBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1812  fhPtYBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1813  fhPtPhiBkgNI[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1814  }
1815 
1816  else{
1817  fhNLc[kStep]->Fill(fCandidateVars[0]);
1818  fhPtEtaLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1819  fhPtYLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1820  fhPtPhiLc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1821 
1822  if(fIsLc==1) { //prompt Lc
1823  fhNLcc[kStep]->Fill(fCandidateVars[0]);
1824  fhPtEtaLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1825  fhPtYLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1826  fhPtPhiLcc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1827  if(fIsLcResonant==1){
1828  fhNLcNonRc[kStep]->Fill(fCandidateVars[0]);
1829  fhPtEtaLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1830  fhPtYLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1831  fhPtPhiLcNonRc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1832  }
1833  else if(fIsLcResonant==2){
1834  fhNLcL1520c[kStep]->Fill(fCandidateVars[0]);
1835  fhPtEtaLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1836  fhPtYLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1837  fhPtPhiLcL1520c[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1838  }
1839  else if(fIsLcResonant==3){
1840  fhNLcKstarc[kStep]->Fill(fCandidateVars[0]);
1841  fhPtEtaLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1842  fhPtYLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1843  fhPtPhiLcKstarc[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1844  }
1845  else if(fIsLcResonant==4){
1846  fhNLcDeltac[kStep]->Fill(fCandidateVars[0]);
1847  fhPtEtaLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1848  fhPtYLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1849  fhPtPhiLcDeltac[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1850  }
1851  }
1852  else if(fIsLc==2) { //non-prompt Lc
1853  fhNLcb[kStep]->Fill(fCandidateVars[0]);
1854  fhPtEtaLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1855  fhPtYLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1856  fhPtPhiLcb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1857  if(fIsLcResonant==1){
1858  fhNLcNonRb[kStep]->Fill(fCandidateVars[0]);
1859  fhPtEtaLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1860  fhPtYLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1861  fhPtPhiLcNonRb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1862  }
1863  else if(fIsLcResonant==2){
1864  fhNLcL1520b[kStep]->Fill(fCandidateVars[0]);
1865  fhPtEtaLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1866  fhPtYLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1867  fhPtPhiLcL1520b[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1868  }
1869  else if(fIsLcResonant==3){
1870  fhNLcKstarb[kStep]->Fill(fCandidateVars[0]);
1871  fhPtEtaLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1872  fhPtYLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1873  fhPtPhiLcKstarb[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1874  }
1875  else if(fIsLcResonant==4){
1876  fhNLcDeltab[kStep]->Fill(fCandidateVars[0]);
1877  fhPtEtaLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[1]);
1878  fhPtYLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[2]);
1879  fhPtPhiLcDeltab[kStep]->Fill(fCandidateVars[0],fCandidateVars[3]);
1880  }
1881  }
1882  }
1883 }
1884 
1885 //-----------------------------
1886 
1888 
1889  //
1891  //
1892 
1893  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1894  for(Int_t i=0;i<3;i++){
1895  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1896  lab[i]=daugh->GetLabel();
1897  if(lab[i]<0) return kFALSE;
1898  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1899  if(!part) return kFALSE;
1900  pdgs[i]=TMath::Abs(part->GetPdgCode());
1901  }
1902 
1903  if(pdgs[0]==2212 && pdgs[1]==321 && pdgs[2]==211) return kTRUE;
1904 
1905  return kFALSE;
1906 }
1907 //-----------------------------
1909 
1910  //
1912  //
1913 
1914  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1915  for(Int_t i=0;i<3;i++){
1916  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1917  lab[i]=daugh->GetLabel();
1918  if(lab[i]<0) return kFALSE;
1919  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1920  if(!part) return kFALSE;
1921  pdgs[i]=TMath::Abs(part->GetPdgCode());
1922  }
1923 
1924  if(pdgs[2]==2212 && pdgs[1]==321 && pdgs[0]==211) {return kTRUE;}
1925 
1926  return kFALSE;
1927 }
1928 
1930  if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) hSelectionBits->Fill(1,fCandidateVars[0]);
1931  if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiPID)) hSelectionBits->Fill(2,fCandidateVars[0]);
1932  if(d->HasSelectionBit(AliRDHFCuts::kD0fromDstarCuts)) hSelectionBits->Fill(3,fCandidateVars[0]);
1933  if(d->HasSelectionBit(AliRDHFCuts::kD0fromDstarPID)) hSelectionBits->Fill(4,fCandidateVars[0]);
1934  if(d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) hSelectionBits->Fill(5,fCandidateVars[0]);
1935  if(d->HasSelectionBit(AliRDHFCuts::kDplusPID)) hSelectionBits->Fill(6,fCandidateVars[0]);
1936  if(d->HasSelectionBit(AliRDHFCuts::kDsCuts)) hSelectionBits->Fill(7,fCandidateVars[0]);
1937  if(d->HasSelectionBit(AliRDHFCuts::kDsPID)) hSelectionBits->Fill(8,fCandidateVars[0]);
1938  if(d->HasSelectionBit(AliRDHFCuts::kLcCuts)) hSelectionBits->Fill(9,fCandidateVars[0]);
1939  if(d->HasSelectionBit(AliRDHFCuts::kLcPID)) hSelectionBits->Fill(10,fCandidateVars[0]);
1940  if(d->HasSelectionBit(AliRDHFCuts::kDstarCuts)) hSelectionBits->Fill(11,fCandidateVars[0]);
1941  if(d->HasSelectionBit(AliRDHFCuts::kDstarPID)) hSelectionBits->Fill(12,fCandidateVars[0]);
1942 }
1943 
1944 //-----------------------------
1945 
1947 
1948  Int_t selection = 0;
1949 
1950  if(fRDCutsAnalysis->GetPidHF()->GetUseCombined()) {// get triplet identity based on the maximum probability
1951  AliVTrack *track0=dynamic_cast<AliVTrack*>(part->GetDaughter(0));
1952  AliVTrack *track1=dynamic_cast<AliVTrack*>(part->GetDaughter(1));
1953  AliVTrack *track2=dynamic_cast<AliVTrack*>(part->GetDaughter(2));
1954  //bayesian probabilities
1955  Double_t prob0[AliPID::kSPECIES];
1956  Double_t prob1[AliPID::kSPECIES];
1957  Double_t prob2[AliPID::kSPECIES];
1958 
1959  if (!track0 || !track1 || !track2) {
1960  AliError("AliVTrack missing");
1961  return 0;
1962  }
1963  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track0,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob0);
1964  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track1,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob1);
1965  fRDCutsAnalysis->GetPidHF()->GetPidCombined()->ComputeProbabilities(track2,fRDCutsAnalysis->GetPidHF()->GetPidResponse(),prob2);
1966  if(prob0[AliPID::kProton] * prob1[AliPID::kKaon] * prob2[AliPID::kPion] > prob2[AliPID::kProton] * prob1[AliPID::kKaon] * prob0[AliPID::kPion]) selection = 1; // pKpi
1967  else selection = 2; // piKp
1968  }
1969  return selection;
1970 }
1971 
1973  //
1974  // calculates the Nch weight using the measured and generateed Nch distributions
1975  //
1976  if(nch<=0) return 0.;
1977  if(!fHistoMCNch) { AliError("Input histos to evaluate Nch weights missing"); return 0.; }
1978  Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1979  Double_t weight = pMC;
1980  return weight;
1981 }
1982 
1984  TClonesArray *arrayMC)
1985 {
1986  //
1990  //
1991 
1992  Bool_t IsInjected = 0;
1993  Bool_t IsLc = 0;
1994  Bool_t IsLcfromLb = 0;
1995 
1996  if(fReadMC){
1997  AliAODMCHeader *mcHeader3 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1998  if(!fIsHijing) IsInjected = fVertUtil->IsCandidateInjected(part,mcHeader3,arrayMC); //for dedicated MC set to 0
1999  }
2000  if(fIsLc>=1 && fIsLc<=2) IsLc=kTRUE;
2001  if(fIsLc==2) IsLcfromLb=kTRUE;
2002  //if(fReadMC && IsInjected && !IsLc && fSyst >=1 ) return; //dont fill if injected bkg, pPb or PbPb
2003 
2004  Float_t tmp[16];
2005  //Is Lc
2006  if(!IsInjected && IsLc==0) tmp[0]=0; //non-injected bkg
2007  else if(IsLc==1 && !IsLcfromLb) tmp[0]=1; //prompt Lc
2008  else if(IsLc==1 && IsLcfromLb) tmp[0]=2; //non-prompt Lc
2009  else if(IsInjected && IsLc==0) tmp[0]=3; //injected bkg
2010  else tmp[0]=-99; //should not happen
2011  tmp[1]=part->Pt();
2012  //Get MC Lc to get true pT
2013  Float_t ptLcMC=0;
2014  Int_t labDp = -1;
2015  Int_t pdgCand =4122;
2016  Int_t pdgDaughter[3]={-1,-1,-1};
2017  pdgDaughter[0]=2212;
2018  pdgDaughter[1]=321;
2019  pdgDaughter[2]=211;
2020  labDp = part->MatchToMC(pdgCand,arrayMC,3,pdgDaughter);
2021  if(labDp>=0){
2022  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(labDp);
2023  ptLcMC = motherPart->Pt();
2024  }
2025  tmp[2]=ptLcMC;
2026 
2027  tmp[3]=part->PtProng(0);
2028  tmp[4]=part->PtProng(1); //pt kaon
2029  tmp[5]=part->PtProng(2);
2030  // Is the track good for TOF PID (for pp proton GEANT3/FLUKA correction)
2031  // and MC pt of each track
2032  Bool_t isTOFpid[3];
2033  Float_t MCpt[3];
2034  for(Int_t i=0;i<3;i++) {
2035  AliAODTrack *daugh=(AliAODTrack*)part->GetDaughter(i);
2036  Int_t daughLab= daugh->GetLabel();
2037  if(daughLab<0) continue;
2038  else{
2039  AliAODMCParticle* pdaugh = dynamic_cast<AliAODMCParticle*>(arrayMC->At(daughLab));
2040  isTOFpid[i] = fRDCutsAnalysis->GetIsUsePID() ? fRDCutsAnalysis->GetPidHF()->CheckTOFPIDStatus(daugh) : kFALSE;
2041  MCpt[i] = pdaugh->Pt();
2042  }
2043  }
2044  tmp[6]=MCpt[0];
2045  tmp[7]=MCpt[1];
2046  tmp[8]=MCpt[2];
2047  tmp[9]=isTOFpid[0];
2048  tmp[10]=isTOFpid[1];
2049  tmp[11]=isTOFpid[2];
2050 
2051  // Selection
2052  Int_t selectionCand=fRDCutsAnalysis->IsSelected(part,AliRDHFCuts::kCandidate,aod);
2053  Int_t selectionPID=fRDCutsAnalysis->IsSelected(part,AliRDHFCuts::kPID,aod);
2054  Int_t selectionPIDprob = 0;
2055  if(fRDCutsAnalysis->GetIsUsePID()) selectionPIDprob = GetPIDselectionMaxProb(part);
2056  tmp[12]=selectionCand;
2057  tmp[13]=selectionPID;
2058  tmp[14]=selectionPIDprob;
2059  tmp[15]=part->Charge();
2060 
2061 // Bool_t ispKpiMC = IspKpiMC(part,arrayMC);
2062 // Bool_t ispiKpMC = IspiKpMC(part,arrayMC);
2063 
2064 // tmp[15] = ispKpiMC?1:ispiKpMC?2:0;
2065 
2066  fNtupleLambdacReco->Fill(tmp);
2067  PostData(6,fNtupleLambdacReco);
2068 }
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&#39;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
Bool_t fAnalysis
flag to cut with KF vertexer
TH2F * fhPtEtaBkgNI[12]
! hist. for n bkg, pT vs eta
TH1F * fHistNEventsRejTM
!hist. for Rejected events from null trigger mask
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&#39;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:331
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&#39;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&#39;d pKpi
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Functions to check the decay tree.
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:271
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:261
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&#39;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&#39;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)
Float_t fPtLc
candidate variables, 0=Pt, 1=Eta, 2=Y, 3=Phi
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&#39;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.
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&#39;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:284
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
Bool_t fUseKF
flag for PID with resonant channels
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&#39;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&#39;d pKpi most prob PID
Bool_t fLcPIDCut
flag for Lc filter bit cut
AliRDHFCutsLctopKpi * fRDCutsAnalysis
lower inv mass limit for histos