AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSELambdac.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: AliAnalysisTaskSELambdac.cxx 63644 2013-07-23 09:04:11Z zconesa $ */
17 
19 //
20 // AliAnalysisTaskSE for the extraction of signal(e.g Lambdac) of heavy flavor
21 // decay candidates with the MC truth.
22 // Authors: r.romita@gsi.de
24 
25 #include <TClonesArray.h>
26 #include <TNtuple.h>
27 #include <TCanvas.h>
28 #include <TList.h>
29 #include <TString.h>
30 #include <TH1F.h>
31 #include <TH2F.h>
32 #include <TDatabasePDG.h>
33 
34 #include <AliAnalysisDataSlot.h>
35 #include <AliAnalysisDataContainer.h>
36 #include "AliAnalysisManager.h"
37 #include "AliAODHandler.h"
38 #include "AliAODEvent.h"
39 #include "AliAODVertex.h"
40 #include "AliAODTrack.h"
41 #include "AliAODMCHeader.h"
42 #include "AliAODMCParticle.h"
44 #include "AliAnalysisVertexingHF.h"
45 #include "AliAnalysisTaskSE.h"
47 #include "AliKFParticle.h"
48 #include "AliAODPidHF.h"
49 #include "AliRDHFCutsLctopKpi.h"
50 #include "AliRDHFCuts.h"
51 #include "AliKFVertex.h"
52 #include "AliESDVertex.h"
53 //#include "AliAODpidUtil.h"
54 #include "AliAODPid.h"
55 #include "AliInputEventHandler.h"
56 #include "AliPID.h"
58 #include "AliVertexingHFUtils.h"
59 
60 
64 
65 //________________________________________________________________________
67 AliAnalysisTaskSE(),
68  fOutput(0),
69  fHistNEvents(0),
70  fhChi2(0),
71  fhMassPtGreater3(0),
72  fhMassPtGreater3TC(0),
73  fhMassPtGreater3Kp(0),
74  fhMassPtGreater3KpTC(0),
75  fhMassPtGreater3Lpi(0),
76  fhMassPtGreater3LpiTC(0),
77  fhMassPtGreater3Dk(0),
78  fhMassPtGreater3DkTC(0),
79  fhMassPtGreater33Pr(0),
80  fhMassPtGreater33PrTC(0),
81  fhMassPtGreater2(0),
82  fhMassPtGreater2TC(0),
83  fhMassPtGreater2Kp(0),
84  fhMassPtGreater2KpTC(0),
85  fhMassPtGreater2Lpi(0),
86  fhMassPtGreater2LpiTC(0),
87  fhMassPtGreater2Dk(0),
88  fhMassPtGreater2DkTC(0),
89  fhMassPtGreater23Pr(0),
90  fhMassPtGreater23PrTC(0),
91  fhMassLcPt(0),
92  fhMassLcplusPt(0),
93  fhMassLcminusPt(0),
94  fhEta3Prong(0),
95  fhEta3ProngAcc(0),
96  fhEta3ProngProd(0),
97  fhEta3ProngAn(0),
98  fhRap3Prong(0),
99  fhRap3ProngAcc(0),
100  fhRap3ProngProd(0),
101  fhRap3ProngAn(0),
102  fhSelectBit(0),
103  fhProtonPtProngLcPt(0),
104  fhBProtonPtProngLcPt(0),
105  fhProtond0ProngLcPt(0),
106  fhBProtond0ProngLcPt(0),
107  fhKaonPtProngLcPt(0),
108  fhBKaonPtProngLcPt(0),
109  fhKaond0ProngLcPt(0),
110  fhBKaond0ProngLcPt(0),
111  fhPionPtProngLcPt(0),
112  fhBPionPtProngLcPt(0),
113  fhPiond0ProngLcPt(0),
114  fhBPiond0ProngLcPt(0),
115  fhDist12PrimLcPt(0),
116  fhBDist12PrimLcPt(0),
117  fhSigmaVertLcPt(0),
118  fhBSigmaVertLcPt(0),
119  fhdcasLcPt(0),
120  fhBdcasLcPt(0),
121  fhCosPointingAngleLcPt(0),
122  fhBCosPointingAngleLcPt(0),
123  fhDecayLengthLcPt(0),
124  fhBDecayLengthLcPt(0),
125  fhSum2LcPt(0),
126  fhBSum2LcPt(0),
127  fhPtMaxLcPt(0),
128  fhBPtMaxLcPt(0),
129  fNtupleLambdac(0),
130  fUpmasslimit(2.486),
131  fLowmasslimit(2.086),
132  fNPtBins(0),
133  fRDCutsAnalysis(0),
134  fRDCutsProduction(0),
135  fListCuts(0),
136  fFillNtuple(kFALSE),
137  fReadMC(kFALSE),
138  fMCPid(kFALSE),
139  fRealPid(kFALSE),
140  fResPid(kTRUE),
141  fUseKF(kFALSE),
142  fAnalysis(kFALSE),
143  fVHF(0),
144  fFillVarHists(kFALSE),
145  fMultiplicityHists(kFALSE),
146  fPriorsHists(kFALSE),
147  fLcCut(kFALSE),
148  fLcPIDCut(kFALSE),
149  fNentries(0),
150  fOutputMC(0),
151  fAPriori(0),
152  fMultiplicity(0),
153 //fUtilPid(0),
154  fPIDResponse(0),
155  fCounter(0)
156 {
157  // Default constructor
158  Float_t ptlims[7]={0.,2.,4.,6.,8.,12.,24.};
159  SetPtBinLimit(7,ptlims);
160  for(Int_t icut=0; icut<2; icut++) fCutsKF[icut]=0.;
161  for(Int_t j=0; j<3*kMaxPtBins; j++){
162  fMassHist[j]=0x0;
163  fMassHistTC[j]=0x0;
164  fMassHistLpi[j]=0x0;
165  fMassHistLpiTC[j]=0x0;
166  fMassHistKp[j]=0x0;
167  fMassHistKpTC[j]=0x0;
168  fMassHistDk[j]=0x0;
169  fMassHistDkTC[j]=0x0;
170  fMassHist3Pr[j]=0x0;
171  fMassHist3PrTC[j]=0x0;
172  }
173 }
174 
175 //________________________________________________________________________
176 AliAnalysisTaskSELambdac::AliAnalysisTaskSELambdac(const char *name,Bool_t fillNtuple,AliRDHFCutsLctopKpi *lccutsana,AliRDHFCutsLctopKpi *lccutsprod):
177  AliAnalysisTaskSE(name),
178  fOutput(0),
179  fHistNEvents(0),
180  fhChi2(0),
181  fhMassPtGreater3(0),
182  fhMassPtGreater3TC(0),
183  fhMassPtGreater3Kp(0),
184  fhMassPtGreater3KpTC(0),
185  fhMassPtGreater3Lpi(0),
186  fhMassPtGreater3LpiTC(0),
187  fhMassPtGreater3Dk(0),
188  fhMassPtGreater3DkTC(0),
189  fhMassPtGreater33Pr(0),
190  fhMassPtGreater33PrTC(0),
191  fhMassPtGreater2(0),
192  fhMassPtGreater2TC(0),
193  fhMassPtGreater2Kp(0),
194  fhMassPtGreater2KpTC(0),
195  fhMassPtGreater2Lpi(0),
196  fhMassPtGreater2LpiTC(0),
197  fhMassPtGreater2Dk(0),
198  fhMassPtGreater2DkTC(0),
199  fhMassPtGreater23Pr(0),
200  fhMassPtGreater23PrTC(0),
201  fhMassLcPt(0),
202  fhMassLcplusPt(0),
203  fhMassLcminusPt(0),
204  fhEta3Prong(0),
205  fhEta3ProngAcc(0),
206  fhEta3ProngProd(0),
207  fhEta3ProngAn(0),
208  fhRap3Prong(0),
209  fhRap3ProngAcc(0),
210  fhRap3ProngProd(0),
211  fhRap3ProngAn(0),
212  fhSelectBit(0),
213  fhProtonPtProngLcPt(0),
214  fhBProtonPtProngLcPt(0),
215  fhProtond0ProngLcPt(0),
216  fhBProtond0ProngLcPt(0),
217  fhKaonPtProngLcPt(0),
218  fhBKaonPtProngLcPt(0),
219  fhKaond0ProngLcPt(0),
220  fhBKaond0ProngLcPt(0),
221  fhPionPtProngLcPt(0),
222  fhBPionPtProngLcPt(0),
223  fhPiond0ProngLcPt(0),
224  fhBPiond0ProngLcPt(0),
225  fhDist12PrimLcPt(0),
226  fhBDist12PrimLcPt(0),
227  fhSigmaVertLcPt(0),
228  fhBSigmaVertLcPt(0),
229  fhdcasLcPt(0),
230  fhBdcasLcPt(0),
231  fhCosPointingAngleLcPt(0),
232  fhBCosPointingAngleLcPt(0),
233  fhDecayLengthLcPt(0),
234  fhBDecayLengthLcPt(0),
235  fhSum2LcPt(0),
236  fhBSum2LcPt(0),
237  fhPtMaxLcPt(0),
238  fhBPtMaxLcPt(0),
239  fNtupleLambdac(0),
240  fUpmasslimit(2.486),
241  fLowmasslimit(2.086),
242  fNPtBins(0),
243  fRDCutsAnalysis(lccutsana),
244  fRDCutsProduction(lccutsprod),
245  fListCuts(0),
246  fFillNtuple(fillNtuple),
247  fReadMC(kFALSE),
248  fMCPid(kFALSE),
249  fRealPid(kTRUE),
250  fResPid(kFALSE),
251  fUseKF(kFALSE),
252  fAnalysis(kFALSE),
253  fVHF(0),
254  fFillVarHists(kFALSE),
255  fMultiplicityHists(kFALSE),
256  fPriorsHists(kFALSE),
257  fLcCut(kFALSE),
258  fLcPIDCut(kFALSE),
259  fNentries(0),
260  fOutputMC(0),
261  fAPriori(0),
262  fMultiplicity(0),
263  //fUtilPid(0),
264  fPIDResponse(0),
265  fCounter(0)
266 {
269  for(Int_t icut=0; icut<2; icut++) fCutsKF[icut]=0.;
270  for(Int_t j=0; j<3*kMaxPtBins; j++){
271  fMassHist[j]=0x0;
272  fMassHistTC[j]=0x0;
273  fMassHistLpi[j]=0x0;
274  fMassHistLpiTC[j]=0x0;
275  fMassHistKp[j]=0x0;
276  fMassHistKpTC[j]=0x0;
277  fMassHistDk[j]=0x0;
278  fMassHistDkTC[j]=0x0;
279  fMassHist3Pr[j]=0x0;
280  fMassHist3PrTC[j]=0x0;
281  }
282  // Default constructor
283  // Output slot #1 writes into a TList container
284  DefineOutput(1,TList::Class()); //My private output
285  DefineOutput(2,TList::Class());
286  DefineOutput(3,TList::Class());
287  DefineOutput(4,TH1F::Class());
288  DefineOutput(5,TList::Class());
289  DefineOutput(6,TList::Class());
290  DefineOutput(7,AliNormalizationCounter::Class());
291  if (fFillNtuple) {
292  // Output slot #2 writes into a TNtuple container
293  DefineOutput(8,TNtuple::Class()); //My private output
294  }
295 }
296 
297 //________________________________________________________________________
299 {
300  // Destructor
301  if (fOutput) {
302  delete fOutput;
303  fOutput = 0;
304  }
305  if (fOutputMC) {
306  delete fOutputMC;
307  fOutputMC = 0;
308  }
309  if (fAPriori) {
310  delete fAPriori;
311  fAPriori = 0;
312  }
313  if (fMultiplicity) {
314  delete fMultiplicity;
315  fMultiplicity = 0;
316  }
317 
318  if (fVHF) {
319  delete fVHF;
320  fVHF = 0;
321  }
322 
323  if(fRDCutsAnalysis){
324  delete fRDCutsAnalysis;
325  fRDCutsAnalysis = 0;
326  }
327  if(fRDCutsProduction){
328  delete fRDCutsProduction;
329  fRDCutsProduction = 0;
330  }
331 
332  if (fListCuts) {
333  delete fListCuts;
334  fListCuts = 0;
335  }
336  if (fNentries){
337  delete fNentries;
338  fNentries = 0;
339  }
340  /*
341  if (fUtilPid){
342  delete fUtilPid;
343  fUtilPid = 0;
344  }
345  */
346  if (fPIDResponse) {
347  delete fPIDResponse;
348  }
349  if(fCounter){
350  delete fCounter;
351  fCounter = 0;
352  }
353 
354 }
355 //_________________________________________________________________
357  fUpmasslimit = 2.286+range;
358  fLowmasslimit = 2.286-range;
359 }
360 //_________________________________________________________________
361 void AliAnalysisTaskSELambdac::SetMassLimits(Float_t lowlimit, Float_t uplimit){
362  if(uplimit>lowlimit)
363  {
364  fUpmasslimit = lowlimit;
365  fLowmasslimit = uplimit;
366  }
367 }
368 
369 
370 //________________________________________________________________________
371 void AliAnalysisTaskSELambdac::SetPtBinLimit(Int_t n, Float_t* lim){
372  // define pt bins for analysis
373  if(n>kMaxPtBins){
374  printf("Max. number of Pt bins = %d\n",kMaxPtBins);
376  fArrayBinLimits[0]=0.;
377  fArrayBinLimits[1]=2.;
378  fArrayBinLimits[2]=3.;
379  fArrayBinLimits[3]=4.;
380  for(Int_t i=4; i<kMaxPtBins+1; i++) fArrayBinLimits[i]=99999999.;
381  }else{
382  fNPtBins=n-1;
383  fArrayBinLimits[0]=lim[0];
384  for(Int_t i=1; i<fNPtBins+1; i++)
385  if(lim[i]>fArrayBinLimits[i-1]){
386  fArrayBinLimits[i]=lim[i];
387  }
388  else {
390  }
391  for(Int_t i=fNPtBins; i<kMaxPtBins+1; i++) fArrayBinLimits[i]=99999999.;
392  }
393  if(fDebug > 1){
394  printf("Number of Pt bins = %d\n",fNPtBins);
395  for(Int_t i=0; i<fNPtBins; i++) printf(" Bin%d = %8.2f-%8.2f\n",i,fArrayBinLimits[i],fArrayBinLimits[i+1]);
396  }
397 }
398 //_________________________________________________________________
399 Double_t AliAnalysisTaskSELambdac::GetPtBinLimit(Int_t ibin) const{
400  if(ibin>fNPtBins)return -1;
401  return fArrayBinLimits[ibin];
402 }
403 
404 //_________________________________________________________________
406 {
407  // Initialization
408 
409  if (fDebug > 1) printf("AnalysisTaskSELambdac::Init() \n");
410 
411  fListCuts=new TList();
412  fListCuts->SetOwner();
413 
416  PostData(2,fListCuts);
417  return;
418 }
419 
420 //________________________________________________________________________
422 {
423  // Create the output container
424  //
425  if (fDebug > 1) printf("AnalysisTaskSELambdac::UserCreateOutputObjects() \n");
426 
427  // Several histograms are more conveniently managed in a TList
428  fOutput = new TList();
429  fOutput->SetOwner();
430  fOutput->SetName("OutputHistos");
431 
432  TString hisname;
433  Int_t index=0;
434  // Int_t indexLS=0;
435  for(Int_t i=0;i<fNPtBins;i++){
436 
437  index=GetHistoIndex(i);
438  // indexLS=GetLSHistoIndex(i);
439 
440  hisname.Form("hMassPt%d",i);
441  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
442  fMassHist[index]->Sumw2();
443  hisname.Form("hMassPt%dTC",i);
444  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
445  fMassHistTC[index]->Sumw2();
446 
447  hisname.Form("hMassPtLpi%d",i);
448  fMassHistLpi[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
449  fMassHistLpi[index]->Sumw2();
450  hisname.Form("hMassPtLpi%dTC",i);
451  fMassHistLpiTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
452  fMassHistLpiTC[index]->Sumw2();
453 
454  hisname.Form("hMassPtKp%d",i);
455  fMassHistKp[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
456  fMassHistKp[index]->Sumw2();
457  hisname.Form("hMassPtKp%dTC",i);
458  fMassHistKpTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
459  fMassHistKpTC[index]->Sumw2();
460  hisname.Form("hMassPtDk%d",i);
461  fMassHistDk[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
462  fMassHistDk[index]->Sumw2();
463  hisname.Form("hMassPtDk%dTC",i);
464  fMassHistDkTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
465  fMassHistDkTC[index]->Sumw2();
466 
467  hisname.Form("hMassPt3Pr%d",i);
468  fMassHist3Pr[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
469  fMassHist3Pr[index]->Sumw2();
470  hisname.Form("hMassPt3Pr%dTC",i);
471  fMassHist3PrTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
472  fMassHist3PrTC[index]->Sumw2();
473  //signal
474  index=GetSignalHistoIndex(i);
475  hisname.Form("hSigPt%d",i);
476  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
477  fMassHist[index]->Sumw2();
478  hisname.Form("hSigPt%dTC",i);
479  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
480  fMassHistTC[index]->Sumw2();
481  hisname.Form("hSigPtLpi%d",i);
482  fMassHistLpi[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
483  fMassHistLpi[index]->Sumw2();
484  hisname.Form("hSigPtLpi%dTC",i);
485  fMassHistLpiTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
486  fMassHistLpiTC[index]->Sumw2();
487 
488  hisname.Form("hSigPtKp%d",i);
489  fMassHistKp[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
490  fMassHistKp[index]->Sumw2();
491  hisname.Form("hSigPtKp%dTC",i);
492  fMassHistKpTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
493  fMassHistKpTC[index]->Sumw2();
494 
495  hisname.Form("hSigPtDk%d",i);
496  fMassHistDk[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
497  fMassHistDk[index]->Sumw2();
498  hisname.Form("hSigPtDk%dTC",i);
499  fMassHistDkTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
500  fMassHistDkTC[index]->Sumw2();
501 
502  hisname.Form("hSigPt3Pr%d",i);
503  fMassHist3Pr[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
504  fMassHist3Pr[index]->Sumw2();
505  hisname.Form("hSigPt3Pr%dTC",i);
506  fMassHist3PrTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
507  fMassHist3PrTC[index]->Sumw2();
508 
509  index=GetLbHistoIndex(i);
510  hisname.Form("hSigLbPt%d",i);
511  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
512  fMassHist[index]->Sumw2();
513  hisname.Form("hSigLbPt%dTC",i);
514  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
515  fMassHistTC[index]->Sumw2();
516 
517  index=GetcOnlyHistoIndex(i);
518  hisname.Form("hSigcOnlyPt%d",i);
519  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
520  fMassHist[index]->Sumw2();
521  hisname.Form("hSigcOnlyPt%dTC",i);
522  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
523  fMassHistTC[index]->Sumw2();
524 
525  index=GetNoQuarkHistoIndex(i);
526  hisname.Form("hSigNoQuarkPt%d",i);
527  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
528  fMassHist[index]->Sumw2();
529  hisname.Form("hSigNoQuarkPt%dTC",i);
530  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
531  fMassHistTC[index]->Sumw2();
532 
533  index=GetBackgroundHistoIndex(i);
534  hisname.Form("hBkgPt%d",i);
535  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
536  fMassHist[index]->Sumw2();
537  hisname.Form("hBkgPt%dTC",i);
538  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
539  fMassHistTC[index]->Sumw2();
540  hisname.Form("hBkgPtLpi%d",i);
541  fMassHistLpi[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
542  fMassHistLpi[index]->Sumw2();
543  hisname.Form("hBkgPtLpi%dTC",i);
544  fMassHistLpiTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
545  fMassHistLpiTC[index]->Sumw2();
546 
547  hisname.Form("hBkgPtKp%d",i);
548  fMassHistKp[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
549  fMassHistKp[index]->Sumw2();
550  hisname.Form("hBkgPtKp%dTC",i);
551  fMassHistKpTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
552  fMassHistKpTC[index]->Sumw2();
553 
554  hisname.Form("hBkgPtDk%d",i);
555  fMassHistDk[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
556  fMassHistDk[index]->Sumw2();
557  hisname.Form("hBkgPtDk%dTC",i);
558  fMassHistDkTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
559  fMassHistDkTC[index]->Sumw2();
560 
561  hisname.Form("hBkgPt3Pr%d",i);
562  fMassHist3Pr[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
563  fMassHist3Pr[index]->Sumw2();
564  hisname.Form("hBkgPt3Pr%dTC",i);
565  fMassHist3PrTC[index]=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
566  fMassHist3PrTC[index]->Sumw2();
567  }
568 
569  for(Int_t ii=0; ii<6*fNPtBins; ii++){
570  fOutput->Add(fMassHist[ii]);
571  fOutput->Add(fMassHistTC[ii]);
572  }
573  for(Int_t i=0; i<3*fNPtBins; i++){
574  fOutput->Add(fMassHistLpi[i]);
575  fOutput->Add(fMassHistLpiTC[i]);
576  fOutput->Add(fMassHistKp[i]);
577  fOutput->Add(fMassHistKpTC[i]);
578  fOutput->Add(fMassHistDk[i]);
579  fOutput->Add(fMassHistDkTC[i]);
580  fOutput->Add(fMassHist3Pr[i]);
581  fOutput->Add(fMassHist3PrTC[i]);
582  }
583 
584  fhMassLcPt = new TH2F("hMassLcPt","hMassLcPt;3-Prong p_{T} GeV/c;3-Prong Mass GeV/c^2",150,0.,15.,200,fLowmasslimit,fUpmasslimit);
585  fhMassLcplusPt = new TH2F("hMassLcplusPt","hMassLcplusPt;3-Prong p_{T} GeV/c;3-Prong Mass GeV/c^2",150,0.,15.,200,fLowmasslimit,fUpmasslimit);
586  fhMassLcminusPt = new TH2F("hMassLcminusPt","hMassLcminusPt;3-Prong p_{T} GeV/c;3-Prong Mass GeV/c^2",150,0.,15.,200,fLowmasslimit,fUpmasslimit);
587  fOutput->Add(fhMassLcPt);
588  fOutput->Add(fhMassLcplusPt);
589  fOutput->Add(fhMassLcminusPt);
590 
591  fhEta3Prong = new TH2F("hEta3Prong","hEta3Prong;3-Prong p_{T} GeV/c;3-Prong #eta",75,0.,15.,50,-2.0,2.0);
592  fhEta3ProngAcc = new TH2F("hEta3ProngAcc","hEta3ProngAcc;3-Prong p_{T} GeV/c;3-Prong #eta",75,0.,15.,50,-2.0,2.0);
593  fhEta3ProngProd = new TH2F("hEta3ProngProd","hEta3ProngProd;3-Prong p_{T} GeV/c;3-Prong #eta",75,0.,15.,50,-2.0,2.0);
594  fhEta3ProngAn = new TH2F("hEta3ProngAn","hEta3ProngAn;3-Prong p_{T} GeV/c;3-Prong #eta",75,0.,15.,50,-2.0,2.0);
595  fhRap3Prong = new TH2F("hRap3Prong","hRap3Prong;3-Prong p_{T} GeV/c;3-Prong y",75,0.,15.,50,-2.0,2.0);
596  fhRap3ProngAcc = new TH2F("hRap3ProngAcc","hRap3ProngAcc;3-Prong p_{T} GeV/c;3-Prong y",75,0.,15.,50,-2.0,2.0);
597  fhRap3ProngProd = new TH2F("hRap3ProngProd","hRap3ProngProd;3-Prong p_{T} GeV/c;3-Prong y",75,0.,15.,50,-2.0,2.0);
598  fhRap3ProngAn = new TH2F("hRap3ProngAn","hRap3ProngAn;3-Prong p_{T} GeV/c;3-Prong y",75,0.,15.,50,-2.0,2.0);
599 
600  fhSelectBit = new TH1F("hSelectBit","hSelectBit",5,-0.5,5.5);
601  fhSelectBit->GetXaxis()->SetBinLabel(2,"All");
602  fhSelectBit->GetXaxis()->SetBinLabel(3,"SelectionMap");
603  fhSelectBit->GetXaxis()->SetBinLabel(4,"!LcCut");
604  fhSelectBit->GetXaxis()->SetBinLabel(5,"!LcPID");
605 
606  fOutput->Add(fhEta3Prong);
607  fOutput->Add(fhEta3ProngAcc);
608  fOutput->Add(fhEta3ProngProd);
609  fOutput->Add(fhEta3ProngAn);
610  fOutput->Add(fhRap3Prong);
611  fOutput->Add(fhRap3ProngAcc);
612  fOutput->Add(fhRap3ProngProd);
613  fOutput->Add(fhRap3ProngAn);
614  fOutput->Add(fhSelectBit);
615 
616  fHistNEvents = new TH1F("fHistNEvents", "Number of processed events; ; Events",3,-1.5,1.5);
617  fHistNEvents->Sumw2();
618  fHistNEvents->SetMinimum(0);
619  fOutput->Add(fHistNEvents);
620 
621  fhChi2 = new TH1F("fhChi2", "Chi2",100,0.,10.);
622  fhChi2->Sumw2();
623  fOutput->Add(fhChi2);
624 
625  fhMassPtGreater3=new TH1F("fhMassPtGreater3","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
626  fhMassPtGreater3->Sumw2();
628  fhMassPtGreater3TC=new TH1F("fhMassPtGreater3TC","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
629  fhMassPtGreater3TC->Sumw2();
631  fhMassPtGreater3Kp=new TH1F("fhMassPtGreater3Kp","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
632  fhMassPtGreater3Kp->Sumw2();
634  fhMassPtGreater3KpTC=new TH1F("fhMassPtGreater3KpTC","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
635  fhMassPtGreater3KpTC->Sumw2();
637  fhMassPtGreater3Lpi=new TH1F("fhMassPtGreater3Lpi","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
638  fhMassPtGreater3Lpi->Sumw2();
640  fhMassPtGreater3LpiTC=new TH1F("fhMassPtGreater3LpiTC","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
641  fhMassPtGreater3LpiTC->Sumw2();
643  fhMassPtGreater3Dk=new TH1F("fhMassPtGreater3Dk","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
644  fhMassPtGreater3Dk->Sumw2();
646  fhMassPtGreater3DkTC=new TH1F("fhMassPtGreater3DkTC","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
647  fhMassPtGreater3DkTC->Sumw2();
649 
650  fhMassPtGreater33Pr=new TH1F("fhMassPtGreater33Pr","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
651  fhMassPtGreater33Pr->Sumw2();
653  fhMassPtGreater33PrTC=new TH1F("fhMassPtGreater33PrTC","Pt > 3 GeV/c",200,fLowmasslimit,fUpmasslimit);
654  fhMassPtGreater33PrTC->Sumw2();
656 
657 
658  fhMassPtGreater2=new TH1F("fhMassPtGreater2","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
659  fhMassPtGreater2->Sumw2();
661  fhMassPtGreater2TC=new TH1F("fhMassPtGreater2TC","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
662  fhMassPtGreater2TC->Sumw2();
664  fhMassPtGreater2Kp=new TH1F("fhMassPtGreater2Kp","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
665  fhMassPtGreater2Kp->Sumw2();
667  fhMassPtGreater2KpTC=new TH1F("fhMassPtGreater2KpTC","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
668  fhMassPtGreater2KpTC->Sumw2();
670  fhMassPtGreater2Lpi=new TH1F("fhMassPtGreater2Lpi","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
671  fhMassPtGreater2Lpi->Sumw2();
673  fhMassPtGreater2LpiTC=new TH1F("fhMassPtGreater2LpiTC","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
674  fhMassPtGreater2LpiTC->Sumw2();
676  fhMassPtGreater2Dk=new TH1F("fhMassPtGreater2Dk","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
677  fhMassPtGreater2Dk->Sumw2();
679  fhMassPtGreater2DkTC=new TH1F("fhMassPtGreater2DkTC","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
680  fhMassPtGreater2DkTC->Sumw2();
682  fhMassPtGreater23Pr=new TH1F("fhMassPtGreater23Pr","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
683  fhMassPtGreater23Pr->Sumw2();
685  fhMassPtGreater23PrTC=new TH1F("fhMassPtGreater23PrTC","Pt > 2 GeV/c",200,fLowmasslimit,fUpmasslimit);
686  fhMassPtGreater23PrTC->Sumw2();
688 
689  fOutputMC = new TList();
690  fOutputMC->SetOwner();
691  fOutputMC->SetName("QAMCHistos");
692 
693  // const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
694 
695  fNentries=new TH1F("fNentries", "Integral(1,2) = number of AODs *** Integral(2,3) = number of candidates selected with cuts *** Integral(3,4) = number of Lc selected with cuts *** Integral(4,5) = events with good vertex *** Integral(5,6) = pt out of bounds", 11,-0.5,10.5);
696 
697  //ROS: qui il bin assignment e' modellato su D0 ma sicuramente iv arie
698  fNentries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
699  fNentries->GetXaxis()->SetBinLabel(2,"nCandSel(Cuts)");
700  fNentries->GetXaxis()->SetBinLabel(3,"nLcSelected");
701  fNentries->GetXaxis()->SetBinLabel(4,"nEventsGoodVtxS");
702  fNentries->GetXaxis()->SetBinLabel(5,"ptbin = -1");
703  fNentries->GetXaxis()->SetBinLabel(6,"no daughter");
704  fNentries->GetXaxis()->SetBinLabel(7,"nCandSel(Tr)");
705  fNentries->GetXaxis()->SetBinLabel(8,"PID=0");
706  fNentries->GetXaxis()->SetBinLabel(9,"PID=1");
707  fNentries->GetXaxis()->SetBinLabel(10,"PID=2");
708  fNentries->GetXaxis()->SetBinLabel(11,"PID=3");
709  fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
710 
711  hisname.Form("hMass");
712  TH1F *hMassInv=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
713  fOutputMC->Add(hMassInv);
714  hisname.Form("hbMass");
715  TH1F *hBMassInv=new TH1F(hisname.Data(),hisname.Data(),200,fLowmasslimit,fUpmasslimit);
716  fOutputMC->Add(hBMassInv);
717 
718  // proton specific
719  hisname.Form("hpTOFSignal");
720  TH1F *hProtonTOFSignal=new TH1F(hisname.Data(),hisname.Data(),100,12000.,50000.0);
721  fOutputMC->Add(hProtonTOFSignal);
722  hisname.Form("hbpTOFSignal");
723  TH1F *hBProtonTOFSignal=new TH1F(hisname.Data(),hisname.Data(),100,12000.,50000.0);
724  fOutputMC->Add(hBProtonTOFSignal);
725 
726  hisname.Form("hpTPCSignal");
727  TH1F *hProtonTPCSignal=new TH1F(hisname.Data(),hisname.Data(),150,0.,150.0);
728  fOutputMC->Add(hProtonTPCSignal);
729  hisname.Form("hbpTPCSignal");
730  TH1F *hBProtonTPCSignal=new TH1F(hisname.Data(),hisname.Data(),150,0.,150.0);
731  fOutputMC->Add(hBProtonTPCSignal);
732 
733  hisname.Form("hpptProng");
734  TH1F *hProtonPtProng=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
735  fOutputMC->Add(hProtonPtProng);
736  hisname.Form("hbpptProng");
737  TH1F *hBProtonPtProng=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
738  fOutputMC->Add(hBProtonPtProng);
739 
740  hisname.Form("hpRealTot");
741  TH1F *hProtonRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
742  fOutputMC->Add(hProtonRealTot);
743  hisname.Form("hbpRealTot");
744  TH1F *hBProtonRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
745  fOutputMC->Add(hBProtonRealTot);
746  hisname.Form("hpIDTot");
747  TH1F *hProtonIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
748  fOutputMC->Add(hProtonIDTot);
749  hisname.Form("hpIDGood");
750  TH1F *hProtonIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
751  fOutputMC->Add(hProtonIDGood);
752  hisname.Form("hbpIDGood");
753  TH1F *hBProtonIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
754  fOutputMC->Add(hBProtonIDGood);
755  hisname.Form("hbpIDTot");
756  TH1F *hBProtonIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
757  fOutputMC->Add(hBProtonIDTot);
758  hisname.Form("hnopIDp");
759  TH1F *hnoProtonIDpTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
760  fOutputMC->Add(hnoProtonIDpTot);
761  hisname.Form("hbnopIDp");
762  TH1F *hBnoProtonIDpTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
763  fOutputMC->Add(hBnoProtonIDpTot);
764 
765  hisname.Form("hpd0Prong");
766  TH1F *hProtond0Prong=new TH1F(hisname.Data(),hisname.Data(),100,-0.1,0.1);
767  fOutputMC->Add(hProtond0Prong);
768  hisname.Form("hbpd0Prong");
769  TH1F *hBProtond0Prong=new TH1F(hisname.Data(),hisname.Data(),100,-0.1,0.1);
770  fOutputMC->Add(hBProtond0Prong);
771  hisname.Form("hbpSignalVspTOF");
772  TH2F *hBpSignalVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,12000.,50000.0);
773  fOutputMC->Add(hBpSignalVspTOF);
774  hisname.Form("hbpSignalVspTPC");
775  TH2F *hBpSignalVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,150,0.,150.0);
776  fOutputMC->Add(hBpSignalVspTPC);
777  hisname.Form("hpSignalVspTOF");
778  TH2F *hpSignalVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,12000.,50000.0);
779  fOutputMC->Add(hpSignalVspTOF);
780  hisname.Form("hpSignalVspTPC");
781  TH2F *hpSignalVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,150,0.,150.0);
782  fOutputMC->Add(hpSignalVspTPC);
783 
784  hisname.Form("hpSigmaVspTOF");
785  TH2F *hpSigmaVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
786  fOutputMC->Add(hpSigmaVspTOF);
787  hisname.Form("hpSigmaVspTPC");
788  TH2F *hpSigmaVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
789  fOutputMC->Add(hpSigmaVspTPC);
790  hisname.Form("hbpSigmaVspTOF");
791  TH2F *hBpSigmaVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
792  fOutputMC->Add(hBpSigmaVspTOF);
793  hisname.Form("hbpSigmaVspTPC");
794  TH2F *hBpSigmaVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
795  fOutputMC->Add(hBpSigmaVspTPC);
796 
797 
798  //kaon specific
799  hisname.Form("hKTOFSignal");
800  TH1F *hKaonTOFSignal=new TH1F(hisname.Data(),hisname.Data(),100,12000.,50000.0);
801  fOutputMC->Add(hKaonTOFSignal);
802  hisname.Form("hbKTOFSignal");
803  TH1F *hBKaonTOFSignal=new TH1F(hisname.Data(),hisname.Data(),100,12000.,50000.0);
804  fOutputMC->Add(hBKaonTOFSignal);
805  hisname.Form("hKTPCSignal");
806  TH1F *hKaonTPCSignal=new TH1F(hisname.Data(),hisname.Data(),150,0.,150.0);
807  fOutputMC->Add(hKaonTPCSignal);
808  hisname.Form("hbKTPCSignal");
809  TH1F *hBKaonTPCSignal=new TH1F(hisname.Data(),hisname.Data(),150,0.,150.0);
810  fOutputMC->Add(hBKaonTPCSignal);
811 
812  hisname.Form("hKptProng");
813  TH1F *hKaonPtProng=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
814  fOutputMC->Add(hKaonPtProng);
815  hisname.Form("hbKptProng");
816  TH1F *hBKaonPtProng=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
817  fOutputMC->Add(hBKaonPtProng);
818  hisname.Form("hKRealTot");
819  TH1F *hKaonRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
820  fOutputMC->Add(hKaonRealTot);
821  hisname.Form("hbKRealTot");
822  TH1F *hBKaonRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
823  fOutputMC->Add(hBKaonRealTot);
824  hisname.Form("hKIDGood");
825  TH1F *hKaonIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
826  fOutputMC->Add(hKaonIDGood);
827  hisname.Form("hKIDTot");
828  TH1F *hKaonIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
829  fOutputMC->Add(hKaonIDTot);
830  hisname.Form("hbKIDGood");
831  TH1F *hBKaonIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
832  fOutputMC->Add(hBKaonIDGood);
833  hisname.Form("hbKIDTot");
834  TH1F *hBKaonIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
835  fOutputMC->Add(hBKaonIDTot);
836  hisname.Form("hnokIDk");
837  TH1F *hnoKaonIDkTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
838  fOutputMC->Add(hnoKaonIDkTot);
839  hisname.Form("hbnokIDk");
840  TH1F *hBnoKaonIDkTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
841  fOutputMC->Add(hBnoKaonIDkTot);
842 
843 
844  hisname.Form("hKd0Prong");
845  TH1F *hKaond0Prong=new TH1F(hisname.Data(),hisname.Data(),100,-0.1,0.1);
846  fOutputMC->Add(hKaond0Prong);
847  hisname.Form("hbKd0Prong");
848  TH1F *hBKaond0Prong=new TH1F(hisname.Data(),hisname.Data(),100,-0.1,0.1);
849  fOutputMC->Add(hBKaond0Prong);
850  hisname.Form("hbKSignalVspTOF");
851  TH2F *hbKSignalVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,12000.,50000.0);
852  fOutputMC->Add(hbKSignalVspTOF);
853  hisname.Form("hbKSignalVspTPC");
854  TH2F *hbKSignalVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,150,0.,150.0);
855  fOutputMC->Add(hbKSignalVspTPC);
856  hisname.Form("hKSignalVspTOF");
857  TH2F *hKSignalVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,12000.,50000.0);
858  fOutputMC->Add(hKSignalVspTOF);
859  hisname.Form("hKSignalVspTPC");
860  TH2F *hKSignalVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,150,0.,150.0);
861  fOutputMC->Add(hKSignalVspTPC);
862  hisname.Form("hKSigmaVspTOF");
863  TH2F *hKSigmaVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
864  fOutputMC->Add(hKSigmaVspTOF);
865  hisname.Form("hKSigmaVspTPC");
866  TH2F *hKSigmaVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
867  fOutputMC->Add(hKSigmaVspTPC);
868  hisname.Form("hbKSigmaVspTOF");
869  TH2F *hBKSigmaVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
870  fOutputMC->Add(hBKSigmaVspTOF);
871  hisname.Form("hbKSigmaVspTPC");
872  TH2F *hBKSigmaVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
873  fOutputMC->Add(hBKSigmaVspTPC);
874 
875 
876  // pion specific
877  hisname.Form("hpiTOFSignal");
878  TH1F *hPionTOFSignal=new TH1F(hisname.Data(),hisname.Data(),100,12000.,50000.0);
879  fOutputMC->Add(hPionTOFSignal);
880  hisname.Form("hbpiTOFSignal");
881  TH1F *hBPionTOFSignal=new TH1F(hisname.Data(),hisname.Data(),100,12000.,50000.0);
882  fOutputMC->Add(hBPionTOFSignal);
883  hisname.Form("hpiTPCSignal");
884  TH1F *hPionTPCSignal=new TH1F(hisname.Data(),hisname.Data(),100,30.,100.0);
885  fOutputMC->Add(hPionTPCSignal);
886  hisname.Form("hbpiTPCSignal");
887  TH1F *hBPionTPCSignal=new TH1F(hisname.Data(),hisname.Data(),100,30.,100.0);
888  fOutputMC->Add(hBPionTPCSignal);
889 
890  hisname.Form("hpiptProng");
891  TH1F *hPionPtProng=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
892  fOutputMC->Add(hPionPtProng);
893  hisname.Form("hbpiptProng");
894  TH1F *hBPionPtProng=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
895  fOutputMC->Add(hBPionPtProng);
896 
897  hisname.Form("hpiRealTot");
898  TH1F *hPionRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
899  fOutputMC->Add(hPionRealTot);
900  hisname.Form("hbpiRealTot");
901  TH1F *hBPionRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
902  fOutputMC->Add(hBPionRealTot);
903  hisname.Form("hpiIDGood");
904  TH1F *hPionIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
905  fOutputMC->Add(hPionIDGood);
906  hisname.Form("hpiIDTot");
907  TH1F *hPionIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
908  fOutputMC->Add(hPionIDTot);
909  hisname.Form("hbpiIDTot");
910  TH1F *hBPionIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
911  fOutputMC->Add(hBPionIDTot);
912  hisname.Form("hbpiIDGood");
913  TH1F *hBPionIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
914  fOutputMC->Add(hBPionIDGood);
915  hisname.Form("hnopiIDpi");
916  TH1F *hnoPionIDpiTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
917  fOutputMC->Add(hnoPionIDpiTot);
918  hisname.Form("hbnopiIDpi");
919  TH1F *hBnoPionIDpiTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.0);
920  fOutputMC->Add(hBnoPionIDpiTot);
921 
922  hisname.Form("hpid0Prong");
923  TH1F *hPiond0Prong=new TH1F(hisname.Data(),hisname.Data(),100,-0.1,-0.1);
924  fOutputMC->Add(hPiond0Prong);
925  hisname.Form("hbpid0Prong");
926  TH1F *hBPiond0Prong=new TH1F(hisname.Data(),hisname.Data(),100,-0.1,0.1);
927  fOutputMC->Add(hBPiond0Prong);
928 
929  hisname.Form("hpiSignalVspTOF");
930  TH2F *hpiSignalVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,12000.,50000.0);
931  fOutputMC->Add(hpiSignalVspTOF);
932  hisname.Form("hpiSignalVspTPC");
933  TH2F *hpiSignalVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,150,0.,150.0);
934  fOutputMC->Add(hpiSignalVspTPC);
935  hisname.Form("hbpiSignalVspTOF");
936  TH2F *hbpiSignalVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,12000.,50000.0);
937  fOutputMC->Add(hbpiSignalVspTOF);
938  hisname.Form("hbpiSignalVspTPC");
939  TH2F *hbpiSignalVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,150,0.,150.0);
940  fOutputMC->Add(hbpiSignalVspTPC);
941  hisname.Form("hpiSigmaVspTOF");
942  TH2F *hpiSigmaVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
943  fOutputMC->Add(hpiSigmaVspTOF);
944  hisname.Form("hpiSigmaVspTPC");
945  TH2F *hpiSigmaVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
946  fOutputMC->Add(hpiSigmaVspTPC);
947  hisname.Form("hbpiSigmaVspTOF");
948  TH2F *hBpiSigmaVspTOF=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
949  fOutputMC->Add(hBpiSigmaVspTOF);
950  hisname.Form("hbpiSigmaVspTPC");
951  TH2F *hBpiSigmaVspTPC=new TH2F(hisname.Data(),hisname.Data(),100,0.,5.0,100,-10.0,10.0);
952  fOutputMC->Add(hBpiSigmaVspTPC);
953 
954  //Jaime Lc specific
955  hisname.Form("hLcRealTot");
956  TH1F *hLambdaRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
957  fOutputMC->Add(hLambdaRealTot);
958  hisname.Form("hbLcRealTot");
959  TH1F *hbLambdaRealTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
960  fOutputMC->Add(hbLambdaRealTot);
961  hisname.Form("hLcIDTot");
962  TH1F *hLambdaIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
963  fOutputMC->Add(hLambdaIDTot);
964  hisname.Form("hbLcIDTot");
965  TH1F *hbLambdaIDTot=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
966  fOutputMC->Add(hbLambdaIDTot);
967  hisname.Form("hLcIDGood");
968  TH1F *hLambdaIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
969  fOutputMC->Add(hLambdaIDGood);
970  hisname.Form("hbLcIDGood");
971  TH1F *hbLambdaIDGood=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
972  fOutputMC->Add(hbLambdaIDGood);
973  hisname.Form("hLcnoID");
974  TH1F *hLambdanoID=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
975  fOutputMC->Add(hLambdanoID);
976  hisname.Form("hbLcnoID");
977  TH1F *hbLambdanoID=new TH1F(hisname.Data(),hisname.Data(),100,0.,15.0);
978  fOutputMC->Add(hbLambdanoID);
979 
980  // other generic
981  hisname.Form("hLcpt");
982  TH1F *hLcPt=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
983  fOutputMC->Add(hLcPt);
984  hisname.Form("hbLcpt");
985  TH1F *hBLcPt=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.0);
986  fOutputMC->Add(hBLcPt);
987  hisname.Form("hDist12toPrim");
988  TH1F *hDist12Prim=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.0);
989  fOutputMC->Add(hDist12Prim);
990  hisname.Form("hbDist12toPrim");
991  TH1F *hBDist12Prim=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.0);
992  fOutputMC->Add(hBDist12Prim);
993 
994  hisname.Form("hSigmaVert");
995  TH1F *hSigmaVert=new TH1F(hisname.Data(),hisname.Data(),60,0.,0.06);
996  fOutputMC->Add(hSigmaVert);
997  hisname.Form("hbSigmaVert");
998  TH1F *hBSigmaVert=new TH1F(hisname.Data(),hisname.Data(),60,0.,0.06);
999  fOutputMC->Add(hBSigmaVert);
1000 
1001  hisname.Form("hDCAs");
1002  TH1F *hdcas=new TH1F(hisname.Data(),hisname.Data(),200,0.,0.1);
1003  fOutputMC->Add(hdcas);
1004  hisname.Form("hbDCAs");
1005  TH1F *hBdcas=new TH1F(hisname.Data(),hisname.Data(),200,0.,0.1);
1006  fOutputMC->Add(hBdcas);
1007 
1008  hisname.Form("hCosPointingAngle");
1009  TH1F *hCosPointingAngle=new TH1F(hisname.Data(),hisname.Data(),40,0.,1.);
1010  fOutputMC->Add(hCosPointingAngle);
1011  hisname.Form("hbCosPointingAngle");
1012  TH1F *hBCosPointingAngle=new TH1F(hisname.Data(),hisname.Data(),40,0.,1.);
1013  fOutputMC->Add(hBCosPointingAngle);
1014 
1015  hisname.Form("hDecayLength");
1016  TH1F *hDecayLength=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
1017  fOutputMC->Add(hDecayLength);
1018  hisname.Form("hbDecayLength");
1019  TH1F *hBDecayLength=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
1020  fOutputMC->Add(hBDecayLength);
1021 
1022  hisname.Form("hSum2");
1023  TH1F *hSum2=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
1024  fOutputMC->Add(hSum2);
1025  hisname.Form("hbSum2");
1026  TH1F *hBSum2=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
1027  fOutputMC->Add(hBSum2);
1028 
1029  hisname.Form("hptmax");
1030  TH1F *hPtMax=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1031  fOutputMC->Add(hPtMax);
1032  hisname.Form("hbptmax");
1033  TH1F *hBPtMax=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1034  fOutputMC->Add(hBPtMax);
1035 
1036 //2D Var x Lc Pt
1037  hisname.Form("hpptProngLcPt");
1038  fhProtonPtProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.0);
1040  hisname.Form("hbpptProngLcPt");
1041  fhBProtonPtProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.0);
1043 
1044  hisname.Form("hpd0ProngLcPt");
1045  fhProtond0ProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,-0.1,0.1);
1047  hisname.Form("hbpd0ProngLcPt");
1048  fhBProtond0ProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,-0.1,0.1);
1050 
1051  hisname.Form("hKptProngLcPt");
1052  fhKaonPtProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.0);
1054  hisname.Form("hbKptProngLcPt");
1055  fhBKaonPtProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.0);
1057 
1058  hisname.Form("hKd0ProngLcPt");
1059  fhKaond0ProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,-0.1,0.1);
1061  hisname.Form("hbKd0ProngLcPt");
1062  fhBKaond0ProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,-0.1,0.1);
1064 
1065  hisname.Form("hpiptProngLcPt");
1066  fhPionPtProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.0);
1068  hisname.Form("hbpiptProngLcPt");
1069  fhBPionPtProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.0);
1071 
1072  hisname.Form("hpid0ProngLcPt");
1073  fhPiond0ProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,-0.1,-0.1);
1075  hisname.Form("hbpid0ProngLcPt");
1076  fhBPiond0ProngLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,-0.1,0.1);
1078 
1079  hisname.Form("hDist12toPrimLcPt");
1080  fhDist12PrimLcPt = new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,1.0);
1082  hisname.Form("hbDist12toPrimLcPt");
1083  fhBDist12PrimLcPt = new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,1.0);
1085 
1086  hisname.Form("hSigmaVertLcPt");
1087  fhSigmaVertLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,60,0.,0.06);
1088  fOutputMC->Add(fhSigmaVertLcPt);
1089  hisname.Form("hbSigmaVertLcPt");
1090  fhBSigmaVertLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,60,0.,0.06);
1092 
1093  hisname.Form("hDCAsLcPt");
1094  fhdcasLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,200,0.,0.1);
1095  fOutputMC->Add(fhdcasLcPt);
1096  hisname.Form("hbDCAsLcPt");
1097  fhBdcasLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,200,0.,0.1);
1098  fOutputMC->Add(fhBdcasLcPt);
1099 
1100  hisname.Form("hCosPointingAngleLcPt");
1101  fhCosPointingAngleLcPt = new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,40,0.,1.);
1103  hisname.Form("hbCosPointingAngleLcPt");
1104  fhBCosPointingAngleLcPt = new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,40,0.,1.);
1106 
1107  hisname.Form("hDecayLengthLcPt");
1108  fhDecayLengthLcPt = new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,0.1);
1110  hisname.Form("hbDecayLengthLcPt");
1111  fhBDecayLengthLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,0.1);
1113 
1114  hisname.Form("hSum2LcPt");
1115  fhSum2LcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,0.1);
1116  fOutputMC->Add(fhSum2LcPt);
1117  hisname.Form("hbSum2LcPt");
1118  fhBSum2LcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,0.1);
1119  fOutputMC->Add(fhBSum2LcPt);
1120 
1121  hisname.Form("hptmaxLcPt");
1122  fhPtMaxLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.);
1123  fOutputMC->Add(fhPtMaxLcPt);
1124  hisname.Form("hbptmaxLcPt");
1125  fhBPtMaxLcPt=new TH2F(hisname.Data(),hisname.Data(),75,0.,15.,100,0.,5.);
1126  fOutputMC->Add(fhBPtMaxLcPt);
1127 
1128  fAPriori = new TList(); // AdC
1129  fAPriori->SetOwner(); // AdC
1130  fAPriori->SetName("APrioriMCHistos"); // AdC
1131 
1132  hisname.Form("hElIn3Prong");
1133  TH1F *hElIn3Prong=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1134  fAPriori->Add(hElIn3Prong);
1135  hisname.Form("hMuIn3Prong");
1136  TH1F *hMuIn3Prong=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1137  fAPriori->Add(hMuIn3Prong);
1138  hisname.Form("hPiIn3Prong");
1139  TH1F *hPiIn3Prong=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1140  fAPriori->Add(hPiIn3Prong);
1141  hisname.Form("hKaIn3Prong");
1142  TH1F *hKaIn3Prong=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1143  fAPriori->Add(hKaIn3Prong);
1144  hisname.Form("hPrIn3Prong");
1145  TH1F *hPrIn3Prong=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1146  fAPriori->Add(hPrIn3Prong);
1147 
1148  hisname.Form("hElIn3Prong1");
1149  TH1F *hElIn3Prong1=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1150  fAPriori->Add(hElIn3Prong1);
1151  hisname.Form("hMuIn3Prong1");
1152  TH1F *hMuIn3Prong1=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1153  fAPriori->Add(hMuIn3Prong1);
1154  hisname.Form("hPiIn3Prong1");
1155  TH1F *hPiIn3Prong1=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1156  fAPriori->Add(hPiIn3Prong1);
1157  hisname.Form("hKaIn3Prong1");
1158  TH1F *hKaIn3Prong1=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1159  fAPriori->Add(hKaIn3Prong1);
1160  hisname.Form("hPrIn3Prong1");
1161  TH1F *hPrIn3Prong1=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1162  fAPriori->Add(hPrIn3Prong1);
1163 
1164  hisname.Form("hElIn3Prong2");
1165  TH1F *hElIn3Prong2=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1166  fAPriori->Add(hElIn3Prong2);
1167  hisname.Form("hMuIn3Prong2");
1168  TH1F *hMuIn3Prong2=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1169  fAPriori->Add(hMuIn3Prong2);
1170  hisname.Form("hPiIn3Prong2");
1171  TH1F *hPiIn3Prong2=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1172  fAPriori->Add(hPiIn3Prong2);
1173  hisname.Form("hKaIn3Prong2");
1174  TH1F *hKaIn3Prong2=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1175  fAPriori->Add(hKaIn3Prong2);
1176  hisname.Form("hPrIn3Prong2");
1177  TH1F *hPrIn3Prong2=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1178  fAPriori->Add(hPrIn3Prong2);
1179 
1180  hisname.Form("hElIn3Prong3");
1181  TH1F *hElIn3Prong3=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1182  fAPriori->Add(hElIn3Prong3);
1183  hisname.Form("hMuIn3Prong3");
1184  TH1F *hMuIn3Prong3=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1185  fAPriori->Add(hMuIn3Prong3);
1186  hisname.Form("hPiIn3Prong3");
1187  TH1F *hPiIn3Prong3=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1188  fAPriori->Add(hPiIn3Prong3);
1189  hisname.Form("hKaIn3Prong3");
1190  TH1F *hKaIn3Prong3=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1191  fAPriori->Add(hKaIn3Prong3);
1192  hisname.Form("hPrIn3Prong3");
1193  TH1F *hPrIn3Prong3=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1194  fAPriori->Add(hPrIn3Prong3);
1195 
1196  hisname.Form("hElIn3Prong4");
1197  TH1F *hElIn3Prong4=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1198  fAPriori->Add(hElIn3Prong4);
1199  hisname.Form("hMuIn3Prong4");
1200  TH1F *hMuIn3Prong4=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1201  fAPriori->Add(hMuIn3Prong4);
1202  hisname.Form("hPiIn3Prong4");
1203  TH1F *hPiIn3Prong4=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1204  fAPriori->Add(hPiIn3Prong4);
1205  hisname.Form("hKaIn3Prong4");
1206  TH1F *hKaIn3Prong4=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1207  fAPriori->Add(hKaIn3Prong4);
1208  hisname.Form("hPrIn3Prong4");
1209  TH1F *hPrIn3Prong4=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1210  fAPriori->Add(hPrIn3Prong4);
1211 
1212  hisname.Form("hElIn3Prong5");
1213  TH1F *hElIn3Prong5=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1214  fAPriori->Add(hElIn3Prong5);
1215  hisname.Form("hMuIn3Prong5");
1216  TH1F *hMuIn3Prong5=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1217  fAPriori->Add(hMuIn3Prong5);
1218  hisname.Form("hPiIn3Prong5");
1219  TH1F *hPiIn3Prong5=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1220  fAPriori->Add(hPiIn3Prong5);
1221  hisname.Form("hKaIn3Prong5");
1222  TH1F *hKaIn3Prong5=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1223  fAPriori->Add(hKaIn3Prong5);
1224  hisname.Form("hPrIn3Prong5");
1225  TH1F *hPrIn3Prong5=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1226  fAPriori->Add(hPrIn3Prong5);
1227 
1228  hisname.Form("hElIn3Prong6");
1229  TH1F *hElIn3Prong6=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1230  fAPriori->Add(hElIn3Prong6);
1231  hisname.Form("hMuIn3Prong6");
1232  TH1F *hMuIn3Prong6=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1233  fAPriori->Add(hMuIn3Prong6);
1234  hisname.Form("hPiIn3Prong6");
1235  TH1F *hPiIn3Prong6=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1236  fAPriori->Add(hPiIn3Prong6);
1237  hisname.Form("hKaIn3Prong6");
1238  TH1F *hKaIn3Prong6=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1239  fAPriori->Add(hKaIn3Prong6);
1240  hisname.Form("hPrIn3Prong6");
1241  TH1F *hPrIn3Prong6=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
1242  fAPriori->Add(hPrIn3Prong6);
1243 
1244 
1245  fMultiplicity = new TList(); // AdC
1246  fMultiplicity->SetOwner(); // AdC
1247  fMultiplicity->SetName("MultiplicityMCHistos"); // AdC
1248 
1249  hisname.Form("hLcinEvent");
1250  TH1I*hLcinEvent=new TH1I(hisname.Data(),hisname.Data(),3,-1,2);
1251  fMultiplicity->Add(hLcinEvent);
1252 
1253  hisname.Form("hPrimariesvsAOD");
1254  TH2I *hPrimariesvsAOD=new TH2I(hisname.Data(),hisname.Data(),300,0,300,300,0,300);
1255  fMultiplicity->Add(hPrimariesvsAOD);
1256 
1257  hisname.Form("hMultiplicityInLcEvent");
1258  TH1I *hMultiplicityInLcEvent=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1259  fMultiplicity->Add(hMultiplicityInLcEvent);
1260  hisname.Form("h2MultiplicityInLcEvent");
1261  TH1I *h2MultiplicityInLcEvent=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1262  fMultiplicity->Add(h2MultiplicityInLcEvent);
1263  hisname.Form("hAll2MultiplicityInEvent");
1264  TH1I *hAll2MultiplicityInEvent=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1265  fMultiplicity->Add(hAll2MultiplicityInEvent);
1266  hisname.Form("hAllMultiplicityInEvent");
1267  TH1I *hAllMultiplicityInEvent=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1268  fMultiplicity->Add(hAllMultiplicityInEvent);
1269  hisname.Form("hAllMultiplicityPrimaryInEvent");
1270  TH1I *hAllMultiplicityPrimaryInEvent=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1271  fMultiplicity->Add(hAllMultiplicityPrimaryInEvent);
1272  hisname.Form("hAll2MultiplicityPrimaryInEvent");
1273  TH1I *hAll2MultiplicityPrimaryInEvent=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1274  fMultiplicity->Add(hAll2MultiplicityPrimaryInEvent);
1275  hisname.Form("hMultiplicityInEvent");
1276  TH1I *hMultiplicityInEvent=new TH1I(hisname.Data(),hisname.Data(),300,0.,300);
1277  fMultiplicity->Add(hMultiplicityInEvent);
1278  hisname.Form("hMultiplicityIn3ProngLC");
1279  TH1I *hMultiplicityIn3ProngLC=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1280  fMultiplicity->Add(hMultiplicityIn3ProngLC);
1281  hisname.Form("hMultiplicityInLCpid");
1282  TH1I *hMultiplicityInLCpid=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1283  fMultiplicity->Add(hMultiplicityInLCpid);
1284  hisname.Form("hMultiplicityInLCmc");
1285  TH1I *hMultiplicityInLCmc=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1286  fMultiplicity->Add(hMultiplicityInLCmc);
1287  hisname.Form("hMultiplicityInLCNomc");
1288  TH1I *hMultiplicityInLCNomc=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1289  fMultiplicity->Add(hMultiplicityInLCNomc);
1290  hisname.Form("hMultiplicityYesC");
1291  TH1I *hMultiplicityYesC=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1292  fMultiplicity->Add(hMultiplicityYesC);
1293  hisname.Form("hMultiplicityYesB");
1294  TH1I *hMultiplicityYesB=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1295  fMultiplicity->Add(hMultiplicityYesB);
1296  hisname.Form("hMultiplicityJPsi");
1297  TH1I *hMultiplicityJPsi=new TH1I(hisname.Data(),hisname.Data(),300,0,300);
1298  fMultiplicity->Add(hMultiplicityJPsi);
1299 
1300 
1301  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
1302  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1303  fPIDResponse = inputHandler->GetPIDResponse();
1304 
1309  //fUtilPid=new AliAODpidUtil(fPIDResponse);
1310  fRDCutsProduction->GetPidHF()->SetOldPid(kFALSE);
1313  }
1318  fRDCutsAnalysis->GetPidHF()->SetOldPid(kFALSE);
1319  fRDCutsAnalysis->GetPidpion()->SetOldPid(kFALSE);
1320  fRDCutsAnalysis->GetPidprot()->SetOldPid(kFALSE);
1321  }
1322 
1323  PostData(1,fOutput);
1324  if (fFillVarHists) PostData(3,fOutputMC);
1325  PostData(4,fNentries);
1326  if (fPriorsHists) PostData(5,fAPriori);
1327  if (fMultiplicityHists) PostData(6,fMultiplicity);
1328  TString normName="NormalizationCounter";
1329  AliAnalysisDataContainer *cont = GetOutputSlot(7)->GetContainer();
1330  if(cont)normName=(TString)cont->GetName();
1331  fCounter = new AliNormalizationCounter(normName.Data());
1332  fCounter->Init();
1333  PostData(7,fCounter);
1334  if (fFillNtuple) {
1335  //OpenFile(3); // 2 is the slot number of the ntuple
1336  fNtupleLambdac = new TNtuple("fNtupleLambdac","D +",
1337  "pdg:Px:Py:Pz:PtTrue:VxTrue:VyTrue:VzTrue:Ptpi:PtK:Ptpi2:PtRec:PointingAngle:DecLeng:VxRec:VyRec:VzRec:InvMass:sigvert:d0Pi:d0K:d0Pi2:dca:d0square");
1338  PostData(8,fNtupleLambdac);
1339  }
1340 
1341  return;
1342 }
1343 
1344 //________________________________________________________________________
1345 void AliAnalysisTaskSELambdac::UserExec(Option_t */*option*/)
1346 {
1347  // Execute analysis for current event:
1348  // heavy flavor candidates association to MC truth
1349 
1350  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
1351  //tmp
1352  fHistNEvents->Fill(0); // count event
1353  // Post the data already here
1354 
1355  TClonesArray *array3Prong = 0;
1356  TClonesArray *arrayLikeSign =0;
1357  if(!aod && AODEvent() && IsStandardAOD()) {
1358  // In case there is an AOD handler writing a standard AOD, use the AOD
1359  // event in memory rather than the input (ESD) event.
1360  aod = dynamic_cast<AliAODEvent*> (AODEvent());
1361  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
1362  // have to taken from the AOD event hold by the AliAODExtension
1363  AliAODHandler* aodHandler = (AliAODHandler*)
1364  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1365  if(aodHandler->GetExtensions()) {
1366  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
1367  AliAODEvent *aodFromExt = ext->GetAOD();
1368  array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1369  arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject("LikeSign3Prong");
1370  }
1371  } else if(aod) {
1372  array3Prong=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1373  arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject("LikeSign3Prong");
1374  }
1375 
1376  if(!aod) return;
1377 
1378  TClonesArray *arrayMC=0;
1379  AliAODMCHeader *mcHeader=0;
1380 
1381  // load MC particles
1382  if(fReadMC){
1383 
1384  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1385  if(!arrayMC) {
1386  AliError("AliAnalysisTaskSELambdac::UserExec: MC particles branch not found!\n");
1387  return;
1388  }
1389 
1390 
1391  // load MC header
1392  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1393  if(!mcHeader) {
1394  AliError("AliAnalysisTaskSELambdac::UserExec: MC header branch not found!\n");
1395  return;
1396  }
1397  }
1398 
1399  TString fillthis="";
1400  Int_t numberOfPrimaries= NumberPrimaries(aod);
1401 
1402  if (fMultiplicityHists && fReadMC) {
1403  fillthis="hPrimariesvsAOD";
1404  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(aod->GetNumberOfTracks(),numberOfPrimaries);
1405 
1406  fillthis="hAll2MultiplicityInEvent";
1407  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(aod->GetNumberOfTracks());
1408 
1409  fillthis="hAll2MultiplicityPrimaryInEvent";
1410  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1411 
1412  if (IsThereAGeneratedLc(arrayMC)) {
1413  fillthis="h2MultiplicityInLcEvent";
1414  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1415  }
1416 
1417  }
1418 
1419  if(!array3Prong || !aod) {
1420  AliError("AliAnalysisTaskSELambdac::UserExec: Charm3Prong branch not found!\n");
1421  return;
1422  }
1423  if(!arrayLikeSign) {
1424  AliDebug(2,"AliAnalysisTaskSELambdac::UserExec: LikeSign3Prong branch not found!\n");
1425  // return;
1426  }
1427 
1428  // fix for temporary bug in ESDfilter
1429  // the AODs with null vertex pointer didn't pass the PhysSel
1430  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1431  if(!vtx1 || TMath::Abs(aod->GetMagneticField())<0.001) return;
1432 
1433  fNentries->Fill(0);
1435  TString trigclass=aod->GetFiredTriggerClasses();
1436  if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNentries->Fill(14);
1437  Bool_t isEvSelProdCuts=fRDCutsProduction->IsEventSelected(aod);
1438  Bool_t isEvSelAnCuts=fRDCutsAnalysis->IsEventSelected(aod);
1439  if(!isEvSelProdCuts || !isEvSelAnCuts){
1440  if(fRDCutsProduction->GetWhyRejection()==1) // rejected for pileup
1441  fNentries->Fill(13);
1442  return;
1443  }
1444 
1445  Bool_t isThereA3prongWithGoodTracks = kFALSE;
1446  Bool_t isThereA3ProngLcKine = kFALSE;
1447  Bool_t isThereA3ProngLcKineANDpid = kFALSE;
1448  Bool_t isThereA3ProngLcMC = kFALSE;
1449  Bool_t isThereA3ProngCyes = kFALSE;
1450  Bool_t isThereA3ProngByes = kFALSE;
1451  Bool_t isThereA3ProngJPsi = kFALSE;
1452 
1453  Int_t n3Prong = array3Prong->GetEntriesFast();
1454  Int_t nSelectedloose[1]={0};
1455  Int_t nSelectedtight[1]={0};
1456 
1457  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
1458  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
1459 
1460  Bool_t unsetvtx=kFALSE;
1461  if(!d->GetOwnPrimaryVtx()){
1462  d->SetOwnPrimaryVtx(vtx1);
1463  unsetvtx=kTRUE;
1464  }
1465 
1466  //Filter bit selection and QA:
1467  fhSelectBit->Fill(1);
1468  if(d->GetSelectionMap()){
1469  fhSelectBit->Fill(2);
1472  if(fLcCut&&!d->HasSelectionBit(AliRDHFCuts::kLcCuts)) continue;
1473  if(fLcPIDCut&&!d->HasSelectionBit(AliRDHFCuts::kLcPID)) continue;
1474  }
1475 
1476  Int_t isSelectedTracks = fRDCutsProduction->IsSelected(d,AliRDHFCuts::kTracks,aod);
1477  if(!isSelectedTracks) continue;
1478  fhEta3Prong->Fill(d->Pt(),d->Eta());
1479  fhRap3Prong->Fill(d->Pt(),d->Y(4122));
1480 
1481  isThereA3prongWithGoodTracks=kTRUE;
1482 
1483  if (fRDCutsProduction->IsInFiducialAcceptance(d->Pt(),d->Y(4122))) {fNentries->Fill(6);}else{continue;}
1484  fhEta3ProngAcc->Fill(d->Pt(),d->Eta());
1485  fhRap3ProngAcc->Fill(d->Pt(),d->Y(4122));
1486 
1487  Int_t ptbin=fRDCutsProduction->PtBin(d->Pt());
1488  if(ptbin==-1) {fNentries->Fill(4); continue;} //out of bounds
1489 
1490  FillMassHists(aod,d,arrayMC,fRDCutsProduction,nSelectedloose,nSelectedtight);
1491  if(fFillVarHists) FillVarHists(d,arrayMC,fRDCutsProduction,/*fOutputMC,*/aod);
1492 
1493  if (fPriorsHists && fReadMC)
1494  FillAPrioriConcentrations(d, fRDCutsProduction, aod, arrayMC);
1495  if (fMultiplicityHists && fReadMC)
1496  MultiplicityStudies(d, fRDCutsProduction, aod, arrayMC,
1497  isThereA3ProngLcKine,isThereA3ProngLcKineANDpid,isThereA3ProngLcMC,
1498  isThereA3ProngCyes,isThereA3ProngByes,isThereA3ProngJPsi);
1499 
1500  /*
1501  //start OS analysis
1502  if(labDp<0)fHistOSbkg->Fill(d->InvMassDplus());
1503  fHistOS->Fill(d->InvMassDplus());
1504  */
1505 
1506  if(unsetvtx) d->UnsetOwnPrimaryVtx();
1507  }
1508  fCounter->StoreCandidates(aod,nSelectedloose[0],kTRUE);
1509  fCounter->StoreCandidates(aod,nSelectedtight[0],kFALSE);
1510 
1511  if (fMultiplicityHists && fReadMC) {
1512  fillthis="hAllMultiplicityInEvent";
1513  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(aod->GetNumberOfTracks());
1514 
1515  fillthis="hAllMultiplicityPrimaryInEvent";
1516  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1517 
1518  if (IsThereAGeneratedLc(arrayMC)) {
1519  fillthis="hMultiplicityInLcEvent";
1520  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1521  }
1522 
1523  if (isThereA3prongWithGoodTracks) {
1524  fillthis="hMultiplicityInEvent";
1525  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1526  }
1527  if (isThereA3ProngLcKine) {
1528  fillthis="hMultiplicityIn3ProngLC";
1529  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1530  }
1531  if (isThereA3ProngLcKineANDpid) {
1532  fillthis="hMultiplicityInLCpid";
1533  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1534  }
1535  if (isThereA3ProngLcMC) {
1536  fillthis="hMultiplicityInLCmc";
1537  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1538  }
1539  if (isThereA3ProngLcKine && !isThereA3ProngLcMC) {
1540  fillthis="hMultiplicityInLCNomc";
1541  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1542  }
1543 
1544  if (isThereA3ProngCyes) {
1545  fillthis="hMultiplicityYesC";
1546  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1547  }
1548  if (isThereA3ProngByes) {
1549  fillthis="hMultiplicityYesB";
1550  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1551  }
1552  if (isThereA3ProngJPsi) {
1553  fillthis="hMultiplicityJPsi";
1554  ((TH1I*)fMultiplicity->FindObject(fillthis))->Fill(numberOfPrimaries);
1555  }
1556 
1557  }
1558 
1559 
1560  PostData(1,fOutput);
1561  if (fFillVarHists) PostData(3,fOutputMC);
1562  if (fPriorsHists) PostData(5,fAPriori);
1563  if (fMultiplicityHists) PostData(6,fMultiplicity);
1564 
1565  PostData(4,fNentries);
1566  PostData(7,fCounter);
1567 
1568  return;
1569 }
1570 
1571 
1572 
1573 //________________________________________________________________________
1574 void AliAnalysisTaskSELambdac::Terminate(Option_t */*option*/)
1575 {
1576  // Terminate analysis
1577  //
1578  if (fDebug > 1) printf("AnalysisTaskSELambdac: Terminate() \n");
1579 
1580  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1581  if (!fOutput) {
1582  AliError("ERROR: fOutput not available\n");
1583  return;
1584  }
1585  //fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1586 
1587  if(fFillNtuple){
1588  fNtupleLambdac = dynamic_cast<TNtuple*>(GetOutputData(3));
1589  }
1590 
1591 
1592  return;
1593 }
1594 
1595 //________________________________________________________________________
1597  // check if the candidate is a Lambdac decaying in pKpi or in the resonant channels
1598  Int_t lambdacLab[3]={0,0,0};
1599  // Int_t pdgs[3]={0,0,0};
1600  for(Int_t i=0;i<3;i++){
1601  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1602  Int_t lab=daugh->GetLabel();
1603  if(lab<0) return 0;
1604  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab);
1605  if(!part) continue;
1606  // pdgs[i]=part->GetPdgCode();
1607  Int_t partPdgcode = TMath::Abs(part->GetPdgCode());
1608  if(partPdgcode==211 || partPdgcode==321 || partPdgcode==2212){
1609  Int_t motherLabel=part->GetMother();
1610  if(motherLabel<0) return 0;
1611  AliAODMCParticle *motherPart = (AliAODMCParticle*)arrayMC->At(motherLabel);
1612  if(!motherPart) continue;
1613  Int_t motherPdg = TMath::Abs(motherPart->GetPdgCode());
1614  if(motherPdg==4122) {
1615  if(GetLambdacDaugh(motherPart,arrayMC)){lambdacLab[i]=motherLabel;continue;}
1616  }
1617  if(motherPdg==313 || motherPdg==2224 || motherPdg==3124){
1618  Int_t granMotherLabel=motherPart->GetMother();
1619  if(granMotherLabel<0) return 0;
1620  AliAODMCParticle *granMotherPart = (AliAODMCParticle*)arrayMC->At(granMotherLabel);
1621  if(!granMotherPart) continue;
1622  Int_t granMotherPdg = TMath::Abs(granMotherPart->GetPdgCode());
1623  if(granMotherPdg ==4122) {
1624  if(GetLambdacDaugh(granMotherPart,arrayMC)) {lambdacLab[i]=granMotherLabel;continue;}
1625  }
1626  }
1627  }
1628  }
1629 
1630  if(lambdacLab[0]==lambdacLab[1] && lambdacLab[1]==lambdacLab[2]) {return lambdacLab[0];}
1631  return 0;
1632 
1633 }
1634 //------------------------
1635 Bool_t AliAnalysisTaskSELambdac::GetLambdacDaugh(AliAODMCParticle *part,TClonesArray *arrayMC) const{
1636  // check if the particle is a lambdac and if its decay mode is the correct one
1637  Int_t numberOfLambdac=0;
1638  if(TMath::Abs(part->GetPdgCode())!=4122) return kFALSE;
1639  // Int_t daughTmp[2];
1640  // daughTmp[0]=part->GetDaughter(0);
1641  // daughTmp[1]=part->GetDaughter(1);
1642  Int_t nDaugh = (Int_t)part->GetNDaughters();
1643  if(nDaugh<2) return kFALSE;
1644  if(nDaugh>3) return kFALSE;
1645  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)arrayMC->At(part->GetDaughter(0));
1646  if(!pdaugh1) {return kFALSE;}
1647  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
1648  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)arrayMC->At(part->GetDaughter(1));
1649  if(!pdaugh2) {return kFALSE;}
1650  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
1651 
1652  if(nDaugh==3){
1653  Int_t thirdDaugh=part->GetDaughter(1)-1;
1654  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)arrayMC->At(thirdDaugh);
1655  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
1656  if((number1==321 && number2==211 && number3==2212) ||
1657  (number1==211 && number2==321 && number3==2212) ||
1658  (number1==211 && number2==2212 && number3==321) ||
1659  (number1==321 && number2==2212 && number3==211) ||
1660  (number1==2212 && number2==321 && number3==211) ||
1661  (number1==2212 && number2==211 && number3==321)) {
1662  numberOfLambdac++;
1663  }
1664  }
1665 
1666  if(nDaugh==2){
1667 
1668  //Lambda resonant
1669 
1670  //Lambda -> p K*0
1671  //
1672  Int_t nfiglieK=0;
1673 
1674  if((number1==2212 && number2==313)){
1675  nfiglieK=pdaugh2->GetNDaughters();
1676  if(nfiglieK!=2) return kFALSE;
1677  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1678  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1679  if(!pdaughK1) return kFALSE;
1680  if(!pdaughK2) return kFALSE;
1681  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
1682  }
1683 
1684  if((number1==313 && number2==2212)){
1685  nfiglieK=pdaugh1->GetNDaughters();
1686  if(nfiglieK!=2) return kFALSE;
1687  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1688  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1689  if(!pdaughK1) return kFALSE;
1690  if(!pdaughK2) return kFALSE;
1691  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
1692  }
1693 
1694  //Lambda -> Delta++ k
1695  Int_t nfiglieDelta=0;
1696  if(number1==321 && number2==2224){
1697  nfiglieDelta=pdaugh2->GetNDaughters();
1698  if(nfiglieDelta!=2) return kFALSE;
1699  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1700  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1701  if(!pdaughD1) return kFALSE;
1702  if(!pdaughD2) return kFALSE;
1703  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
1704  }
1705  if(number1==2224 && number2==321){
1706  nfiglieDelta=pdaugh1->GetNDaughters();
1707  if(nfiglieDelta!=2) return kFALSE;
1708  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1709  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1710  if(!pdaughD1) return kFALSE;
1711  if(!pdaughD2) return kFALSE;
1712  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
1713  }
1714 
1715 
1716  //Lambdac -> Lambda(1520) pi
1717  Int_t nfiglieLa=0;
1718  if(number1==3124 && number2==211){
1719  nfiglieLa=pdaugh1->GetNDaughters();
1720  if(nfiglieLa!=2) return kFALSE;
1721  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(0));
1722  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh1->GetDaughter(1));
1723  if(!pdaughL1) return kFALSE;
1724  if(!pdaughL2) return kFALSE;
1725  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
1726  }
1727  if(number1==211 && number2==3124){
1728  nfiglieLa=pdaugh2->GetNDaughters();
1729  if(nfiglieLa!=2) return kFALSE;
1730  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(0));
1731  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)arrayMC->At(pdaugh2->GetDaughter(1));
1732  if(!pdaughL1) return kFALSE;
1733  if(!pdaughL2) return kFALSE;
1734  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
1735 
1736  }
1737  }
1738 
1739  if(numberOfLambdac>0) {return kTRUE;}
1740  return kFALSE;
1741 }
1742 //-----------------------------
1743 Bool_t AliAnalysisTaskSELambdac::IspKpiMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC) const{
1744  // Apply MC PID
1745  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1746  for(Int_t i=0;i<3;i++){
1747  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1748  lab[i]=daugh->GetLabel();
1749  if(lab[i]<0) return kFALSE;
1750  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1751  if(!part) return kFALSE;
1752  pdgs[i]=TMath::Abs(part->GetPdgCode());
1753  }
1754 
1755  if(pdgs[0]==2212 && pdgs[1]==321 && pdgs[2]==211) return kTRUE;
1756 
1757  return kFALSE;
1758 }
1759 //-----------------------------
1760 Bool_t AliAnalysisTaskSELambdac::IspiKpMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC) const{
1761 
1762  // Apply MC PID
1763  Int_t lab[3]={0,0,0},pdgs[3]={0,0,0};
1764  for(Int_t i=0;i<3;i++){
1765  AliAODTrack *daugh=(AliAODTrack*)d->GetDaughter(i);
1766  lab[i]=daugh->GetLabel();
1767  if(lab[i]<0) return kFALSE;
1768  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab[i]);
1769  if(!part) return kFALSE;
1770  pdgs[i]=TMath::Abs(part->GetPdgCode());
1771  }
1772 
1773  if(pdgs[2]==2212 && pdgs[1]==321 && pdgs[0]==211) {return kTRUE;}
1774 
1775  return kFALSE;
1776 }
1777 //--------------------------------------
1778 Bool_t AliAnalysisTaskSELambdac::VertexingKF(AliAODRecoDecayHF3Prong *d,Int_t *pdgs,Double_t field) const{
1779  // apply vertexing KF
1780  Int_t iprongs[3]={0,1,2};
1781  Double_t mass[2]={0.,0.};
1782  Bool_t constraint=kFALSE;
1783  if(fCutsKF[0]>0.)constraint=kTRUE;
1784  //topological constr
1785  AliKFParticle *lambdac=d->ApplyVertexingKF(iprongs,3,pdgs,constraint,field,mass);
1786  if(!lambdac) return kFALSE;
1787  if(lambdac->GetChi2()/lambdac->GetNDF()>fCutsKF[1]) return kFALSE;
1788  return kTRUE;
1789 }
1790 //-------------------------------------
1791 void AliAnalysisTaskSELambdac::IspiKpResonant(AliAODRecoDecayHF3Prong *d,Double_t field,Int_t *resNumber) const{
1792 
1793  // apply PID using the resonant channels
1794  //if lambda* -> pk
1795  Double_t mass[2]={1.520,0.005};
1796  Int_t ipRes[2]={1,2};
1797  Int_t pdgres[2]={321,2212};
1798  AliKFParticle *lambda1520=d->ApplyVertexingKF(ipRes,2,pdgres,kFALSE,field,mass);
1799  Double_t probLa=TMath::Prob(lambda1520->GetChi2(),lambda1520->GetNDF());
1800  if(probLa>0.1) resNumber[0]=1;
1801  //K* -> kpi
1802  mass[0]=0.8961;mass[1]=0.03;
1803  ipRes[0]=0;ipRes[1]=1;
1804  pdgres[0]=211;pdgres[1]=321;
1805  AliKFParticle *kstar=d->ApplyVertexingKF(ipRes,2,pdgres,kFALSE,field,mass);
1806  Double_t probKa=TMath::Prob(kstar->GetChi2(),kstar->GetNDF());
1807  if(probKa>0.1) resNumber[1]=1;
1808 
1809  // Delta++
1810  mass[0]=1.232;mass[1]=0.15;
1811  ipRes[0]=0;ipRes[1]=2;
1812  pdgres[0]=211;pdgres[1]=2122;
1813  AliKFParticle *delta=d->ApplyVertexingKF(ipRes,2,pdgres,kFALSE,field,mass);
1814  Double_t probDe=TMath::Prob(delta->GetChi2(),delta->GetNDF());
1815  if(probDe>0.1) resNumber[2]=1;
1816 
1817  return ;
1818 
1819 }
1820 //-------------------------------------
1821 void AliAnalysisTaskSELambdac::IspKpiResonant(AliAODRecoDecayHF3Prong *d,Double_t field,Int_t *resNumber) const{
1822 
1823  // apply PID using the resonant channels
1824  //if lambda* -> pk
1825  Double_t mass[2]={1.520,0.005};
1826  Int_t ipRes[2]={0,1};
1827  Int_t pdgres[2]={2212,321};
1828  AliKFParticle *lambda1520=d->ApplyVertexingKF(ipRes,2,pdgres,kFALSE,field,mass);
1829  Double_t probLa=TMath::Prob(lambda1520->GetChi2(),lambda1520->GetNDF());
1830  if(probLa>0.1) resNumber[0]=1;
1831  //K* -> kpi
1832  mass[0]=0.8961;mass[1]=0.03;
1833  ipRes[0]=1;ipRes[1]=2;
1834  pdgres[1]=211;pdgres[0]=321;
1835  AliKFParticle *kstar=d->ApplyVertexingKF(ipRes,2,pdgres,kFALSE,field,mass);
1836  Double_t probKa=TMath::Prob(kstar->GetChi2(),kstar->GetNDF());
1837  if(probKa>0.1) resNumber[1]=1;
1838 
1839  // Delta++
1840  mass[0]=1.232;mass[1]=0.15;
1841  ipRes[0]=0;ipRes[1]=2;
1842  pdgres[0]=2122;pdgres[1]=211;
1843  AliKFParticle *delta=d->ApplyVertexingKF(ipRes,2,pdgres,kFALSE,field,mass);
1844  Double_t probDe=TMath::Prob(delta->GetChi2(),delta->GetNDF());
1845  if(probDe>0.1) resNumber[2]=1;
1846 
1847  return ;
1848 
1849 }
1850 //---------------------------
1852  TClonesArray *arrayMC, AliRDHFCutsLctopKpi *cuts,Int_t *nSelectedloose,Int_t *nSelectedtight)
1853 {
1854 
1855  //if MC PID or no PID, unset PID
1856  //if(!fRealPid) cuts->SetUsePID(kFALSE);
1857  Int_t selection=cuts->IsSelected(part,AliRDHFCuts::kCandidate,aod);
1858  if(selection>0){
1859  nSelectedloose[0]=nSelectedloose[0]+1;
1860  Int_t iPtBin = -1;
1861  Double_t ptCand = part->Pt();
1862  Int_t index=0;
1863 
1864  for(Int_t ibin=0;ibin<fNPtBins&&iPtBin<0&&ptCand>fArrayBinLimits[0]&&ptCand<fArrayBinLimits[fNPtBins];ibin++){
1865  if(ptCand<fArrayBinLimits[ibin+1])iPtBin=ibin;
1866  }
1867 
1868  Float_t pdgCode=-2;
1869  Float_t pdgCode1=-1;
1870  Float_t pdgCode2=-1;
1871  Int_t labDp=-1;
1872  Float_t deltaPx=0.;
1873  Float_t deltaPy=0.;
1874  Float_t deltaPz=0.;
1875  Float_t truePt=0.;
1876  Float_t xDecay=0.;
1877  Float_t yDecay=0.;
1878  Float_t zDecay=0.;
1879  // Bool_t IsInjected = -1;
1880  Bool_t IsLc = 0;
1881  Bool_t IsLcfromLb = 0;
1882  Bool_t IsLcfromc = 0;
1883  Bool_t IsLcFromq = 0;
1884 
1885  if(fReadMC){
1886  // AliAODMCHeader *mcHeader2 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1888  // IsInjected = util->IsCandidateInjected(part,mcHeader2,arrayMC)?1:0;
1889 
1890  labDp = MatchToMCLambdac(part,arrayMC);
1891  if(labDp>0){
1892  IsLc = 1;
1893  AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1894  AliAODMCParticle *dg0 = (AliAODMCParticle*)arrayMC->At(partDp->GetDaughter(0));
1895  AliAODMCParticle *dg1 = (AliAODMCParticle*)arrayMC->At(partDp->GetDaughter(1));
1896  deltaPx=partDp->Px()-part->Px();
1897  deltaPy=partDp->Py()-part->Py();
1898  deltaPz=partDp->Pz()-part->Pz();
1899  truePt=partDp->Pt();
1900  xDecay=dg0->Xv();
1901  yDecay=dg0->Yv();
1902  zDecay=dg0->Zv();
1903  pdgCode=TMath::Abs(partDp->GetPdgCode());
1904  pdgCode1=TMath::Abs(dg0->GetPdgCode());
1905  pdgCode2=TMath::Abs(dg1->GetPdgCode());
1906  Int_t pdgMom=util->CheckOrigin(arrayMC,partDp,kFALSE);
1907  if(pdgMom == 5) IsLcfromLb =1;
1908  if(pdgMom == 4) IsLcfromc =1;
1909  Int_t isThereaQuark=util->CheckOrigin(arrayMC,partDp,kTRUE);
1910  if(isThereaQuark>0) IsLcFromq = 1;
1911 
1912 
1913  }else{
1914  pdgCode=-1;
1915  }
1916  delete util;
1917  }
1918 
1919  Double_t invMasspKpi=-1.;
1920  Double_t invMasspiKp=-1.;
1921  Double_t invMasspKpiLpi=-1.;
1922  Double_t invMasspiKpLpi=-1.;
1923  Double_t invMasspKpiKp=-1.;
1924  Double_t invMasspiKpKp=-1.;
1925  Double_t invMasspiKpDk=-1.;
1926  Double_t invMasspKpiDk=-1.;
1927  Double_t invMasspiKp3Pr=-1.;
1928  Double_t invMasspKpi3Pr=-1.;
1929  Double_t field=aod->GetMagneticField();
1930  //apply MC PID
1931  if(fReadMC && fMCPid){
1932  if(IspKpiMC(part,arrayMC)) invMasspKpi=part->InvMassLcpKpi();
1933  if(IspiKpMC(part,arrayMC)) invMasspiKp=part->InvMassLcpiKp();
1934  }
1935 
1936  // apply realistic PID
1937  if(fRealPid){
1938  if(selection==1 || selection==3) invMasspKpi=part->InvMassLcpKpi();
1939  if(selection>=2) invMasspiKp=part->InvMassLcpiKp();
1940  }
1941  //apply PID using resonances
1942  if (fResPid && fRealPid) {
1943  Int_t ispKpi[3]={0,0,0};
1944  IspKpiResonant(part,field,ispKpi);
1945  Int_t ispiKp[3]={0,0,0};
1946  IspiKpResonant(part,field,ispiKp);
1947  if (selection==3 || selection==1) {
1948  if(ispKpi[0]==1){
1949  invMasspKpiLpi=part->InvMassLcpKpi();
1950  }
1951  if(ispKpi[1]==1){
1952  invMasspKpiKp=part->InvMassLcpKpi();
1953  }
1954  if(ispKpi[2]==1){
1955  invMasspKpiDk=part->InvMassLcpKpi();
1956  }
1957  if(ispKpi[2]==0 && ispKpi[1]==0 && ispKpi[0]==0){
1958  invMasspKpi3Pr=part->InvMassLcpKpi();
1959  }
1960  }
1961  if(selection>=2) {
1962  if(ispiKp[0]==1){
1963  invMasspiKpLpi=part->InvMassLcpiKp();
1964  }
1965  if(ispiKp[1]==1){
1966  invMasspiKpKp=part->InvMassLcpiKp();
1967  }
1968  if(ispiKp[2]==1){
1969  invMasspiKpDk=part->InvMassLcpiKp();
1970  }
1971  if(ispiKp[2]==0 && ispiKp[1]==0 && ispiKp[0]==0){
1972  invMasspiKp3Pr=part->InvMassLcpiKp();
1973  }
1974  }
1975 
1976  }
1977 
1978 
1979  if(invMasspiKp<0. && invMasspKpi<0.) return;
1980 
1981  Int_t passTightCuts=0;
1982  if(fAnalysis) {
1983  passTightCuts=fRDCutsAnalysis->IsSelected(part,AliRDHFCuts::kCandidate,aod);
1984  if(fUseKF){
1985  Int_t pdgs[3]={0,0,0};
1986  if(invMasspKpi>0.){
1987  pdgs[0]=2212;pdgs[1]=321;pdgs[2]=211;
1988  if(!VertexingKF(part,pdgs,field)) {
1989  invMasspKpi=-1.;
1990  invMasspKpi3Pr=-1.;
1991  invMasspKpiDk=-1.;
1992  invMasspKpiLpi=-1.;
1993  invMasspKpiKp=-1.;
1994  }
1995  }
1996  if(invMasspiKp>0.){
1997  pdgs[0]=211;pdgs[1]=321;pdgs[2]=2212;
1998  if(!VertexingKF(part,pdgs,field)) {
1999  invMasspiKp=-1.;
2000  invMasspiKp3Pr=-1.;
2001  invMasspiKpDk=-1.;
2002  invMasspiKpLpi=-1.;
2003  invMasspiKpKp=-1.;
2004  }
2005  }
2006  }
2007  if(passTightCuts>0) nSelectedtight[0]=nSelectedtight[0]+1;
2008  }
2009  // Eta and y plots:
2010  fhEta3ProngProd->Fill(part->Pt(),part->Eta());
2011  fhRap3ProngProd->Fill(part->Pt(),part->Y(4122));
2012  if(passTightCuts>0){
2013  fhEta3ProngAn->Fill(part->Pt(),part->Eta());
2014  fhRap3ProngAn->Fill(part->Pt(),part->Y(4122));
2015  if(invMasspiKp>0. && invMasspKpi>0.){
2016  fhMassLcPt->Fill(part->Pt(),invMasspKpi,0.5);
2017  fhMassLcPt->Fill(part->Pt(),invMasspiKp,0.5);
2018  if(part->Charge()==1){
2019  fhMassLcplusPt->Fill(part->Pt(),invMasspKpi,0.5);
2020  fhMassLcplusPt->Fill(part->Pt(),invMasspiKp,0.5);
2021  }
2022  else if(part->Charge()==-1){
2023  fhMassLcminusPt->Fill(part->Pt(),invMasspKpi,0.5);
2024  fhMassLcminusPt->Fill(part->Pt(),invMasspiKp,0.5);
2025  }
2026  }
2027  else if(invMasspiKp>0.){
2028  fhMassLcPt->Fill(part->Pt(),invMasspiKp);
2029  if(part->Charge()==1) fhMassLcplusPt->Fill(part->Pt(),invMasspiKp);
2030  else if(part->Charge()==-1) fhMassLcminusPt->Fill(part->Pt(),invMasspiKp);
2031  }
2032  else if(invMasspKpi>0.){
2033  fhMassLcPt->Fill(part->Pt(),invMasspKpi);
2034  if(part->Charge()==1) fhMassLcplusPt->Fill(part->Pt(),invMasspKpi);
2035  else if(part->Charge()==-1) fhMassLcminusPt->Fill(part->Pt(),invMasspKpi);
2036  }
2037 
2038  }
2039  Float_t tmp[24];
2040  if (fFillNtuple) {
2041  tmp[0]=pdgCode;
2042  tmp[1]=deltaPx;
2043  tmp[2]=deltaPy;
2044  tmp[3]=deltaPz;
2045  tmp[4]=truePt;
2046  tmp[5]=xDecay;
2047  tmp[6]=yDecay;
2048  tmp[7]=zDecay;
2049  if(pdgCode1==2212) {tmp[8]=part->PtProng(0);}else{tmp[8]=0.;}
2050  if(pdgCode1==211) {tmp[10]=part->PtProng(0);}else{tmp[10]=0.;}
2051  tmp[9]=part->PtProng(1);
2052  if(pdgCode2==211) {tmp[10]=part->PtProng(2);}else{tmp[10]=0.;}
2053  tmp[11]=part->Pt();
2054  tmp[12]=part->CosPointingAngle();
2055  tmp[13]=part->DecayLength();
2056  tmp[14]=part->Xv();
2057  tmp[15]=part->Yv();
2058  tmp[16]=part->Zv();
2059  if(invMasspiKp>0.) tmp[17]=invMasspiKp;
2060  if(invMasspKpi>0.) tmp[17]=invMasspKpi;
2061  tmp[18]=part->GetSigmaVert();
2062  tmp[19]=part->Getd0Prong(0);
2063  tmp[20]=part->Getd0Prong(1);
2064  tmp[21]=part->Getd0Prong(2);
2065  tmp[22]=part->GetDCA();
2066  tmp[23]=part->Prodd0d0();
2067  fNtupleLambdac->Fill(tmp);
2068  PostData(7,fNtupleLambdac);
2069  }
2070 
2071 
2072 
2073  if(part->Pt()>3.&& part->Pt()<=6.){
2074  if(invMasspiKp>0. && invMasspKpi>0.){
2075  if(invMasspiKp>0.) fhMassPtGreater3->Fill(invMasspiKp,0.5);
2076  if(invMasspKpi>0.) fhMassPtGreater3->Fill(invMasspKpi,0.5);
2077  }else{
2078  if(invMasspiKp>0.) fhMassPtGreater3->Fill(invMasspiKp);
2079  if(invMasspKpi>0.) fhMassPtGreater3->Fill(invMasspKpi);
2080  }
2081  if(invMasspiKpLpi>0. && invMasspKpiLpi>0.){
2082  if(invMasspiKpLpi>0.) fhMassPtGreater3Lpi->Fill(invMasspiKpLpi,0.5);
2083  if(invMasspKpiLpi>0.) fhMassPtGreater3Lpi->Fill(invMasspKpiLpi,0.5);
2084  }else{
2085  if(invMasspiKpLpi>0.) fhMassPtGreater3Lpi->Fill(invMasspiKpLpi);
2086  if(invMasspKpiLpi>0.) fhMassPtGreater3Lpi->Fill(invMasspKpiLpi);
2087  }
2088  if(invMasspiKpKp>0. && invMasspKpiKp>0.){
2089  if(invMasspiKpKp>0.) fhMassPtGreater3Kp->Fill(invMasspiKpKp,0.5);
2090  if(invMasspKpiKp>0.) fhMassPtGreater3Kp->Fill(invMasspKpiKp,0.5);
2091  }else{
2092  if(invMasspiKpKp>0.) fhMassPtGreater3Kp->Fill(invMasspiKpKp);
2093  if(invMasspKpiKp>0.) fhMassPtGreater3Kp->Fill(invMasspKpiKp);
2094  }
2095  if(invMasspiKpDk>0. && invMasspKpiDk>0.){
2096  if(invMasspiKpDk>0.) fhMassPtGreater3Dk->Fill(invMasspiKpDk,0.5);
2097  if(invMasspKpiDk>0.) fhMassPtGreater3Dk->Fill(invMasspKpiDk,0.5);
2098  }else{
2099  if(invMasspiKpDk>0.) fhMassPtGreater3Dk->Fill(invMasspiKpDk);
2100  if(invMasspKpiDk>0.) fhMassPtGreater3Dk->Fill(invMasspKpiDk);
2101  }
2102  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0.){
2103  if(invMasspiKp3Pr>0.) fhMassPtGreater33Pr->Fill(invMasspiKp3Pr,0.5);
2104  if(invMasspKpi3Pr>0.) fhMassPtGreater33Pr->Fill(invMasspKpi3Pr,0.5);
2105  }else{
2106  if(invMasspiKp3Pr>0.) fhMassPtGreater33Pr->Fill(invMasspiKp3Pr);
2107  if(invMasspKpi3Pr>0.) fhMassPtGreater33Pr->Fill(invMasspKpi3Pr);
2108  }
2109 
2110  if(passTightCuts>0){
2111  if(invMasspiKp>0. && invMasspKpi>0.){
2112  if(invMasspiKp>0.) fhMassPtGreater3TC->Fill(invMasspiKp,0.5);
2113  if(invMasspKpi>0.) fhMassPtGreater3TC->Fill(invMasspKpi,0.5);
2114  }else{
2115  if(invMasspiKp>0.) fhMassPtGreater3TC->Fill(invMasspiKp);
2116  if(invMasspKpi>0.) fhMassPtGreater3TC->Fill(invMasspKpi);
2117  }
2118  if(invMasspiKpLpi>0. && invMasspKpiLpi>0.){
2119  if(invMasspiKpLpi>0.) fhMassPtGreater3LpiTC->Fill(invMasspiKpLpi,0.5);
2120  if(invMasspKpiLpi>0.) fhMassPtGreater3LpiTC->Fill(invMasspKpiLpi,0.5);
2121  }else{
2122  if(invMasspiKpLpi>0.) fhMassPtGreater3LpiTC->Fill(invMasspiKpLpi);
2123  if(invMasspKpiLpi>0.) fhMassPtGreater3LpiTC->Fill(invMasspKpiLpi);
2124  }
2125  if(invMasspiKpKp>0. && invMasspKpiKp>0.){
2126  if(invMasspiKpKp>0.) fhMassPtGreater3KpTC->Fill(invMasspiKpKp,0.5);
2127  if(invMasspKpiKp>0.) fhMassPtGreater3KpTC->Fill(invMasspKpiKp,0.5);
2128  }else{
2129  if(invMasspiKpKp>0.) fhMassPtGreater3KpTC->Fill(invMasspiKpKp);
2130  if(invMasspKpiKp>0.) fhMassPtGreater3KpTC->Fill(invMasspKpiKp);
2131  }
2132 
2133  if(invMasspiKpDk>0. && invMasspKpiDk>0.){
2134  if(invMasspiKpDk>0.) fhMassPtGreater3DkTC->Fill(invMasspiKpDk,0.5);
2135  if(invMasspKpiDk>0.) fhMassPtGreater3DkTC->Fill(invMasspKpiDk,0.5);
2136  }else{
2137  if(invMasspiKpDk>0.) fhMassPtGreater3DkTC->Fill(invMasspiKpDk);
2138  if(invMasspKpiDk>0.) fhMassPtGreater3DkTC->Fill(invMasspKpiDk);
2139  }
2140  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0.){
2141  if(invMasspiKp3Pr>0.) fhMassPtGreater33PrTC->Fill(invMasspiKp3Pr,0.5);
2142  if(invMasspKpi3Pr>0.) fhMassPtGreater33PrTC->Fill(invMasspKpi3Pr,0.5);
2143  }else{
2144  if(invMasspiKp3Pr>0.) fhMassPtGreater33PrTC->Fill(invMasspiKp3Pr);
2145  if(invMasspKpi3Pr>0.) fhMassPtGreater33PrTC->Fill(invMasspKpi3Pr);
2146  }
2147 
2148  }
2149  }
2150  if(part->Pt()>2.&& part->Pt()<=6.){
2151  if(invMasspiKp>0. && invMasspKpi>0.){
2152  if(invMasspiKp>0.) fhMassPtGreater2->Fill(invMasspiKp,0.5);
2153  if(invMasspKpi>0.) fhMassPtGreater2->Fill(invMasspKpi,0.5);
2154  }else{
2155  if(invMasspiKp>0.) fhMassPtGreater2->Fill(invMasspiKp);
2156  if(invMasspKpi>0.) fhMassPtGreater2->Fill(invMasspKpi);
2157  }
2158  if(invMasspiKpLpi>0. && invMasspKpiLpi>0.){
2159  if(invMasspiKpLpi>0.) fhMassPtGreater2Lpi->Fill(invMasspiKpLpi,0.5);
2160  if(invMasspKpiLpi>0.) fhMassPtGreater2Lpi->Fill(invMasspKpiLpi,0.5);
2161  }else{
2162  if(invMasspiKpLpi>0.) fhMassPtGreater2Lpi->Fill(invMasspiKpLpi);
2163  if(invMasspKpiLpi>0.) fhMassPtGreater2Lpi->Fill(invMasspKpiLpi);
2164  }
2165  if(invMasspiKpKp>0. && invMasspKpiKp>0.){
2166  if(invMasspiKpKp>0.) fhMassPtGreater2Kp->Fill(invMasspiKpKp,0.5);
2167  if(invMasspKpiKp>0.) fhMassPtGreater2Kp->Fill(invMasspKpiKp,0.5);
2168  }else{
2169  if(invMasspiKpKp>0.) fhMassPtGreater2Kp->Fill(invMasspiKpKp);
2170  if(invMasspKpiKp>0.) fhMassPtGreater2Kp->Fill(invMasspKpiKp);
2171  }
2172  if(invMasspiKpDk>0. && invMasspKpiDk>0.){
2173  if(invMasspiKpDk>0.) fhMassPtGreater2Dk->Fill(invMasspiKpDk,0.5);
2174  if(invMasspKpiDk>0.) fhMassPtGreater2Dk->Fill(invMasspKpiDk,0.5);
2175  }else{
2176  if(invMasspiKpDk>0.) fhMassPtGreater2Dk->Fill(invMasspiKpDk);
2177  if(invMasspKpiDk>0.) fhMassPtGreater2Dk->Fill(invMasspKpiDk);
2178  }
2179  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0.){
2180  if(invMasspiKp3Pr>0.) fhMassPtGreater23Pr->Fill(invMasspiKp3Pr,0.5);
2181  if(invMasspKpi3Pr>0.) fhMassPtGreater23Pr->Fill(invMasspKpi3Pr,0.5);
2182  }else{
2183  if(invMasspiKp3Pr>0.) fhMassPtGreater23Pr->Fill(invMasspiKp3Pr);
2184  if(invMasspKpi3Pr>0.) fhMassPtGreater23Pr->Fill(invMasspKpi3Pr);
2185  }
2186 
2187  if(passTightCuts>0){
2188  if(invMasspiKp>0. && invMasspKpi>0.){
2189  if(invMasspiKp>0.) fhMassPtGreater2TC->Fill(invMasspiKp,0.5);
2190  if(invMasspKpi>0.) fhMassPtGreater2TC->Fill(invMasspKpi,0.5);
2191  }else{
2192  if(invMasspiKp>0.) fhMassPtGreater2TC->Fill(invMasspiKp);
2193  if(invMasspKpi>0.) fhMassPtGreater2TC->Fill(invMasspKpi);
2194  }
2195  if(invMasspiKpLpi>0. && invMasspKpiLpi>0.){
2196  if(invMasspiKpLpi>0.) fhMassPtGreater2LpiTC->Fill(invMasspiKpLpi,0.5);
2197  if(invMasspKpiLpi>0.) fhMassPtGreater2LpiTC->Fill(invMasspKpiLpi,0.5);
2198  }else{
2199  if(invMasspiKpLpi>0.) fhMassPtGreater2LpiTC->Fill(invMasspiKpLpi);
2200  if(invMasspKpiLpi>0.) fhMassPtGreater2LpiTC->Fill(invMasspKpiLpi);
2201  }
2202  if(invMasspiKpKp>0. && invMasspKpiKp>0.){
2203  if(invMasspiKpKp>0.) fhMassPtGreater2KpTC->Fill(invMasspiKpKp,0.5);
2204  if(invMasspKpiKp>0.) fhMassPtGreater2KpTC->Fill(invMasspKpiKp,0.5);
2205  }else{
2206  if(invMasspiKpKp>0.) fhMassPtGreater2KpTC->Fill(invMasspiKpKp);
2207  if(invMasspKpiKp>0.) fhMassPtGreater2KpTC->Fill(invMasspKpiKp);
2208  }
2209  if(invMasspiKpDk>0. && invMasspKpiDk>0.){
2210  if(invMasspiKpDk>0.) fhMassPtGreater2DkTC->Fill(invMasspiKpDk,0.5);
2211  if(invMasspKpiDk>0.) fhMassPtGreater2DkTC->Fill(invMasspKpiDk,0.5);
2212  }else{
2213  if(invMasspiKpDk>0.) fhMassPtGreater2DkTC->Fill(invMasspiKpDk);
2214  if(invMasspKpiDk>0.) fhMassPtGreater2DkTC->Fill(invMasspKpiDk);
2215  }
2216  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0.){
2217  if(invMasspiKp3Pr>0.) fhMassPtGreater23PrTC->Fill(invMasspiKp3Pr,0.5);
2218  if(invMasspKpi3Pr>0.) fhMassPtGreater23PrTC->Fill(invMasspKpi3Pr,0.5);
2219  }else{
2220  if(invMasspiKp3Pr>0.) fhMassPtGreater23PrTC->Fill(invMasspiKp3Pr);
2221  if(invMasspKpi3Pr>0.) fhMassPtGreater23PrTC->Fill(invMasspKpi3Pr);
2222  }
2223 
2224  }
2225  }
2226 
2227  if(iPtBin>=0){
2228  index=GetHistoIndex(iPtBin);
2229  if(invMasspiKp>0. && invMasspKpi>0.){
2230  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp,0.5);
2231  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi,0.5);
2232  }else{
2233  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp);
2234  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi);
2235  }
2236  if(invMasspiKpLpi>0. && invMasspKpiLpi>0.){
2237  if(invMasspiKpLpi>0.) fMassHistLpi[index]->Fill(invMasspiKpLpi,0.5);
2238  if(invMasspKpiLpi>0.) fMassHistLpi[index]->Fill(invMasspKpiLpi,0.5);
2239  }else{
2240  if(invMasspiKpLpi>0.) fMassHistLpi[index]->Fill(invMasspiKpLpi);
2241  if(invMasspKpiLpi>0.) fMassHistLpi[index]->Fill(invMasspKpiLpi);
2242  }
2243  if(invMasspiKpKp>0. && invMasspKpiKp>0.){
2244  if(invMasspiKpKp>0.) fMassHistKp[index]->Fill(invMasspiKpKp,0.5);
2245  if(invMasspKpiKp>0.) fMassHistKp[index]->Fill(invMasspKpiKp,0.5);
2246  }else{
2247  if(invMasspiKpKp>0.) fMassHistKp[index]->Fill(invMasspiKpKp);
2248  if(invMasspKpiKp>0.) fMassHistKp[index]->Fill(invMasspKpiKp);
2249  }
2250  if(invMasspiKpDk>0. && invMasspKpiDk>0.){
2251  if(invMasspiKpDk>0.) fMassHistDk[index]->Fill(invMasspiKpDk,0.5);
2252  if(invMasspKpiDk>0.) fMassHistDk[index]->Fill(invMasspKpiDk,0.5);
2253  }else{
2254  if(invMasspiKpDk>0.) fMassHistDk[index]->Fill(invMasspiKpDk);
2255  if(invMasspKpiDk>0.) fMassHistDk[index]->Fill(invMasspKpiDk);
2256  }
2257  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0.){
2258  if(invMasspiKp3Pr>0.) fMassHist3Pr[index]->Fill(invMasspiKp3Pr,0.5);
2259  if(invMasspKpi3Pr>0.) fMassHist3Pr[index]->Fill(invMasspKpi3Pr,0.5);
2260  }else{
2261  if(invMasspiKp3Pr>0.) fMassHist3Pr[index]->Fill(invMasspiKp3Pr);
2262  if(invMasspKpi3Pr>0.) fMassHist3Pr[index]->Fill(invMasspKpi3Pr);
2263  }
2264 
2265  if(passTightCuts>0){
2266  if(invMasspiKp>0. && invMasspKpi>0. && passTightCuts==3){
2267  if(invMasspiKp>0.) fMassHistTC[index]->Fill(invMasspiKp,0.5);
2268  if(invMasspKpi>0.) fMassHistTC[index]->Fill(invMasspKpi,0.5);
2269  }else{
2270  if(invMasspiKp>0. && passTightCuts==2) fMassHistTC[index]->Fill(invMasspiKp);
2271  if(invMasspKpi>0. && passTightCuts==1) fMassHistTC[index]->Fill(invMasspKpi);
2272  }
2273  if(invMasspiKpLpi>0. && invMasspKpiLpi>0. && passTightCuts==3){
2274  if(invMasspiKpLpi>0.) fMassHistLpiTC[index]->Fill(invMasspiKpLpi,0.5);
2275  if(invMasspKpiLpi>0.) fMassHistLpiTC[index]->Fill(invMasspKpiLpi,0.5);
2276  }else{
2277  if(invMasspiKpLpi>0. && passTightCuts==2) fMassHistLpiTC[index]->Fill(invMasspiKpLpi);
2278  if(invMasspKpiLpi>0.&& passTightCuts==1) fMassHistLpiTC[index]->Fill(invMasspKpiLpi);
2279  }
2280  if(invMasspiKpKp>0. && invMasspKpiKp>0. && passTightCuts==3){
2281  if(invMasspiKpKp>0.) fMassHistKpTC[index]->Fill(invMasspiKpKp,0.5);
2282  if(invMasspKpiKp>0.) fMassHistKpTC[index]->Fill(invMasspKpiKp,0.5);
2283  }else{
2284  if(invMasspiKpKp>0. && passTightCuts==2) fMassHistKpTC[index]->Fill(invMasspiKpKp);
2285  if(invMasspKpiKp>0.&& passTightCuts==1) fMassHistKpTC[index]->Fill(invMasspKpiKp);
2286  }
2287  if(invMasspiKpDk>0. && invMasspKpiDk>0. && passTightCuts==3){
2288  if(invMasspiKpDk>0.) fMassHistDkTC[index]->Fill(invMasspiKpDk,0.5);
2289  if(invMasspKpiDk>0.) fMassHistDkTC[index]->Fill(invMasspKpiDk,0.5);
2290  }else{
2291  if(invMasspiKpDk>0. && passTightCuts==2) fMassHistDkTC[index]->Fill(invMasspiKpDk);
2292  if(invMasspKpiDk>0.&& passTightCuts==1) fMassHistDkTC[index]->Fill(invMasspKpiDk);
2293  }
2294  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0. && passTightCuts==3){
2295  if(invMasspiKp3Pr>0.) fMassHist3PrTC[index]->Fill(invMasspiKp3Pr,0.5);
2296  if(invMasspKpi3Pr>0.) fMassHist3PrTC[index]->Fill(invMasspKpi3Pr,0.5);
2297  }else{
2298  if(invMasspiKp3Pr>0. && passTightCuts==2) fMassHist3PrTC[index]->Fill(invMasspiKp3Pr);
2299  if(invMasspKpi3Pr>0.&& passTightCuts==1) fMassHist3PrTC[index]->Fill(invMasspKpi3Pr);
2300  }
2301 
2302  }
2303 
2304  if(fReadMC){
2305  if(labDp>0) {
2306  index=GetSignalHistoIndex(iPtBin);
2307  if(invMasspiKp>0. && invMasspKpi>0.){
2308  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp,0.5);
2309  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi,0.5);
2310  }else{
2311  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp);
2312  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi);
2313  }
2314  if(invMasspiKpLpi>0. && invMasspKpiLpi>0.){
2315  if(invMasspiKpLpi>0.) fMassHistLpi[index]->Fill(invMasspiKpLpi,0.5);
2316  if(invMasspKpiLpi>0.) fMassHistLpi[index]->Fill(invMasspKpiLpi,0.5);
2317  }else{
2318  if(invMasspiKpLpi>0.) fMassHistLpi[index]->Fill(invMasspiKpLpi);
2319  if(invMasspKpiLpi>0.) fMassHistLpi[index]->Fill(invMasspKpiLpi);
2320  }
2321  if(invMasspiKpKp>0. && invMasspKpiKp>0.){
2322  if(invMasspiKpKp>0.) fMassHistKp[index]->Fill(invMasspiKpKp,0.5);
2323  if(invMasspKpiKp>0.) fMassHistKp[index]->Fill(invMasspKpiKp,0.5);
2324  }else{
2325  if(invMasspiKpKp>0.) fMassHistKp[index]->Fill(invMasspiKpKp);
2326  if(invMasspKpiKp>0.) fMassHistKp[index]->Fill(invMasspKpiKp);
2327  }
2328  if(invMasspiKpDk>0. && invMasspKpiDk>0.){
2329  if(invMasspiKpDk>0.) fMassHistDk[index]->Fill(invMasspiKpDk,0.5);
2330  if(invMasspKpiDk>0.) fMassHistDk[index]->Fill(invMasspKpiDk,0.5);
2331  }else{
2332  if(invMasspiKpDk>0.) fMassHistDk[index]->Fill(invMasspiKpDk);
2333  if(invMasspKpiDk>0.) fMassHistDk[index]->Fill(invMasspKpiDk);
2334  }
2335  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0.){
2336  if(invMasspiKp3Pr>0.) fMassHist3Pr[index]->Fill(invMasspiKp3Pr,0.5);
2337  if(invMasspKpi3Pr>0.) fMassHist3Pr[index]->Fill(invMasspKpi3Pr,0.5);
2338  }else{
2339  if(invMasspiKp3Pr>0.) fMassHist3Pr[index]->Fill(invMasspiKp3Pr);
2340  if(invMasspKpi3Pr>0.) fMassHistDk[index]->Fill(invMasspKpi3Pr);
2341  }
2342 
2343  if(passTightCuts>0){
2344  if(invMasspiKp>0. && invMasspKpi>0. && passTightCuts==3){
2345  if(invMasspiKp>0.) fMassHistTC[index]->Fill(invMasspiKp,0.5);
2346  if(invMasspKpi>0.) fMassHistTC[index]->Fill(invMasspKpi,0.5);
2347  }else{
2348  if(invMasspiKp>0. && passTightCuts==2) fMassHistTC[index]->Fill(invMasspiKp);
2349  if(invMasspKpi>0.&& passTightCuts==1) fMassHistTC[index]->Fill(invMasspKpi);
2350  }
2351  if(invMasspiKpLpi>0. && invMasspKpiLpi>0. && passTightCuts==3){
2352  if(invMasspiKpLpi>0.) fMassHistLpiTC[index]->Fill(invMasspiKpLpi,0.5);
2353  if(invMasspKpiLpi>0.) fMassHistLpiTC[index]->Fill(invMasspKpiLpi,0.5);
2354  }else{
2355  if(invMasspiKpLpi>0. && passTightCuts==2) fMassHistLpiTC[index]->Fill(invMasspiKpLpi);
2356  if(invMasspKpiLpi>0.&& passTightCuts==1) fMassHistLpiTC[index]->Fill(invMasspKpiLpi);
2357  }
2358  if(invMasspiKpKp>0. && invMasspKpiKp>0. && passTightCuts==3){
2359  if(invMasspiKpKp>0.) fMassHistKpTC[index]->Fill(invMasspiKpKp,0.5);
2360  if(invMasspKpiKp>0.) fMassHistKpTC[index]->Fill(invMasspKpiKp,0.5);
2361  }else{
2362  if(invMasspiKpKp>0. && passTightCuts==2) fMassHistKpTC[index]->Fill(invMasspiKpKp);
2363  if(invMasspKpiKp>0.&& passTightCuts==1) fMassHistKpTC[index]->Fill(invMasspKpiKp);
2364  }
2365  if(invMasspiKpDk>0. && invMasspKpiDk>0. && passTightCuts==3){
2366  if(invMasspiKpDk>0.) fMassHistDkTC[index]->Fill(invMasspiKpDk,0.5);
2367  if(invMasspKpiDk>0.) fMassHistDkTC[index]->Fill(invMasspKpiDk,0.5);
2368  }else{
2369  if(invMasspiKpDk>0. && passTightCuts==2) fMassHistDkTC[index]->Fill(invMasspiKpDk);
2370  if(invMasspKpiDk>0.&& passTightCuts==1) fMassHistDkTC[index]->Fill(invMasspKpiDk);
2371  }
2372  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0. && passTightCuts==3){
2373  if(invMasspiKp3Pr>0.) fMassHist3PrTC[index]->Fill(invMasspiKp3Pr,0.5);
2374  if(invMasspKpi3Pr>0.) fMassHist3PrTC[index]->Fill(invMasspKpi3Pr,0.5);
2375  }else{
2376  if(invMasspiKp3Pr>0. && passTightCuts==2) fMassHist3PrTC[index]->Fill(invMasspiKp3Pr);
2377  if(invMasspKpi3Pr>0.&& passTightCuts==1) fMassHist3PrTC[index]->Fill(invMasspKpi3Pr);
2378  }
2379  }
2380 
2381  if(IsLc && IsLcfromLb){
2382  index=GetLbHistoIndex(iPtBin);
2383  if(invMasspiKp>0. && invMasspKpi>0.){
2384  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp,0.5);
2385  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi,0.5);
2386  }else{
2387  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp);
2388  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi);
2389  }
2390  if(passTightCuts>0){
2391  if(invMasspiKp>0. && invMasspKpi>0. && passTightCuts==3){
2392  if(invMasspiKp>0.) fMassHistTC[index]->Fill(invMasspiKp,0.5);
2393  if(invMasspKpi>0.) fMassHistTC[index]->Fill(invMasspKpi,0.5);
2394  }else{
2395  if(invMasspiKp>0. && passTightCuts==2) fMassHistTC[index]->Fill(invMasspiKp);
2396  if(invMasspKpi>0.&& passTightCuts==1) fMassHistTC[index]->Fill(invMasspKpi);
2397  }
2398  }
2399  }
2400  if(IsLc && !IsLcfromLb && IsLcfromc) {
2401  index=GetcOnlyHistoIndex(iPtBin);
2402  if(invMasspiKp>0. && invMasspKpi>0.){
2403  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp,0.5);
2404  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi,0.5);
2405  }else{
2406  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp);
2407  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi);
2408  }
2409  if(passTightCuts>0){
2410  if(invMasspiKp>0. && invMasspKpi>0. && passTightCuts==3){
2411  if(invMasspiKp>0.) fMassHistTC[index]->Fill(invMasspiKp,0.5);
2412  if(invMasspKpi>0.) fMassHistTC[index]->Fill(invMasspKpi,0.5);
2413  }else{
2414  if(invMasspiKp>0. && passTightCuts==2) fMassHistTC[index]->Fill(invMasspiKp);
2415  if(invMasspKpi>0.&& passTightCuts==1) fMassHistTC[index]->Fill(invMasspKpi);
2416  }
2417  }
2418 
2419  }
2420 
2421  if(IsLc && !IsLcFromq) {
2422  index=GetNoQuarkHistoIndex(iPtBin);
2423  if(invMasspiKp>0. && invMasspKpi>0.){
2424  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp,0.5);
2425  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi,0.5);
2426  }else{
2427  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp);
2428  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi);
2429  }
2430  if(passTightCuts>0){
2431  if(invMasspiKp>0. && invMasspKpi>0. && passTightCuts==3){
2432  if(invMasspiKp>0.) fMassHistTC[index]->Fill(invMasspiKp,0.5);
2433  if(invMasspKpi>0.) fMassHistTC[index]->Fill(invMasspKpi,0.5);
2434  }else{
2435  if(invMasspiKp>0. && passTightCuts==2) fMassHistTC[index]->Fill(invMasspiKp);
2436  if(invMasspKpi>0.&& passTightCuts==1) fMassHistTC[index]->Fill(invMasspKpi);
2437  }
2438  }
2439 
2440  }
2441 
2442  }else{
2443  index=GetBackgroundHistoIndex(iPtBin);
2444  if(invMasspiKp>0. && invMasspKpi>0.){
2445  fMassHist[index]->Fill(invMasspiKp,0.5);
2446  fMassHist[index]->Fill(invMasspKpi,0.5);
2447  }else{
2448  if(invMasspiKp>0.) fMassHist[index]->Fill(invMasspiKp);
2449  if(invMasspKpi>0.) fMassHist[index]->Fill(invMasspKpi);
2450  }
2451  if(invMasspiKpLpi>0. && invMasspKpiLpi>0.){
2452  if(invMasspiKpLpi>0.) fMassHistLpi[index]->Fill(invMasspiKpLpi,0.5);
2453  if(invMasspKpiLpi>0.) fMassHistLpi[index]->Fill(invMasspKpiLpi,0.5);
2454  }else{
2455  if(invMasspiKpLpi>0.) fMassHistLpi[index]->Fill(invMasspiKpLpi);
2456  if(invMasspKpiLpi>0.) fMassHistLpi[index]->Fill(invMasspKpiLpi);
2457  }
2458  if(invMasspiKpKp>0. && invMasspKpiKp>0.){
2459  if(invMasspiKpKp>0.) fMassHistKp[index]->Fill(invMasspiKpKp,0.5);
2460  if(invMasspKpiKp>0.) fMassHistKp[index]->Fill(invMasspKpiKp,0.5);
2461  }else{
2462  if(invMasspiKpKp>0.) fMassHistKp[index]->Fill(invMasspiKpKp);
2463  if(invMasspKpiKp>0.) fMassHistKp[index]->Fill(invMasspKpiKp);
2464  }
2465  if(invMasspiKpDk>0. && invMasspKpiDk>0.){
2466  if(invMasspiKpDk>0.) fMassHistDk[index]->Fill(invMasspiKpDk,0.5);
2467  if(invMasspKpiDk>0.) fMassHistDk[index]->Fill(invMasspKpiDk,0.5);
2468  }else{
2469  if(invMasspiKpDk>0.) fMassHistDk[index]->Fill(invMasspiKpDk);
2470  if(invMasspKpiDk>0.) fMassHistDk[index]->Fill(invMasspKpiDk);
2471  }
2472  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0.){
2473  if(invMasspiKp3Pr>0.) fMassHist3Pr[index]->Fill(invMasspiKp3Pr,0.5);
2474  if(invMasspKpi3Pr>0.) fMassHist3Pr[index]->Fill(invMasspKpi3Pr,0.5);
2475  }else{
2476  if(invMasspiKp3Pr>0.) fMassHist3Pr[index]->Fill(invMasspiKp3Pr);
2477  if(invMasspKpi3Pr>0.) fMassHistDk[index]->Fill(invMasspKpi3Pr);
2478  }
2479  if(invMasspiKp>0. && invMasspKpi>0. && passTightCuts==3){
2480  fMassHistTC[index]->Fill(invMasspiKp,0.5);
2481  fMassHistTC[index]->Fill(invMasspKpi,0.5);
2482  }else{
2483  if(invMasspiKp>0. && passTightCuts==2) fMassHistTC[index]->Fill(invMasspiKp);
2484  if(invMasspKpi>0. && passTightCuts==1) fMassHistTC[index]->Fill(invMasspKpi);
2485  }
2486  if(invMasspiKpLpi>0. && invMasspKpiLpi>0. && passTightCuts==3){
2487  if(invMasspiKpLpi>0.) fMassHistLpiTC[index]->Fill(invMasspiKpLpi,0.5);
2488  if(invMasspKpiLpi>0.) fMassHistLpiTC[index]->Fill(invMasspKpiLpi,0.5);
2489  }else{
2490  if(invMasspiKpLpi>0. && passTightCuts==2) fMassHistLpiTC[index]->Fill(invMasspiKpLpi);
2491  if(invMasspKpiLpi>0.&& passTightCuts==1) fMassHistLpiTC[index]->Fill(invMasspKpiLpi);
2492  }
2493  if(invMasspiKpKp>0. && invMasspKpiKp>0. && passTightCuts==3){
2494  if(invMasspiKpKp>0.) fMassHistKpTC[index]->Fill(invMasspiKpKp,0.5);
2495  if(invMasspKpiKp>0.) fMassHistKpTC[index]->Fill(invMasspKpiKp,0.5);
2496  }else{
2497  if(invMasspiKpKp>0. && passTightCuts==2) fMassHistKpTC[index]->Fill(invMasspiKpKp);
2498  if(invMasspKpiKp>0.&& passTightCuts==1) fMassHistKpTC[index]->Fill(invMasspKpiKp);
2499  }
2500  if(invMasspiKpDk>0. && invMasspKpiDk>0. && passTightCuts==3){
2501  if(invMasspiKpDk>0.) fMassHistDkTC[index]->Fill(invMasspiKpDk,0.5);
2502  if(invMasspKpiDk>0.) fMassHistDkTC[index]->Fill(invMasspKpiDk,0.5);
2503  }else{
2504  if(invMasspiKpDk>0. && passTightCuts==2) fMassHistDkTC[index]->Fill(invMasspiKpDk);
2505  if(invMasspKpiDk>0.&& passTightCuts==1) fMassHistDkTC[index]->Fill(invMasspKpiDk);
2506  }
2507  if(invMasspiKp3Pr>0. && invMasspKpi3Pr>0. && passTightCuts==3){
2508  if(invMasspiKp3Pr>0.) fMassHist3PrTC[index]->Fill(invMasspiKp3Pr,0.5);
2509  if(invMasspKpi3Pr>0.) fMassHist3PrTC[index]->Fill(invMasspKpi3Pr,0.5);
2510  }else{
2511  if(invMasspiKp3Pr>0. && passTightCuts==2) fMassHist3PrTC[index]->Fill(invMasspiKp3Pr);
2512  if(invMasspKpi3Pr>0.&& passTightCuts==1) fMassHist3PrTC[index]->Fill(invMasspKpi3Pr);
2513  }
2514  }
2515 
2516  }
2517  }
2518  }
2519  return;
2520 }
2521 //-----------------------
2523  TClonesArray *arrMC,
2524  AliRDHFCutsLctopKpi *cuts,
2525  /* TList *listout,*/
2526  AliAODEvent* aod) {
2527  //
2528  // function used in UserExec to fill variable histograms analysing MC
2529  //
2530 
2531  TString fillthis="";
2532 
2533  Double_t mPDG=TDatabasePDG::Instance()->GetParticle(4122)->Mass();
2534  Double_t invmasscut=0.05;
2535 
2536  Int_t pdgDgLctopKpi[3]={2212,321,211};
2537  Int_t lab=-9999;
2538  // Bool_t IsLcfromLb=0;
2539  Bool_t IsLcfromc=0;
2540  if(fReadMC){
2541  lab=part->MatchToMC(4122,arrMC,3,pdgDgLctopKpi); //return MC particle label if the array corresponds to a Lc, -1 if not (cf. AliAODRecoDecay.cxx)
2542  if(lab>0){
2543  AliAODMCParticle *partDp = (AliAODMCParticle*)arrMC->At(lab);
2545  Int_t pdgMom=util->CheckOrigin(arrMC,partDp,kFALSE);
2546  // if(pdgMom == 5) IsLcfromLb =1;
2547  if(pdgMom == 4) IsLcfromc =1;
2548  delete util;
2549  }
2550  }
2551  // Int_t isSelectedPID=cuts->IsSelectedPID(part); // 0 rejected, 1 Lc -> p K- pi+ (K at center because different sign is there),
2552  // 2 Lc -> pi+ K- p (K at center because different sign is there),
2553  // 3 both (it should never happen...)
2554  Int_t isSelectedPID=cuts->IsSelected(part,AliRDHFCuts::kPID,aod); // 0 rejected, 1 Lc -> p K- pi+ (K at center because different sign is there),
2555  // 2 Lc -> pi+ K- p (K at center because different sign is there),
2556  // 3 both (it should never happen...)
2557 
2558  if (isSelectedPID==0)fNentries->Fill(7);
2559  if (isSelectedPID==1)fNentries->Fill(8);
2560  if (isSelectedPID==2)fNentries->Fill(9);
2561  if (isSelectedPID==3)fNentries->Fill(10);
2562 
2563  AliAODTrack *prong0=(AliAODTrack*)part->GetDaughter(0);
2564  AliAODTrack *prong1=(AliAODTrack*)part->GetDaughter(1);
2565  AliAODTrack *prong2=(AliAODTrack*)part->GetDaughter(2);
2566  if (!prong0 || !prong1 || !prong2) {
2567  fNentries->Fill(5);
2568  return;
2569  }
2570 
2571  Double_t minvLcpKpi = part->InvMassLcpKpi();
2572  Double_t minvLcpiKp = part->InvMassLcpiKp();
2573 
2574 
2575  //check pdg of the prongs
2576  Int_t labprong[3]={-1,-1,-1};
2577  if(fReadMC){
2578  labprong[0]=prong0->GetLabel();
2579  labprong[1]=prong1->GetLabel();
2580  labprong[2]=prong2->GetLabel();
2581  }
2582 
2583  AliAODMCParticle *mcprong=0;
2584  Int_t pdgProngMC[3]={-1,-1,-1};
2585  if(fReadMC) {
2586  for (Int_t iprong=0;iprong<3;iprong++){
2587  if(labprong[iprong]<0) continue;
2588  mcprong = (AliAODMCParticle*)arrMC->At(labprong[iprong]);
2589  pdgProngMC[iprong]=TMath::Abs(mcprong->GetPdgCode());
2590  }
2591  }
2592 
2593  Int_t pdgProngPID[3]={-1,-1,-1};
2594  if(isSelectedPID>0){
2595  pdgProngPID[1]=321;
2596  if(isSelectedPID==1) {pdgProngPID[0]=2212;pdgProngPID[2]=211;}
2597  if(isSelectedPID==2) {pdgProngPID[0]=211;pdgProngPID[2]=2212;}
2598  }
2599 
2600  //fill hRealTot ---> PID efficiency denominators
2601  //cuts->SetUsePID(kFALSE); //PAOLA
2602  Int_t selectionTrack = cuts->IsSelected(part,AliRDHFCuts::kTracks,aod);
2603 
2604  //IsInjected check
2605  Bool_t IsInjected = 0;
2606  if(fReadMC){
2607  AliAODMCHeader *mcHeader2 = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
2609  IsInjected = util->IsCandidateInjected(part,mcHeader2,arrMC)?1:0;
2610  delete util;
2611  }
2612  if(fReadMC && selectionTrack>0) { // 3prongs candidate x Lc (only track selection) Jaime
2613  Int_t isReal=0;
2614  if(lab>0 && IsLcfromc){ // Signal
2615  for (Int_t iprong=0; iprong<3; iprong++) {
2616  switch (pdgProngMC[iprong]) {
2617  case 2212:
2618  fillthis="hpRealTot";
2619  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2620  isReal++;
2621  break;
2622  case 321:
2623  fillthis="hKRealTot";
2624  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2625  isReal++;
2626  break;
2627  case 211:
2628  fillthis="hpiRealTot";
2629  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2630  isReal++;
2631  break;
2632  default:
2633  break;
2634  }
2635  }
2636  fillthis="hLcRealTot";
2637  if(isReal==3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
2638  //Marcel: Should we zero isReal
2639  } else if(!IsInjected) { // bkg // bkg
2640  for (Int_t iprong=0; iprong<3; iprong++) {
2641  switch (pdgProngMC[iprong]) {
2642  case 2212:
2643  fillthis="hbpRealTot";
2644  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2645  isReal++;
2646  break;
2647  case 321:
2648  fillthis="hbKRealTot";
2649  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2650  isReal++;
2651  break;
2652  case 211:
2653  fillthis="hbpiRealTot";
2654  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2655  isReal++;
2656  break;
2657  default:
2658  break;
2659  }
2660  }
2661  fillthis="hbLcRealTot";
2662  if(isReal==3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
2663  }
2664  }
2665 
2666 
2667  //cuts->SetUsePID(kTRUE); //PAOLA
2668  Int_t selection=cuts->IsSelected(part,AliRDHFCuts::kCandidate,aod);
2669 
2670  if ( (lab>0 && fReadMC && IsLcfromc) || // signal X MC
2671  (isSelectedPID>0 && !fReadMC) ) { // signal+bkg X real data
2672 
2673  fillthis="hMass";
2674  if ( (fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 4122) ||
2675  (!fReadMC && (isSelectedPID>0 && part->Charge()>0)) ) { // Lc
2676  if ( (pdgProngPID[0]==2212) && (pdgProngPID[1]==321) && (pdgProngPID[2]==211) )
2677  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpKpi); // signal+bkg X MC and real data
2678  else if ( (pdgProngPID[0]==211) && (pdgProngPID[1]==321) && (pdgProngPID[2]==2212) )
2679  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpiKp); // signal+bkg X MC and real data
2680  }
2681  else if ( (fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == -4122) ||
2682  (!fReadMC && (isSelectedPID>0 && part->Charge()<0)) ) { // anti-Lc
2683  if ( (pdgProngPID[0]==2212) && (pdgProngPID[1]==321) && (pdgProngPID[2]==211) )
2684  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpKpi); // signal+bkg X MC and real data
2685  else if ( (pdgProngPID[0]==211) && (pdgProngPID[1]==321) && (pdgProngPID[2]==2212) )
2686  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpiKp); // signal+bkg X MC and real data
2687  }
2688 
2689  if (selection>0) { // 3prongs candidate x Lc (yes PID)
2690 
2691  Double_t ptmax=0.;
2692  Int_t isID=0;
2693  Int_t isCorrect=0;
2694  for (Int_t iprong=0; iprong<3; iprong++) {
2695  if (part->PtProng(iprong)>ptmax) ptmax=part->PtProng(iprong);
2696 
2697  AliAODTrack *prong = (AliAODTrack*)part->GetDaughter(iprong);
2698  AliAODPid *pidObjtrk = (AliAODPid*)prong->GetDetPid();
2699  AliAODPidHF *pidObj = (AliAODPidHF*)cuts->GetPidHF();
2700  Bool_t hasTOF=pidObj->CheckStatus(prong,"TOF");
2701  Bool_t hasTPC=pidObj->CheckStatus(prong,"TPC");
2702  Double_t tofSignal=0.;
2703  Double_t dedxTPC=0.;
2704  Double_t momTOF=0.;
2705  Double_t momTPC=0.;
2706  if(hasTOF) {
2707  momTOF = prong->P();
2708  tofSignal=pidObjtrk->GetTOFsignal();
2709  }
2710  if(hasTPC) {
2711  momTPC = pidObjtrk->GetTPCmomentum();
2712  dedxTPC=pidObjtrk->GetTPCsignal();
2713  }
2714  switch (pdgProngPID[iprong]) {
2715  case 2212:
2716  fillthis="hpTOFSignal";
2717  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(tofSignal);
2718  fillthis="hpTPCSignal";
2719  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dedxTPC);
2720  fillthis="hpptProng";
2721  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2722  fillthis="hpptProngLcPt";
2723  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->PtProng(iprong));
2724  fillthis="hpd0Prong";
2725  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Getd0Prong(iprong));
2726  fillthis="hpd0ProngLcPt";
2727  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->Getd0Prong(iprong));
2728  fillthis="hpSignalVspTPC";
2729  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,dedxTPC);
2730  fillthis="hpSignalVspTOF";
2731  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,tofSignal);
2732  AliPID::EParticleType typep;
2733  typep=AliPID::EParticleType(4);
2734  if(hasTPC) {
2735  //Double_t nsigmap = fUtilPid->NumberOfSigmasTPC(prong,typep);
2736  Double_t nsigmap = fPIDResponse->NumberOfSigmasTPC(prong,typep);
2737  fillthis="hpSigmaVspTPC";
2738  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,nsigmap);
2739  }
2740  if(hasTOF){
2741  //Double_t nsigma=fUtilPid->NumberOfSigmasTOF(prong,typep);
2742  Double_t nsigma=fPIDResponse->NumberOfSigmasTOF(prong,typep);
2743  fillthis="hpSigmaVspTOF";
2744  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,nsigma);
2745  }
2746 
2747  if (fReadMC) { // fill hpIDTot ---> PID contamination denominator
2748  // hIDGood, hnoID ---> PID numerators
2749  fillthis="hpIDTot";
2750  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2751  isID++;
2752  if(pdgProngMC[iprong]==2212) { // id protons
2753  fillthis="hpIDGood";
2754  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2755  isCorrect++;
2756  }
2757  else { // misidentified electrons, muons, pions and kaons
2758  fillthis="hnopIDp";
2759  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2760  }
2761  }
2762  break;
2763 
2764  case 321:
2765  fillthis="hKTOFSignal";
2766  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(tofSignal);
2767  fillthis="hKTPCSignal";
2768  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dedxTPC);
2769  fillthis="hKptProng";
2770  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2771  fillthis="hKptProngLcPt";
2772  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->PtProng(iprong));
2773  fillthis="hKd0Prong";
2774  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Getd0Prong(iprong));
2775  fillthis="hKd0ProngLcPt";
2776  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->Getd0Prong(iprong));
2777  fillthis="hKSignalVspTPC";
2778  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,dedxTPC);
2779  fillthis="hKSignalVspTOF";
2780  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,tofSignal);
2781  AliPID::EParticleType typek;
2782  typek=AliPID::EParticleType(3);
2783  if(hasTPC) {
2784  //Double_t nsigmap = fUtilPid->NumberOfSigmasTPC(prong,typek);
2785  Double_t nsigmap = fPIDResponse->NumberOfSigmasTPC(prong,typek);
2786  fillthis="hKSigmaVspTPC";
2787  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,nsigmap);
2788  }
2789  if(hasTOF){
2790  //Double_t nsigma = fUtilPid->NumberOfSigmasTOF(prong,typek);
2791  Double_t nsigma=fPIDResponse->NumberOfSigmasTOF(prong,typek); // protection against 'old' AODs...
2792  fillthis="hKSigmaVspTOF";
2793  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,nsigma);
2794  }
2795 
2796  if (fReadMC) { // fill hKIDTot ---> PID contamination denominator
2797  // hIDGood, hnoID ---> PID numerators
2798  fillthis="hKIDTot";
2799  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2800  isID++;
2801  if(pdgProngMC[iprong]==321) { // id kaons
2802  fillthis="hKIDGood";
2803  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2804  isCorrect++;
2805  }
2806  else { // misidentified electrons, muons, pions and protons
2807  fillthis="hnokIDk";
2808  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2809  }
2810  }
2811  break;
2812 
2813  case 211:
2814  fillthis="hpiTOFSignal";
2815  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(tofSignal);
2816  fillthis="hpiTPCSignal";
2817  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dedxTPC);
2818  fillthis="hpiptProng";
2819  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2820  fillthis="hpiptProngLcPt";
2821  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->PtProng(iprong));
2822  fillthis="hpid0Prong";
2823  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Getd0Prong(iprong));
2824  fillthis="hpid0ProngLcPt";
2825  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->Getd0Prong(iprong));
2826 
2827  fillthis="hpiSignalVspTPC";
2828  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,dedxTPC);
2829  fillthis="hpiSignalVspTOF";
2830  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,tofSignal);
2831  AliPID::EParticleType typepi;
2832  typepi=AliPID::EParticleType(2);
2833  if(hasTPC) {
2834  //Double_t nsigmap = fUtilPid->NumberOfSigmasTPC(prong,typepi);
2835  Double_t nsigmap = fPIDResponse->NumberOfSigmasTPC(prong,typepi);
2836  fillthis="hpiSigmaVspTPC";
2837  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,nsigmap);
2838  }
2839  if(hasTOF){
2840  //Double_t nsigma = fUtilPid->NumberOfSigmasTOF(prong,typepi);
2841  Double_t nsigma=fPIDResponse->NumberOfSigmasTOF(prong,typepi); // protection against 'old' AODs...
2842  fillthis="hpiSigmaVspTOF";
2843  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,nsigma);
2844  }
2845 
2846  if (fReadMC) { // fill hpiIDTot ---> PID contamination denominator
2847  // hIDGood, hnoID ---> PID numerators
2848  fillthis="hpiIDTot";
2849  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2850  isID++;
2851  if(pdgProngMC[iprong]==211) { // id pions
2852  fillthis="hpiIDGood";
2853  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2854  isCorrect++;
2855  }
2856  else { // misidentified electrons, muons, kaons and protons
2857  fillthis="hnopiIDpi";
2858  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2859  }
2860  }
2861  break;
2862 
2863  default:
2864  break;
2865  }
2866 
2867  }//end loop on prongs
2868 
2869  //Jaime Lc checks
2870  fillthis="hLcIDTot";
2871  if(isID==3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
2872  fillthis="hLcIDGood";
2873  if(isCorrect==3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
2874  fillthis="hLcnoID";
2875  if(isCorrect<3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
2876 
2877  //now histograms where we don't need to check identity
2878  fillthis="hLcpt";
2879  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
2880  fillthis = "hDist12toPrim";
2881  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->GetDist12toPrim());
2882  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->GetDist23toPrim());
2883  fillthis = "hDist12toPrimLcPt";
2884  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->GetDist12toPrim());
2885  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->GetDist23toPrim());
2886  fillthis = "hSigmaVert";
2887  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->GetSigmaVert());
2888  fillthis = "hSigmaVertLcPt";
2889  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->GetSigmaVert());
2890  fillthis = "hDCAs";
2891  Double_t dcas[3];
2892  part->GetDCAs(dcas);
2893  for (Int_t idca=0;idca<3;idca++) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dcas[idca]);
2894  fillthis = "hDCAsLcPt";
2895  for (Int_t idca=0;idca<3;idca++) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),dcas[idca]);
2896  fillthis = "hCosPointingAngle";
2897  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->CosPointingAngle());
2898  fillthis = "hCosPointingAngleLcPt";
2899  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->CosPointingAngle());
2900  fillthis = "hDecayLength";
2901  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->DecayLength());
2902  fillthis = "hDecayLengthLcPt";
2903  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->DecayLength());
2904  Double_t sum2=part->Getd0Prong(0)*part->Getd0Prong(0)+
2905  part->Getd0Prong(1)*part->Getd0Prong(1)+
2906  part->Getd0Prong(2)*part->Getd0Prong(2);
2907  fillthis = "hSum2";
2908  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(sum2);
2909  fillthis = "hSum2LcPt";
2910  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),sum2);
2911  fillthis = "hptmax";
2912  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(ptmax);
2913  fillthis = "hptmaxLcPt";
2914  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),ptmax);
2915 
2916 
2917  } // end if (selection)
2918 
2919  }else if( lab<=0 && fReadMC && !IsInjected ) { // bkg x MC
2920 
2921  fillthis="hbMass";
2922 
2923  if (part->Charge()>0) { //Lc background
2924  if ( (pdgProngPID[0]==2212) && (pdgProngPID[1]==321) && (pdgProngPID[2]==211) )
2925  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpKpi); // bkg X MC
2926  else if ( (pdgProngPID[0]==211) && (pdgProngPID[1]==321) && (pdgProngPID[2]==2212) )
2927  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpiKp); // bkg X MC
2928  }
2929  else if (part->Charge()<0){ //anti-Lc background
2930  if ( (pdgProngPID[0]==2212) && (pdgProngPID[1]==321) && (pdgProngPID[2]==211) )
2931  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpKpi); // bkg X MC
2932  else if ( (pdgProngPID[0]==211) && (pdgProngPID[1]==321) && (pdgProngPID[2]==2212) )
2933  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(minvLcpiKp); // bkg X MC
2934  }
2935 
2936 
2937  //apply cut on invariant mass on the pair
2938  if (TMath::Abs(minvLcpKpi-mPDG)<invmasscut || TMath::Abs(minvLcpiKp-mPDG)<invmasscut) {
2939 
2940  if (selection>0) { // 3prongs candidate x Lc (yes PID)
2941 
2942  Double_t ptmax=0.;
2943  Int_t isID=0;
2944  Int_t isCorrect=0;
2945  for (Int_t iprong=0; iprong<3; iprong++) {
2946  if(part->PtProng(iprong)>ptmax)ptmax=part->PtProng(iprong);
2947 
2948  AliAODTrack *prong = (AliAODTrack*)part->GetDaughter(iprong);
2949  AliAODPid *pidObjtrk = (AliAODPid*)prong->GetDetPid();
2950  AliAODPidHF *pidObj = (AliAODPidHF*)cuts->GetPidHF();
2951  Bool_t hasTOF=pidObj->CheckStatus(prong,"TOF");
2952  Bool_t hasTPC=pidObj->CheckStatus(prong,"TPC");
2953  Double_t tofSignal=0.;
2954  Double_t dedxTPC=0.;
2955  Double_t momTOF=0.;
2956  Double_t momTPC=0.;
2957  if(hasTOF) {
2958  momTOF = prong->P();
2959  tofSignal=pidObjtrk->GetTOFsignal();
2960  }
2961  if(hasTPC) {
2962  momTPC = pidObjtrk->GetTPCmomentum();
2963  dedxTPC=pidObjtrk->GetTPCsignal();
2964  }
2965 
2966  switch (pdgProngPID[iprong]) {
2967  case 2212:
2968  fillthis="hbpTOFSignal";
2969  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(tofSignal);
2970  fillthis="hbpTPCSignal";
2971  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dedxTPC);
2972  fillthis="hbpptProng";
2973  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
2974  fillthis="hbpptProngLcPt";
2975  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->PtProng(iprong));
2976  fillthis="hbpd0Prong";
2977  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Getd0Prong(iprong));
2978  fillthis="hbpd0ProngLcPt";
2979  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->Getd0Prong(iprong));
2980  fillthis="hbpSignalVspTPC";
2981  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,dedxTPC);
2982  fillthis="hbpSignalVspTOF";
2983  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,tofSignal);
2984  AliPID::EParticleType typep;
2985  typep=AliPID::EParticleType(4);
2986  if(hasTPC) {
2987  //Double_t nsigmap = fUtilPid->NumberOfSigmasTPC(prong,typep);
2988  Double_t nsigmap = fPIDResponse->NumberOfSigmasTPC(prong,typep);
2989  fillthis="hbpSigmaVspTPC";
2990  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,nsigmap);
2991  }
2992  if(hasTOF){
2993  //Double_t nsigma = fUtilPid->NumberOfSigmasTOF(prong,typep);
2994  Double_t nsigma=fPIDResponse->NumberOfSigmasTOF(prong,typep); // protection against 'old' AODs...
2995  fillthis="hbpSigmaVspTOF";
2996  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,nsigma);
2997  }
2998  if(fReadMC){ // fill hbpIDTot ---> PID contamination denominator
2999  // hbIDGood, hbnoID ---> PID numerators
3000  fillthis="hbpIDTot";
3001  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3002  isID++;
3003  if(pdgProngMC[iprong]==2212) { // id protons
3004  fillthis="hbpIDGood";
3005  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3006  isCorrect++;
3007  }
3008  else { // misidentified electrons, muons, pions and kaons
3009  fillthis="hbnopIDp";
3010  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3011  }
3012  }
3013  break;
3014 
3015  case 321:
3016  fillthis="hbKTOFSignal";
3017  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(tofSignal);
3018  fillthis="hbKTPCSignal";
3019  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dedxTPC);
3020  fillthis="hbKptProng";
3021  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3022  fillthis="hbKptProngLcPt";
3023  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->PtProng(iprong));
3024  fillthis="hbKd0Prong";
3025  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Getd0Prong(iprong));
3026  fillthis="hbKd0ProngLcPt";
3027  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->Getd0Prong(iprong));
3028  fillthis="hbKSignalVspTPC";
3029  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,dedxTPC);
3030  fillthis="hbKSignalVspTOF";
3031  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,tofSignal);
3032  AliPID::EParticleType typek;
3033  typek=AliPID::EParticleType(3);
3034  if(hasTPC) {
3035  //Double_t nsigmap = fUtilPid->NumberOfSigmasTPC(prong,typek);
3036  Double_t nsigmap = fPIDResponse->NumberOfSigmasTPC(prong,typek);
3037  fillthis="hbKSigmaVspTPC";
3038  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,nsigmap);
3039  }
3040  if(hasTOF){
3041  //Double_t nsigma = fUtilPid->NumberOfSigmasTOF(prong,typek);
3042  Double_t nsigma=fPIDResponse->NumberOfSigmasTOF(prong,typek); // protection against 'old' AODs...
3043  fillthis="hbKSigmaVspTOF";
3044  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,nsigma);
3045  }
3046  if (fReadMC) { // fill hbKIDTot ---> PID contamination denominator
3047  // hIDGood, hnoID ---> PID numerators
3048  fillthis="hbKIDTot";
3049  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3050  isID++;
3051  if(pdgProngMC[iprong]==321) { // id kaons
3052  fillthis="hbKIDGood";
3053  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3054  isCorrect++;
3055  }
3056  else { // misidentified electrons, muons, pions and protons
3057  fillthis="hbnokIDk";
3058  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3059  }
3060  }
3061  break;
3062 
3063  case 211:
3064  fillthis="hbpiTOFSignal";
3065  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(tofSignal);
3066  fillthis="hbpiTPCSignal";
3067  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dedxTPC);
3068  fillthis="hbpiptProng";
3069  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3070  fillthis="hbpiptProngLcPt";
3071  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3072  fillthis="hbpid0Prong";
3073  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Getd0Prong(iprong));
3074  fillthis="hbpid0ProngLcPt";
3075  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->Getd0Prong(iprong));
3076  fillthis="hbpiSignalVspTPC";
3077  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,dedxTPC);
3078  fillthis="hbpiSignalVspTOF";
3079  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,tofSignal);
3080  AliPID::EParticleType typepi;
3081  typepi=AliPID::EParticleType(2);
3082  if(hasTPC) {
3083  //Double_t nsigmap = fUtilPid->NumberOfSigmasTPC(prong,typepi);
3084  Double_t nsigmap = fPIDResponse->NumberOfSigmasTPC(prong,typepi);
3085  fillthis="hbpiSigmaVspTPC";
3086  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTPC,nsigmap);
3087  }
3088  if(hasTOF){
3089  //Double_t nsigma = fUtilPid->NumberOfSigmasTOF(prong,typepi);
3090  Double_t nsigma=fPIDResponse->NumberOfSigmasTOF(prong,typepi); // protection against 'old' AODs...
3091  fillthis="hbpiSigmaVspTOF";
3092  ((TH2F*)fOutputMC->FindObject(fillthis))->Fill(momTOF,nsigma);
3093  }
3094  if (fReadMC) { // fill hbpiIDTot ---> PID contamination denominator
3095  // hIDGood, hnonIDTot ---> PID numerators
3096  fillthis="hbpiIDTot";
3097  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3098  isID++;
3099  if(pdgProngMC[iprong]==211) { // id pions
3100  fillthis="hbpiIDGood";
3101  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3102  isCorrect++;
3103  }
3104  else { // misidentified electrons, muons, kaons and protons
3105  fillthis="hbnopiIDpi";
3106  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->PtProng(iprong));
3107  }
3108  }
3109  break;
3110 
3111  default:
3112  break;
3113  }
3114 
3115  } //end loop on prongs
3116 
3117  fillthis="hbLcIDTot";
3118  if(isID==3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
3119  fillthis="hbLcIDGood";
3120  if(isCorrect==3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
3121  fillthis="hbLcnoID";
3122  if(isCorrect<3) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
3123 
3124  //now histograms where we don't need to check identity
3125  fillthis="hbLcpt";
3126  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt());
3127 
3128  fillthis = "hbDist12toPrim";
3129  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->GetDist12toPrim());
3130  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->GetDist23toPrim());
3131  fillthis = "hbDist12toPrimLcPt";
3132  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->GetDist12toPrim());
3133  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->GetDist23toPrim());
3134  fillthis = "hbSigmaVert";
3135  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->GetSigmaVert());
3136  fillthis = "hbSigmaVertLcPt";
3137  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->GetSigmaVert());
3138  fillthis = "hbDCAs";
3139  Double_t dcas[3];
3140  part->GetDCAs(dcas);
3141  for (Int_t idca=0;idca<3;idca++) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(dcas[idca]);
3142  fillthis = "hbDCAsLcPt";
3143  for (Int_t idca=0;idca<3;idca++) ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),dcas[idca]);
3144  fillthis = "hbCosPointingAngle";
3145  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->CosPointingAngle());
3146  fillthis = "hbCosPointingAngleLcPt";
3147  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->CosPointingAngle());
3148  fillthis = "hbDecayLength";
3149  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->DecayLength());
3150  fillthis = "hbDecayLengthLcPt";
3151  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),part->DecayLength());
3152  Double_t sum2=part->Getd0Prong(0)*part->Getd0Prong(0)+
3153  part->Getd0Prong(1)*part->Getd0Prong(1)+
3154  part->Getd0Prong(2)*part->Getd0Prong(2);
3155  fillthis = "hbSum2";
3156  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(sum2);
3157  fillthis = "hbSum2LcPt";
3158  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),sum2);
3159  fillthis = "hbptmax";
3160  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(ptmax);
3161  fillthis = "hbptmaxLcPt";
3162  ((TH1F*)fOutputMC->FindObject(fillthis))->Fill(part->Pt(),ptmax);
3163 
3164  } // end if (selection)
3165 
3166  } // end mass cut
3167 
3168  } // end background case
3169 
3170  return;
3171 
3172 }
3173 
3174 //-------------------------
3176  AliRDHFCutsLctopKpi *cuts,
3177  AliAODEvent* aod,
3178  TClonesArray *arrMC)
3179 {
3180 
3181  // FillAPrioriConcentrations
3182  //cuts->SetUsePID(kFALSE); //Annalisa
3183  Int_t isSelected3ProngByLc=cuts->IsSelected(part,AliRDHFCuts::kCandidate,aod);
3184 
3185  TString fillthis="";
3186 
3187  if(isSelected3ProngByLc>0 && fReadMC) {
3188 
3189  for (Int_t ii=0; ii<3; ii++) {
3190  AliAODTrack *prongTest=(AliAODTrack*)part->GetDaughter(ii);
3191  if (!prongTest) continue;
3192  Int_t labprongTest = prongTest->GetLabel();
3193  if(labprongTest<0) continue;
3194  AliAODMCParticle *mcprongTest = (AliAODMCParticle*)arrMC->At(labprongTest);
3195 
3196  switch (TMath::Abs(mcprongTest->GetPdgCode())) {
3197  case 11:
3198  fillthis="hElIn3Prong";
3199  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3200  break;
3201  case 13:
3202  fillthis="hMuIn3Prong";
3203  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3204  break;
3205  case 211:
3206  fillthis="hPiIn3Prong";
3207  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3208  break;
3209  case 321:
3210  fillthis="hKaIn3Prong";
3211  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3212  break;
3213  case 2212:
3214  fillthis="hPrIn3Prong";
3215  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3216  break;
3217  default:
3218  break;
3219  }
3220  }
3221  }
3222 
3223  //cuts->SetUsePID(kTRUE); //Annalisa
3224 
3225 }
3226 
3227 //-----------------------
3229  TClonesArray *arrayMC,
3230  Int_t pdgToBeCompared)
3231 {
3232  //
3233  // Returs kTRUE if at least one of tracks in the current 3prong
3234  // cames from particle with pdgCode=pdgToBeCompared
3235  //
3236 
3237  Bool_t localFlag = kFALSE;
3238 
3239  for (Int_t ii=0;ii<3;ii++) {
3240  AliAODTrack *daugh = (AliAODTrack*)d->GetDaughter(ii);
3241 
3242  Int_t lab = daugh->GetLabel();
3243  if(lab<0) continue;
3244  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab);
3245  //Int_t partPdg = part->GetPdgCode();
3246  //printf(" -------------------------------------- partLab=%d partPdg=%d ---\n", lab, partPdg);
3247 
3248  Int_t motherLabel = part->GetMother();
3249  if(motherLabel<0) continue;
3250 
3251  AliAODMCParticle *motherPart = 0;
3252  Int_t motherPdg = 0;
3253  while (!localFlag && motherLabel>=0) {
3254  motherPart = (AliAODMCParticle*)arrayMC->At(motherLabel);
3255  motherPdg = motherPart->GetPdgCode();
3256  //printf(" ------------- motherLab=%d motherPdg=%d ---\n", motherLabel, motherPdg);
3257  if (TMath::Abs(motherPdg)==pdgToBeCompared) {
3258  //printf("-------------------------- trovato quark c/cbar\n");
3259  localFlag = kTRUE;
3260  }
3261  else {
3262  motherLabel = motherPart->GetMother();
3263  }
3264  }
3265 
3266  }
3267 
3268  return localFlag;
3269 
3270 }
3271 
3272 //-----------------------
3273 Bool_t AliAnalysisTaskSELambdac::IsTrackFromPDG(const AliAODTrack *daugh,
3274  TClonesArray *arrayMC,
3275  Int_t pdgToBeCompared)
3276 {
3277  //
3278  // Returs kTRUE if at the tracks comes
3279  // from particle with pdgCode=pdgToBeCompared
3280  //
3281 
3282  Bool_t localFlag = kFALSE;
3283 
3284  Int_t lab = daugh->GetLabel();
3285  if(lab<0) return localFlag;
3286  AliAODMCParticle *part= (AliAODMCParticle*)arrayMC->At(lab);
3287  //Int_t partPdg = part->GetPdgCode();
3288  //printf(" -------------------------------------- partLab=%d partPdg=%d ---\n", lab, partPdg);
3289 
3290  Int_t motherLabel = part->GetMother();
3291  if(motherLabel<0) return localFlag;
3292 
3293  AliAODMCParticle *motherPart = 0;
3294  Int_t motherPdg = 0;
3295  while (!localFlag && motherLabel>=0) {
3296  motherPart = (AliAODMCParticle*)arrayMC->At(motherLabel);
3297  motherPdg = motherPart->GetPdgCode();
3298  //printf(" ------------- motherLab=%d motherPdg=%d ---\n", motherLabel, motherPdg);
3299  if (TMath::Abs(motherPdg)==pdgToBeCompared) {
3300  //printf("-------------------------- trovato quark c/cbar\n");
3301  localFlag = kTRUE;
3302  }
3303  else {
3304  motherLabel = motherPart->GetMother();
3305  }
3306  }
3307 
3308  return localFlag;
3309 
3310 }
3311 
3312 
3313 
3314 
3315 //-----------------------
3317 {
3318  //
3319  // Returs kTRUE if there is a lepton related to the LambdaC
3320  //
3321 
3322  Bool_t localFlag = kFALSE;
3323 
3324  AliAODMCParticle *searchLc;
3325 
3326  for (Int_t iii=0; iii<arrayMC->GetEntries(); iii++) {
3327  searchLc = (AliAODMCParticle*)arrayMC->At(iii);
3328  Int_t searchLcpdg = searchLc->GetPdgCode();
3329  if (TMath::Abs(searchLcpdg) == 4122){
3330  localFlag = kTRUE;
3331  break;
3332  }
3333  }
3334 
3335 
3336  return localFlag;
3337 
3338 }
3339 //_________________________________
3340 Int_t AliAnalysisTaskSELambdac::NumberPrimaries(const AliAODEvent *aods)
3341 {
3343  Int_t counter=0;
3344 
3345 
3346  TClonesArray *aodtracks=(TClonesArray *)aods->GetTracks();
3347 
3348  // for(Int_t ji=0;ji<aods->GetNumberOfTracks();ji++)
3349  for(Int_t ji=0;ji<aodtracks->GetEntriesFast();ji++)
3350  {
3351  AliAODTrack*aodTrack=(AliAODTrack*)aodtracks->UncheckedAt(ji);
3352  if(aodTrack->IsPrimaryCandidate()) counter++;
3353  }
3354  return counter;
3355 
3356 }
3357 //_________________________________
3358 
3360  AliRDHFCutsLctopKpi *cuts,
3361  AliAODEvent* aod,
3362  TClonesArray *arrMC,
3363  Bool_t &flag1,Bool_t &flag2,Bool_t &flag3,
3364  Bool_t &flag4, Bool_t &flag5, Bool_t &flag6)
3365 {
3366 
3367 
3368 // Multiplicity studies
3369 
3370  TString fillthis="";
3371 
3372  Int_t pdgDgLctopKpi[3]={2212,321,211};
3373  Int_t lab=-9999;
3374  if(fReadMC)
3375  lab=part->MatchToMC(4122,arrMC,3,pdgDgLctopKpi); //return MC particle label if the array corresponds to a Lc, -1 if not (cf. AliAODRecoDecay.cxx)
3376 
3377  //cuts->SetUsePID(kFALSE); //Annalisa
3378  Int_t isSelected3ProngByLc=cuts->IsSelected(part,AliRDHFCuts::kCandidate,aod);
3379 
3380  if(isSelected3ProngByLc>0 && fReadMC) {
3381  flag1 = kTRUE;
3382  if (lab>0) {
3383  flag3 = kTRUE;
3384  }
3385 
3386  Bool_t is3ProngFromJPsi = Is3ProngFromPDG(part,arrMC,443);
3387  if (is3ProngFromJPsi) flag6=is3ProngFromJPsi;
3388 
3389  Bool_t is3ProngFromC = Is3ProngFromPDG(part,arrMC,4);
3390  if (is3ProngFromC) flag4=is3ProngFromC;
3391 
3392  Bool_t is3ProngFromB = Is3ProngFromPDG(part,arrMC,5);
3393  if (is3ProngFromB) flag5=is3ProngFromB;
3394 
3395  for (Int_t ii=0; ii<3; ii++) {
3396  AliAODTrack *prongTest=(AliAODTrack*)part->GetDaughter(ii);
3397  if (!prongTest) continue;
3398  Int_t labprongTest = prongTest->GetLabel();
3399  if(labprongTest<0) continue;
3400  AliAODMCParticle *mcprongTest = (AliAODMCParticle*)arrMC->At(labprongTest);
3401 
3402  switch (TMath::Abs(mcprongTest->GetPdgCode())) {
3403  case 11:
3404  fillthis="hElIn3Prong";
3405  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3406  if (IsTrackFromPDG(prongTest,arrMC,443)) {
3407  fillthis="hElIn3Prong6";
3408  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3409  }
3410  break;
3411  case 13:
3412  fillthis="hMuIn3Prong";
3413  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3414  if (IsTrackFromPDG(prongTest,arrMC,443)) {
3415  fillthis="hMuIn3Prong6";
3416  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3417  }
3418  break;
3419  case 211:
3420  fillthis="hPiIn3Prong";
3421  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3422  if (IsTrackFromPDG(prongTest,arrMC,443)) {
3423  fillthis="hPiIn3Prong6";
3424  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3425  }
3426  break;
3427  case 321:
3428  fillthis="hKaIn3Prong";
3429  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3430  if (IsTrackFromPDG(prongTest,arrMC,443)) {
3431  fillthis="hKaIn3Prong6";
3432  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3433  }
3434  break;
3435  case 2212:
3436  fillthis="hPrIn3Prong";
3437  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3438  if (IsTrackFromPDG(prongTest,arrMC,443)) {
3439  fillthis="hPrIn3Prong6";
3440  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3441  }
3442  break;
3443  default:
3444  break;
3445  }
3446 
3447  if (lab>0) {
3448  switch (TMath::Abs(mcprongTest->GetPdgCode())) {
3449  case 11:
3450  fillthis="hElIn3Prong1";
3451  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3452  break;
3453  case 13:
3454  fillthis="hMuIn3Prong1";
3455  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3456  break;
3457  case 211:
3458  fillthis="hPiIn3Prong1";
3459  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3460  break;
3461  case 321:
3462  fillthis="hKaIn3Prong1";
3463  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3464  break;
3465  case 2212:
3466  fillthis="hPrIn3Prong1";
3467  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3468  break;
3469  default:
3470  break;
3471  }
3472  } else {
3473  switch (TMath::Abs(mcprongTest->GetPdgCode())) {
3474  case 11:
3475  fillthis="hElIn3Prong2";
3476  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3477  if (IsTrackFromPDG(prongTest,arrMC,4)) {
3478  fillthis="hElIn3Prong3";
3479  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3480  }
3481  if (IsTrackFromPDG(prongTest,arrMC,5)) {
3482  fillthis="hElIn3Prong4";
3483  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3484  }
3485  if (!IsTrackFromPDG(prongTest,arrMC,4) && !IsTrackFromPDG(prongTest,arrMC,5)) {
3486  fillthis="hElIn3Prong5";
3487  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3488  }
3489  break;
3490  case 13:
3491  fillthis="hMuIn3Prong2";
3492  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3493  if (IsTrackFromPDG(prongTest,arrMC,4)) {
3494  fillthis="hMuIn3Prong3";
3495  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3496  }
3497  if (IsTrackFromPDG(prongTest,arrMC,5)) {
3498  fillthis="hMuIn3Prong4";
3499  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3500  }
3501  if (!IsTrackFromPDG(prongTest,arrMC,4) && !IsTrackFromPDG(prongTest,arrMC,5)) {
3502  fillthis="hMuIn3Prong5";
3503  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3504  }
3505  break;
3506  case 211:
3507  fillthis="hPiIn3Prong2";
3508  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3509  if (IsTrackFromPDG(prongTest,arrMC,4)) {
3510  fillthis="hPiIn3Prong3";
3511  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3512  }
3513  if (IsTrackFromPDG(prongTest,arrMC,5)) {
3514  fillthis="hPiIn3Prong4";
3515  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3516  }
3517  if (!IsTrackFromPDG(prongTest,arrMC,4) && !IsTrackFromPDG(prongTest,arrMC,5)) {
3518  fillthis="hPiIn3Prong5";
3519  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3520  }
3521  break;
3522  case 321:
3523  fillthis="hKaIn3Prong2";
3524  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3525  if (IsTrackFromPDG(prongTest,arrMC,4)) {
3526  fillthis="hKaIn3Prong3";
3527  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3528  }
3529  if (IsTrackFromPDG(prongTest,arrMC,5)) {
3530  fillthis="hKaIn3Prong4";
3531  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3532  }
3533  if (!IsTrackFromPDG(prongTest,arrMC,4) && !IsTrackFromPDG(prongTest,arrMC,5)) {
3534  fillthis="hKaIn3Prong5";
3535  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3536  }
3537  break;
3538  case 2212:
3539  fillthis="hPrIn3Prong2";
3540  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3541  if (IsTrackFromPDG(prongTest,arrMC,4)) {
3542  fillthis="hPrIn3Prong3";
3543  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3544  }
3545  if (IsTrackFromPDG(prongTest,arrMC,5)) {
3546  fillthis="hPrIn3Prong4";
3547  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3548  }
3549  if (!IsTrackFromPDG(prongTest,arrMC,4) && !IsTrackFromPDG(prongTest,arrMC,5)) {
3550  fillthis="hPrIn3Prong5";
3551  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3552  }
3553  break;
3554  default:
3555  break;
3556  }
3557  }
3558  /*
3559  if (is3ProngFromC) {
3560  switch (TMath::Abs(mcprongTest->GetPdgCode())) {
3561  case 11:
3562  fillthis="hElIn3Prong3";
3563  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3564  break;
3565  case 13:
3566  fillthis="hMuIn3Prong3";
3567  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3568  break;
3569  case 211:
3570  fillthis="hPiIn3Prong3";
3571  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3572  break;
3573  case 321:
3574  fillthis="hKaIn3Prong3";
3575  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3576  break;
3577  case 2212:
3578  fillthis="hPrIn3Prong3";
3579  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3580  break;
3581  default:
3582  break;
3583  }
3584  } else { // !is3ProngFromC
3585  if (is3ProngFromB) {
3586  switch (TMath::Abs(mcprongTest->GetPdgCode())) {
3587  case 11:
3588  fillthis="hElIn3Prong4";
3589  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3590  break;
3591  case 13:
3592  fillthis="hMuIn3Prong4";
3593  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3594  break;
3595  case 211:
3596  fillthis="hPiIn3Prong4";
3597  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3598  break;
3599  case 321:
3600  fillthis="hKaIn3Prong4";
3601  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3602  break;
3603  case 2212:
3604  fillthis="hPrIn3Prong4";
3605  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3606  break;
3607  default:
3608  break;
3609  }
3610  } else {//!is3ProngFromB
3611  switch (TMath::Abs(mcprongTest->GetPdgCode())) {
3612  case 11:
3613  fillthis="hElIn3Prong5";
3614  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3615  break;
3616  case 13:
3617  fillthis="hMuIn3Prong5";
3618  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3619  break;
3620  case 211:
3621  fillthis="hPiIn3Prong5";
3622  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3623  break;
3624  case 321:
3625  fillthis="hKaIn3Prong5";
3626  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3627  break;
3628  case 2212:
3629  fillthis="hPrIn3Prong5";
3630  ((TH1F*)fAPriori->FindObject(fillthis))->Fill(part->PtProng(ii));
3631  break;
3632  default:
3633  break;
3634  }
3635  }
3636  }
3637  */
3638  }
3639  }
3640 
3641  Double_t mPDG=TDatabasePDG::Instance()->GetParticle(4122)->Mass();
3642  Double_t invmasscut=0.05;
3643 
3644  Double_t minvLcpKpi = part->InvMassLcpKpi();
3645  Double_t minvLcpiKp = part->InvMassLcpiKp();
3646 
3647  //cuts->SetUsePID(kTRUE); //Annalisa
3648  Int_t isSelected3ProngByLcPID=cuts->IsSelected(part,AliRDHFCuts::kCandidate,aod);
3649  if (isSelected3ProngByLcPID>0) {
3650  if (TMath::Abs(minvLcpKpi-mPDG)<invmasscut || TMath::Abs(minvLcpiKp-mPDG)<invmasscut) {
3651  flag2 = kTRUE;
3652  }
3653  }
3654 
3655 
3656 }
TH2F * fhPiond0ProngLcPt
!hist for var_LcPt
TH1F * fMassHistTC[6 *kMaxPtBins]
!hist. for inv mass (TC)
TH1F * fhMassPtGreater33Pr
!hist. for No. of events
TH1F * fMassHistDk[3 *kMaxPtBins]
!hist. for inv mass (LC)
TH1F * fMassHist3Pr[3 *kMaxPtBins]
!hist. for inv mass (LC)
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
TH1F * fhMassPtGreater2TC
!hist. for No. of events
TH1F * fhMassPtGreater3DkTC
!hist. for No. of events
AliAnalysisVertexingHF * fVHF
apply analysis cuts
TH2F * fhEta3ProngAn
!hist. for 3-prong Eta fiducial An Cuts
Double_t GetPtBinLimit(Int_t ibin) const
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
TH2F * fhPtMaxLcPt
!hist for var_LcPt
TH2F * fhCosPointingAngleLcPt
!hist for var_LcPt
TH2F * fhdcasLcPt
!hist for var_LcPt
TH1F * fMassHistDkTC[3 *kMaxPtBins]
!hist. for inv mass (TC)
Bool_t HasSelectionBit(Int_t i) const
Double_t fArrayBinLimits[kMaxPtBins+1]
list of cuts
TH1F * fhMassPtGreater2KpTC
!hist. for No. of events
TH2F * fhBdcasLcPt
!hist for var_LcPt
TH2F * fhRap3ProngAn
!hist. for 3-prong Eta fiducial An cuts
Double_t mass
TH1F * fMassHist[6 *kMaxPtBins]
!hist. for inv mass (LC)
Bool_t Is3ProngFromPDG(AliAODRecoDecayHF3Prong *part, TClonesArray *arrMC, Int_t pdgToBeCompared=4)
TH2F * fhDecayLengthLcPt
!hist for var_LcPt
TH1F * fhMassPtGreater3Kp
!hist. for No. of events
Double_t ptlims[nPtBins+1]
AliPIDResponse * fPIDResponse
output3
Bool_t IsThereAGeneratedLc(TClonesArray *arrayMC)
TH2F * fhBSigmaVertLcPt
!hist for var_LcPt
TH1F * fMassHistKpTC[3 *kMaxPtBins]
!hist. for inv mass (TC)
TH1F * fhMassPtGreater23PrTC
!hist. for No. of events
TH1F * fMassHistKp[3 *kMaxPtBins]
!hist. for inv mass (LC)
Int_t GetSignalHistoIndex(Int_t iPtBin) const
Int_t GetWhyRejection() const
Definition: AliRDHFCuts.h:293
TH2F * fhBCosPointingAngleLcPt
!hist for var_LcPt
TH2F * fhSum2LcPt
!hist for var_LcPt
TH2F * fhBDecayLengthLcPt
!hist for var_LcPt
Int_t fNPtBins
cuts with KF vertexer
ULong_t GetSelectionMap() const
Bool_t fFillVarHists
Vertexer heavy flavour (used to pass the cuts)
TH1F * fMassHistLpi[3 *kMaxPtBins]
!hist. for inv mass (LC)
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
TH1F * fhMassPtGreater2LpiTC
!hist. for No. of events
void MultiplicityStudies(AliAODRecoDecayHF3Prong *part, AliRDHFCutsLctopKpi *cuts, AliAODEvent *aod, TClonesArray *arrMC, Bool_t &flag1, Bool_t &flag2, Bool_t &flag3, Bool_t &flag4, Bool_t &flag5, Bool_t &flag6)
TNtuple * fNtupleLambdac
! output ntuple
TH2F * fhBProtond0ProngLcPt
!hist for var_LcPt
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
TH1F * fhMassPtGreater33PrTC
!hist. for No. of events
Bool_t VertexingKF(AliAODRecoDecayHF3Prong *d, Int_t *pdgs, Double_t field) const
TH2F * fhEta3Prong
!hist. for 3-prong Eta
TList * fListCuts
Production Cuts.
TH1F * fhMassPtGreater3TC
!hist. for No. of events
TH2F * fhBSum2LcPt
!hist for var_LcPt
virtual void Terminate(Option_t *option)
TH1F * fhMassPtGreater2Lpi
!hist. for No. of events
TH2F * fhRap3Prong
!hist. for 3-prong y
TH1F * fNentries
flag for Lc filter bit PID
void FillAPrioriConcentrations(AliAODRecoDecayHF3Prong *part, AliRDHFCutsLctopKpi *cuts, AliAODEvent *aod, TClonesArray *arrMC)
TH1F * fhMassPtGreater2DkTC
!hist. for No. of events
const Double_t ptmax
Bool_t fAnalysis
flag to cut with KF vertexer
TH1F * fhMassPtGreater3Dk
!hist. for No. of events
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
TH2F * fhBKaonPtProngLcPt
!hist for var_LcPt
TH2F * fhMassLcPt
!hist Mass x pt
Bool_t fPriorsHists
flag for activation of multiplcity histos
Int_t MatchToMCLambdac(AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC) const
Bool_t CheckStatus(AliAODTrack *track, TString detectors) const
AliAODVertex * GetOwnPrimaryVtx() const
TH2F * fhBDist12PrimLcPt
!hist for var_LcPt
TH2F * fhBProtonPtProngLcPt
!hist for var_LcPt
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
virtual void UserExec(Option_t *option)
AliAODPidHF * GetPidprot() const
TH2F * fhKaonPtProngLcPt
!hist for var_LcPt
TH2F * fhEta3ProngAcc
!hist. for 3-prong Eta fiducial acc
Double_t nsigma
TH2F * fhProtonPtProngLcPt
!hist for var_LcPt
Int_t GetHistoIndex(Int_t iPtBin) const
TH1F * fhMassPtGreater23Pr
!hist. for No. of events
Bool_t IsCandidateInjected(AliAODRecoDecayHF *cand, AliAODMCHeader *header, TClonesArray *arrayMC)
void GetDCAs(Double_t dca[3]) const
AliAODPidHF * GetPidpion() const
TH1F * fhMassPtGreater3KpTC
!hist. for No. of events
Bool_t fMultiplicityHists
flag for creation and fill of histograms with vars
Bool_t fRealPid
flag for access to MC
Bool_t fReadMC
flag for filling ntuple
Bool_t fMCPid
flag for access to MC
Int_t GetNoQuarkHistoIndex(Int_t iPtBin) const
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
TList * fOutputMC
histo with number of entries
TH2F * fhEta3ProngProd
!hist. for 3-prong Eta fiducial Prod Cuts
TH1F * fMassHist3PrTC[3 *kMaxPtBins]
!hist. for inv mass (TC)
Float_t fLowmasslimit
upper inv mass limit for histos
void FillMassHists(AliAODEvent *aod, AliAODRecoDecayHF3Prong *part, TClonesArray *arrayMC, AliRDHFCutsLctopKpi *cuts, Int_t *nSelectedloose, Int_t *nSelectedtight)
void FillVarHists(AliAODRecoDecayHF3Prong *part, TClonesArray *arrMC, AliRDHFCutsLctopKpi *cuts, AliAODEvent *aod)
Bool_t GetLambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC) const
Bool_t IsEventSelected(AliVEvent *event)
Int_t NumberPrimaries(const AliAODEvent *aods)
TH2F * fhBPtMaxLcPt
!hist for var_LcPt
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
TH1F * fhMassPtGreater3Lpi
!hist. for No. of events
Bool_t fLcCut
flag for histos with priors
TH2F * fhProtond0ProngLcPt
!hist for var_LcPt
virtual void UserCreateOutputObjects()
Implementation of interface methods.
void SetPtBinLimit(Int_t n, Float_t *limitarray)
Bool_t fUseKF
flag for PID with resonant channels
TH1F * fMassHistLpiTC[3 *kMaxPtBins]
!hist. for inv mass (TC)
Float_t * GetPtBinLimits() const
Definition: AliRDHFCuts.h:232
void SetOldPid(Bool_t oldPid)
Definition: AliAODPidHF.h:108
TH2F * fhKaond0ProngLcPt
!hist for var_LcPt
AliNormalizationCounter * fCounter
!AliNormalizationCounter on output slot 7
TH1F * fhMassPtGreater3
!hist. for No. of events
TH1F * fHistNEvents
!hist. for No. of events
Int_t GetcOnlyHistoIndex(Int_t iPtBin) const
TH1F * fhMassPtGreater3LpiTC
!hist. for No. of events
TH2F * fhPionPtProngLcPt
!hist for var_LcPt
TH2F * fhBPionPtProngLcPt
!hist for var_LcPt
TH2F * fhRap3ProngProd
!hist. for 3-prong Eta fiducial Prod cuts
TH2F * fhMassLcminusPt
!hist Mass x pt Lcminu
TH1F * fhMassPtGreater2Dk
!hist. for No. of events
TH2F * fhMassLcplusPt
!hist Mass x pt Lcplus
TH2F * fhSigmaVertLcPt
!hist for var_LcPt
Bool_t GetIsUsePID() const
Definition: AliRDHFCuts.h:253
Int_t GetNPtBins() const
Definition: AliRDHFCuts.h:233
TList * fOutput
! list send on output slot 0
Bool_t IspiKpMC(AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC) const
Bool_t fFillNtuple
limits for the Pt bins
AliKFParticle * ApplyVertexingKF(Int_t *iprongs, Int_t nprongs, Int_t *pdgs, Bool_t topoCostraint, Double_t bzkG, Double_t *mass) const
vertexing KF:
Bool_t IsTrackFromPDG(const AliAODTrack *daugh, TClonesArray *arrayMC, Int_t pdgToBeCompared)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999)
TH1F * fhMassPtGreater2
!hist. for No. of events
Double_t CosPointingAngle() const
Bool_t fResPid
flag for real PID
void IspKpiResonant(AliAODRecoDecayHF3Prong *d, Double_t field, Int_t *resNumber) const
TH2F * fhRap3ProngAcc
!hist. for 3-prong Eta fiducial acc
AliRDHFCutsLctopKpi * fRDCutsAnalysis
number of bins in Pt for histograms
Bool_t IspKpiMC(AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC) const
Int_t PtBin(Double_t pt) const
TH2F * fhBKaond0ProngLcPt
!hist for var_LcPt
Float_t fCutsKF[2]
lower inv mass limit for histos
Double_t DecayLength() const
Bool_t fLcPIDCut
flag for Lc filter bit cut
void IspiKpResonant(AliAODRecoDecayHF3Prong *d, Double_t field, Int_t *resNumber) const
TH1F * fhMassPtGreater2Kp
!hist. for No. of events
Int_t GetLbHistoIndex(Int_t iPtBin) const
TH2F * fhBPiond0ProngLcPt
!hist for var_LcPt
AliRDHFCutsLctopKpi * fRDCutsProduction
Cuts for Analysis.
Int_t GetBackgroundHistoIndex(Int_t iPtBin) const
TH1F * fhChi2
!hist. for No. of events
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111
TH1F * fhSelectBit
! hist for Filter Bit
TH2F * fhDist12PrimLcPt
!hist for var_LcPt
Class with functions useful for different D2H analyses //.