]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/UserTasks/AliAnalysisTaskPIDV0base.h
Merge branch 'TPCdev' of https://git.cern.ch/reps/AliRoot into TPCdev
[u/mrichter/AliRoot.git] / PWGJE / UserTasks / AliAnalysisTaskPIDV0base.h
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
31 class AliAnalysisTaskPIDV0base : public AliAnalysisTaskSE {
32  public:
33   enum TPCcutType { kNoCut = 0, kTPCCutMIGeo = 1, kTPCnclCut = 2 };
34   AliAnalysisTaskPIDV0base();
35   AliAnalysisTaskPIDV0base(const char *name);
36   virtual ~AliAnalysisTaskPIDV0base();
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:
96   static Double_t fgCutGeo;   // Cut variable for TPCCutMIGeo concerning geometry
97   static Double_t fgCutNcr; // Cut variable for TPCCutMIGeo concerning num crossed rows
98   static Double_t fgCutNcl;  // Cut variable for TPCCutMIGeo concerning num clusters
99   
100   static UShort_t fgCutPureNcl; // Cut variable for TPCnclCut
101   
102   AliVEvent   *fEvent;    //! VEvent object
103   AliESDEvent *fESD;      //! ESDEvent object, if ESD
104   AliMCEvent  *fMC;       //! MC object
105
106   AliPIDResponse *fPIDResponse;    //! PID response Handler
107   AliESDv0KineCuts *fV0KineCuts;       //! ESD V0 kine cuts
108   
109   Bool_t fIsPbpOrpPb;       // Pbp/pPb collision or something else?
110   Bool_t fUsePhiCut;        // Use cut on phi (useful for TPC)
111   TPCcutType fTPCcutType;   // Type of TPC cut to be used
112   Double_t fZvtxCutEvent;   // Vertex z cut for the event (cm)
113   Double_t fEtaCut;         // Eta cut
114   
115   TF1* fPhiCutLow;          // phi prime cut, low
116   TF1* fPhiCutHigh;         // phi prime cut, high
117   
118   TRandom3* fRandom;        //! Can be used to statistically determine the shape in the pt bins e.g.
119   
120   AliAnalysisFilter* fTrackFilter; // Track Filter
121   
122
123   Int_t fNumTagsStored;     // Number of entries of fV0tags
124   Char_t* fV0tags;         //! Pointer to array with tags for identified particles from V0 decays
125   
126   Bool_t fStoreMotherIndex; // Switch on/off storing the mother indices of V0 daughters
127   Int_t* fV0motherIndex; //! Pointer to array with index of the mother V0
128   
129  private:
130   void FillV0PIDlist(AliESDEvent* esdEvent = 0x0);
131   void ClearV0PIDlist();
132   
133   AliAnalysisTaskPIDV0base(const AliAnalysisTaskPIDV0base&); // not implemented
134   AliAnalysisTaskPIDV0base& operator=(const AliAnalysisTaskPIDV0base&); // not implemented
135   
136   ClassDef(AliAnalysisTaskPIDV0base, 1);
137 };
138
139
140
141 inline Float_t AliAnalysisTaskPIDV0base::GetDeltaTOF(const AliVTrack *track, const AliTOFPIDResponse* tofPIDresponse,
142                                                      const Double_t* times, AliPID::EParticleType type) const
143 {
144   return (track->GetTOFsignal() - tofPIDresponse->GetStartTime(track->P()) - times[type]);
145 }
146
147 #endif