]>
Commit | Line | Data |
---|---|---|
f1d945a1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
f1d945a1 | 16 | #include "Riostream.h" //needed as include |
17 | #include "AliFlowCommonConstants.h" //needed as include | |
18 | #include "AliFlowCommonHist.h" | |
19 | #include "AliFlowEventSimple.h" | |
20 | #include "AliFlowTrackSimple.h" | |
21 | ||
22 | #include "TString.h" | |
23 | #include "TProfile.h" | |
24 | #include "TMath.h" //needed as include | |
25 | #include "AliFlowVector.h" | |
26 | ||
27 | class TH1F; | |
28 | class TH1D; | |
29 | ||
30 | // AliFlowCommonHist: | |
31 | // | |
32 | // Description: Class to organise common histograms for Flow Analysis | |
33 | ||
34 | // authors: N. van der Kolk (kolk@nikhef.nl) and A. Bilandzic (anteb@nikhef.nl) | |
35 | ||
36 | ||
37 | ClassImp(AliFlowCommonHist) | |
38 | ||
39 | //----------------------------------------------------------------------- | |
40 | ||
7ffdc193 | 41 | AliFlowCommonHist::AliFlowCommonHist(TString input):TObject(), |
42 | fHistMultOrig(NULL), | |
43 | fHistMultInt(NULL), | |
44 | fHistMultDiff(NULL), | |
45 | fHistPtInt(NULL), | |
46 | fHistPtDiff(NULL), | |
47 | fHistPhiInt(NULL), | |
48 | fHistPhiDiff(NULL), | |
49 | fHistEtaInt(NULL), | |
50 | fHistEtaDiff(NULL), | |
51 | fHistProMeanPtperBin(NULL), | |
52 | fHistQ(NULL) | |
f1d945a1 | 53 | { |
54 | //constructor creating histograms | |
55 | Int_t fNbinsMult = AliFlowCommonConstants::GetNbinsMult(); | |
56 | Int_t fNbinsPt = AliFlowCommonConstants::GetNbinsPt(); | |
57 | Int_t fNbinsPhi = AliFlowCommonConstants::GetNbinsPhi(); | |
58 | Int_t fNbinsEta = AliFlowCommonConstants::GetNbinsEta(); | |
59 | Int_t fNbinsQ = AliFlowCommonConstants::GetNbinsQ(); | |
60 | TString name; | |
61 | ||
62 | Double_t fMultMin = AliFlowCommonConstants::GetMultMin(); | |
63 | Double_t fMultMax = AliFlowCommonConstants::GetMultMax(); | |
64 | Double_t fPtMin = AliFlowCommonConstants::GetPtMin(); | |
65 | Double_t fPtMax = AliFlowCommonConstants::GetPtMax(); | |
66 | Double_t fPhiMin = AliFlowCommonConstants::GetPhiMin(); | |
67 | Double_t fPhiMax = AliFlowCommonConstants::GetPhiMax(); | |
68 | Double_t fEtaMin = AliFlowCommonConstants::GetEtaMin(); | |
69 | Double_t fEtaMax = AliFlowCommonConstants::GetEtaMax(); | |
70 | Double_t fQMin = AliFlowCommonConstants::GetQMin(); | |
71 | Double_t fQMax = AliFlowCommonConstants::GetQMax(); | |
72 | ||
73 | cout<<"The settings for the common histograms are as follows:"<<endl; | |
74 | cout<<"Multiplicity: "<<fNbinsMult<<" bins between "<<fMultMin<<" and "<<fMultMax<<endl; | |
75 | cout<<"Pt: "<<fNbinsPt<<" bins between "<<fPtMin<<" and "<<fPtMax<<endl; | |
76 | cout<<"Phi: "<<fNbinsPhi<<" bins between "<<fPhiMin<<" and "<<fPhiMax<<endl; | |
77 | cout<<"Eta: "<<fNbinsEta<<" bins between "<<fEtaMin<<" and "<<fEtaMax<<endl; | |
78 | cout<<"Q: "<<fNbinsQ<<" bins between "<<fQMin<<" and "<<fQMax<<endl; | |
79 | ||
80 | //Multiplicity | |
81 | name = "Control_Flow_OrigMult_"; | |
82 | name +=input; | |
83 | fHistMultOrig = new TH1F(name.Data(), name.Data(),fNbinsMult, fMultMin, fMultMax); | |
84 | fHistMultOrig ->SetXTitle("Original Multiplicity"); | |
85 | fHistMultOrig ->SetYTitle("Counts"); | |
86 | ||
87 | name = "Control_Flow_MultInt_"; | |
88 | name +=input; | |
89 | fHistMultInt = new TH1F(name.Data(), name.Data(),fNbinsMult, fMultMin, fMultMax); | |
90 | fHistMultInt ->SetXTitle("Multiplicity for integrated flow"); | |
91 | fHistMultInt ->SetYTitle("Counts"); | |
92 | ||
93 | name = "Control_Flow_MultDiff_"; | |
94 | name +=input; | |
95 | fHistMultDiff = new TH1F(name.Data(), name.Data(),fNbinsMult, fMultMin, fMultMax); | |
96 | fHistMultDiff ->SetXTitle("Multiplicity for differential flow"); | |
97 | fHistMultDiff ->SetYTitle("Counts"); | |
98 | ||
99 | //Pt | |
100 | name = "Control_Flow_PtInt_"; | |
101 | name +=input; | |
102 | fHistPtInt = new TH1F(name.Data(), name.Data(),fNbinsPt, fPtMin, fPtMax); | |
103 | fHistPtInt ->SetXTitle("Pt (GeV/c) for integrated flow"); | |
104 | fHistPtInt ->SetYTitle("Counts"); | |
105 | ||
106 | name = "Control_Flow_PtDiff_"; | |
107 | name +=input; | |
108 | fHistPtDiff = new TH1F(name.Data(), name.Data(),fNbinsPt, fPtMin, fPtMax); | |
109 | //binning has to be the same as for fHistProVPt! use to get Nprime! | |
110 | fHistPtDiff ->SetXTitle("Pt (GeV/c) for differential flow"); | |
111 | fHistPtDiff ->SetYTitle("Counts"); | |
112 | ||
113 | //Phi | |
114 | name = "Control_Flow_PhiInt_"; | |
115 | name +=input; | |
116 | fHistPhiInt = new TH1F(name.Data(), name.Data(),fNbinsPhi, fPhiMin, fPhiMax); | |
117 | fHistPhiInt ->SetXTitle("Phi for integrated flow"); | |
118 | fHistPhiInt ->SetYTitle("Counts"); | |
119 | ||
120 | name = "Control_Flow_PhiDiff_"; | |
121 | name +=input; | |
122 | fHistPhiDiff = new TH1F(name.Data(), name.Data(),fNbinsPhi, fPhiMin, fPhiMax); | |
123 | fHistPhiDiff ->SetXTitle("Phi for differential flow"); | |
124 | fHistPhiDiff ->SetYTitle("Counts"); | |
125 | ||
126 | //Eta | |
127 | name = "Control_Flow_EtaInt_"; | |
128 | name +=input; | |
129 | fHistEtaInt = new TH1F(name.Data(), name.Data(),fNbinsEta, fEtaMin, fEtaMax); | |
130 | fHistEtaInt ->SetXTitle("Eta for integrated flow"); | |
131 | fHistEtaInt ->SetYTitle("Counts"); | |
132 | ||
133 | name = "Control_Flow_EtaDiff_"; | |
134 | name +=input; | |
135 | fHistEtaDiff = new TH1F(name.Data(), name.Data(),fNbinsEta, fEtaMin, fEtaMax); | |
136 | fHistEtaDiff ->SetXTitle("Eta for differential flow"); | |
137 | fHistEtaDiff ->SetYTitle("Counts"); | |
138 | ||
139 | //Mean Pt per pt bin | |
140 | name = "Control_FlowPro_MeanPtperBin_"; | |
141 | name +=input; | |
142 | fHistProMeanPtperBin = new TProfile(name.Data(), name.Data(),fNbinsPt,fPtMin,fPtMax); | |
143 | fHistProMeanPtperBin ->SetXTitle("Pt"); | |
144 | fHistProMeanPtperBin ->SetYTitle("<Pt>"); | |
145 | ||
146 | //Q vector | |
147 | name = "Control_Flow_Q_"; | |
148 | name +=input; | |
149 | fHistQ = new TH1F(name.Data(), name.Data(),fNbinsQ, fQMin, fQMax); | |
150 | fHistQ ->SetXTitle("Qvector/Mult"); | |
151 | fHistQ ->SetYTitle("Counts"); | |
152 | } | |
153 | ||
154 | ||
155 | //----------------------------------------------------------------------- | |
156 | ||
157 | AliFlowCommonHist::~AliFlowCommonHist() | |
158 | { | |
159 | //deletes histograms | |
160 | delete fHistMultOrig; | |
161 | delete fHistMultInt; | |
162 | delete fHistMultDiff; | |
163 | delete fHistPtInt; | |
164 | delete fHistPtDiff; | |
165 | delete fHistPhiInt; | |
166 | delete fHistPhiDiff; | |
167 | delete fHistEtaInt; | |
168 | delete fHistEtaDiff; | |
169 | delete fHistProMeanPtperBin; | |
170 | delete fHistQ; | |
171 | } | |
172 | ||
173 | ||
174 | //----------------------------------------------------------------------- | |
175 | ||
8232a5ec | 176 | Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* Event) |
f1d945a1 | 177 | { |
178 | //Fills the control histograms | |
8232a5ec | 179 | if (!Event){ |
f1d945a1 | 180 | cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl; |
181 | return kFALSE; | |
182 | } | |
183 | ||
184 | Double_t fPt, fPhi, fEta; | |
185 | ||
186 | ||
187 | //fill the histograms | |
8232a5ec | 188 | Int_t fNumberOfTracks = Event->NumberOfTracks(); |
f1d945a1 | 189 | fHistMultOrig->Fill(fNumberOfTracks); |
190 | ||
8232a5ec | 191 | AliFlowVector fQ = Event->GetQ(); |
f1d945a1 | 192 | //weight by the Multiplicity |
193 | Double_t fQX = fQ.X()/fQ.GetMult(); | |
194 | Double_t fQY = fQ.Y()/fQ.GetMult(); | |
195 | fQ.Set(fQX,fQY); | |
196 | fHistQ->Fill(fQ.Mod()); | |
197 | ||
198 | Int_t fMultInt = 0; | |
199 | Int_t fMultDiff = 0; | |
7ffdc193 | 200 | |
201 | AliFlowTrackSimple* fTrack = NULL; | |
202 | ||
f1d945a1 | 203 | for (Int_t i=0;i<fNumberOfTracks;i++) { |
8232a5ec | 204 | fTrack = Event->GetTrack(i); |
f1d945a1 | 205 | if (fTrack ) { |
206 | if (fTrack->UseForIntegratedFlow()){ | |
207 | fPt = fTrack->Pt(); | |
208 | fHistPtInt->Fill(fPt); | |
209 | fPhi = fTrack->Phi(); | |
210 | if (fPhi<0.) fPhi+=2*TMath::Pi(); | |
211 | fHistPhiInt->Fill(fPhi); | |
212 | fEta = fTrack->Eta(); | |
213 | fHistEtaInt->Fill(fEta); | |
214 | fMultInt++; | |
215 | } | |
216 | if (fTrack->UseForDifferentialFlow()){ | |
217 | fPt = fTrack->Pt(); | |
218 | fHistPtDiff->Fill(fPt); | |
219 | fPhi = fTrack->Phi(); | |
220 | if (fPhi<0.) fPhi+=2*TMath::Pi(); | |
221 | fHistPhiDiff->Fill(fPhi); | |
222 | fEta = fTrack->Eta(); | |
223 | fHistEtaDiff->Fill(fEta); | |
224 | fHistProMeanPtperBin->Fill(fPt,fPt); | |
225 | fMultDiff++; | |
226 | } | |
227 | } //track | |
228 | } //loop over tracks | |
229 | ||
230 | fHistMultInt->Fill(fMultInt); | |
231 | fHistMultDiff->Fill(fMultDiff); | |
232 | ||
233 | return kTRUE; | |
234 | } | |
235 | ||
236 | //----------------------------------------------------------------------- | |
237 | ||
238 | Double_t AliFlowCommonHist::GetEntriesInPtBin(Int_t fBin) | |
239 | { | |
240 | //get entries in bin fBin from fHistPtDiff | |
241 | Double_t fEntries = fHistPtDiff->GetBinContent(fBin); | |
242 | ||
243 | return fEntries; | |
244 | ||
245 | } | |
246 | ||
247 | //----------------------------------------------------------------------- | |
248 | ||
249 | Double_t AliFlowCommonHist::GetMeanPt(Int_t fBin) | |
250 | { | |
251 | //Get entry from bin fBin from fHistProMeanPtperBin | |
252 | Double_t fMeanPt = fHistProMeanPtperBin->GetBinContent(fBin); | |
253 | ||
254 | return fMeanPt; | |
255 | ||
0683b7d5 | 256 | } |
257 | ||
258 |