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 //-------------------------------------------------------------------------
26 #include "AliCFContainer.h"
32 class AliExternalTrackParam;
35 class AliProtonAnalysis : public TObject {
38 AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
39 Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt);
40 virtual ~AliProtonAnalysis();
42 void UseTPCOnly() {fUseTPCOnly = kTRUE;}
44 void InitAnalysisHistograms(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
45 Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt);
46 Bool_t ReadFromFile(const char* filename);
47 void Analyze(AliESDEvent *fESD);
48 void Analyze(AliAODEvent *fAOD);
49 void Analyze(AliStack *stack);
51 AliCFContainer *GetProtonContainer() {return fProtonContainer;}
52 AliCFContainer *GetAntiProtonContainer() {return fAntiProtonContainer;}
54 TH2D *GetProtonYPtHistogram() {return fHistYPtProtons;}
55 TH2D *GetAntiProtonYPtHistogram() {return fHistYPtAntiProtons;}
56 TH1D *GetProtonYHistogram();
57 TH1D *GetAntiProtonYHistogram();
58 TH1D *GetProtonPtHistogram();
59 TH1D *GetAntiProtonPtHistogram();
60 TH1D *GetProtonCorrectedYHistogram();
61 TH1D *GetAntiProtonCorrectedYHistogram();
62 TH1D *GetProtonCorrectedPtHistogram();
63 TH1D *GetAntiProtonCorrectedPtHistogram();
65 TH1D *GetYRatioHistogram();
66 TH1D *GetPtRatioHistogram();
67 TH1D *GetYAsymmetryHistogram();
68 TH1D *GetPtAsymmetryHistogram();
70 TH1I *GetEventHistogram() {return fHistEvents;}
72 Int_t GetNumberOfAnalyzedEvents() {return (Int_t)fHistEvents->GetEntries();}
73 Bool_t PrintMean(TH1 *hist, Double_t edge);
74 Bool_t PrintYields(TH1 *hist, Double_t edge);
77 void SetMinITSClusters(Int_t minITSClusters) {
78 fMinITSClusters = minITSClusters;
79 fMinITSClustersFlag = kTRUE;
81 void SetMaxChi2PerITSCluster(Double_t maxChi2PerITSCluster) {
82 fMaxChi2PerITSCluster = maxChi2PerITSCluster;
83 fMaxChi2PerITSClusterFlag = kTRUE;
85 void SetMinTPCClusters(Int_t minTPCClusters) {
86 fMinTPCClusters = minTPCClusters;
87 fMinTPCClustersFlag = kTRUE;
89 void SetMaxChi2PerTPCCluster(Double_t maxChi2PerTPCCluster) {
90 fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
91 fMaxChi2PerTPCClusterFlag = kTRUE;
93 void SetMaxCov11(Double_t maxCov11) {
94 fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
95 void SetMaxCov22(Double_t maxCov22) {
96 fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
97 void SetMaxCov33(Double_t maxCov33) {
98 fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
99 void SetMaxCov44(Double_t maxCov44) {
100 fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
101 void SetMaxCov55(Double_t maxCov55) {
102 fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
103 void SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
104 fMaxSigmaToVertex = maxSigmaToVertex;
105 fMaxSigmaToVertexFlag = kTRUE;
107 void SetMaxSigmaToVertexTPC(Double_t maxSigmaToVertex) {
108 fMaxSigmaToVertexTPC = maxSigmaToVertex;
109 fMaxSigmaToVertexTPCFlag = kTRUE;
111 void SetITSRefit() {fITSRefitFlag = kTRUE;}
112 void SetTPCRefit() {fTPCRefitFlag = kTRUE;}
113 void SetESDpid() {fESDpidFlag = kTRUE;}
114 void SetTPCpid() {fTPCpidFlag = kTRUE;}
118 void SetQAYPtBins(Int_t nbinsY, Double_t minY, Double_t maxY,
119 Int_t nbinsPt, Double_t minPt, Double_t maxPt);
121 void RunQA(AliStack *stack, AliESDEvent *esd);
122 TList *GetGlobalQAList() {return fGlobalQAList;}
124 //Prior probabilities
125 void SetPriorProbabilities(Double_t *partFrac) {
126 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];}
127 void SetPriorProbabilityFunctions(TF1 *felectron, TF1 *fmuon, TF1 *fpion, TF1 *fkaon, TF1 *fproton) {
128 fFunctionProbabilityFlag = kTRUE;
129 fElectronFunction = felectron;
130 fMuonFunction = fmuon;
131 fPionFunction = fpion;
132 fKaonFunction = fkaon;
133 fProtonFunction = fproton;
135 Double_t GetParticleFraction(Int_t i, Double_t p);
137 //interface to the correction framework
138 void Correct(Int_t step);
139 Bool_t ReadCorrectionContainer(const char* filename);
140 TList *GetCorrectionListProtons2D() {return fCorrectionListProtons2D;}
141 TList *GetEfficiencyListProtons1D() {return fEfficiencyListProtons1D;}
142 TList *GetCorrectionListProtons1D() {return fCorrectionListProtons1D;}
143 TList *GetCorrectionListAntiProtons2D() {return fCorrectionListAntiProtons2D;}
144 TList *GetEfficiencyListAntiProtons1D() {return fEfficiencyListAntiProtons1D;}
145 TList *GetCorrectionListAntiProtons1D() {return fCorrectionListAntiProtons1D;}
147 //iStep=0->MC - iStep=1->Acceptance - iStep=2->Reconstruction - iStep=3->PID
148 TH1D *GetUncorrectedProtonYHistogram(Int_t iStep) {return fProtonContainer->ShowProjection(0, iStep);}
149 TH1D *GetUncorrectedProtonPtHistogram(Int_t iStep) {return fProtonContainer->ShowProjection(1, iStep);}
150 TH1D *GetUncorrectedAntiProtonYHistogram(Int_t iStep) {return fAntiProtonContainer->ShowProjection(0, iStep);}
151 TH1D *GetUncorrectedAntiProtonPtHistogram(Int_t iStep) {return fAntiProtonContainer->ShowProjection(1, iStep);}
154 AliProtonAnalysis(const AliProtonAnalysis&); // Not implemented
155 AliProtonAnalysis& operator=(const AliProtonAnalysis&); // Not implemented
157 Bool_t IsAccepted(AliESDtrack *track);
158 void FillQA(AliESDtrack *track, AliStack *stack);
159 Float_t GetSigmaToVertex(AliESDtrack* esdTrack);
160 Double_t Rapidity(Double_t Px, Double_t Py, Double_t Pz);
162 Int_t fNBinsY; //number of bins in y
163 Float_t fMinY, fMaxY; //min & max value of y
164 Int_t fNBinsPt; //number of bins in pT
165 Float_t fMinPt, fMaxPt; //min & max value of pT
168 Int_t fMinTPCClusters, fMinITSClusters; //min TPC & ITS clusters
169 Double_t fMaxChi2PerTPCCluster, fMaxChi2PerITSCluster; //max chi2 per TPC & ITS cluster
170 Double_t fMaxCov11, fMaxCov22, fMaxCov33, fMaxCov44, fMaxCov55; //max values of cov. matrix
171 Double_t fMaxSigmaToVertex; //max sigma to vertex cut
172 Double_t fMaxSigmaToVertexTPC; //max sigma to vertex cut
173 Bool_t fMinTPCClustersFlag, fMinITSClustersFlag; //shows if this cut is used or not
174 Bool_t fMaxChi2PerTPCClusterFlag, fMaxChi2PerITSClusterFlag; //shows if this cut is used or not
175 Bool_t fMaxCov11Flag, fMaxCov22Flag, fMaxCov33Flag, fMaxCov44Flag, fMaxCov55Flag; //shows if this cut is used or not
176 Bool_t fMaxSigmaToVertexFlag; //shows if this cut is used or not
177 Bool_t fMaxSigmaToVertexTPCFlag; //shows if this cut is used or not
178 Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
179 Bool_t fESDpidFlag, fTPCpidFlag; //shows if this cut is used or not
182 Bool_t fQAHistograms; //Boolean to activate the QA histograms
183 TList *fGlobalQAList; //TList storing the directories for the QA histograms
184 TList *fQA2DList; //TList storing the accepted primary/secondary (anti)protons
185 TList *fQAPrimaryProtonsAcceptedList; //list of the QA histos for accepted primary protons
186 TList *fQAPrimaryProtonsRejectedList; //list of the QA histos for rejected primary protons
187 TList *fQASecondaryProtonsAcceptedList; //list of the QA histos for accepted secondary protons
188 TList *fQASecondaryProtonsRejectedList; //list of the QA histos for rejected secondary protons
189 TList *fQAPrimaryAntiProtonsAcceptedList; //list of the QA histos for accepted primary antiprotons
190 TList *fQAPrimaryAntiProtonsRejectedList; //list of the QA histos for rejected primary antiprotons
191 TList *fQASecondaryAntiProtonsAcceptedList; //list of the QA histos for accepted secondary antiprotons
192 TList *fQASecondaryAntiProtonsRejectedList; //list of the QA histos for rejected secondary antiprotons
195 Bool_t fFunctionProbabilityFlag; //flag: kTRUE if functions used
196 Double_t fPartFrac[10]; //prior probabilities
197 TF1 *fElectronFunction; //momentum dependence of the prior probs
198 TF1 *fMuonFunction; //momentum dependence of the prior probs
199 TF1 *fPionFunction; //momentum dependence of the prior probs
200 TF1 *fKaonFunction; //momentum dependence of the prior probs
201 TF1 *fProtonFunction; //momentum dependence of the prior probs
204 Bool_t fUseTPCOnly; //kTRUE if TPC only information is used
206 //Analysis containers
207 AliCFContainer *fProtonContainer; //container for protons
208 AliCFContainer *fAntiProtonContainer; //container for antiprotons
209 TH1I *fHistEvents; //event counter
210 TH2D *fHistYPtProtons; //Y-Pt of Protons
211 TH2D *fHistYPtAntiProtons; // Y-Pt of Antiprotons
214 TList *fEffGridListProtons; //list for the efficiency grid - protons
215 TList *fCorrectionListProtons2D; //list for the 2d corrections
216 TList *fEfficiencyListProtons1D; //list for the 1d efficiencies
217 TList *fCorrectionListProtons1D; //list for the 1d corrections
218 TList *fEffGridListAntiProtons; //list for the efficiency grid - antiprotons
219 TList *fCorrectionListAntiProtons2D; //list for the 2d corrections
220 TList *fEfficiencyListAntiProtons1D; //list for the 1d efficiencies
221 TList *fCorrectionListAntiProtons1D; //list for the 1d corrections
222 AliCFDataGrid *fCorrectProtons; //corrected data grid for protons
223 AliCFDataGrid *fCorrectAntiProtons; //corrected data grid for antiprotons
225 ClassDef(AliProtonAnalysis,0);