AliPhysics  d497afb (d497afb)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskPIDV0base.h
Go to the documentation of this file.
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"
30 #include "AliAnalysisUtils.h"
31 
33  public:
34 
37  enum TPCcutType { kNoCut = 0, kTPCCutMIGeo = 1, kTPCnclCut = 2 };
39  AliAnalysisTaskPIDV0base(const char *name);
40  virtual ~AliAnalysisTaskPIDV0base();
41 
42  virtual void UserCreateOutputObjects();
43  virtual void UserExec(Option_t *option);
44  virtual void Terminate(const Option_t*);
45 
46  virtual Bool_t GetVertexIsOk(AliVEvent* event, Bool_t doVtxZcut = kTRUE) const;
47 
48  virtual Bool_t GetIsPileUp(AliVEvent* event, PileUpRejectionType pileUpRejection = kPileUpRejectionClass) const;
49 
50  RunMode GetRunMode() const { return fRunMode; };
51  void SetRunMode(RunMode flag) { fRunMode = flag; };
52 
55 
56  virtual Int_t GetMinPlpContribSPD() const { return fMinPlpContribSPD; };
57  virtual void SetMinPlpContribSPD(Int_t newValue) { fMinPlpContribSPD = newValue; };
58 
59  virtual Bool_t GetIsPbpOrpPb() const { return fIsPbpOrpPb; };
60  virtual void SetIsPbpOrpPb(Bool_t newValue) { fIsPbpOrpPb = newValue; };
61 
62  virtual Double_t GetZvtxCutEvent() const { return fZvtxCutEvent; };
63  virtual void SetZvtxCutEvent(Double_t newValue) { fZvtxCutEvent = newValue; if (fAnaUtils) fAnaUtils->SetMaxVtxZ(fZvtxCutEvent);};
64 
65  virtual Bool_t GetUsePhiCut() const { return fUsePhiCut; };
66  virtual void SetUsePhiCut(Bool_t newValue) { fUsePhiCut = newValue; };
67 
68  virtual TPCcutType GetTPCcutType() const { return fTPCcutType; };
69  virtual Bool_t GetUseTPCCutMIGeo() const { return (fTPCcutType == kTPCCutMIGeo); };
70  virtual Bool_t GetUseTPCnclCut() const { return (fTPCcutType == kTPCnclCut); };
71 
72  virtual void SetTPCcutType(TPCcutType newType) { fTPCcutType = newType; };
73 
74  virtual Double_t GetEtaCut() const { return fEtaCut; };
75  virtual void SetEtaCut(Double_t etaCut){ fEtaCut = etaCut; };
76 
77  virtual const AliAnalysisFilter* GetTrackFilter() const { return fTrackFilter; };
78  virtual void SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}
79 
80  virtual Char_t GetV0tag(Int_t trackIndex) const;
81 
82  virtual Bool_t GetStoreMotherIndex() const { return fStoreMotherIndex; };
83  virtual void SetStoreMotherIndex(Bool_t newValue) { fStoreMotherIndex = newValue; };
84 
85  virtual Int_t GetV0motherIndex(Int_t trackIndex) const;
86 
87  virtual Double_t GetPhiPrime(Double_t phi, Double_t magField, Int_t charge) const;
88  virtual Bool_t PhiPrimeCut(const AliVTrack* track, Double_t magField) const;
89  virtual Bool_t PhiPrimeCut(Double_t trackPt, Double_t trackPhi, Short_t trackCharge, Double_t magField) const;
90  virtual Float_t GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse, const Double_t* times,
91  AliPID::EParticleType type) const;
92 
93  static Double_t GetCutGeo() { return fgCutGeo; };
94  static Double_t GetCutNcr() { return fgCutNcr; };
95  static Double_t GetCutNcl() { return fgCutNcl; };
96 
97  static void SetCutGeo(Double_t value) { fgCutGeo = value; };
98  static void SetCutNcr(Double_t value) { fgCutNcr = value; };
99  static void SetCutNcl(Double_t value) { fgCutNcl = value; };
100 
101  static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliVEvent* evt, TTreeStream* streamer = 0x0);
102  static Bool_t TPCCutMIGeo(const AliVTrack* track, const AliInputEventHandler* evtHandler, TTreeStream* streamer = 0x0)
103  { if (!evtHandler) return kFALSE; return TPCCutMIGeo(track, evtHandler->GetEvent(), streamer); };
104 
105  static UShort_t GetCutPureNcl() { return fgCutPureNcl; };
106  static void SetCutPureNcl(UShort_t value) { fgCutPureNcl = value; };
107 
108  static Bool_t TPCnclCut(const AliVTrack* track);
109 
110  protected:
111  void FillV0PIDlist(AliESDEvent* esdEvent = 0x0);
112  void ClearV0PIDlist();
113 
114  static Double_t fgCutGeo; // Cut variable for TPCCutMIGeo concerning geometry
115  static Double_t fgCutNcr; // Cut variable for TPCCutMIGeo concerning num crossed rows
116  static Double_t fgCutNcl; // Cut variable for TPCCutMIGeo concerning num clusters
117 
118  static UShort_t fgCutPureNcl; // Cut variable for TPCnclCut
119 
120  AliVEvent *fEvent;
122  AliMCEvent *fMC;
123 
124  AliPIDResponse *fPIDResponse;
125  AliESDv0KineCuts *fV0KineCuts;
126 
127  AliAnalysisUtils *fAnaUtils;
128 
130  PileUpRejectionType fPileUpRejectionType; // Which pile-up rejection is used (if any)
131  Int_t fMinPlpContribSPD; //Minimum of SPD contributors to vertext (used for Pile-Up rejection)
132 
133  Bool_t fIsPbpOrpPb; // Pbp/pPb collision or something else?
134  Bool_t fUsePhiCut; // Use cut on phi (useful for TPC)
135  TPCcutType fTPCcutType; // Type of TPC cut to be used
136  Double_t fZvtxCutEvent; // Vertex z cut for the event (cm)
137  Double_t fEtaCut; // Eta cut
138 
139  TF1* fPhiCutLow; // phi prime cut, low
140  TF1* fPhiCutHigh; // phi prime cut, high
141 
142  TRandom3* fRandom;
143 
144  AliAnalysisFilter* fTrackFilter; // Track Filter
145 
146 
147  Int_t fNumTagsStored; // Number of entries of fV0tags
149 
150  Bool_t fStoreMotherIndex; // Switch on/off storing the mother indices of V0 daughters
152 
153  private:
154  AliAnalysisTaskPIDV0base(const AliAnalysisTaskPIDV0base&); // not implemented
155  AliAnalysisTaskPIDV0base& operator=(const AliAnalysisTaskPIDV0base&); // not implemented
156 
157  ClassDef(AliAnalysisTaskPIDV0base, 3);
158 };
159 
160 
161 
162 inline Float_t AliAnalysisTaskPIDV0base::GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse,
163  const Double_t* times, AliPID::EParticleType type) const
164 {
165  return (track->GetTOFsignal() - tofPIDresponse->GetStartTime(track->P()) - times[type]);
166 }
167 
168 #endif
Int_t charge
virtual Bool_t GetIsPbpOrpPb() const
virtual void Terminate(const Option_t *)
virtual Double_t GetZvtxCutEvent() const
virtual Int_t GetMinPlpContribSPD() const
virtual Float_t GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse *tofPIDresponse, const Double_t *times, AliPID::EParticleType type) const
double Double_t
Definition: External.C:58
static void SetCutGeo(Double_t value)
AliAnalysisFilter * fTrackFilter
Can be used to statistically determine the shape in the pt bins e.g.
PileUpRejectionType GetPileUpRejectionType() const
static Bool_t TPCCutMIGeo(const AliVTrack *track, const AliInputEventHandler *evtHandler, TTreeStream *streamer=0x0)
static Bool_t TPCCutMIGeo(const AliVTrack *track, const AliVEvent *evt, TTreeStream *streamer=0x0)
virtual void SetZvtxCutEvent(Double_t newValue)
char Char_t
Definition: External.C:18
Bool_t fStoreMotherIndex
Pointer to array with tags for identified particles from V0 decays.
virtual void SetStoreMotherIndex(Bool_t newValue)
virtual Bool_t GetUseTPCCutMIGeo() const
virtual Double_t GetPhiPrime(Double_t phi, Double_t magField, Int_t charge) const
virtual void SetTPCcutType(TPCcutType newType)
virtual Bool_t GetUseTPCnclCut() const
virtual Bool_t GetUsePhiCut() const
virtual void SetTrackFilter(AliAnalysisFilter *trackF)
virtual Bool_t GetIsPileUp(AliVEvent *event, PileUpRejectionType pileUpRejection=kPileUpRejectionClass) const
virtual Bool_t PhiPrimeCut(const AliVTrack *track, Double_t magField) const
virtual Double_t GetEtaCut() const
AliPIDResponse * fPIDResponse
MC object.
virtual void SetUsePhiCut(Bool_t newValue)
virtual Int_t GetV0motherIndex(Int_t trackIndex) const
AliESDv0KineCuts * fV0KineCuts
PID response Handler.
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
virtual Bool_t GetStoreMotherIndex() const
AliAnalysisUtils * fAnaUtils
ESD V0 kine cuts.
static void SetCutNcr(Double_t value)
virtual void UserExec(Option_t *option)
static Bool_t TPCnclCut(const AliVTrack *track)
PileUpRejectionType fPileUpRejectionType
void SetPileUpRejectionType(PileUpRejectionType newType)
RunMode fRunMode
Object to use analysis utils like pile-up rejection.
virtual void SetEtaCut(Double_t etaCut)
virtual void SetIsPbpOrpPb(Bool_t newValue)
short Short_t
Definition: External.C:23
virtual TPCcutType GetTPCcutType() const
virtual Char_t GetV0tag(Int_t trackIndex) const
AliESDEvent * fESD
VEvent object.
AliMCEvent * fMC
ESDEvent object, if ESD.
AliAnalysisTaskPIDV0base & operator=(const AliAnalysisTaskPIDV0base &)
virtual Bool_t GetVertexIsOk(AliVEvent *event, Bool_t doVtxZcut=kTRUE) const
unsigned short UShort_t
Definition: External.C:28
static void SetCutPureNcl(UShort_t value)
const char Option_t
Definition: External.C:48
virtual const AliAnalysisFilter * GetTrackFilter() const
bool Bool_t
Definition: External.C:53
static void SetCutNcl(Double_t value)
void FillV0PIDlist(AliESDEvent *esdEvent=0x0)
virtual void SetMinPlpContribSPD(Int_t newValue)