]>
Commit | Line | Data |
---|---|---|
88b71b9f | 1 | #ifndef ALITPCPIDBASE_H |
2 | #define ALITPCPIDBASE_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" | |
30 | ||
31 | class AliTPCPIDBase : public AliAnalysisTaskSE { | |
32 | public: | |
33 | enum TPCcutType { kNoCut = 0, kTPCCutMIGeo = 1, kTPCnclCut = 2 }; | |
34 | AliTPCPIDBase(); | |
35 | AliTPCPIDBase(const char *name); | |
36 | virtual ~AliTPCPIDBase(); | |
37 | ||
38 | virtual void UserCreateOutputObjects(); | |
39 | virtual void UserExec(Option_t *option); | |
40 | virtual void Terminate(const Option_t*); | |
41 | ||
42 | virtual Bool_t GetVertexIsOk(AliVEvent* event, Bool_t doVtxZcut = kTRUE) const; | |
43 | ||
44 | virtual Bool_t GetIsPbpOrpPb() const { return fIsPbpOrpPb; }; | |
45 | virtual void SetIsPbpOrpPb(Bool_t newValue) { fIsPbpOrpPb = newValue; }; | |
46 | ||
47 | virtual Double_t GetZvtxCutEvent() const { return fZvtxCutEvent; }; | |
48 | virtual void SetZvtxCutEvent(Double_t newValue) { fZvtxCutEvent = newValue; }; | |
49 | ||
50 | virtual Bool_t GetUsePhiCut() const { return fUsePhiCut; }; | |
51 | virtual void SetUsePhiCut(Bool_t newValue) { fUsePhiCut = newValue; }; | |
52 | ||
53 | virtual TPCcutType GetTPCcutType() const { return fTPCcutType; }; | |
54 | virtual Bool_t GetUseTPCCutMIGeo() const { return (fTPCcutType == kTPCCutMIGeo); }; | |
55 | virtual Bool_t GetUseTPCnclCut() const { return (fTPCcutType == kTPCnclCut); }; | |
56 | ||
57 | virtual void SetTPCcutType(TPCcutType newType) { fTPCcutType = newType; }; | |
58 | ||
59 | virtual Double_t GetEtaCut() const { return fEtaCut; }; | |
60 | virtual void SetEtaCut(Double_t etaCut){ fEtaCut = etaCut; }; | |
61 | ||
62 | virtual const AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; }; | |
63 | virtual void SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;} | |
64 | ||
65 | virtual Char_t GetV0tag(Int_t trackIndex) const; | |
66 | ||
67 | virtual Bool_t GetStoreMotherIndex() const { return fStoreMotherIndex; }; | |
68 | virtual void SetStoreMotherIndex(Bool_t newValue) { fStoreMotherIndex = newValue; }; | |
69 | ||
70 | virtual Int_t GetV0motherIndex(Int_t trackIndex) const; | |
71 | ||
72 | virtual Double_t GetPhiPrime(Double_t phi, Double_t magField, Int_t charge) const; | |
73 | virtual Bool_t PhiPrimeCut(const AliVTrack* track, Double_t magField) const; | |
74 | virtual Bool_t PhiPrimeCut(Double_t trackPt, Double_t trackPhi, Short_t trackCharge, Double_t magField) const; | |
75 | virtual Float_t GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse, const Double_t* times, | |
76 | AliPID::EParticleType type) const; | |
77 | ||
78 | static Double_t GetCutGeo() { return fgCutGeo; }; | |
79 | static Double_t GetCutNcr() { return fgCutNcr; }; | |
80 | static Double_t GetCutNcl() { return fgCutNcl; }; | |
81 | ||
82 | static void SetCutGeo(Double_t value) { fgCutGeo = value; }; | |
83 | static void SetCutNcr(Double_t value) { fgCutNcr = value; }; | |
84 | static void SetCutNcl(Double_t value) { fgCutNcl = value; }; | |
85 | ||
86 | static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliVEvent* evt, TTreeStream* streamer = 0x0); | |
87 | static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliInputEventHandler* evtHandler, TTreeStream* streamer = 0x0) | |
88 | { if (!evtHandler) return kFALSE; return TPCCutMIGeo(track, evtHandler->GetEvent(), streamer); }; | |
89 | ||
90 | static UShort_t GetCutPureNcl() { return fgCutPureNcl; }; | |
91 | static void SetCutPureNcl(UShort_t value) { fgCutPureNcl = value; }; | |
92 | ||
93 | static Bool_t TPCnclCut(const AliVTrack* track); | |
94 | ||
95 | protected: | |
caa5a9ed | 96 | void FillV0PIDlist(AliESDEvent* esdEvent = 0x0); |
97 | void ClearV0PIDlist(); | |
98 | ||
88b71b9f | 99 | static Double_t fgCutGeo; // Cut variable for TPCCutMIGeo concerning geometry |
100 | static Double_t fgCutNcr; // Cut variable for TPCCutMIGeo concerning num crossed rows | |
101 | static Double_t fgCutNcl; // Cut variable for TPCCutMIGeo concerning num clusters | |
102 | ||
103 | static UShort_t fgCutPureNcl; // Cut variable for TPCnclCut | |
104 | ||
105 | AliVEvent *fEvent; //! VEvent object | |
106 | AliESDEvent *fESD; //! ESDEvent object, if ESD | |
107 | AliMCEvent *fMC; //! MC object | |
108 | ||
109 | AliPIDResponse *fPIDResponse; //! PID response Handler | |
110 | AliESDv0KineCuts *fV0KineCuts; //! ESD V0 kine cuts | |
111 | ||
112 | Bool_t fIsPbpOrpPb; // Pbp/pPb collision or something else? | |
113 | Bool_t fUsePhiCut; // Use cut on phi (useful for TPC) | |
114 | TPCcutType fTPCcutType; // Type of TPC cut to be used | |
115 | Double_t fZvtxCutEvent; // Vertex z cut for the event (cm) | |
116 | Double_t fEtaCut; // Eta cut | |
117 | ||
118 | TF1* fPhiCutLow; // phi prime cut, low | |
119 | TF1* fPhiCutHigh; // phi prime cut, high | |
120 | ||
121 | TRandom3* fRandom; //! Can be used to statistically determine the shape in the pt bins e.g. | |
122 | ||
123 | AliAnalysisFilter* fTrackFilter; // Track Filter | |
124 | ||
125 | ||
126 | Int_t fNumTagsStored; // Number of entries of fV0tags | |
127 | Char_t* fV0tags; //! Pointer to array with tags for identified particles from V0 decays | |
128 | ||
129 | Bool_t fStoreMotherIndex; // Switch on/off storing the mother indices of V0 daughters | |
130 | Int_t* fV0motherIndex; //! Pointer to array with index of the mother V0 | |
131 | ||
132 | private: | |
88b71b9f | 133 | |
134 | AliTPCPIDBase(const AliTPCPIDBase&); // not implemented | |
135 | AliTPCPIDBase& operator=(const AliTPCPIDBase&); // not implemented | |
136 | ||
137 | ClassDef(AliTPCPIDBase, 1); | |
138 | }; | |
139 | ||
140 | ||
141 | ||
142 | inline Float_t AliTPCPIDBase::GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse, | |
143 | const Double_t* times, AliPID::EParticleType type) const | |
144 | { | |
145 | return (track->GetTOFsignal() - tofPIDresponse->GetStartTime(track->P()) - times[type]); | |
146 | } | |
147 | ||
148 | #endif |