]>
Commit | Line | Data |
---|---|---|
6c178944 | 1 | #ifndef ALIBALANCE_H |
2 | #define ALIBALANCE_H | |
3 | /* See cxx source for full Copyright notice */ | |
4 | ||
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //------------------------------------------------------------------------- | |
9 | // Class AliBalance | |
10 | // This is the class for the Balance Function analysis | |
11 | // | |
12 | // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch | |
13 | //------------------------------------------------------------------------- | |
14 | ||
e559055a | 15 | #include <TObject.h> |
9d1f0df5 | 16 | #include "TString.h" |
6c178944 | 17 | |
b966652f | 18 | #define ANALYSIS_TYPES 7 |
6c178944 | 19 | #define MAXIMUM_NUMBER_OF_STEPS 1024 |
20 | ||
6c178944 | 21 | class TGraphErrors; |
5c33329d | 22 | class TObjArray; |
b966652f | 23 | class TH1D; |
6c178944 | 24 | |
6432ac6a | 25 | const TString gBFAnalysisType[ANALYSIS_TYPES] = {"y","eta","qlong","qout","qside","qinv","phi"}; |
26 | ||
5c33329d | 27 | class AliBalance : public TObject { |
6c178944 | 28 | public: |
3feee083 | 29 | enum EAnalysisType { |
30 | kRapidity = 0, | |
31 | kEta = 1, | |
32 | kQlong = 2, | |
33 | kQout = 3, | |
34 | kQside = 4, | |
35 | kQinv = 5, | |
36 | kPhi = 6 | |
37 | }; | |
38 | ||
e559055a | 39 | AliBalance(); |
7f0257ea | 40 | AliBalance(const AliBalance& balance); |
6c178944 | 41 | ~AliBalance(); |
42 | ||
6432ac6a | 43 | //void SetNumberOfBins(Int_t ibin, Int_t ibins); |
44 | void SetAnalysisLevel(const char* analysisLevel) { | |
45 | fAnalysisLevel = analysisLevel;} | |
46 | void SetShuffle(Bool_t shuffle) {bShuffle = shuffle;} | |
47 | void SetInterval(Int_t iAnalysisType, Double_t p1Start, Double_t p1Stop, | |
48 | Int_t ibins, Double_t p2Start, Double_t p2Stop); | |
49 | void SetNp(Int_t analysisType, Double_t NpSet) { fNp[analysisType] = NpSet; } | |
50 | void SetNn(Int_t analysisType, Double_t NnSet) { fNn[analysisType] = NnSet; } | |
51 | void SetNpp(Int_t analysisType, Int_t ibin, Double_t NppSet) { if(ibin > -1 && ibin < MAXIMUM_NUMBER_OF_STEPS) fNpp[analysisType][ibin] = NppSet; } | |
52 | void SetNpn(Int_t analysisType, Int_t ibin, Double_t NpnSet) { if(ibin > -1 && ibin < MAXIMUM_NUMBER_OF_STEPS) fNpn[analysisType][ibin] = NpnSet; } | |
53 | void SetNnp(Int_t analysisType, Int_t ibin, Double_t NnpSet) { if(ibin > -1 && ibin < MAXIMUM_NUMBER_OF_STEPS) fNnp[analysisType][ibin] = NnpSet; } | |
54 | void SetNnn(Int_t analysisType, Int_t ibin, Double_t NnnSet) { if(ibin > -1 && ibin < MAXIMUM_NUMBER_OF_STEPS) fNnn[analysisType][ibin] = NnnSet; } | |
55 | ||
56 | void InitHistograms(void); | |
57 | ||
58 | const char* GetAnalysisLevel() {return fAnalysisLevel.Data();} | |
59 | Int_t GetNumberOfAnalyzedEvent() {return fAnalyzedEvents;} | |
6c178944 | 60 | |
3feee083 | 61 | Int_t GetNumberOfBins(Int_t ibin) {return fNumberOfBins[ibin];} |
6432ac6a | 62 | Double_t GetP1Start(Int_t ibin){return fP1Start[ibin];} |
63 | Double_t GetP1Stop(Int_t ibin){return fP1Stop[ibin];} | |
3feee083 | 64 | Double_t GetP2Start(Int_t ibin){return fP2Start[ibin];} |
65 | Double_t GetP2Stop(Int_t ibin){return fP2Stop[ibin];} | |
7f0257ea | 66 | |
b966652f | 67 | Double_t GetNp(Int_t analysisType) const { return 1.0*fNp[analysisType]; } |
68 | Double_t GetNn(Int_t analysisType) const { return 1.0*fNn[analysisType]; } | |
69 | Double_t GetNnn(Int_t analysisType, Int_t p2) const { | |
70 | return 1.0*fNnn[analysisType][p2]; } | |
71 | Double_t GetNpp(Int_t analysisType, Int_t p2) const { | |
72 | return 1.0*fNpp[analysisType][p2]; } | |
73 | Double_t GetNpn(Int_t analysisType, Int_t p2) const { | |
6432ac6a | 74 | return 1.0*fNpn[analysisType][p2]; } |
75 | Double_t GetNnp(Int_t analysisType, Int_t p2) const { | |
76 | return 1.0*fNnp[analysisType][p2]; } | |
09bb7bf4 | 77 | |
5c33329d | 78 | void CalculateBalance(TObjArray *gTrackArray); |
7f0257ea | 79 | |
3feee083 | 80 | Double_t GetBalance(Int_t a, Int_t p2); |
81 | Double_t GetError(Int_t a, Int_t p2); | |
6c178944 | 82 | |
b966652f | 83 | TH1D *GetHistNp(Int_t iAnalysisType) { return fHistP[iAnalysisType];} |
84 | TH1D *GetHistNn(Int_t iAnalysisType) { return fHistN[iAnalysisType];} | |
85 | TH1D *GetHistNpn(Int_t iAnalysisType) { return fHistPN[iAnalysisType];} | |
86 | TH1D *GetHistNnp(Int_t iAnalysisType) { return fHistNP[iAnalysisType];} | |
87 | TH1D *GetHistNpp(Int_t iAnalysisType) { return fHistPP[iAnalysisType];} | |
88 | TH1D *GetHistNnn(Int_t iAnalysisType) { return fHistNN[iAnalysisType];} | |
89 | ||
09bb7bf4 | 90 | void PrintAnalysisSettings(); |
6432ac6a | 91 | TGraphErrors *drawBalance(Int_t fAnalysisType); |
92 | void SetGraphTitle(TGraphErrors *gr, Int_t fAnalysisType); | |
93 | ||
94 | void SetHistNp(Int_t iAnalysisType, TH1D *gHist) { | |
95 | fHistP[iAnalysisType] = gHist;} | |
96 | void SetHistNn(Int_t iAnalysisType, TH1D *gHist) { | |
97 | fHistN[iAnalysisType] = gHist;} | |
98 | void SetHistNpn(Int_t iAnalysisType, TH1D *gHist) { | |
99 | fHistPN[iAnalysisType] = gHist;} | |
100 | void SetHistNnp(Int_t iAnalysisType, TH1D *gHist) { | |
101 | fHistNP[iAnalysisType] = gHist;} | |
102 | void SetHistNpp(Int_t iAnalysisType, TH1D *gHist) { | |
103 | fHistPP[iAnalysisType] = gHist;} | |
104 | void SetHistNnn(Int_t iAnalysisType, TH1D *gHist) { | |
105 | fHistNN[iAnalysisType] = gHist;} | |
106 | ||
107 | TH1D *GetBalanceFunctionHistogram(Int_t iAnalysisType); | |
108 | void PrintResults(Int_t iAnalysisType, TH1D *gHist); | |
6c178944 | 109 | |
110 | private: | |
6432ac6a | 111 | |
112 | Bool_t bShuffle; //shuffled balance function object | |
9d1f0df5 | 113 | TString fAnalysisLevel; //ESD, AOD or MC |
6c178944 | 114 | Int_t fAnalyzedEvents; //number of events that have been analyzed |
6432ac6a | 115 | |
b966652f | 116 | Int_t fNumberOfBins[ANALYSIS_TYPES]; //number of bins of the analyzed interval |
117 | Double_t fP1Start[ANALYSIS_TYPES]; | |
118 | Double_t fP1Stop[ANALYSIS_TYPES]; | |
119 | Double_t fP2Start[ANALYSIS_TYPES]; | |
120 | Double_t fP2Stop[ANALYSIS_TYPES]; | |
121 | Double_t fP2Step[ANALYSIS_TYPES]; | |
6c178944 | 122 | |
b966652f | 123 | Double_t fNnn[ANALYSIS_TYPES][MAXIMUM_NUMBER_OF_STEPS]; //N(--) |
124 | Double_t fNpp[ANALYSIS_TYPES][MAXIMUM_NUMBER_OF_STEPS]; //N(++) | |
125 | Double_t fNpn[ANALYSIS_TYPES][MAXIMUM_NUMBER_OF_STEPS]; //N(+-) | |
6432ac6a | 126 | Double_t fNnp[ANALYSIS_TYPES][MAXIMUM_NUMBER_OF_STEPS]; //N(-+) |
b966652f | 127 | Double_t fNn[ANALYSIS_TYPES], fNp[ANALYSIS_TYPES]; //number of pos./neg. inside the analyzed interval |
6c178944 | 128 | |
b966652f | 129 | Double_t fB[ANALYSIS_TYPES][MAXIMUM_NUMBER_OF_STEPS]; //BF matrix |
130 | Double_t ferror[ANALYSIS_TYPES][MAXIMUM_NUMBER_OF_STEPS]; //error of the BF | |
09bb7bf4 | 131 | |
b966652f | 132 | TH1D *fHistP[ANALYSIS_TYPES]; //N+ |
133 | TH1D *fHistN[ANALYSIS_TYPES]; //N- | |
134 | TH1D *fHistPN[ANALYSIS_TYPES]; //N+- | |
135 | TH1D *fHistNP[ANALYSIS_TYPES]; //N-+ | |
136 | TH1D *fHistPP[ANALYSIS_TYPES]; //N++ | |
137 | TH1D *fHistNN[ANALYSIS_TYPES]; //N-- | |
138 | ||
7f0257ea | 139 | AliBalance & operator=(const AliBalance & ) {return *this;} |
140 | ||
3feee083 | 141 | ClassDef(AliBalance, 3) |
7f0257ea | 142 | }; |
6c178944 | 143 | |
144 | #endif |