Splitted the PID cuts into three classes for ITS, TPC and TOF, and added the possibil...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / extra / AliRsnAnalysisPhi7TeV.h
CommitLineData
6279d59e 1//
2// Header file for implementation of data analysis aft 900 GeV
3//
4// Author: A. Pulvirenti
5//
6
7#ifndef ALIRSNANALYSISPHI7TEV_H
8#define ALIRSNANALYSISPHI7TEV_H
9
5faf5a07 10#include "AliRsnDaughter.h"
11#include "AliRsnCutESD2010.h"
6279d59e 12#include "AliAnalysisTaskSE.h"
13#include "AliRsnTOFT0maker.h"
4c06ce33 14#include "AliESDtrackCuts.h"
5faf5a07 15#include "AliPID.h"
6279d59e 16
17class TH1I;
4c06ce33 18class TH1F;
5faf5a07 19class TH3F;
6279d59e 20class TTree;
21
22class AliStack;
23class AliESDEvent;
24class AliESDVertex;
25class AliESDpid;
26class AliTOFT0maker;
27class AliTOFcalib;
28
29class AliRsnAnalysisPhi7TeV : public AliAnalysisTaskSE
30{
31 public:
4c06ce33 32
33 enum
34 {
35 kGoodTracksPrimaryVertex = 0,
36 kGoodSPDPrimaryVertex = 1,
37 kFarTracksPrimaryVertex = 2,
38 kFarSPDPrimaryVertex = 3,
39 kNoGoodPrimaryVertex = 4,
5faf5a07 40 kEmptyEvent = 5
4c06ce33 41 };
6279d59e 42
5faf5a07 43 AliRsnAnalysisPhi7TeV(const char *name = "Phi7TeV", Bool_t isMC = kFALSE);
6279d59e 44 AliRsnAnalysisPhi7TeV(const AliRsnAnalysisPhi7TeV& copy);
45 AliRsnAnalysisPhi7TeV& operator=(const AliRsnAnalysisPhi7TeV& copy);
46 virtual ~AliRsnAnalysisPhi7TeV();
47
5faf5a07 48 void SetUseMC (Bool_t yn = kTRUE);
0d73200d 49 void SetCheckITS(Bool_t yn = kTRUE) {fCheckITS = yn;}
50 void SetCheckTPC(Bool_t yn = kTRUE) {fCheckTPC = yn;}
51 void SetCheckTOF(Bool_t yn = kTRUE) {fCheckTOF = yn;}
5faf5a07 52 void SetAddITSSA(Bool_t yn = kTRUE) {fAddITSSA = yn;}
6279d59e 53
4c06ce33 54 void SetMaxVz(Double_t v) {fMaxVz = v;}
6279d59e 55
4c06ce33 56 void SetITSband(Double_t v) {fMaxITSband = v;}
5faf5a07 57 void SetITSmom (Double_t v) {fMaxITSmom = v;}
4c06ce33 58
59 void SetTPCpLimit(Double_t v) {fTPCpLimit = v;}
60 void SetTPCrange(Double_t min, Double_t max) {fMinTPCband = min; fMaxTPCband = max;}
61 void SetTPCpar(Double_t p0, Double_t p1, Double_t p2, Double_t p3, Double_t p4)
62 {fTPCpar[0]=p0;fTPCpar[1]=p1;fTPCpar[2]=p2;fTPCpar[3]=p3;fTPCpar[4]=p4;}
63
64 void SetTOFcalibrateESD(Bool_t yn = kTRUE) {fTOFcalibrateESD = yn;}
65 void SetTOFcorrectTExp (Bool_t yn = kTRUE) {fTOFcorrectTExp = yn;}
66 void SetTOFuseT0 (Bool_t yn = kTRUE) {fTOFuseT0 = yn;}
67 void SetTOFtuneMC (Bool_t yn = kTRUE) {fTOFtuneMC = yn;}
68 void SetTOFresolution (Double_t v = 100.0) {fTOFresolution = v;}
5faf5a07 69 void SetMinTOF (Double_t v) {fMinTOF = v;}
70 void SetMaxTOF (Double_t v) {fMaxTOF = v;}
4c06ce33 71
72 virtual void UserCreateOutputObjects();
73 virtual void UserExec(Option_t *option = "");
74 virtual void Terminate(Option_t *option = "");
75
76 Int_t EventEval(AliESDEvent *esd);
4c06ce33 77 AliESDtrackCuts* GetCutsTPC() {return &fESDtrackCutsTPC;}
78 AliESDtrackCuts* GetCutsITS() {return &fESDtrackCutsITS;}
5faf5a07 79
80 Bool_t IsITSTPC (AliESDtrack *track);
81 Bool_t IsITSSA (AliESDtrack *track);
82 Bool_t MatchTOF (AliESDtrack *track);
83 Bool_t OkQuality(AliESDtrack *track);
84 Bool_t OkITSPID (AliESDtrack *track, AliPID::EParticleType pid);
85 Bool_t OkTPCPID (AliESDtrack *track, AliPID::EParticleType pid);
86 Bool_t OkTOFPID (AliESDtrack *track, AliPID::EParticleType pid);
87 Bool_t OkTrack (AliESDtrack *track, AliPID::EParticleType pid);
6279d59e 88
89 private:
90
4c06ce33 91 void ProcessESD(AliESDEvent *esd, AliStack *stack);
6279d59e 92
93 Bool_t fUseMC; // use MC or data?
0d73200d 94 Bool_t fCheckITS; // chec ITS PID?
95 Bool_t fCheckTPC; // chec TPC PID?
96 Bool_t fCheckTOF; // chec TOF PID?
5faf5a07 97 Bool_t fAddITSSA; // add ITS standalone?
6279d59e 98
4c06ce33 99 Double_t fMaxVz; // range in Z of primary vertex w.r. to origin
100
101 Double_t fMaxITSband; // range for ITS de/dx band
5faf5a07 102 Double_t fMaxITSmom; // maximum momentum for ITS identification
6279d59e 103
104 Double_t fTPCpLimit; // limit to choose what band to apply
105 Double_t fTPCpar[5]; // parameters for TPC bethe-Bloch
106 Double_t fMinTPCband; // range for TPC de/dx band - min
107 Double_t fMaxTPCband; // range for TPC de/dx band - max
5faf5a07 108 Double_t fMinTOF; // TOF range (min)
109 Double_t fMaxTOF; // TOF range (min)
6279d59e 110
6279d59e 111 TList *fOutList; // list for monitoring histograms
5faf5a07 112 TH3F *fUnlike; // unlike-sign pairs
113 TH3F *fLikePP; // unlike-sign pairs
114 TH3F *fLikeMM; // unlike-sign pairs
115 TH3F *fTrues; // true pairs
6279d59e 116 TH1I *fHEvents; // histogram of event types
4c06ce33 117 TH1F *fVertexX[2]; // histogram of X coordinate of primary vertex ([0] = tracks, [1] = SPD)
118 TH1F *fVertexY[2]; // histogram of Y coordinate of primary vertex ([0] = tracks, [1] = SPD)
119 TH1F *fVertexZ[2]; // histogram of Z coordinate of primary vertex ([0] = tracks, [1] = SPD)
6279d59e 120
6aecf4fd 121 AliESDtrackCuts fESDtrackCutsTPC; // ESD standard defined track cuts for TPC tracks
122 AliESDtrackCuts fESDtrackCutsITS; // ESD standard defined track cuts for ITS-SA tracks
6279d59e 123 AliESDpid *fESDpid; //! PID manager
124 AliTOFT0maker *fTOFmaker; //! TOF time0 computator
125 AliTOFcalib *fTOFcalib; //! TOF calibration
126 Bool_t fTOFcalibrateESD; // TOF settings
127 Bool_t fTOFcorrectTExp; // TOF settings
128 Bool_t fTOFuseT0; // TOF settings
129 Bool_t fTOFtuneMC; // TOF settings
130 Double_t fTOFresolution; // TOF settings
5faf5a07 131
132 AliRsnDaughter fDaughter;
133 AliRsnCutESD2010 fRsnCuts;
6279d59e 134
135 // ROOT dictionary
136 ClassDef(AliRsnAnalysisPhi7TeV,1)
137};
138
5faf5a07 139inline Bool_t AliRsnAnalysisPhi7TeV::IsITSTPC(AliESDtrack *vtrack)
140{
141//
142// Checks if the track has the status flags required for a global track
143//
144
145 if (!vtrack)
146 {
147 AliWarning("NULL argument: impossible to check status");
148 return kFALSE;
149 }
150
151 return vtrack->IsOn(AliESDtrack::kTPCin);
152}
153
154inline Bool_t AliRsnAnalysisPhi7TeV::IsITSSA(AliESDtrack *vtrack)
155{
156//
157// Checks if the track has the status flags required for an ITS standalone track
158//
159
160 if (!vtrack)
161 {
162 AliWarning("NULL argument: impossible to check status");
163 return kFALSE;
164 }
165
166 Bool_t isTPCin = vtrack->IsOn(AliESDtrack::kTPCin);
167 Bool_t isITSrefit = vtrack->IsOn(AliESDtrack::kITSrefit);
168 Bool_t isITSpureSA = vtrack->IsOn(AliESDtrack::kITSpureSA);
169 Bool_t isITSpid = vtrack->IsOn(AliESDtrack::kITSpid);
170
171 return ( (!isTPCin) && isITSrefit && (!isITSpureSA) && isITSpid );
172}
173
174
175inline Bool_t AliRsnAnalysisPhi7TeV::MatchTOF(AliESDtrack *vtrack)
176{
177//
178// Checks if the track has matched the TOF detector
179//
180
181 if (!vtrack)
182 {
183 AliWarning("NULL argument: impossible to check status");
184 return kFALSE;
185 }
186
187 // require a minimum length to have meaningful match
188 if (vtrack->GetIntegratedLength() < 350.) return kFALSE;
189
190 Bool_t isTOFout = vtrack->IsOn(AliESDtrack::kTOFout);
191 Bool_t isTIME = vtrack->IsOn(AliESDtrack::kTIME);
192
193 return ( isTOFout && isTIME );
194}
195
6279d59e 196#endif