3 /* See cxx source for full Copyright notice */
8 //-------------------------------------------------------------------------
10 // This is the class for the Balance Function analysis
12 // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
13 //-------------------------------------------------------------------------
18 #define ANALYSIS_TYPES 7
19 #define MAXIMUM_NUMBER_OF_STEPS 1024
25 const TString gBFAnalysisType[ANALYSIS_TYPES] = {"y","eta","qlong","qout","qside","qinv","phi"};
27 class AliBalance : public TObject {
40 AliBalance(const AliBalance& balance);
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; }
56 void InitHistograms(void);
58 const char* GetAnalysisLevel() {return fAnalysisLevel.Data();}
59 Int_t GetNumberOfAnalyzedEvent() {return fAnalyzedEvents;}
61 Int_t GetNumberOfBins(Int_t ibin) {return fNumberOfBins[ibin];}
62 Double_t GetP1Start(Int_t ibin){return fP1Start[ibin];}
63 Double_t GetP1Stop(Int_t ibin){return fP1Stop[ibin];}
64 Double_t GetP2Start(Int_t ibin){return fP2Start[ibin];}
65 Double_t GetP2Stop(Int_t ibin){return fP2Stop[ibin];}
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 {
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]; }
78 void CalculateBalance(TObjArray *gTrackArray);
80 Double_t GetBalance(Int_t a, Int_t p2);
81 Double_t GetError(Int_t a, Int_t p2);
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];}
90 void PrintAnalysisSettings();
91 TGraphErrors *drawBalance(Int_t fAnalysisType);
92 void SetGraphTitle(TGraphErrors *gr, Int_t fAnalysisType);
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;}
107 TH1D *GetBalanceFunctionHistogram(Int_t iAnalysisType);
108 void PrintResults(Int_t iAnalysisType, TH1D *gHist);
112 Bool_t bShuffle; //shuffled balance function object
113 TString fAnalysisLevel; //ESD, AOD or MC
114 Int_t fAnalyzedEvents; //number of events that have been analyzed
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];
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(+-)
126 Double_t fNnp[ANALYSIS_TYPES][MAXIMUM_NUMBER_OF_STEPS]; //N(-+)
127 Double_t fNn[ANALYSIS_TYPES], fNp[ANALYSIS_TYPES]; //number of pos./neg. inside the analyzed interval
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
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--
139 AliBalance & operator=(const AliBalance & ) {return *this;}
141 ClassDef(AliBalance, 3)