]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/vertexingHF/AliAnalysisTaskSED0Mass.h
Fix typo
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSED0Mass.h
1 #ifndef ALIANALYSISTASKSED0MASS_H
2 #define ALIANALYSISTASKSED0MASS_H
3
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */ 
8
9 //*************************************************************************
10 // Class AliAnalysisTaskSED0Mass
11 // AliAnalysisTaskSE for D0 candidates invariant mass histogram
12 // and comparison to MC truth (kinematics stored in the AOD) and cut variables
13 // distributions
14 // Authors: A.Dainese, andrea.dainese@ln.infn.it
15 // and C.Bianchin, chiara.bianchin@pd.infn.it
16 //*************************************************************************
17
18 #include <TROOT.h>
19 #include <TSystem.h>
20 #include <TNtuple.h>
21 #include <TTree.h>
22 #include <TH1F.h>
23 #include <THnSparse.h>
24
25 #include "AliAnalysisTaskSE.h"
26 #include "AliRDHFCutsD0toKpi.h"
27 #include "AliNormalizationCounter.h"
28
29 class AliAODEvent;
30
31 class AliAnalysisTaskSED0Mass : public AliAnalysisTaskSE
32 {
33  public:
34
35   AliAnalysisTaskSED0Mass();
36   AliAnalysisTaskSED0Mass(const char *name,AliRDHFCutsD0toKpi* cuts);
37   virtual ~AliAnalysisTaskSED0Mass();
38
39
40   // Implementation of interface methods
41   virtual void UserCreateOutputObjects();
42   virtual void Init();
43   virtual void LocalInit() {Init();}
44   virtual void UserExec(Option_t *option);
45   virtual void Terminate(Option_t *option);
46
47   void SetArray(Int_t type=AliAnalysisTaskSED0Mass::kD0){fArray=type;}
48   enum{kD0,kLS};
49
50   void SetReadMC(Bool_t readMC=kFALSE){fReadMC=readMC;}
51   void SetCutOnDistr(Bool_t cutondistr=kFALSE){fCutOnDistr=cutondistr;}
52   void SetUsePid4Distr(Bool_t usepid=kTRUE){fUsePid4Distr=usepid;}
53   void SetFillOnlyD0D0bar(Int_t flagfill){fFillOnlyD0D0bar=flagfill;}
54   void SetFillVarHists(Bool_t flag) {fFillVarHists=flag;}
55   void SetFillPtHistos(Bool_t flag) {fFillPtHist=flag;}
56   void SetFillImpactParameterHistos(Bool_t flag) {fFillImpParHist=flag;}
57   void SetSystem(Int_t sys){fSys=sys; if(fSys==1) SetFillVarHists(kFALSE);}
58   void SetRejectSDDClusters(Bool_t flag) { fIsRejectSDDClusters=flag; }
59   void SetWriteVariableTree(Bool_t flag) { fWriteVariableTree=flag; }
60
61   Bool_t GetCutOnDistr() const {return fCutOnDistr;}
62   Bool_t GetUsePid4Distr() const {return fUsePid4Distr;}
63   Int_t  GetFillOnlyD0D0bar() const {return fFillOnlyD0D0bar;}
64   Bool_t GetFillVarHists() const {return fFillVarHists;}
65   Bool_t GetFillPtHistos() const {return fFillPtHist;}
66   Bool_t GetFillImpactParameterHistos() const {return fFillImpParHist;}
67   Int_t  GetSystem() const {return fSys;}
68   Bool_t GetRejectSDDClusters() const { return fIsRejectSDDClusters; }
69   Bool_t GetWriteVariableTree() const {return fWriteVariableTree;}
70
71  private:
72
73   AliAnalysisTaskSED0Mass(const AliAnalysisTaskSED0Mass &source);
74   AliAnalysisTaskSED0Mass& operator=(const AliAnalysisTaskSED0Mass& source); 
75   void     FillMassHists(AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi *cuts, TList *listout);
76   void     FillVarHists(AliAODEvent *aodev,AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliRDHFCutsD0toKpi *cuts, TList *listout);
77   AliAODVertex* GetPrimaryVtxSkipped(AliAODEvent *aodev);
78   void CreateImpactParameterHistos();
79   Int_t CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const;
80   Float_t GetTrueImpactParameter(AliAODMCHeader *mcHeader, TClonesArray* arrayMC, AliAODMCParticle *partD0) const ;
81
82   TList    *fOutputMass;          //! list send on output slot 1
83   TList    *fOutputMassPt;        //! list send on output slot 6
84   TList    *fDistr;               //! list send on output slot 2
85   TH1F     *fNentries;            //! histogram with number of events on output slot 3
86   AliRDHFCutsD0toKpi *fCuts;      //  Cuts - sent to output slot 4
87   THnSparseF *fHistMassPtImpParTC[5];   //! histograms for impact paramter studies
88   Int_t     fArray;               //  can be D0 or Like Sign candidates
89   Bool_t    fReadMC;              //  flag for MC array: kTRUE = read it, kFALSE = do not read it
90   Bool_t    fCutOnDistr;          //  flag to decide if apply cut also on distributions: 0 no cuts, 1 looser cuts, 2 tighter cuts 
91   Bool_t    fUsePid4Distr;        //  flag to use the particle identification to fill the signal histograms of distributions. It has effect only with fReadMC=kFALSE
92   AliNormalizationCounter *fCounter;//!AliNormalizationCounter on output slot 5
93   Int_t     fNPtBins;             //  number of pt bins
94   Double_t  fLsNormalization;     //  normalization
95   Int_t     fFillOnlyD0D0bar;     // flag to fill mass histogram with D0/D0bar only (0 = fill with both, 1 = fill with D0 only, 2 = fill with D0bar only)
96   TObjArray fDaughterTracks;      // keeps the daughter tracks
97   Int_t     fIsSelectedCandidate; // selection outcome
98   Bool_t    fFillVarHists;        // flag to enable filling variable histos
99   Int_t     fSys;                 // fSys=0 -> p-p; fSys=1 ->PbPb (in this case fFillVarHists=kFALSE by default: set it to kTRUE *after* if needed)
100   Bool_t    fIsRejectSDDClusters; // flag to reject events with SDD clusters
101   Bool_t    fFillPtHist;          // flag to fill Pt and Impact Parameter Histograms
102   Bool_t    fFillImpParHist;      // flag to fill Pt and Impact Parameter Histograms
103
104   Bool_t    fWriteVariableTree;       // flag to decide whether to write the candidate variables on a tree variables
105   TTree    *fVariablesTree;           //! tree of the candidate variables after track selection on output slot 7
106   Double_t *fCandidateVariables;      //!  variables to be written to the tree
107
108
109   ClassDef(AliAnalysisTaskSED0Mass,16); // AliAnalysisTaskSE for D0->Kpi
110 };
111
112 #endif
113