1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 #include "Riostream.h" //needed as include
21 #include "AliFlowCommonConstants.h" //needed as include
22 #include "AliFlowCommonHist.h"
23 #include "AliFlowEventSimple.h"
24 #include "AliFlowTrackSimple.h"
28 #include "TMath.h" //needed as include
29 #include "AliFlowVector.h"
36 // Description: Class to organise common histograms for Flow Analysis
38 // authors: N. van der Kolk (kolk@nikhef.nl) and A. Bilandzic (anteb@nikhef.nl)
41 ClassImp(AliFlowCommonHist)
43 //-----------------------------------------------------------------------
45 AliFlowCommonHist::AliFlowCommonHist(TString input):
57 fHistProMeanPtperBin(0),
60 //constructor creating histograms
61 Int_t fNbinsMult = AliFlowCommonConstants::GetNbinsMult();
62 Int_t fNbinsPt = AliFlowCommonConstants::GetNbinsPt();
63 Int_t fNbinsPhi = AliFlowCommonConstants::GetNbinsPhi();
64 Int_t fNbinsEta = AliFlowCommonConstants::GetNbinsEta();
65 Int_t fNbinsQ = AliFlowCommonConstants::GetNbinsQ();
68 Double_t fMultMin = AliFlowCommonConstants::GetMultMin();
69 Double_t fMultMax = AliFlowCommonConstants::GetMultMax();
70 Double_t fPtMin = AliFlowCommonConstants::GetPtMin();
71 Double_t fPtMax = AliFlowCommonConstants::GetPtMax();
72 Double_t fPhiMin = AliFlowCommonConstants::GetPhiMin();
73 Double_t fPhiMax = AliFlowCommonConstants::GetPhiMax();
74 Double_t fEtaMin = AliFlowCommonConstants::GetEtaMin();
75 Double_t fEtaMax = AliFlowCommonConstants::GetEtaMax();
76 Double_t fQMin = AliFlowCommonConstants::GetQMin();
77 Double_t fQMax = AliFlowCommonConstants::GetQMax();
79 cout<<"The settings for the common histograms are as follows:"<<endl;
80 cout<<"Multiplicity: "<<fNbinsMult<<" bins between "<<fMultMin<<" and "<<fMultMax<<endl;
81 cout<<"Pt: "<<fNbinsPt<<" bins between "<<fPtMin<<" and "<<fPtMax<<endl;
82 cout<<"Phi: "<<fNbinsPhi<<" bins between "<<fPhiMin<<" and "<<fPhiMax<<endl;
83 cout<<"Eta: "<<fNbinsEta<<" bins between "<<fEtaMin<<" and "<<fEtaMax<<endl;
84 cout<<"Q: "<<fNbinsQ<<" bins between "<<fQMin<<" and "<<fQMax<<endl;
87 name = "Control_Flow_OrigMult_";
89 fHistMultOrig = new TH1F(name.Data(), name.Data(),fNbinsMult, fMultMin, fMultMax);
90 fHistMultOrig ->SetXTitle("Original Multiplicity");
91 fHistMultOrig ->SetYTitle("Counts");
93 name = "Control_Flow_MultInt_";
95 fHistMultInt = new TH1F(name.Data(), name.Data(),fNbinsMult, fMultMin, fMultMax);
96 fHistMultInt ->SetXTitle("Multiplicity for integrated flow");
97 fHistMultInt ->SetYTitle("Counts");
99 name = "Control_Flow_MultDiff_";
101 fHistMultDiff = new TH1F(name.Data(), name.Data(),fNbinsMult, fMultMin, fMultMax);
102 fHistMultDiff ->SetXTitle("Multiplicity for differential flow");
103 fHistMultDiff ->SetYTitle("Counts");
106 name = "Control_Flow_PtInt_";
108 fHistPtInt = new TH1F(name.Data(), name.Data(),fNbinsPt, fPtMin, fPtMax);
109 fHistPtInt ->SetXTitle("Pt (GeV/c) for integrated flow");
110 fHistPtInt ->SetYTitle("Counts");
112 name = "Control_Flow_PtDiff_";
114 fHistPtDiff = new TH1F(name.Data(), name.Data(),fNbinsPt, fPtMin, fPtMax);
115 //binning has to be the same as for fHistProVPt! use to get Nprime!
116 fHistPtDiff ->SetXTitle("Pt (GeV/c) for differential flow");
117 fHistPtDiff ->SetYTitle("Counts");
120 name = "Control_Flow_PhiInt_";
122 fHistPhiInt = new TH1F(name.Data(), name.Data(),fNbinsPhi, fPhiMin, fPhiMax);
123 fHistPhiInt ->SetXTitle("Phi for integrated flow");
124 fHistPhiInt ->SetYTitle("Counts");
126 name = "Control_Flow_PhiDiff_";
128 fHistPhiDiff = new TH1F(name.Data(), name.Data(),fNbinsPhi, fPhiMin, fPhiMax);
129 fHistPhiDiff ->SetXTitle("Phi for differential flow");
130 fHistPhiDiff ->SetYTitle("Counts");
133 name = "Control_Flow_EtaInt_";
135 fHistEtaInt = new TH1F(name.Data(), name.Data(),fNbinsEta, fEtaMin, fEtaMax);
136 fHistEtaInt ->SetXTitle("Eta for integrated flow");
137 fHistEtaInt ->SetYTitle("Counts");
139 name = "Control_Flow_EtaDiff_";
141 fHistEtaDiff = new TH1F(name.Data(), name.Data(),fNbinsEta, fEtaMin, fEtaMax);
142 fHistEtaDiff ->SetXTitle("Eta for differential flow");
143 fHistEtaDiff ->SetYTitle("Counts");
146 name = "Control_FlowPro_MeanPtperBin_";
148 fHistProMeanPtperBin = new TProfile(name.Data(), name.Data(),fNbinsPt,fPtMin,fPtMax);
149 fHistProMeanPtperBin ->SetXTitle("Pt");
150 fHistProMeanPtperBin ->SetYTitle("<Pt>");
153 name = "Control_Flow_Q_";
155 fHistQ = new TH1F(name.Data(), name.Data(),fNbinsQ, fQMin, fQMax);
156 fHistQ ->SetXTitle("Qvector/Mult");
157 fHistQ ->SetYTitle("Counts");
161 //-----------------------------------------------------------------------
163 AliFlowCommonHist::~AliFlowCommonHist()
166 delete fHistMultOrig;
168 delete fHistMultDiff;
175 delete fHistProMeanPtperBin;
180 //-----------------------------------------------------------------------
182 Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* fEvent)
184 //Fills the control histograms
186 cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
190 Double_t fPt, fPhi, fEta;
193 //fill the histograms
194 Int_t fNumberOfTracks = fEvent->NumberOfTracks();
195 fHistMultOrig->Fill(fNumberOfTracks);
197 AliFlowVector fQ = fEvent->GetQ();
198 //weight by the Multiplicity
199 Double_t fQX = fQ.X()/fQ.GetMult();
200 Double_t fQY = fQ.Y()/fQ.GetMult();
202 fHistQ->Fill(fQ.Mod());
206 for (Int_t i=0;i<fNumberOfTracks;i++) {
207 fTrack = fEvent->GetTrack(i);
209 if (fTrack->UseForIntegratedFlow()){
211 fHistPtInt->Fill(fPt);
212 fPhi = fTrack->Phi();
213 if (fPhi<0.) fPhi+=2*TMath::Pi();
214 fHistPhiInt->Fill(fPhi);
215 fEta = fTrack->Eta();
216 fHistEtaInt->Fill(fEta);
219 if (fTrack->UseForDifferentialFlow()){
221 fHistPtDiff->Fill(fPt);
222 fPhi = fTrack->Phi();
223 if (fPhi<0.) fPhi+=2*TMath::Pi();
224 fHistPhiDiff->Fill(fPhi);
225 fEta = fTrack->Eta();
226 fHistEtaDiff->Fill(fEta);
227 fHistProMeanPtperBin->Fill(fPt,fPt);
233 fHistMultInt->Fill(fMultInt);
234 fHistMultDiff->Fill(fMultDiff);
239 //-----------------------------------------------------------------------
241 Double_t AliFlowCommonHist::GetEntriesInPtBin(Int_t fBin)
243 //get entries in bin fBin from fHistPtDiff
244 Double_t fEntries = fHistPtDiff->GetBinContent(fBin);
250 //-----------------------------------------------------------------------
252 Double_t AliFlowCommonHist::GetMeanPt(Int_t fBin)
254 //Get entry from bin fBin from fHistProMeanPtperBin
255 Double_t fMeanPt = fHistProMeanPtperBin->GetBinContent(fBin);