]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliAnalysisTaskSED0Mass.h
Minor bug on T0-AC resolution fixed. TOF resolution no longer read from TOHheader...
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSED0Mass.h
CommitLineData
49061176 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
27de2dfb 7/* $Id$ */
8
49061176 9//*************************************************************************
10// Class AliAnalysisTaskSED0Mass
11// AliAnalysisTaskSE for D0 candidates invariant mass histogram
a41f6fad 12// and comparison to MC truth (kinematics stored in the AOD) and cut variables
13// distributions
49061176 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>
90c70b48 21#include <TTree.h>
49061176 22#include <TH1F.h>
90c70b48 23#include <THnSparse.h>
49061176 24
25#include "AliAnalysisTaskSE.h"
ea0d8716 26#include "AliRDHFCutsD0toKpi.h"
a96083b9 27#include "AliNormalizationCounter.h"
ea0d8716 28
4e61a020 29class AliAODEvent;
49061176 30
31class AliAnalysisTaskSED0Mass : public AliAnalysisTaskSE
32{
33 public:
34
35 AliAnalysisTaskSED0Mass();
ea0d8716 36 AliAnalysisTaskSED0Mass(const char *name,AliRDHFCutsD0toKpi* cuts);
49061176 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
feb73eca 47 void SetArray(Int_t type=AliAnalysisTaskSED0Mass::kD0){fArray=type;}
feb73eca 48 enum{kD0,kLS};
ce39f0ac 49
50 void SetReadMC(Bool_t readMC=kFALSE){fReadMC=readMC;}
ea0d8716 51 void SetCutOnDistr(Bool_t cutondistr=kFALSE){fCutOnDistr=cutondistr;}
6b3e3c78 52 void SetUsePid4Distr(Bool_t usepid=kTRUE){fUsePid4Distr=usepid;}
449b1302 53 void SetFillOnlyD0D0bar(Int_t flagfill){fFillOnlyD0D0bar=flagfill;}
d7688946 54 void SetFillVarHists(Bool_t flag) {fFillVarHists=flag;}
90c70b48 55 void SetFillPtHistos(Bool_t flag) {fFillPtHist=flag;}
13d21bbd 56 void SetFillYHistos(Bool_t flag) {fFillYHist=flag;}
90c70b48 57 void SetFillImpactParameterHistos(Bool_t flag) {fFillImpParHist=flag;}
a8ce111e 58 void SetSystem(Int_t sys){fSys=sys; if(fSys==1) SetFillVarHists(kFALSE);}
2b35ac47 59 void SetRejectSDDClusters(Bool_t flag) { fIsRejectSDDClusters=flag; }
19f6b9ff 60 void SetUseSelectionBit(Bool_t flag) { fUseSelectionBit=flag; }
90c70b48 61 void SetWriteVariableTree(Bool_t flag) { fWriteVariableTree=flag; }
e2aa82b6 62 void SetDrawDetSignal(Bool_t flag) { fDrawDetSignal=flag; }
63 void SetPIDCheck(Bool_t flag) { fPIDCheck=flag; }
64
6b3e3c78 65
66 Bool_t GetCutOnDistr() const {return fCutOnDistr;}
67 Bool_t GetUsePid4Distr() const {return fUsePid4Distr;}
449b1302 68 Int_t GetFillOnlyD0D0bar() const {return fFillOnlyD0D0bar;}
90c70b48 69 Bool_t GetFillVarHists() const {return fFillVarHists;}
70 Bool_t GetFillPtHistos() const {return fFillPtHist;}
13d21bbd 71 Bool_t GetFillYHistos() const {return fFillYHist;}
90c70b48 72 Bool_t GetFillImpactParameterHistos() const {return fFillImpParHist;}
a8ce111e 73 Int_t GetSystem() const {return fSys;}
5ba83ee1 74 Bool_t GetRejectSDDClusters() const { return fIsRejectSDDClusters; }
19f6b9ff 75 Bool_t GetUseSelectionBit() const { return fUseSelectionBit; }
90c70b48 76 Bool_t GetWriteVariableTree() const {return fWriteVariableTree;}
e2aa82b6 77 Bool_t GetDrawDetSignal() const {return fDrawDetSignal;}
78 Bool_t GetPIDCheck() const {return fPIDCheck;}
449b1302 79
49061176 80 private:
81
82 AliAnalysisTaskSED0Mass(const AliAnalysisTaskSED0Mass &source);
83 AliAnalysisTaskSED0Mass& operator=(const AliAnalysisTaskSED0Mass& source);
e2aa82b6 84 void DrawDetSignal(AliAODRecoDecayHF2Prong *part, TList *ListDetSignal);
85
90c70b48 86 void FillMassHists(AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi *cuts, TList *listout);
4e61a020 87 void FillVarHists(AliAODEvent *aodev,AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliRDHFCutsD0toKpi *cuts, TList *listout);
d7688946 88 AliAODVertex* GetPrimaryVtxSkipped(AliAODEvent *aodev);
90c70b48 89 void CreateImpactParameterHistos();
90 Int_t CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const;
91 Float_t GetTrueImpactParameter(AliAODMCHeader *mcHeader, TClonesArray* arrayMC, AliAODMCParticle *partD0) const ;
4e61a020 92
6b3e3c78 93 TList *fOutputMass; //! list send on output slot 1
90c70b48 94 TList *fOutputMassPt; //! list send on output slot 6
13d21bbd 95 TList *fOutputMassY; //! list send on output slot 9
6b3e3c78 96 TList *fDistr; //! list send on output slot 2
97 TH1F *fNentries; //! histogram with number of events on output slot 3
09f85846 98 AliRDHFCutsD0toKpi *fCuts; // Cuts - sent to output slot 4
90c70b48 99 THnSparseF *fHistMassPtImpParTC[5]; //! histograms for impact paramter studies
6b3e3c78 100 Int_t fArray; // can be D0 or Like Sign candidates
101 Bool_t fReadMC; // flag for MC array: kTRUE = read it, kFALSE = do not read it
102 Bool_t fCutOnDistr; // flag to decide if apply cut also on distributions: 0 no cuts, 1 looser cuts, 2 tighter cuts
103 Bool_t fUsePid4Distr; // flag to use the particle identification to fill the signal histograms of distributions. It has effect only with fReadMC=kFALSE
90c70b48 104 AliNormalizationCounter *fCounter;//!AliNormalizationCounter on output slot 5
6b3e3c78 105 Int_t fNPtBins; // number of pt bins
6b3e3c78 106 Double_t fLsNormalization; // normalization
449b1302 107 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)
d7688946 108 TObjArray fDaughterTracks; // keeps the daughter tracks
109 Int_t fIsSelectedCandidate; // selection outcome
110 Bool_t fFillVarHists; // flag to enable filling variable histos
a8ce111e 111 Int_t fSys; // fSys=0 -> p-p; fSys=1 ->PbPb (in this case fFillVarHists=kFALSE by default: set it to kTRUE *after* if needed)
2b35ac47 112 Bool_t fIsRejectSDDClusters; // flag to reject events with SDD clusters
90c70b48 113 Bool_t fFillPtHist; // flag to fill Pt and Impact Parameter Histograms
13d21bbd 114 Bool_t fFillYHist; // flag to fill Y Histograms
90c70b48 115 Bool_t fFillImpParHist; // flag to fill Pt and Impact Parameter Histograms
19f6b9ff 116 Bool_t fUseSelectionBit; // flag to check or not the selection bit
6b3e3c78 117
90c70b48 118 Bool_t fWriteVariableTree; // flag to decide whether to write the candidate variables on a tree variables
119 TTree *fVariablesTree; //! tree of the candidate variables after track selection on output slot 7
120 Double_t *fCandidateVariables; //! variables to be written to the tree
e2aa82b6 121 Bool_t fPIDCheck; // flag to decide whether to fill "PID = x" bins in fNentrie
122 Bool_t fDrawDetSignal; // flag to decide whether to draw the TPC dE/dx and TOF signal before/after PID
123 TList *fDetSignal; //!Detector signal histograms (on output slot 8)
90c70b48 124
13d21bbd 125 ClassDef(AliAnalysisTaskSED0Mass,19); // AliAnalysisTaskSE for D0->Kpi
49061176 126};
127
128#endif
87020237 129