]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/SPECTRA/AliProtonAnalysis.h
Possibility to define a momentum dependent prior probabilities from fit functions...
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliProtonAnalysis.h
1 #ifndef ALIPROTONANALYSIS_H
2 #define ALIPROTONANALYSIS_H
3
4 /*  See cxx source for full Copyright notice */
5
6
7 /* $Id$ */
8
9 //-------------------------------------------------------------------------
10 //                       Class AliProtonAnalysis
11 //   This is the class for the baryon (proton) analysis
12 //
13 //    Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
14 //-------------------------------------------------------------------------
15
16 #include <TObject.h>
17
18 class TF1;
19 class TH2F;
20 class TH1D;
21 class AliESDEvent;
22 class AliESDtrack;
23
24 class AliProtonAnalysis : public TObject {
25  public:
26   AliProtonAnalysis();
27   AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
28                     Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt);
29   virtual ~AliProtonAnalysis();
30   
31   void InitHistograms(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
32                       Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt);
33   void ReadFromFile(const char* filename);
34   void Analyze(AliESDEvent* fESD);
35   
36   TH2F *GetProtonYPtHistogram() {return fHistYPtProtons;}
37   TH2F *GetAntiProtonYPtHistogram() {return fHistYPtAntiProtons;}
38   TH1D *GetProtonYHistogram();
39   TH1D *GetAntiProtonYHistogram();
40   TH1D *GetProtonPtHistogram();
41   TH1D *GetAntiProtonPtHistogram();
42   TH1D *GetYRatioHistogram();
43   TH1D *GetPtRatioHistogram();
44   TH1D *GetYAsymmetryHistogram();
45   TH1D *GetPtAsymmetryHistogram();
46   
47   //Cut functions
48   void    SetMinTPCClusters(Int_t minTPCClusters) {
49     fMinTPCClusters = minTPCClusters;
50     fMinTPCClustersFlag = kTRUE;
51   }
52   void    SetMinITSClusters(Int_t minITSClusters) {
53     fMinITSClusters = minITSClusters;
54     fMinITSClustersFlag = kTRUE;
55   }
56   void    SetMaxChi2PerTPCCluster(Double_t maxChi2PerTPCCluster) {
57     fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
58     fMaxChi2PerTPCClusterFlag = kTRUE;
59   }
60   void    SetMaxChi2PerITSCluster(Double_t maxChi2PerITSCluster) {
61     fMaxChi2PerITSCluster = maxChi2PerITSCluster;
62     fMaxChi2PerITSClusterFlag = kTRUE;
63   }
64   void    SetMaxCov11(Double_t maxCov11) {fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
65   void    SetMaxCov22(Double_t maxCov22) {fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
66   void    SetMaxCov33(Double_t maxCov33) {fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
67   void    SetMaxCov44(Double_t maxCov44) {fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
68   void    SetMaxCov55(Double_t maxCov55) {fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
69   void    SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
70     fMaxSigmaToVertex = maxSigmaToVertex;
71     fMaxSigmaToVertexFlag = kTRUE;
72   }
73   void    SetITSRefit() {fITSRefitFlag = kTRUE;}
74   void    SetTPCRefit() {fTPCRefitFlag = kTRUE;}
75   
76   //Prior probabilities
77   void    SetPriorProbabilities(Double_t *partFrac) {for(Int_t i = 0; i < 5; i++) fPartFrac[i] = partFrac[i];} 
78   void    SetPriorProbabilityFunctions(TF1 *felectron, TF1 *fmuon, TF1 *fpion, TF1 *fkaon, TF1 *fproton) {
79     fFunctionProbabilityFlag = kTRUE;
80     fElectronFunction = felectron; 
81     fMuonFunction = fmuon; 
82     fPionFunction = fpion;
83     fKaonFunction = fkaon;
84     fProtonFunction = fproton;
85   } 
86   Double_t GetParticleFraction(Int_t i, Double_t p);
87
88  private:
89   Bool_t IsAccepted(AliESDtrack *track);
90   Float_t GetSigmaToVertex(AliESDtrack* esdTrack); 
91   Double_t Rapidity(AliESDtrack *track);
92   
93   Int_t fNBinsY; //number of bins in y
94   Float_t fMinY, fMaxY; //min & max value of y
95   Int_t fNBinsPt;  //number of bins in pT
96   Float_t fMinPt, fMaxPt; //min & max value of pT
97   
98   //cuts
99   Int_t fMinTPCClusters, fMinITSClusters; //min TPC & ITS clusters
100   Double_t fMaxChi2PerTPCCluster, fMaxChi2PerITSCluster; //max chi2 per TPC & ITS cluster
101   Double_t fMaxCov11, fMaxCov22, fMaxCov33, fMaxCov44, fMaxCov55; //max values of cov. matrix
102   Double_t fMaxSigmaToVertex; //max sigma to vertex cut
103   Bool_t fMinTPCClustersFlag, fMinITSClustersFlag; //shows if this cut is used or not
104   Bool_t fMaxChi2PerTPCClusterFlag, fMaxChi2PerITSClusterFlag; //shows if this cut is used or not
105   Bool_t fMaxCov11Flag, fMaxCov22Flag, fMaxCov33Flag, fMaxCov44Flag, fMaxCov55Flag; //shows if this cut is used or not
106   Bool_t fMaxSigmaToVertexFlag; //shows if this cut is used or not
107   Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
108   
109   //pid
110   Bool_t fFunctionProbabilityFlag; //flag: kTRUE if functions used
111   Double_t fPartFrac[5]; //prior probabilities
112   TF1  *fElectronFunction; //momentum dependence of the prior probs
113   TF1  *fMuonFunction; //momentum dependence of the prior probs
114   TF1  *fPionFunction; //momentum dependence of the prior probs
115   TF1  *fKaonFunction; //momentum dependence of the prior probs
116   TF1  *fProtonFunction; //momentum dependence of the prior probs
117
118   TH2F *fHistYPtProtons; //Y-Pt of Protons
119   TH2F *fHistYPtAntiProtons; // Y-Pt of Antiprotons
120   
121   ClassDef(AliProtonAnalysis,0);
122 };
123
124 #endif