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