1 #ifndef ALIPROTONANALYSIS_H
2 #define ALIPROTONANALYSIS_H
4 /* See cxx source for full Copyright notice */
9 //-------------------------------------------------------------------------
10 // Class AliProtonAnalysis
11 // This is the class for the baryon (proton) analysis
13 // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
14 //-------------------------------------------------------------------------
30 class AliExternalTrackParam;
33 class AliProtonAnalysis : public TObject {
36 AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
37 Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt);
38 virtual ~AliProtonAnalysis();
40 void UseTPCOnly() {fUseTPCOnly = kTRUE;}
42 void InitAnalysisHistograms(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
43 Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt);
44 Bool_t ReadFromFile(const char* filename);
45 void Analyze(AliESDEvent *fESD);
46 void Analyze(AliAODEvent *fAOD);
47 void Analyze(AliStack *stack);
49 TH2F *GetProtonYPtHistogram() {return fHistYPtProtons;}
50 TH2F *GetAntiProtonYPtHistogram() {return fHistYPtAntiProtons;}
51 TH1D *GetProtonYHistogram();
52 TH1D *GetAntiProtonYHistogram();
53 TH1D *GetProtonPtHistogram();
54 TH1D *GetAntiProtonPtHistogram();
55 TH1D *GetYRatioHistogram();
56 TH1D *GetPtRatioHistogram();
57 TH1D *GetYAsymmetryHistogram();
58 TH1D *GetPtAsymmetryHistogram();
60 TH1I *GetEvenHtistogram() {return fHistEvents;}
62 Int_t GetNumberOfAnalyzedEvents() {return (Int_t)fHistEvents->GetEntries();}
63 Bool_t PrintMean(TH1 *hist, Double_t edge);
64 Bool_t PrintYields(TH1 *hist, Double_t edge);
67 void SetMinTPCClusters(Int_t minTPCClusters) {
68 fMinTPCClusters = minTPCClusters;
69 fMinTPCClustersFlag = kTRUE;
71 void SetMinITSClusters(Int_t minITSClusters) {
72 fMinITSClusters = minITSClusters;
73 fMinITSClustersFlag = kTRUE;
75 void SetMaxChi2PerTPCCluster(Double_t maxChi2PerTPCCluster) {
76 fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
77 fMaxChi2PerTPCClusterFlag = kTRUE;
79 void SetMaxChi2PerITSCluster(Double_t maxChi2PerITSCluster) {
80 fMaxChi2PerITSCluster = maxChi2PerITSCluster;
81 fMaxChi2PerITSClusterFlag = kTRUE;
83 void SetMaxCov11(Double_t maxCov11) {fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
84 void SetMaxCov22(Double_t maxCov22) {fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
85 void SetMaxCov33(Double_t maxCov33) {fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
86 void SetMaxCov44(Double_t maxCov44) {fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
87 void SetMaxCov55(Double_t maxCov55) {fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
88 void SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
89 fMaxSigmaToVertex = maxSigmaToVertex;
90 fMaxSigmaToVertexFlag = kTRUE;
92 void SetITSRefit() {fITSRefitFlag = kTRUE;}
93 void SetTPCRefit() {fTPCRefitFlag = kTRUE;}
97 fQAHistograms = kTRUE;
98 fGlobalQAList = new TList();
99 fQA2DList = new TList();
100 fQAPrimaryProtonsAcceptedList = new TList();
101 fQAPrimaryProtonsRejectedList = new TList();
102 fQASecondaryProtonsAcceptedList = new TList();
103 fQASecondaryProtonsRejectedList = new TList();
104 fQAPrimaryAntiProtonsAcceptedList = new TList();
105 fQAPrimaryAntiProtonsRejectedList = new TList();
106 fQASecondaryAntiProtonsAcceptedList = new TList();
107 fQASecondaryAntiProtonsRejectedList = new TList();
109 void SetQAYPtBins(Int_t nbinsY, Double_t minY, Double_t maxY,
110 Int_t nbinsPt, Double_t minPt, Double_t maxPt) {
112 fMinY = minY; fMaxY = maxY;
114 fMinPt = minPt; fMaxPt = maxPt;
117 void RunQA(AliStack *stack, AliESDEvent *esd);
119 //Prior probabilities
120 void SetPriorProbabilities(Double_t *partFrac) {for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];}
121 void SetPriorProbabilityFunctions(TF1 *felectron, TF1 *fmuon, TF1 *fpion, TF1 *fkaon, TF1 *fproton) {
122 fFunctionProbabilityFlag = kTRUE;
123 fElectronFunction = felectron;
124 fMuonFunction = fmuon;
125 fPionFunction = fpion;
126 fKaonFunction = fkaon;
127 fProtonFunction = fproton;
129 Double_t GetParticleFraction(Int_t i, Double_t p);
131 //interface to the correction framework
132 Bool_t ReadCorrectionContainer(const char* filename);
133 TList *GetCorrectionList2D() {return fCorrectionList2D;}
134 TList *GetEfficiencyList1D() {return fEfficiencyList1D;}
135 TList *GetCorrectionList1D() {return fCorrectionList1D;}
138 AliProtonAnalysis(const AliProtonAnalysis&); // Not implemented
139 AliProtonAnalysis& operator=(const AliProtonAnalysis&); // Not implemented
141 Bool_t IsAccepted(AliESDtrack *track);
142 Bool_t IsAccepted(AliESDtrack *track, AliStack *stack);
143 Float_t GetSigmaToVertex(AliESDtrack* esdTrack);
144 Double_t Rapidity(Double_t Px, Double_t Py, Double_t Pz);
146 Int_t fNBinsY; //number of bins in y
147 Float_t fMinY, fMaxY; //min & max value of y
148 Int_t fNBinsPt; //number of bins in pT
149 Float_t fMinPt, fMaxPt; //min & max value of pT
152 Int_t fMinTPCClusters, fMinITSClusters; //min TPC & ITS clusters
153 Double_t fMaxChi2PerTPCCluster, fMaxChi2PerITSCluster; //max chi2 per TPC & ITS cluster
154 Double_t fMaxCov11, fMaxCov22, fMaxCov33, fMaxCov44, fMaxCov55; //max values of cov. matrix
155 Double_t fMaxSigmaToVertex; //max sigma to vertex cut
156 Bool_t fMinTPCClustersFlag, fMinITSClustersFlag; //shows if this cut is used or not
157 Bool_t fMaxChi2PerTPCClusterFlag, fMaxChi2PerITSClusterFlag; //shows if this cut is used or not
158 Bool_t fMaxCov11Flag, fMaxCov22Flag, fMaxCov33Flag, fMaxCov44Flag, fMaxCov55Flag; //shows if this cut is used or not
159 Bool_t fMaxSigmaToVertexFlag; //shows if this cut is used or not
160 Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
163 Bool_t fQAHistograms; //Boolean to activate the QA histograms
164 TList *fGlobalQAList; //TList storing the directories for the QA histograms
165 TList *fQA2DList; //TList storing the accepted primary/secondary (anti)protons
166 TList *fQAPrimaryProtonsAcceptedList; //list of the QA histos for accepted primary protons
167 TList *fQAPrimaryProtonsRejectedList; //list of the QA histos for rejected primary protons
168 TList *fQASecondaryProtonsAcceptedList; //list of the QA histos for accepted secondary protons
169 TList *fQASecondaryProtonsRejectedList; //list of the QA histos for rejected secondary protons
170 TList *fQAPrimaryAntiProtonsAcceptedList; //list of the QA histos for accepted primary antiprotons
171 TList *fQAPrimaryAntiProtonsRejectedList; //list of the QA histos for rejected primary antiprotons
172 TList *fQASecondaryAntiProtonsAcceptedList; //list of the QA histos for accepted secondary antiprotons
173 TList *fQASecondaryAntiProtonsRejectedList; //list of the QA histos for rejected secondary antiprotons
175 /*TH1F *fPrimaryProtonsTPCClustersReject; //QA histogram for the primaries rejected by the TPC cluster cut
176 TH1F *fPrimaryProtonsTPCClustersPass; //QA histogram for the primaries accepted by the TPC cluster cut
177 TH1F *fPrimaryProtonsChi2PerClusterTPCReject; //QA histogram for the primaries rejected by the chi2 per TPC cluster cut
178 TH1F *fPrimaryProtonsChi2PerClusterTPCPass; //QA histogram for the primaries accepted by the chi2 per TPC cluster cut
179 TH1F *fPrimaryProtonsExtCov11Reject; //QA histogram for the primaries rejected by the sigma of the local Y cut
180 TH1F *fPrimaryProtonsExtCov11Pass; //QA histogram for the primaries accepted by the sigma of the local Y cut
181 TH1F *fPrimaryProtonsExtCov22Reject; //QA histogram for the primaries rejected by the sigma of the local Z cut
182 TH1F *fPrimaryProtonsExtCov22Pass; //QA histogram for the primaries accepted by the sigma of the local Z cut
183 TH1F *fPrimaryProtonsExtCov33Reject; //QA histogram for the primaries rejected by the sigma of the sin(phi) cut
184 TH1F *fPrimaryProtonsExtCov33Pass; //QA histogram for the primaries accepted by the sigma of the sin(phi) cut
185 TH1F *fPrimaryProtonsExtCov44Reject; //QA histogram for the primaries rejected by the sigma of the tan(lambda) cut
186 TH1F *fPrimaryProtonsExtCov44Pass; //QA histogram for the primaries accepted by the sigma of the tan(lambda) cut
187 TH1F *fPrimaryProtonsExtCov55Reject; //QA histogram for the primaries rejected by the the sigma of 1/pT cut
188 TH1F *fPrimaryProtonsExtCov55Pass; //QA histogram for the primaries accepted by the sigma of the 1/pT cut
189 TH1F *fPrimaryProtonsSigmaToVertexReject; //QA histogram for the primaries rejected by the sigma to vertex cut
190 TH1F *fPrimaryProtonsSigmaToVertexPass; //QA histogram for the primaries accepted by the sigma to vertex cut
191 TH1F *fPrimaryProtonsSigmaToVertexTPCReject; //QA histogram for the primaries rejected by the sigma to vertex (TPC) cut
192 TH1F *fPrimaryProtonsSigmaToVertexTPCPass; //QA histogram for the primaries accepted by the sigma to vertex (TPC) cut
193 TH1F *fPrimaryProtonsITSRefitReject; //QA histogram for the primaries rejected by the ITS refit cut
194 TH1F *fPrimaryProtonsITSRefitPass; //QA histogram for the primaries accepted by the ITS refit cut
195 TH1F *fPrimaryProtonsTPCRefitReject; //QA histogram for the primaries rejected by the TPC refit cut
196 TH1F *fPrimaryProtonsTPCRefitPass; //QA histogram for the primaries accepted by the TPC refit cut
197 TH1F *fPrimaryProtonsESDpidReject; //QA histogram for the primaries rejected by the ESD pid cut
198 TH1F *fPrimaryProtonsESDpidPass; //QA histogram for the primaries accepted by the ESD pid cut
199 TH1F *fPrimaryProtonsTPCpidReject; //QA histogram for the primaries rejected by the TPC pid cut
200 TH1F *fPrimaryProtonsTPCpidPass; //QA histogram for the primaries accepted by the TPC pid cut
202 TH1F *fSecondaryProtonsTPCClustersReject; //QA histogram for the secondaries rejected by the TPC cluster cut
203 TH1F *fSecondaryProtonsTPCClustersPass; //QA histogram for the secondaries accepted by the TPC cluster cut
204 TH1F *fSecondaryProtonsChi2PerClusterTPCReject; //QA histogram for the secondaries rejected by the chi2 per TPC cluster cut
205 TH1F *fSecondaryProtonsChi2PerClusterTPCPass; //QA histogram for the secondaries accepted by the chi2 per TPC cluster cut
206 TH1F *fSecondaryProtonsExtCov11Reject; //QA histogram for the secondaries rejected by the sigma of the local Y cut
207 TH1F *fSecondaryProtonsExtCov11Pass; //QA histogram for the secondaries accepted by the sigma of the local Y cut
208 TH1F *fSecondaryProtonsExtCov22Reject; //QA histogram for the secondaries rejected by the sigma of the local Z cut
209 TH1F *fSecondaryProtonsExtCov22Pass; //QA histogram for the secondaries accepted by the sigma of the local Z cut
210 TH1F *fSecondaryProtonsExtCov33Reject; //QA histogram for the secondaries rejected by the sigma of the sin(phi) cut
211 TH1F *fSecondaryProtonsExtCov33Pass; //QA histogram for the secondaries accepted by the sigma of the sin(phi) cut
212 TH1F *fSecondaryProtonsExtCov44Reject; //QA histogram for the secondaries rejected by the sigma of the tan(lambda) cut
213 TH1F *fSecondaryProtonsExtCov44Pass; //QA histogram for the secondaries accepted by the sigma of the tan(lambda) cut
214 TH1F *fSecondaryProtonsExtCov55Reject; //QA histogram for the secondaries rejected by the the sigma of 1/pT cut
215 TH1F *fSecondaryProtonsExtCov55Pass; //QA histogram for the secondaries accepted by the sigma of the 1/pT cut
216 TH1F *fSecondaryProtonsSigmaToVertexReject; //QA histogram for the secondaries rejected by the sigma to vertex cut
217 TH1F *fSecondaryProtonsSigmaToVertexPass; //QA histogram for the secondaries accepted by the sigma to vertex cut
218 TH1F *fSecondaryProtonsSigmaToVertexTPCReject; //QA histogram for the secondaries rejected by the sigma to vertex (TPC) cut
219 TH1F *fSecondaryProtonsSigmaToVertexTPCPass; //QA histogram for the secondaries accepted by the sigma to vertex (TPC) cut
220 TH1F *fSecondaryProtonsITSRefitReject; //QA histogram for the secondaries rejected by the ITS refit cut
221 TH1F *fSecondaryProtonsITSRefitPass; //QA histogram for the secondaries accepted by the ITS refit cut
222 TH1F *fSecondaryProtonsTPCRefitReject; //QA histogram for the secondaries rejected by the TPC refit cut
223 TH1F *fSecondaryProtonsTPCRefitPass; //QA histogram for the secondaries accepted by the TPC refit cut
224 TH1F *fSecondaryProtonsESDpidReject; //QA histogram for the secondaries rejected by the ESD pid cut
225 TH1F *fSecondaryProtonsESDpidPass; //QA histogram for the secondaries accepted by the ESD pid cut
226 TH1F *fSecondaryProtonsTPCpidReject; //QA histogram for the secondaries rejected by the TPC pid cut
227 TH1F *fSecondaryProtonsTPCpidPass; //QA histogram for the secondaries accepted by the TPC pid cut
228 //primary antiprotons
229 TH1F *fPrimaryAntiProtonsTPCClustersReject; //QA histogram for the primaries rejected by the TPC cluster cut
230 TH1F *fPrimaryAntiProtonsTPCClustersPass; //QA histogram for the primaries accepted by the TPC cluster cut
231 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCReject; //QA histogram for the primaries rejected by the chi2 per TPC cluster cut
232 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCPass; //QA histogram for the primaries accepted by the chi2 per TPC cluster cut
233 TH1F *fPrimaryAntiProtonsExtCov11Reject; //QA histogram for the primaries rejected by the sigma of the local Y cut
234 TH1F *fPrimaryAntiProtonsExtCov11Pass; //QA histogram for the primaries accepted by the sigma of the local Y cut
235 TH1F *fPrimaryAntiProtonsExtCov22Reject; //QA histogram for the primaries rejected by the sigma of the local Z cut
236 TH1F *fPrimaryAntiProtonsExtCov22Pass; //QA histogram for the primaries accepted by the sigma of the local Z cut
237 TH1F *fPrimaryAntiProtonsExtCov33Reject; //QA histogram for the primaries rejected by the sigma of the sin(phi) cut
238 TH1F *fPrimaryAntiProtonsExtCov33Pass; //QA histogram for the primaries accepted by the sigma of the sin(phi) cut
239 TH1F *fPrimaryAntiProtonsExtCov44Reject; //QA histogram for the primaries rejected by the sigma of the tan(lambda) cut
240 TH1F *fPrimaryAntiProtonsExtCov44Pass; //QA histogram for the primaries accepted by the sigma of the tan(lambda) cut
241 TH1F *fPrimaryAntiProtonsExtCov55Reject; //QA histogram for the primaries rejected by the the sigma of 1/pT cut
242 TH1F *fPrimaryAntiProtonsExtCov55Pass; //QA histogram for the primaries accepted by the sigma of the 1/pT cut
243 TH1F *fPrimaryAntiProtonsSigmaToVertexReject; //QA histogram for the primaries rejected by the sigma to vertex cut
244 TH1F *fPrimaryAntiProtonsSigmaToVertexPass; //QA histogram for the primaries accepted by the sigma to vertex cut
245 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCReject; //QA histogram for the primaries rejected by the sigma to vertex (TPC) cut
246 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCPass; //QA histogram for the primaries accepted by the sigma to vertex (TPC) cut
247 TH1F *fPrimaryAntiProtonsITSRefitReject; //QA histogram for the primaries rejected by the ITS refit cut
248 TH1F *fPrimaryAntiProtonsITSRefitPass; //QA histogram for the primaries accepted by the ITS refit cut
249 TH1F *fPrimaryAntiProtonsTPCRefitReject; //QA histogram for the primaries rejected by the TPC refit cut
250 TH1F *fPrimaryAntiProtonsTPCRefitPass; //QA histogram for the primaries accepted by the TPC refit cut
251 TH1F *fPrimaryAntiProtonsESDpidReject; //QA histogram for the primaries rejected by the ESD pid cut
252 TH1F *fPrimaryAntiProtonsESDpidPass; //QA histogram for the primaries accepted by the ESD pid cut
253 TH1F *fPrimaryAntiProtonsTPCpidReject; //QA histogram for the primaries rejected by the TPC pid cut
254 TH1F *fPrimaryAntiProtonsTPCpidPass; //QA histogram for the primaries accepted by the TPC pid cut
255 //secondary antiprotons
256 TH1F *fSecondaryAntiProtonsTPCClustersReject; //QA histogram for the secondaries rejected by the TPC cluster cut
257 TH1F *fSecondaryAntiProtonsTPCClustersPass; //QA histogram for the secondaries accepted by the TPC cluster cut
258 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCReject; //QA histogram for the secondaries rejected by the chi2 per TPC cluster cut
259 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCPass; //QA histogram for the secondaries accepted by the chi2 per TPC cluster cut
260 TH1F *fSecondaryAntiProtonsExtCov11Reject; //QA histogram for the secondaries rejected by the sigma of the local Y cut
261 TH1F *fSecondaryAntiProtonsExtCov11Pass; //QA histogram for the secondaries accepted by the sigma of the local Y cut
262 TH1F *fSecondaryAntiProtonsExtCov22Reject; //QA histogram for the secondaries rejected by the sigma of the local Z cut
263 TH1F *fSecondaryAntiProtonsExtCov22Pass; //QA histogram for the secondaries accepted by the sigma of the local Z cut
264 TH1F *fSecondaryAntiProtonsExtCov33Reject; //QA histogram for the secondaries rejected by the sigma of the sin(phi) cut
265 TH1F *fSecondaryAntiProtonsExtCov33Pass; //QA histogram for the secondaries accepted by the sigma of the sin(phi) cut
266 TH1F *fSecondaryAntiProtonsExtCov44Reject; //QA histogram for the secondaries rejected by the sigma of the tan(lambda) cut
267 TH1F *fSecondaryAntiProtonsExtCov44Pass; //QA histogram for the secondaries accepted by the sigma of the tan(lambda) cut
268 TH1F *fSecondaryAntiProtonsExtCov55Reject; //QA histogram for the secondaries rejected by the the sigma of 1/pT cut
269 TH1F *fSecondaryAntiProtonsExtCov55Pass; //QA histogram for the secondaries accepted by the sigma of the 1/pT cut
270 TH1F *fSecondaryAntiProtonsSigmaToVertexReject; //QA histogram for the secondaries rejected by the sigma to vertex cut
271 TH1F *fSecondaryAntiProtonsSigmaToVertexPass; //QA histogram for the secondaries accepted by the sigma to vertex cut
272 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCReject; //QA histogram for the secondaries rejected by the sigma to vertex (TPC) cut
273 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCPass; //QA histogram for the secondaries accepted by the sigma to vertex (TPC) cut
274 TH1F *fSecondaryAntiProtonsITSRefitReject; //QA histogram for the secondaries rejected by the ITS refit cut
275 TH1F *fSecondaryAntiProtonsITSRefitPass; //QA histogram for the secondaries accepted by the ITS refit cut
276 TH1F *fSecondaryAntiProtonsTPCRefitReject; //QA histogram for the secondaries rejected by the TPC refit cut
277 TH1F *fSecondaryAntiProtonsTPCRefitPass; //QA histogram for the secondaries accepted by the TPC refit cut
278 TH1F *fSecondaryAntiProtonsESDpidReject; //QA histogram for the secondaries rejected by the ESD pid cut
279 TH1F *fSecondaryAntiProtonsESDpidPass; //QA histogram for the secondaries accepted by the ESD pid cut
280 TH1F *fSecondaryAntiProtonsTPCpidReject; //QA histogram for the secondaries rejected by the TPC pid cut
281 TH1F *fSecondaryAntiProtonsTPCpidPass;*/ //QA histogram for the secondaries accepted by the TPC pid cut
284 Bool_t fFunctionProbabilityFlag; //flag: kTRUE if functions used
285 Double_t fPartFrac[10]; //prior probabilities
286 TF1 *fElectronFunction; //momentum dependence of the prior probs
287 TF1 *fMuonFunction; //momentum dependence of the prior probs
288 TF1 *fPionFunction; //momentum dependence of the prior probs
289 TF1 *fKaonFunction; //momentum dependence of the prior probs
290 TF1 *fProtonFunction; //momentum dependence of the prior probs
293 Bool_t fUseTPCOnly; //kTRUE if TPC only information is used
295 TH1I *fHistEvents; //event counter
296 TH2F *fHistYPtProtons; //Y-Pt of Protons
297 TH2F *fHistYPtAntiProtons; // Y-Pt of Antiprotons
300 TList *fCorrectionList2D; //list for the 2d corrections
301 TList *fEfficiencyList1D; //list for the 1d efficiencies
302 TList *fCorrectionList1D; //list for the 1d corrections
304 ClassDef(AliProtonAnalysis,0);