1 #ifndef ALIANALYSISTASKPIDV0BASE_H
2 #define ALIANALYSISTASKPIDV0BASE_H
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.
10 Class written by Benjamin Hess.
11 Contact: bhess@cern.ch
21 class AliESDv0KineCuts;
23 class AliAnalysisFilter;
26 #include <TTreeStream.h>
27 #include "AliInputEventHandler.h"
28 #include "AliTOFPIDResponse.h"
29 #include "AliAnalysisTaskSE.h"
31 class AliAnalysisTaskPIDV0base : public AliAnalysisTaskSE {
33 enum TPCcutType { kNoCut = 0, kTPCCutMIGeo = 1, kTPCnclCut = 2 };
34 AliAnalysisTaskPIDV0base();
35 AliAnalysisTaskPIDV0base(const char *name);
36 virtual ~AliAnalysisTaskPIDV0base();
38 virtual void UserCreateOutputObjects();
39 virtual void UserExec(Option_t *option);
40 virtual void Terminate(const Option_t*);
42 virtual Bool_t GetVertexIsOk(AliVEvent* event, Bool_t doVtxZcut = kTRUE) const;
44 virtual Bool_t GetIsPbpOrpPb() const { return fIsPbpOrpPb; };
45 virtual void SetIsPbpOrpPb(Bool_t newValue) { fIsPbpOrpPb = newValue; };
47 virtual Double_t GetZvtxCutEvent() const { return fZvtxCutEvent; };
48 virtual void SetZvtxCutEvent(Double_t newValue) { fZvtxCutEvent = newValue; };
50 virtual Bool_t GetUsePhiCut() const { return fUsePhiCut; };
51 virtual void SetUsePhiCut(Bool_t newValue) { fUsePhiCut = newValue; };
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); };
57 virtual void SetTPCcutType(TPCcutType newType) { fTPCcutType = newType; };
59 virtual Double_t GetEtaCut() const { return fEtaCut; };
60 virtual void SetEtaCut(Double_t etaCut){ fEtaCut = etaCut; };
62 virtual const AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; };
63 virtual void SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}
65 virtual Char_t GetV0tag(Int_t trackIndex) const;
67 virtual Bool_t GetStoreMotherIndex() const { return fStoreMotherIndex; };
68 virtual void SetStoreMotherIndex(Bool_t newValue) { fStoreMotherIndex = newValue; };
70 virtual Int_t GetV0motherIndex(Int_t trackIndex) const;
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;
78 static Double_t GetCutGeo() { return fgCutGeo; };
79 static Double_t GetCutNcr() { return fgCutNcr; };
80 static Double_t GetCutNcl() { return fgCutNcl; };
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; };
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); };
90 static UShort_t GetCutPureNcl() { return fgCutPureNcl; };
91 static void SetCutPureNcl(UShort_t value) { fgCutPureNcl = value; };
93 static Bool_t TPCnclCut(const AliVTrack* track);
96 void FillV0PIDlist(AliESDEvent* esdEvent = 0x0);
97 void ClearV0PIDlist();
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
103 static UShort_t fgCutPureNcl; // Cut variable for TPCnclCut
105 AliVEvent *fEvent; //! VEvent object
106 AliESDEvent *fESD; //! ESDEvent object, if ESD
107 AliMCEvent *fMC; //! MC object
109 AliPIDResponse *fPIDResponse; //! PID response Handler
110 AliESDv0KineCuts *fV0KineCuts; //! ESD V0 kine cuts
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
118 TF1* fPhiCutLow; // phi prime cut, low
119 TF1* fPhiCutHigh; // phi prime cut, high
121 TRandom3* fRandom; //! Can be used to statistically determine the shape in the pt bins e.g.
123 AliAnalysisFilter* fTrackFilter; // Track Filter
126 Int_t fNumTagsStored; // Number of entries of fV0tags
127 Char_t* fV0tags; //! Pointer to array with tags for identified particles from V0 decays
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
133 AliAnalysisTaskPIDV0base(const AliAnalysisTaskPIDV0base&); // not implemented
134 AliAnalysisTaskPIDV0base& operator=(const AliAnalysisTaskPIDV0base&); // not implemented
136 ClassDef(AliAnalysisTaskPIDV0base, 1);
141 inline Float_t AliAnalysisTaskPIDV0base::GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse,
142 const Double_t* times, AliPID::EParticleType type) const
144 return (track->GetTOFsignal() - tofPIDresponse->GetStartTime(track->P()) - times[type]);