Updates to Trains. create a job-script to help
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / IdentifiedHighPt / grid / AliAnalysisTaskHighPtDeDxV0.h
CommitLineData
4ebdd20e 1#ifndef ALIANALYSISTASKHIGHPTDEDXV0_H
2#define ALIANALYSISTASKHIGHPTDEDXV0_H
3
4// ROOT includes
5#include <TList.h>
6#include <TH1.h>
7#include <TTreeStream.h>
8#include <TObject.h>
9
10// AliRoot includes
11#include <AliAnalysisTaskSE.h>
12#include <AliESDEvent.h>
13#include <AliAODEvent.h>
14#include <AliAnalysisFilter.h>
15#include <AliStack.h>
16#include <AliGenEventHeader.h>
17#include <AliVHeader.h>
18#include <AliAODMCParticle.h>
19
20#include <DebugClasses.C>
21
22
23class AliAnalysisTaskHighPtDeDxV0 : public AliAnalysisTaskSE {
24 public:
25 enum AnalysisMode { kInvalid = -1, kGlobalTrk = 0x1, kTPCTrk = 0x2 };
26 AliAnalysisTaskHighPtDeDxV0();
27 AliAnalysisTaskHighPtDeDxV0(const char *name);
28
29 virtual ~AliAnalysisTaskHighPtDeDxV0();
30
31 virtual void UserCreateOutputObjects();
32 virtual void UserExec(Option_t *option);
33
34 Bool_t GetAnalysisMC() { return fAnalysisMC; }
35 Double_t GetVtxCut() { return fVtxCut; }
36 Double_t GetEtaCut() { return fEtaCut; }
37 Double_t GetMinPt() { return fMinPt; }
38 Int_t GetTreeOption() { return fTreeOption; }
39
40 virtual void SetTrigger1(UInt_t ktriggerInt1) {ftrigBit1 = ktriggerInt1;}
41 virtual void SetTrigger2(UInt_t ktriggerInt2) {ftrigBit2 = ktriggerInt2;}
42 virtual void SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}
43 virtual void SetTrackFilterGolden(AliAnalysisFilter* trackF) {fTrackFilterGolden = trackF;}
44 virtual void SetTrackFilterTPC(AliAnalysisFilter* trackF) {fTrackFilterTPC = trackF;}
45 virtual void SetProduceTPCBranch(Bool_t prodtpcb) {fTPCBranch = prodtpcb;}
46 virtual void SetAnalysisType(const char* analysisType) {fAnalysisType = analysisType;}
47 virtual void SetAnalysisMC(Bool_t isMC) {fAnalysisMC = isMC;}
48 virtual void SetVtxCut(Double_t vtxCut){fVtxCut = vtxCut;}
49 virtual void SetEtaCut(Double_t etaCut){fEtaCut = etaCut;}
50 virtual void SetMinPt(Double_t value) {fMinPt = value;}
51 virtual void SetMinCent(Float_t minvalc) {fMinCent = minvalc;}
52 virtual void SetMaxCent(Float_t maxvalc) {fMaxCent = maxvalc;}
53 virtual void SetMassCut(Double_t massCut){fMassCut = massCut;}
54 virtual void SetTreeOption(Int_t value) {fTreeOption = value;}
55 virtual void SetRequireRecV0(Bool_t value) {fRequireRecV0 = value;}
56 virtual void SetStoreMcIn(Bool_t value) {fStoreMcIn = value;}
57 virtual void SetAnalysisPbPb(Bool_t isanaPbPb) {fAnalysisPbPb = isanaPbPb;}
58
59 private:
60 virtual Float_t GetVertex(const AliVEvent* event) const;
61 virtual void AnalyzeESD(AliESDEvent* esd);
62 virtual void AnalyzeAOD(AliAODEvent* aod);
63 virtual void ProduceArrayTrksESD(AliESDEvent* event, AnalysisMode anamode );
64 virtual void ProduceArrayTrksAOD(AliAODEvent* event, AnalysisMode anamode );
65 Short_t GetPidCode(Int_t pdgCode) const;
66 void ProcessMCTruthESD();
67 void ProcessMCTruthAOD();
68 void Sort(TClonesArray* array, Bool_t isMC);
69 Short_t GetPythiaEventProcessType(Int_t pythiaType);
70 Short_t GetDPMjetEventProcessType(Int_t dpmJetType);
71 ULong64_t GetEventIdAsLong(AliVHeader* header) const;
72
73 TParticle* FindPrimaryMother(AliStack* stack, Int_t label);
74 Int_t FindPrimaryMotherLabel(AliStack* stack, Int_t label, Int_t& nSteps);
75
76 AliAODMCParticle* FindPrimaryMotherAOD(AliAODMCParticle* startParticle, Int_t& nSteps);
77
78 static const Double_t fgkClight; // Speed of light (cm/ps)
79
80 AliESDEvent* fESD; //! ESD object
81 AliAODEvent* fAOD; //! AOD object
82 AliMCEvent* fMC; //! MC object
83 AliStack* fMCStack; //! MC ESD stack
84 TClonesArray* fMCArray; //! MC array for AOD
85 AliAnalysisFilter* fTrackFilter; // Track Filter, old cuts 2010
86 AliAnalysisFilter* fTrackFilterGolden; // Track Filter, set 2010 with golden cuts
87 AliAnalysisFilter* fTrackFilterTPC; // track filter for TPC only tracks
88 Bool_t fTPCBranch; //tru if you want to produce the TPC branch
89 TString fAnalysisType; // "ESD" or "AOD"
90 Bool_t fAnalysisMC; // Real(kFALSE) or MC(kTRUE) flag
91 Bool_t fAnalysisPbPb; // true you want to analyze PbPb data, false for pp
92 DeDxEvent* fEvent; //! event pointer
93 TClonesArray* fV0ArrayGlobalPar; //! V0 array pointer, global tracks
94 TClonesArray* fV0ArrayTPCPar; //! V0 array pointer, tpc tracks
95 TClonesArray* fTrackArrayMC; //! MC track array pointer
96
97 //
98 // Cuts and options
99 //
100 UInt_t ftrigBit1;
101 UInt_t ftrigBit2;
102 Double_t fVtxCut; // Vtx cut on z position in cm
103 Double_t fEtaCut; // Eta cut used to select particles
104 Double_t fMinPt; // Min pt - for histogram limits
105 Double_t fMassCut; // Reject all v0 with all dmass > masscut!
106 Int_t fTreeOption; // 0: no tree, >0: enable debug tree
107 Float_t fMinCent; //minimum centrality
108 Float_t fMaxCent; //maximum centrality
109 Bool_t fRequireRecV0; // Require a v0 before updating tree
110 // For a spectra analysis we will need to
111 // keep track also of the empty events
112 Bool_t fStoreMcIn; // Store MC input tracks
113 //
114 // Help variables
115 //
116 Short_t fMcProcessType; // -1=invalid, 0=data, 1=ND, 2=SD, 3=DD
117 Short_t fTriggeredEventMB; // 1 = triggered, 0 = not trigged (MC only)
118 Short_t fVtxStatus; // -1 = no vtx, 0 = outside cut, 1 = inside cut
119 Float_t fZvtx; // z vertex
120 Float_t fZvtxMC; // z vertex MC (truth)
121 Int_t fRun; // run no
122 ULong64_t fEventId; // unique event id
123
124 //
125 // Output objects
126 //
127 TList* fListOfObjects; //! Output list of objects
128 TH1I* fEvents; //! No of accepted events
129 TH1I* fVtx; //! Event vertex info
130 TH1F * fnv0;
131 TH1I* fVtxMC; //! Event vertex info for ALL MC events
132 TH1F* fVtxBeforeCuts; //! Vertex z dist before cuts
133 TH1F* fVtxAfterCuts; //! Vertex z dist after cuts
134 TTree* fTree; //! Debug tree
135
136 ClassDef(AliAnalysisTaskHighPtDeDxV0, 1); //Analysis task for high pt v0 analysis
137};
138
139#endif