]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/vertexingHF/AliAnalysisTaskSELambdac.h
Possibility to use PID via AliPIDResponse and OADB (Rossella)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskSELambdac.h
1 #ifndef ALIANALYSISTASKLAMBDAC_H
2 #define ALIANALYSISTASKLAMBDAC_H
3
4 /* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */ 
8
9 //*************************************************************************
10 // Class AliAnalysisTaskSELambdac
11 // AliAnalysisTaskSE for the Lambdac candidates Invariant Mass Histogram and 
12 //comparison of heavy-flavour decay candidates
13 // to MC truth (kinematics stored in the AOD)
14 // r.romita@gsi.de
15 //*************************************************************************
16
17 #include <TROOT.h>
18 #include <TSystem.h>
19 #include <TNtuple.h>
20 #include <TH1F.h>
21 #include <TH2F.h>
22 #include <TArrayD.h>
23
24 #include "AliAnalysisTaskSE.h"
25 #include "AliAnalysisVertexingHF.h"
26 #include "AliAODMCParticle.h"
27 #include "AliRDHFCutsLctopKpi.h"
28 #include "AliRDHFCuts.h"
29 #include "TClonesArray.h"
30
31 class AliAnalysisTaskSELambdac : public AliAnalysisTaskSE
32 {
33  public:
34
35   AliAnalysisTaskSELambdac();
36   AliAnalysisTaskSELambdac(const char *name, Bool_t fillNtuple,AliRDHFCutsLctopKpi *lccutsana, AliRDHFCutsLctopKpi *lccutsprod);
37   virtual ~AliAnalysisTaskSELambdac();
38
39   void SetReadMC(Bool_t readMC=kTRUE){fReadMC=readMC;}
40   void SetMCPid(){fMCPid=kTRUE;fReadMC=kTRUE;fRealPid=kFALSE;fResPid=kFALSE;return;}
41   void SetRealPid(){fRealPid=kTRUE;fMCPid=kFALSE;fResPid=kFALSE;return;}
42   void SetResonantPid(){fResPid=kTRUE;fRealPid=kFALSE;fMCPid=kFALSE;return;}
43   void SetCutsKF(Float_t cutsKF[10]){for(Int_t i=0;i<10;i++){fCutsKF[i]=cutsKF[i];}return;}
44   void SetUseKF(Bool_t useKF=kTRUE){fUseKF=useKF;}
45   void SetMassLimits(Float_t range);
46   void SetMassLimits(Float_t lowlimit, Float_t uplimit);
47   void SetPtBinLimit(Int_t n, Float_t *limitarray);
48   
49   Float_t GetUpperMassLimit() const {return fUpmasslimit;}
50   Float_t GetLowerMassLimit() const {return fLowmasslimit;}
51   Int_t GetNBinsPt() const {return fNPtBins;}
52   Double_t GetPtBinLimit(Int_t ibin) const ;
53   Bool_t IspiKpMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC) const ;
54   Bool_t IspKpiMC(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC) const ;
55   Bool_t IspiKpResonant(AliAODRecoDecayHF3Prong *d,Double_t field) const ;
56   Bool_t IspKpiResonant(AliAODRecoDecayHF3Prong *d,Double_t field) const ;
57   Bool_t VertexingKF(AliAODRecoDecayHF3Prong *d,Int_t *pdgs,Double_t field) const ;
58   Int_t MatchToMCLambdac(AliAODRecoDecayHF3Prong *d,TClonesArray *arrayMC) const ;
59   Bool_t GetLambdacDaugh(AliAODMCParticle *part, TClonesArray *arrayMC) const ;
60
61   // Implementation of interface methods
62   virtual void UserCreateOutputObjects();
63   virtual void Init();
64   virtual void LocalInit() {Init();}
65   virtual void UserExec(Option_t *option);
66   virtual void Terminate(Option_t *option);
67     
68  private:
69
70   AliAnalysisTaskSELambdac(const AliAnalysisTaskSELambdac &source);
71   AliAnalysisTaskSELambdac& operator=(const AliAnalysisTaskSELambdac& source); 
72   Int_t GetHistoIndex(Int_t iPtBin) const { return iPtBin*3;}
73   Int_t GetSignalHistoIndex(Int_t iPtBin) const { return iPtBin*3+1;}
74   Int_t GetBackgroundHistoIndex(Int_t iPtBin) const { return iPtBin*3+2;}
75   Int_t GetLSHistoIndex(Int_t iPtBin)const { return iPtBin*5;}
76
77   Bool_t ReconstructKF(AliAODRecoDecayHF3Prong *d,Int_t *pdgs,Double_t field) const;
78  
79   enum {kMaxPtBins=10};
80
81   TList   *fOutput; //! list send on output slot 0
82   TH1F    *fHistNEvents; //!hist. for No. of events
83   TH1F    *fhChi2; //!hist. for No. of events
84   TH1F    *fhMassPtGreater3; //!hist. for No. of events
85   TH1F    *fhMassPtGreater3TC; //!hist. for No. of events
86   TH1F *fMassHist[3*kMaxPtBins]; //!hist. for inv mass (LC)
87   TH1F*   fCosPHist[3*kMaxPtBins]; //!hist. for PointingAngle (LC)
88   TH1F*   fDLenHist[3*kMaxPtBins]; //!hist. for Dec Length (LC)
89   TH1F*   fSumd02Hist[3*kMaxPtBins]; //!hist. for sum d02 (LC)
90   TH1F*   fSigVertHist[3*kMaxPtBins]; //!hist. for sigVert (LC)
91   TH1F*   fPtMaxHist[3*kMaxPtBins]; //!hist. for Pt Max (LC)
92   TH1F*   fDCAHist[3*kMaxPtBins]; //!hist. for DCA (LC)
93   TH1F *fMassHistTC[3*kMaxPtBins]; //!hist. for inv mass (TC)
94   TH1F *fMassHistLS[5*kMaxPtBins];//!hist. for LS inv mass (LC)
95   TH1F *fCosPHistLS[3*kMaxPtBins];//!hist. for LS cuts variable 1 (LC)
96   TH1F *fDLenHistLS[3*kMaxPtBins];//!hist. for LS cuts variable 2 (LC)
97   TH1F *fSumd02HistLS[3*kMaxPtBins];//!hist. for LS cuts variable 3 (LC)
98   TH1F *fSigVertHistLS[3*kMaxPtBins];//!hist. for LS cuts variable 4 (LC)
99   TH1F *fPtMaxHistLS[3*kMaxPtBins];//!hist. for LS cuts variable 5 (LC)
100   TH1F *fDCAHistLS[3*kMaxPtBins];//!hist. for LS cuts variable 6 (LC)
101   TH1F *fMassHistLSTC[5*kMaxPtBins];//!hist. for LS inv mass (TC)
102   TNtuple *fNtupleLambdac; //! output ntuple
103   Float_t fUpmasslimit;  //upper inv mass limit for histos
104   Float_t fLowmasslimit; //lower inv mass limit for histos
105   Float_t fCutsKF[10]; //cuts with KF vertexer
106   Int_t fNPtBins; //number of bins in Pt for histograms
107   AliRDHFCutsLctopKpi *fRDCutsAnalysis; //Cuts for Analysis
108   AliRDHFCutsLctopKpi *fRDCutsProduction; //Production Cuts
109   TList *fListCuts; //list of cuts
110   Double_t fArrayBinLimits[kMaxPtBins+1]; //limits for the Pt bins
111   Bool_t fFillNtuple;   // flag for filling ntuple
112   Bool_t fReadMC;    //flag for access to MC
113   Bool_t fMCPid;    //flag for access to MC
114   Bool_t fRealPid;    //flag for real PID
115   Bool_t fResPid;      //flag for PID with resonant channels
116   Bool_t fUseKF;      //flag to cut with KF vertexer
117   AliAnalysisVertexingHF *fVHF;  // Vertexer heavy flavour (used to pass the cuts)
118   
119   ClassDef(AliAnalysisTaskSELambdac,3); // AliAnalysisTaskSE for the invariant mass analysis of heavy-flavour decay candidates (Lambdac)
120 };
121
122 #endif
123