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