]>
Commit | Line | Data |
---|---|---|
493982d9 ML |
1 | #ifndef ALIANALYSISTASKPIDV0BASE_H |
2 | #define ALIANALYSISTASKPIDV0BASE_H | |
3 | ||
4 | /* | |
5 | This class is a base class for all other | |
6 | analysis tasks that use V0's. | |
7 | It provides basics for V0 identification. | |
8 | In addition, some further basic functions are provided. | |
9 | ||
10 | Class written by Benjamin Hess. | |
11 | Contact: bhess@cern.ch | |
12 | */ | |
13 | ||
14 | class TF1; | |
15 | class TRandom3; | |
16 | class TObjArray; | |
17 | class AliVEvent; | |
18 | class AliESDEvent; | |
19 | class AliMCEvent; | |
20 | class AliPIDResponse; | |
21 | class AliESDv0KineCuts; | |
22 | class AliPID; | |
23 | class AliAnalysisFilter; | |
24 | class AliVTrack; | |
25 | ||
26 | #include <TTreeStream.h> | |
27 | #include "AliInputEventHandler.h" | |
28 | #include "AliTOFPIDResponse.h" | |
29 | #include "AliAnalysisTaskSE.h" | |
e72b99b6 | 30 | #include "AliAnalysisUtils.h" |
493982d9 ML |
31 | |
32 | class AliAnalysisTaskPIDV0base : public AliAnalysisTaskSE { | |
33 | public: | |
1a8d4484 | 34 | enum PileUpRejectionType { kPileUpRejectionOff = 0, kPileUpRejectionSPD = 1, kPileUpRejectionMV = 2 }; |
493982d9 ML |
35 | enum TPCcutType { kNoCut = 0, kTPCCutMIGeo = 1, kTPCnclCut = 2 }; |
36 | AliAnalysisTaskPIDV0base(); | |
37 | AliAnalysisTaskPIDV0base(const char *name); | |
38 | virtual ~AliAnalysisTaskPIDV0base(); | |
39 | ||
40 | virtual void UserCreateOutputObjects(); | |
41 | virtual void UserExec(Option_t *option); | |
42 | virtual void Terminate(const Option_t*); | |
43 | ||
4b4d71d4 | 44 | virtual Bool_t GetVertexIsOk(AliVEvent* event, Bool_t doVtxZcut = kTRUE) const; |
1a8d4484 | 45 | |
46 | virtual Bool_t GetIsPileUp(AliVEvent* event, PileUpRejectionType pileUpRejectionType) const; | |
493982d9 ML |
47 | |
48 | virtual Bool_t GetIsPbpOrpPb() const { return fIsPbpOrpPb; }; | |
49 | virtual void SetIsPbpOrpPb(Bool_t newValue) { fIsPbpOrpPb = newValue; }; | |
50 | ||
51 | virtual Double_t GetZvtxCutEvent() const { return fZvtxCutEvent; }; | |
e72b99b6 | 52 | virtual void SetZvtxCutEvent(Double_t newValue) { fZvtxCutEvent = newValue; if (fAnaUtils) fAnaUtils->SetMaxVtxZ(fZvtxCutEvent);}; |
493982d9 ML |
53 | |
54 | virtual Bool_t GetUsePhiCut() const { return fUsePhiCut; }; | |
55 | virtual void SetUsePhiCut(Bool_t newValue) { fUsePhiCut = newValue; }; | |
56 | ||
57 | virtual TPCcutType GetTPCcutType() const { return fTPCcutType; }; | |
58 | virtual Bool_t GetUseTPCCutMIGeo() const { return (fTPCcutType == kTPCCutMIGeo); }; | |
59 | virtual Bool_t GetUseTPCnclCut() const { return (fTPCcutType == kTPCnclCut); }; | |
60 | ||
61 | virtual void SetTPCcutType(TPCcutType newType) { fTPCcutType = newType; }; | |
62 | ||
63 | virtual Double_t GetEtaCut() const { return fEtaCut; }; | |
64 | virtual void SetEtaCut(Double_t etaCut){ fEtaCut = etaCut; }; | |
65 | ||
66 | virtual const AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; }; | |
67 | virtual void SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;} | |
68 | ||
69 | virtual Char_t GetV0tag(Int_t trackIndex) const; | |
70 | ||
71 | virtual Bool_t GetStoreMotherIndex() const { return fStoreMotherIndex; }; | |
72 | virtual void SetStoreMotherIndex(Bool_t newValue) { fStoreMotherIndex = newValue; }; | |
73 | ||
74 | virtual Int_t GetV0motherIndex(Int_t trackIndex) const; | |
75 | ||
76 | virtual Double_t GetPhiPrime(Double_t phi, Double_t magField, Int_t charge) const; | |
77 | virtual Bool_t PhiPrimeCut(const AliVTrack* track, Double_t magField) const; | |
78 | virtual Bool_t PhiPrimeCut(Double_t trackPt, Double_t trackPhi, Short_t trackCharge, Double_t magField) const; | |
79 | virtual Float_t GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse, const Double_t* times, | |
80 | AliPID::EParticleType type) const; | |
81 | ||
82 | static Double_t GetCutGeo() { return fgCutGeo; }; | |
83 | static Double_t GetCutNcr() { return fgCutNcr; }; | |
84 | static Double_t GetCutNcl() { return fgCutNcl; }; | |
85 | ||
86 | static void SetCutGeo(Double_t value) { fgCutGeo = value; }; | |
87 | static void SetCutNcr(Double_t value) { fgCutNcr = value; }; | |
88 | static void SetCutNcl(Double_t value) { fgCutNcl = value; }; | |
89 | ||
90 | static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliVEvent* evt, TTreeStream* streamer = 0x0); | |
91 | static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliInputEventHandler* evtHandler, TTreeStream* streamer = 0x0) | |
92 | { if (!evtHandler) return kFALSE; return TPCCutMIGeo(track, evtHandler->GetEvent(), streamer); }; | |
93 | ||
94 | static UShort_t GetCutPureNcl() { return fgCutPureNcl; }; | |
95 | static void SetCutPureNcl(UShort_t value) { fgCutPureNcl = value; }; | |
96 | ||
97 | static Bool_t TPCnclCut(const AliVTrack* track); | |
98 | ||
99 | protected: | |
cdcd2d51 | 100 | void FillV0PIDlist(AliESDEvent* esdEvent = 0x0); |
101 | void ClearV0PIDlist(); | |
102 | ||
493982d9 ML |
103 | static Double_t fgCutGeo; // Cut variable for TPCCutMIGeo concerning geometry |
104 | static Double_t fgCutNcr; // Cut variable for TPCCutMIGeo concerning num crossed rows | |
105 | static Double_t fgCutNcl; // Cut variable for TPCCutMIGeo concerning num clusters | |
106 | ||
107 | static UShort_t fgCutPureNcl; // Cut variable for TPCnclCut | |
108 | ||
109 | AliVEvent *fEvent; //! VEvent object | |
110 | AliESDEvent *fESD; //! ESDEvent object, if ESD | |
111 | AliMCEvent *fMC; //! MC object | |
112 | ||
113 | AliPIDResponse *fPIDResponse; //! PID response Handler | |
114 | AliESDv0KineCuts *fV0KineCuts; //! ESD V0 kine cuts | |
115 | ||
1a8d4484 | 116 | AliAnalysisUtils *fAnaUtils; //! Object to use analysis utils like pile-up rejection |
117 | ||
493982d9 ML |
118 | Bool_t fIsPbpOrpPb; // Pbp/pPb collision or something else? |
119 | Bool_t fUsePhiCut; // Use cut on phi (useful for TPC) | |
120 | TPCcutType fTPCcutType; // Type of TPC cut to be used | |
121 | Double_t fZvtxCutEvent; // Vertex z cut for the event (cm) | |
122 | Double_t fEtaCut; // Eta cut | |
123 | ||
124 | TF1* fPhiCutLow; // phi prime cut, low | |
125 | TF1* fPhiCutHigh; // phi prime cut, high | |
126 | ||
127 | TRandom3* fRandom; //! Can be used to statistically determine the shape in the pt bins e.g. | |
128 | ||
129 | AliAnalysisFilter* fTrackFilter; // Track Filter | |
130 | ||
131 | ||
132 | Int_t fNumTagsStored; // Number of entries of fV0tags | |
133 | Char_t* fV0tags; //! Pointer to array with tags for identified particles from V0 decays | |
134 | ||
135 | Bool_t fStoreMotherIndex; // Switch on/off storing the mother indices of V0 daughters | |
136 | Int_t* fV0motherIndex; //! Pointer to array with index of the mother V0 | |
137 | ||
138 | private: | |
493982d9 ML |
139 | AliAnalysisTaskPIDV0base(const AliAnalysisTaskPIDV0base&); // not implemented |
140 | AliAnalysisTaskPIDV0base& operator=(const AliAnalysisTaskPIDV0base&); // not implemented | |
141 | ||
e72b99b6 | 142 | ClassDef(AliAnalysisTaskPIDV0base, 3); |
493982d9 ML |
143 | }; |
144 | ||
145 | ||
146 | ||
147 | inline Float_t AliAnalysisTaskPIDV0base::GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse, | |
148 | const Double_t* times, AliPID::EParticleType type) const | |
149 | { | |
150 | return (track->GetTOFsignal() - tofPIDresponse->GetStartTime(track->P()) - times[type]); | |
151 | } | |
152 | ||
153 | #endif |