]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/FLOW/Base/AliFlowCommonHist.cxx
updated timestamps following the timestamps of the new simulation in AMANDA, adding...
[u/mrichter/AliRoot.git] / PWG / FLOW / Base / AliFlowCommonHist.cxx
CommitLineData
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
e35ddff0 25#include "TList.h"
44e060e0 26#include "TH2F.h"
f1d945a1 27#include "AliFlowVector.h"
04f6283b 28#include "TBrowser.h"
f1d945a1 29
30class TH1F;
31class TH1D;
32
33// AliFlowCommonHist:
34//
35// Description: Class to organise common histograms for Flow Analysis
a93de0f0 36//
20c03187 37// authors: N. van der Kolk (kolk@nikhef.nl), A. Bilandzic (anteb@nikhef.nl), RS
f1d945a1 38
39
40ClassImp(AliFlowCommonHist)
41
42//-----------------------------------------------------------------------
43
44e060e0 44AliFlowCommonHist::AliFlowCommonHist():
45 TNamed(),
62d19320 46 fBookOnlyBasic(kFALSE),
b7cb54d5 47 fHistMultRP(NULL),
48 fHistMultPOI(NULL),
1073c74a 49 fHistMultPOIvsRP(NULL),
b7cb54d5 50 fHistPtRP(NULL),
51 fHistPtPOI(NULL),
44e060e0 52 fHistPtSub0(NULL),
53 fHistPtSub1(NULL),
b7cb54d5 54 fHistPhiRP(NULL),
55 fHistPhiPOI(NULL),
44e060e0 56 fHistPhiSub0(NULL),
57 fHistPhiSub1(NULL),
b7cb54d5 58 fHistEtaRP(NULL),
59 fHistEtaPOI(NULL),
44e060e0 60 fHistEtaSub0(NULL),
61 fHistEtaSub1(NULL),
62 fHistPhiEtaRP(NULL),
63 fHistPhiEtaPOI(NULL),
7573885c 64 fHistProMeanPtperBin(NULL),
ef749f67 65 fHistWeightvsPhi(NULL),
7573885c 66 fHistQ(NULL),
a93de0f0 67 fHistAngleQ(NULL),
68 fHistAngleQSub0(NULL),
69 fHistAngleQSub1(NULL),
2aa4ebcd 70 fHarmonic(NULL),
c109b8c7 71 fRefMultVsNoOfRPs(NULL),
5c09ff70 72 fHistRefMult(NULL),
15725198 73 fHistMassPOI(NULL),
7573885c 74 fHistList(NULL)
75{
76
77 //default constructor
78
79}
80
81AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
82 TNamed(),
62d19320 83 fBookOnlyBasic(a.fBookOnlyBasic),
b7cb54d5 84 fHistMultRP(new TH1F(*a.fHistMultRP)),
85 fHistMultPOI(new TH1F(*a.fHistMultPOI)),
1073c74a 86 fHistMultPOIvsRP(new TH2F(*a.fHistMultPOIvsRP)),
b7cb54d5 87 fHistPtRP(new TH1F(*a.fHistPtRP)),
88 fHistPtPOI(new TH1F(*a.fHistPtPOI)),
44e060e0 89 fHistPtSub0(new TH1F(*a.fHistPtSub0)),
90 fHistPtSub1(new TH1F(*a.fHistPtSub1)),
b7cb54d5 91 fHistPhiRP(new TH1F(*a.fHistPhiRP)),
92 fHistPhiPOI(new TH1F(*a.fHistPhiPOI)),
44e060e0 93 fHistPhiSub0(new TH1F(*a.fHistPhiSub0)),
94 fHistPhiSub1(new TH1F(*a.fHistPhiSub1)),
b7cb54d5 95 fHistEtaRP(new TH1F(*a.fHistEtaRP)),
96 fHistEtaPOI(new TH1F(*a.fHistEtaPOI)),
44e060e0 97 fHistEtaSub0(new TH1F(*a.fHistEtaSub0)),
98 fHistEtaSub1(new TH1F(*a.fHistEtaSub1)),
99 fHistPhiEtaRP(new TH2F(*a.fHistPhiEtaRP)),
100 fHistPhiEtaPOI(new TH2F(*a.fHistPhiEtaPOI)),
7573885c 101 fHistProMeanPtperBin(new TProfile(*a.fHistProMeanPtperBin)),
ef749f67 102 fHistWeightvsPhi(new TH2F(*a.fHistWeightvsPhi)),
7573885c 103 fHistQ(new TH1F(*a.fHistQ)),
a93de0f0 104 fHistAngleQ(new TH1F(*a.fHistAngleQ)),
105 fHistAngleQSub0(new TH1F(*a.fHistAngleQSub0)),
106 fHistAngleQSub1(new TH1F(*a.fHistAngleQSub1)),
2aa4ebcd 107 fHarmonic(new TProfile(*a.fHarmonic)),
c109b8c7 108 fRefMultVsNoOfRPs(new TProfile(*a.fRefMultVsNoOfRPs)),
5c09ff70 109 fHistRefMult(new TH1F(*a.fHistRefMult)),
15725198 110 fHistMassPOI(new TH2F(*a.fHistMassPOI)),
7573885c 111 fHistList(NULL)
112{
113 // copy constructor
e35ddff0 114
7573885c 115 fHistList = new TList();
b7cb54d5 116 fHistList-> Add(fHistMultRP);
1073c74a 117 fHistList-> Add(fHistMultPOI);
62d19320 118 if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
b7cb54d5 119 fHistList-> Add(fHistPtRP);
44e060e0 120 fHistList-> Add(fHistPtPOI);
62d19320 121 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
122 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
b7cb54d5 123 fHistList-> Add(fHistPhiRP);
44e060e0 124 fHistList-> Add(fHistPhiPOI);
62d19320 125 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
126 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
b7cb54d5 127 fHistList-> Add(fHistEtaRP);
44e060e0 128 fHistList-> Add(fHistEtaPOI);
62d19320 129 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
130 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
131 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
132 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
ef749f67 133 fHistList-> Add(fHistProMeanPtperBin);
62d19320 134 if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
2aa4ebcd 135 fHistList-> Add(fHarmonic);
c109b8c7 136 fHistList-> Add(fRefMultVsNoOfRPs);
5c09ff70 137 fHistList-> Add(fHistRefMult);
15725198 138 fHistList-> Add(fHistMassPOI);
62d19320 139 if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
140 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
141 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
142 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);}
7573885c 143 // TListIter next = TListIter(a.fHistList);
144
145}
146
e35ddff0 147
148//-----------------------------------------------------------------------
149
62d19320 150 AliFlowCommonHist::AliFlowCommonHist(const char *anInput, const char *title, Bool_t bookOnlyBasic):
44e060e0 151 TNamed(anInput,title),
62d19320 152 fBookOnlyBasic(bookOnlyBasic),
44e060e0 153 fHistMultRP(NULL),
154 fHistMultPOI(NULL),
1073c74a 155 fHistMultPOIvsRP(NULL),
44e060e0 156 fHistPtRP(NULL),
157 fHistPtPOI(NULL),
158 fHistPtSub0(NULL),
159 fHistPtSub1(NULL),
160 fHistPhiRP(NULL),
161 fHistPhiPOI(NULL),
162 fHistPhiSub0(NULL),
163 fHistPhiSub1(NULL),
164 fHistEtaRP(NULL),
165 fHistEtaPOI(NULL),
166 fHistEtaSub0(NULL),
167 fHistEtaSub1(NULL),
168 fHistPhiEtaRP(NULL),
169 fHistPhiEtaPOI(NULL),
170 fHistProMeanPtperBin(NULL),
ef749f67 171 fHistWeightvsPhi(NULL),
44e060e0 172 fHistQ(NULL),
a93de0f0 173 fHistAngleQ(NULL),
174 fHistAngleQSub0(NULL),
175 fHistAngleQSub1(NULL),
44e060e0 176 fHarmonic(NULL),
c109b8c7 177 fRefMultVsNoOfRPs(NULL),
5c09ff70 178 fHistRefMult(NULL),
15725198 179 fHistMassPOI(NULL),
44e060e0 180 fHistList(NULL)
181{
e35ddff0 182
f1d945a1 183 //constructor creating histograms
bee2efdc 184 Int_t iNbinsMult = AliFlowCommonConstants::GetMaster()->GetNbinsMult();
185 Int_t iNbinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
186 Int_t iNbinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
187 Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
188 Int_t iNbinsQ = AliFlowCommonConstants::GetMaster()->GetNbinsQ();
15725198 189 Int_t iNbinsMass = AliFlowCommonConstants::GetMaster()->GetNbinsMass();
e35ddff0 190 TString sName;
191
bee2efdc 192 Double_t dMultMin = AliFlowCommonConstants::GetMaster()->GetMultMin();
193 Double_t dMultMax = AliFlowCommonConstants::GetMaster()->GetMultMax();
194 Double_t dPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
195 Double_t dPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
196 Double_t dPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
197 Double_t dPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
198 Double_t dEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
199 Double_t dEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
200 Double_t dQMin = AliFlowCommonConstants::GetMaster()->GetQMin();
201 Double_t dQMax = AliFlowCommonConstants::GetMaster()->GetQMax();
644f1368 202 Double_t dHistWeightvsPhiMin = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMin();
203 Double_t dHistWeightvsPhiMax = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMax();
15725198 204 Double_t dMassMin = AliFlowCommonConstants::GetMaster()->GetMassMin();
205 Double_t dMassMax = AliFlowCommonConstants::GetMaster()->GetMassMax();
206
f1d945a1 207
cea49479 208 // cout<<"The settings for the common histograms are as follows:"<<endl;
209 // cout<<"Multiplicity: "<<iNbinsMult<<" bins between "<<dMultMin<<" and "<<dMultMax<<endl;
210 // cout<<"Pt: "<<iNbinsPt<<" bins between "<<dPtMin<<" and "<<dPtMax<<endl;
211 // cout<<"Phi: "<<iNbinsPhi<<" bins between "<<dPhiMin<<" and "<<dPhiMax<<endl;
212 // cout<<"Eta: "<<iNbinsEta<<" bins between "<<dEtaMin<<" and "<<dEtaMax<<endl;
213 // cout<<"Q: "<<iNbinsQ<<" bins between "<<dQMin<<" and "<<dQMax<<endl;
214 // cout<<"Mass: "<<iNbinsMass<<" bins between "<<dMassMin<<" and "<<dMassMax<<endl;
f1d945a1 215
216 //Multiplicity
b7cb54d5 217 sName = "Control_Flow_MultRP_";
e35ddff0 218 sName +=anInput;
b7cb54d5 219 fHistMultRP = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
220 fHistMultRP ->SetXTitle("Multiplicity for RP selection");
221 fHistMultRP ->SetYTitle("Counts");
f1d945a1 222
b7cb54d5 223 sName = "Control_Flow_MultPOI_";
e35ddff0 224 sName +=anInput;
b7cb54d5 225 fHistMultPOI = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
226 fHistMultPOI ->SetXTitle("Multiplicity for POI selection");
227 fHistMultPOI ->SetYTitle("Counts");
f1d945a1 228
62d19320 229 if(!fBookOnlyBasic){
1073c74a 230 sName = "Control_Flow_MultPOIvsRP_";
231 sName +=anInput;
623ed9af 232 fHistMultPOIvsRP = new TH2F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax,100, dMultMin, dMultMax);
1073c74a 233 fHistMultPOIvsRP->SetXTitle("Multiplicity for RP selection");
234 fHistMultPOIvsRP->SetYTitle("Multiplicity for POI selection");
62d19320 235 }
236
f1d945a1 237 //Pt
b7cb54d5 238 sName = "Control_Flow_PtRP_";
e35ddff0 239 sName +=anInput;
b7cb54d5 240 fHistPtRP = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
241 fHistPtRP ->SetXTitle("P_{t} (GeV/c) for RP selection");
242 fHistPtRP ->SetYTitle("Counts");
f1d945a1 243
b7cb54d5 244 sName = "Control_Flow_PtPOI_";
e35ddff0 245 sName +=anInput;
b7cb54d5 246 fHistPtPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
f1d945a1 247 //binning has to be the same as for fHistProVPt! use to get Nprime!
b7cb54d5 248 fHistPtPOI ->SetXTitle("P_{t} (GeV/c) for POI selection");
249 fHistPtPOI ->SetYTitle("Counts");
f1d945a1 250
62d19320 251 if(!fBookOnlyBasic){
44e060e0 252 sName = "Control_Flow_PtSub0_";
253 sName +=anInput;
254 fHistPtSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
255 fHistPtSub0 ->SetXTitle("P_{t} (GeV/c) for Subevent 0 selection");
256 fHistPtSub0 ->SetYTitle("Counts");
62d19320 257 }
258
259 if(!fBookOnlyBasic){
44e060e0 260 sName = "Control_Flow_PtSub1_";
261 sName +=anInput;
262 fHistPtSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax);
263 fHistPtSub1 ->SetXTitle("P_{t} (GeV/c) for Subevent 1 selection");
264 fHistPtSub1 ->SetYTitle("Counts");
62d19320 265 }
266
f1d945a1 267 //Phi
b7cb54d5 268 sName = "Control_Flow_PhiRP_";
e35ddff0 269 sName +=anInput;
b7cb54d5 270 fHistPhiRP = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
271 fHistPhiRP ->SetXTitle("#phi for RP selection");
272 fHistPhiRP ->SetYTitle("Counts");
f1d945a1 273
b7cb54d5 274 sName = "Control_Flow_PhiPOI_";
e35ddff0 275 sName +=anInput;
b7cb54d5 276 fHistPhiPOI = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
277 fHistPhiPOI ->SetXTitle("#phi for POI selection");
278 fHistPhiPOI ->SetYTitle("Counts");
f1d945a1 279
62d19320 280 if(!fBookOnlyBasic){
44e060e0 281 sName = "Control_Flow_PhiSub0_";
282 sName +=anInput;
283 fHistPhiSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
284 fHistPhiSub0 ->SetXTitle("#phi for Subevent 0 selection");
285 fHistPhiSub0 ->SetYTitle("Counts");
62d19320 286 }
287
288 if(!fBookOnlyBasic){
44e060e0 289 sName = "Control_Flow_PhiSub1_";
290 sName +=anInput;
291 fHistPhiSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
292 fHistPhiSub1 ->SetXTitle("#phi for Subevent 1 selection");
293 fHistPhiSub1 ->SetYTitle("Counts");
62d19320 294 }
295
f1d945a1 296 //Eta
b7cb54d5 297 sName = "Control_Flow_EtaRP_";
e35ddff0 298 sName +=anInput;
b7cb54d5 299 fHistEtaRP = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
300 fHistEtaRP ->SetXTitle("#eta for RP selection");
301 fHistEtaRP ->SetYTitle("Counts");
f1d945a1 302
b7cb54d5 303 sName = "Control_Flow_EtaPOI_";
e35ddff0 304 sName +=anInput;
b7cb54d5 305 fHistEtaPOI = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
306 fHistEtaPOI ->SetXTitle("#eta for POI selection");
307 fHistEtaPOI ->SetYTitle("Counts");
f1d945a1 308
62d19320 309 if(!fBookOnlyBasic){
44e060e0 310 sName = "Control_Flow_EtaSub0_";
311 sName +=anInput;
312 fHistEtaSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
313 fHistEtaSub0 ->SetXTitle("#eta for Subevent 0 selection");
314 fHistEtaSub0 ->SetYTitle("Counts");
62d19320 315 }
316
317 if(!fBookOnlyBasic){
44e060e0 318 sName = "Control_Flow_EtaSub1_";
319 sName +=anInput;
320 fHistEtaSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
321 fHistEtaSub1 ->SetXTitle("#eta for Subevent 1 selection");
322 fHistEtaSub1 ->SetYTitle("Counts");
62d19320 323 }
44e060e0 324
62d19320 325 if(!fBookOnlyBasic){
44e060e0 326 //Phi vs Eta
327 sName = "Control_Flow_PhiEtaRP_";
328 sName +=anInput;
329 fHistPhiEtaRP = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
330 fHistPhiEtaRP ->SetXTitle("#eta");
331 fHistPhiEtaRP ->SetYTitle("#phi");
62d19320 332 }
333
334 if(!fBookOnlyBasic){
44e060e0 335 sName = "Control_Flow_PhiEtaPOI_";
336 sName +=anInput;
337 fHistPhiEtaPOI = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
338 fHistPhiEtaPOI ->SetXTitle("#eta");
339 fHistPhiEtaPOI ->SetYTitle("#phi");
62d19320 340 }
341
f1d945a1 342 //Mean Pt per pt bin
e35ddff0 343 sName = "Control_FlowPro_MeanPtperBin_";
344 sName +=anInput;
345 fHistProMeanPtperBin = new TProfile(sName.Data(), sName.Data(),iNbinsPt,dPtMin,dPtMax);
7ebf0358 346 fHistProMeanPtperBin ->SetXTitle("P_{t} (GeV/c) ");
347 fHistProMeanPtperBin ->SetYTitle("<P_{t}> (GeV/c) ");
f1d945a1 348
62d19320 349
350 if(!fBookOnlyBasic){
ef749f67 351 //Particle weight
352 sName = "Control_Flow_WeightvsPhi_";
353 sName +=anInput;
644f1368 354 fHistWeightvsPhi = new TH2F(sName.Data(), sName.Data(), iNbinsPhi, dPhiMin, dPhiMax, 300, dHistWeightvsPhiMin, dHistWeightvsPhiMax);
ef749f67 355 fHistWeightvsPhi ->SetXTitle("#phi");
356 fHistWeightvsPhi ->SetYTitle("weight");
62d19320 357 }
358
359 if(!fBookOnlyBasic){
f1d945a1 360 //Q vector
e35ddff0 361 sName = "Control_Flow_Q_";
362 sName +=anInput;
363 fHistQ = new TH1F(sName.Data(), sName.Data(),iNbinsQ, dQMin, dQMax);
7ebf0358 364 fHistQ ->SetXTitle("Q_{vector}/Mult");
f1d945a1 365 fHistQ ->SetYTitle("Counts");
62d19320 366 }
367
368 if(!fBookOnlyBasic){
a93de0f0 369 //Angle of Q vector
370 sName = "Control_Flow_AngleQ_";
371 sName +=anInput;
372 fHistAngleQ = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
373 fHistAngleQ ->SetXTitle("Angle of Q_{vector}");
374 fHistAngleQ ->SetYTitle("Counts");
62d19320 375 }
376
377 if(!fBookOnlyBasic){
a93de0f0 378 sName = "Control_Flow_AngleQSub0_";
379 sName +=anInput;
380 fHistAngleQSub0 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
381 fHistAngleQSub0 ->SetXTitle("Angle of Q_{vector} for Subevent 0");
382 fHistAngleQSub0 ->SetYTitle("Counts");
62d19320 383 }
384
385 if(!fBookOnlyBasic){
a93de0f0 386 sName = "Control_Flow_AngleQSub1_";
387 sName +=anInput;
388 fHistAngleQSub1 = new TH1F(sName.Data(), sName.Data(),72, 0., TMath::Pi());
389 fHistAngleQSub1 ->SetXTitle("Angle of Q_{vector} for Subevent 1");
390 fHistAngleQSub1 ->SetYTitle("Counts");
62d19320 391 }
392
2aa4ebcd 393 //harmonic
394 sName = "Control_Flow_Harmonic_";
395 sName +=anInput;
396 fHarmonic = new TProfile(sName.Data(),sName.Data(),1,0,1);
397 fHarmonic ->SetYTitle("harmonic");
c109b8c7 398
399 //<reference multiplicity> versus # of RPs
400 sName = "Reference_Multiplicity_Vs_Number_Of_RPs_";
401 sName +=anInput;
402 fRefMultVsNoOfRPs = new TProfile(sName.Data(),sName.Data(),iNbinsMult, dMultMin, dMultMax);
403 fRefMultVsNoOfRPs->SetYTitle("<reference multiplicity>");
404 fRefMultVsNoOfRPs->SetXTitle("# of RPs");
e35ddff0 405
5c09ff70 406 //reference multiplicity
407 sName = "Control_Flow_Ref_Mult_";
408 sName +=anInput;
409 fHistRefMult = new TH1F(sName.Data(), sName.Data(),iNbinsMult, dMultMin, dMultMax);
410 fHistRefMult->SetXTitle("Reference multiplicity");
411 fHistRefMult->SetYTitle("Counts");
412
15725198 413 //mass for POI selection
414 sName = "Control_Flow_Mass_POI";
415 sName +=anInput;
416 fHistMassPOI = new TH2F(sName.Data(), sName.Data(), iNbinsMass, dMassMin, dMassMax,
417 iNbinsPt, dPtMin, dPtMax);
418 double mbWidth = (dMassMax-dMassMin)/iNbinsMass*1000.;
419 fHistMassPOI->SetXTitle("Mass (GeV/c^{2})");
420 fHistMassPOI->SetYTitle("P_{t} (GeV/c)");
421 fHistMassPOI->SetZTitle( Form("Counts/(%.2f MeV/c^{2})",mbWidth) );
422
7573885c 423 //list of histograms if added here also add in copy constructor
e35ddff0 424 fHistList = new TList();
b7cb54d5 425 fHistList-> Add(fHistMultRP);
1073c74a 426 fHistList-> Add(fHistMultPOI);
62d19320 427 if(!fBookOnlyBasic){fHistList-> Add(fHistMultPOIvsRP);}
b7cb54d5 428 fHistList-> Add(fHistPtRP);
44e060e0 429 fHistList-> Add(fHistPtPOI);
62d19320 430 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub0);}
431 if(!fBookOnlyBasic){fHistList-> Add(fHistPtSub1);}
b7cb54d5 432 fHistList-> Add(fHistPhiRP);
44e060e0 433 fHistList-> Add(fHistPhiPOI);
62d19320 434 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub0);}
435 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiSub1);}
b7cb54d5 436 fHistList-> Add(fHistEtaRP);
44e060e0 437 fHistList-> Add(fHistEtaPOI);
62d19320 438 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub0);}
439 if(!fBookOnlyBasic){fHistList-> Add(fHistEtaSub1);}
440 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaRP);}
441 if(!fBookOnlyBasic){fHistList-> Add(fHistPhiEtaPOI);}
2aa4ebcd 442 fHistList-> Add(fHistProMeanPtperBin);
62d19320 443 if(!fBookOnlyBasic){fHistList-> Add(fHistWeightvsPhi);}
c109b8c7 444 fHistList-> Add(fHarmonic);
445 fHistList-> Add(fRefMultVsNoOfRPs);
5c09ff70 446 fHistList-> Add(fHistRefMult);
15725198 447 fHistList-> Add(fHistMassPOI);
62d19320 448 if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}
449 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
450 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
451 if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub1);}
e35ddff0 452
f1d945a1 453}
454
455
456//-----------------------------------------------------------------------
457
458AliFlowCommonHist::~AliFlowCommonHist()
459{
460 //deletes histograms
b7cb54d5 461 delete fHistMultRP;
1073c74a 462 delete fHistMultPOI;
62d19320 463 if(!fBookOnlyBasic){delete fHistMultPOIvsRP;}
b7cb54d5 464 delete fHistPtRP;
44e060e0 465 delete fHistPtPOI;
62d19320 466 if(!fBookOnlyBasic){delete fHistPtSub0;}
467 if(!fBookOnlyBasic){delete fHistPtSub1;}
b7cb54d5 468 delete fHistPhiRP;
44e060e0 469 delete fHistPhiPOI;
62d19320 470 if(!fBookOnlyBasic){delete fHistPhiSub0;}
471 if(!fBookOnlyBasic){delete fHistPhiSub1;}
b7cb54d5 472 delete fHistEtaRP;
473 delete fHistEtaPOI;
62d19320 474 if(!fBookOnlyBasic){delete fHistEtaSub0;}
475 if(!fBookOnlyBasic){delete fHistEtaSub1;}
44e060e0 476 delete fHistPhiEtaRP;
477 delete fHistPhiEtaPOI;
f1d945a1 478 delete fHistProMeanPtperBin;
62d19320 479 if(!fBookOnlyBasic){delete fHistWeightvsPhi;}
480 if(!fBookOnlyBasic){delete fHistQ;}
481 if(!fBookOnlyBasic){delete fHistAngleQ;}
482 if(!fBookOnlyBasic){delete fHistAngleQSub0;}
483 if(!fBookOnlyBasic){delete fHistAngleQSub1;}
2aa4ebcd 484 delete fHarmonic;
c109b8c7 485 delete fRefMultVsNoOfRPs;
5c09ff70 486 delete fHistRefMult;
15725198 487 delete fHistMassPOI;
e35ddff0 488 delete fHistList;
f1d945a1 489}
490
491
492//-----------------------------------------------------------------------
493
ef749f67 494Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent,TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
f1d945a1 495{
496 //Fills the control histograms
e35ddff0 497 if (!anEvent){
f1d945a1 498 cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
499 return kFALSE;
500 }
501
ef749f67 502 //track datamembers
503 Double_t dPt = 0.;
504 Double_t dPhi = 0.;
505 Double_t dEta = 0.;
506 Double_t dWeight = 1.;
507
508 //weights used for corrections
509 Double_t dWPhi = 1.;
510 Double_t dWPt = 1.;
511 Double_t dWEta = 1.;
512
513 TH1F *phiWeights = NULL;
514 TH1F *phiWeightsSub0 = NULL;
515 TH1F *phiWeightsSub1 = NULL;
516 TH1D *ptWeights = NULL;
517 TH1D *etaWeights = NULL;
518
519 Int_t nBinsPhi = 0;
520 Int_t nBinsPhiSub0 = 0;
521 Int_t nBinsPhiSub1 = 0;
522 Double_t dBinWidthPt = 0.;
523 Double_t dPtMin = 0.;
524 Double_t dBinWidthEta = 0.;
525 Double_t dEtaMin = 0.;
526
527 if(weightsList)
528 {
529 if(usePhiWeights)
530 {
531 phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
532 if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
533 phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
534 if(phiWeightsSub0) nBinsPhiSub0 = phiWeightsSub0->GetNbinsX();
535 phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
536 if(phiWeightsSub1) nBinsPhiSub1 = phiWeightsSub1->GetNbinsX();
537 }
538 if(usePtWeights)
539 {
540 ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
541 if(ptWeights)
542 {
543 dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
544 dPtMin = (ptWeights->GetXaxis())->GetXmin();
545 }
546 }
547 if(useEtaWeights)
548 {
549 etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
550 if(etaWeights)
551 {
552 dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
553 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
554 }
555 }
556 } // end of if(weightsList)
f1d945a1 557
ef749f67 558
559
f1d945a1 560 //fill the histograms
ef749f67 561 AliFlowVector vQ = anEvent->GetQ(2, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
f1d945a1 562 //weight by the Multiplicity
9d062fe3 563 Double_t dQX = 0.;
564 Double_t dQY = 0.;
e60cd248 565 if (vQ.GetMult()!=0) {
9d062fe3 566 dQX = vQ.X()/vQ.GetMult();
567 dQY = vQ.Y()/vQ.GetMult();
568 }
e35ddff0 569 vQ.Set(dQX,dQY);
62d19320 570 if(!fBookOnlyBasic){fHistQ->Fill(vQ.Mod());}
571 if(!fBookOnlyBasic){fHistAngleQ->Fill(vQ.Phi()/2);}
a93de0f0 572
573 AliFlowVector* vQSub = new AliFlowVector[2];
ef749f67 574 anEvent->Get2Qsub(vQSub, 2, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
a93de0f0 575 AliFlowVector vQa = vQSub[0];
576 AliFlowVector vQb = vQSub[1];
62d19320 577 if(!fBookOnlyBasic){fHistAngleQSub0->Fill(vQa.Phi()/2);}
578 if(!fBookOnlyBasic){fHistAngleQSub1->Fill(vQb.Phi()/2);}
f1d945a1 579
04c6b875 580 Double_t dMultRP = 0.;
581 Double_t dMultPOI = 0.;
7ffdc193 582
a93de0f0 583 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
e35ddff0 584 AliFlowTrackSimple* pTrack = NULL;
585
586 for (Int_t i=0;i<iNumberOfTracks;i++) {
587 pTrack = anEvent->GetTrack(i);
588 if (pTrack ) {
04c6b875 589 dWeight = pTrack->Weight();
ef749f67 590 dPt = pTrack->Pt();
591 dPhi = pTrack->Phi();
592 if (dPhi<0.) dPhi+=2*TMath::Pi();
593 dEta = pTrack->Eta();
594
595 //weights are only used for the RP selection
b7cb54d5 596 if (pTrack->InRPSelection()){
ef749f67 597 // determine Phi weight:
598 if(phiWeights && nBinsPhi) {
599 dWPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
600 }
601 // determine v'(pt) weight:
602 if(ptWeights && dBinWidthPt) {
603 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
604 }
605 // determine v'(eta) weight:
606 if(etaWeights && dBinWidthEta) {
607 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
608 }
609
610 //the total weight is the product
611 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
612
44e060e0 613 //pt
ef749f67 614 fHistPtRP->Fill(dPt,dW);
44e060e0 615 //phi
ef749f67 616 fHistPhiRP->Fill(dPhi,dW);
44e060e0 617 //eta
ef749f67 618 fHistEtaRP->Fill(dEta,dW);
44e060e0 619 //eta vs phi
62d19320 620 if(!fBookOnlyBasic){fHistPhiEtaRP->Fill(dEta,dPhi,dW);}
ef749f67 621 //weight vs phi
62d19320 622 if(!fBookOnlyBasic){fHistWeightvsPhi->Fill(dPhi,dW);}
44e060e0 623 //count
ef749f67 624 dMultRP += dW;
625 }
626 if (pTrack->InRPSelection() && pTrack->InSubevent(0)) {
627 // determine Phi weight:
628 if(phiWeightsSub0 && nBinsPhiSub0){
629 dWPhi = phiWeightsSub0->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub0/TMath::TwoPi())));
630 }
631 // determine v'(pt) weight:
632 if(ptWeights && dBinWidthPt) {
633 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
634 }
635 // determine v'(eta) weight:
636 if(etaWeights && dBinWidthEta) {
637 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
638 }
639
640 //the total weight is the product
641 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
642
643 //pt
62d19320 644 if(!fBookOnlyBasic){fHistPtSub0 ->Fill(dPt,dW);}
ef749f67 645 //phi
62d19320 646 if(!fBookOnlyBasic){fHistPhiSub0 ->Fill(dPhi,dW);}
ef749f67 647 //eta
62d19320 648 if(!fBookOnlyBasic){fHistEtaSub0 ->Fill(dEta,dW);}
ef749f67 649 }
650 if (pTrack->InRPSelection() && pTrack->InSubevent(1)) {
651 // determine Phi weight:
652 if(phiWeightsSub1 && nBinsPhiSub1){
653 dWPhi = phiWeightsSub1->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhiSub1/TMath::TwoPi())));
654 }
655 // determine v'(pt) weight:
656 if(ptWeights && dBinWidthPt) {
657 dWPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
658 }
659 // determine v'(eta) weight:
660 if(etaWeights && dBinWidthEta) {
661 dWEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
662 }
663
664 //the total weight is the product
665 Double_t dW = dWeight*dWPhi*dWPt*dWEta;
666
667 //pt
62d19320 668 if(!fBookOnlyBasic){fHistPtSub1 -> Fill(dPt,dW);}
ef749f67 669 //phi
62d19320 670 if(!fBookOnlyBasic){fHistPhiSub1 -> Fill(dPhi,dW);}
ef749f67 671 //eta
62d19320 672 if(!fBookOnlyBasic){fHistEtaSub1 -> Fill(dEta,dW);}
f1d945a1 673 }
b7cb54d5 674 if (pTrack->InPOISelection()){
ef749f67 675
676 Double_t dW = dWeight; //no pt, phi or eta weights
677
44e060e0 678 //pt
ef749f67 679 fHistPtPOI ->Fill(dPt,dW);
44e060e0 680 //phi
ef749f67 681 fHistPhiPOI ->Fill(dPhi,dW);
44e060e0 682 //eta
ef749f67 683 fHistEtaPOI ->Fill(dEta,dW);
44e060e0 684 //eta vs phi
62d19320 685 if(!fBookOnlyBasic){fHistPhiEtaPOI ->Fill(dEta,dPhi,dW);}
44e060e0 686 //mean pt
ef749f67 687 fHistProMeanPtperBin ->Fill(dPt,dPt,dW);
15725198 688 //mass
689 fHistMassPOI->Fill(pTrack->Mass(),dPt,dW);
44e060e0 690 //count
ef749f67 691 dMultPOI += dW;
f1d945a1 692 }
693 } //track
694 } //loop over tracks
695
04c6b875 696 fHistMultRP->Fill(dMultRP);
697 fHistMultPOI->Fill(dMultPOI);
62d19320 698 if(!fBookOnlyBasic){fHistMultPOIvsRP->Fill(dMultRP,dMultPOI);}
c109b8c7 699
700 //<reference multiplicity> versus # of RPs:
701 fRefMultVsNoOfRPs->Fill(dMultRP+0.5,anEvent->GetReferenceMultiplicity(),1.);
5c09ff70 702
703 //reference multiplicity:
704 fHistRefMult->Fill(anEvent->GetReferenceMultiplicity());
f1d945a1 705
706 return kTRUE;
707}
708
709//-----------------------------------------------------------------------
710
e8c3ff94 711Double_t AliFlowCommonHist::GetEntriesInPtBinRP(Int_t aBin)
712{
b7cb54d5 713 //get entries in bin aBin from fHistPtRP
714 Double_t dEntries = fHistPtRP->GetBinContent(aBin);
e8c3ff94 715
716 return dEntries;
717
718}
719
720//-----------------------------------------------------------------------
721
722Double_t AliFlowCommonHist::GetEntriesInPtBinPOI(Int_t aBin)
f1d945a1 723{
b7cb54d5 724 //get entries in bin aBin from fHistPtPOI
725 Double_t dEntries = fHistPtPOI->GetBinContent(aBin);
f1d945a1 726
e35ddff0 727 return dEntries;
f1d945a1 728
729}
730
731//-----------------------------------------------------------------------
732
e8c3ff94 733Double_t AliFlowCommonHist::GetEntriesInEtaBinRP(Int_t aBin)
734{
b7cb54d5 735 //get entries in bin aBin from fHistPtRP
736 Double_t dEntries = fHistEtaRP->GetBinContent(aBin);
e8c3ff94 737
738 return dEntries;
739
740}
741
742//-----------------------------------------------------------------------
743
744Double_t AliFlowCommonHist::GetEntriesInEtaBinPOI(Int_t aBin)
745{
b7cb54d5 746 //get entries in bin aBin from fHistPtPOI
747 Double_t dEntries = fHistEtaPOI->GetBinContent(aBin);
e8c3ff94 748
749 return dEntries;
750
751}
752
753//-----------------------------------------------------------------------
754
e35ddff0 755Double_t AliFlowCommonHist::GetMeanPt(Int_t aBin)
f1d945a1 756{
e35ddff0 757 //Get entry from bin aBin from fHistProMeanPtperBin
758 Double_t dMeanPt = fHistProMeanPtperBin->GetBinContent(aBin);
f1d945a1 759
e35ddff0 760 return dMeanPt;
f1d945a1 761
0683b7d5 762}
763
764
e35ddff0 765//-----------------------------------------------------------------------
766 Double_t AliFlowCommonHist::Merge(TCollection *aList)
767{
768 //merge fuction
567b3738 769 //cout<<"entering merge function"<<endl;
e35ddff0 770 if (!aList) return 0;
771 if (aList->IsEmpty()) return 0; //no merging is needed
772
773 Int_t iCount = 0;
774 TIter next(aList); // list is supposed to contain only objects of the same type as this
775 AliFlowCommonHist *toMerge;
776 // make a temporary list
777 TList *pTemp = new TList();
778 while ((toMerge=(AliFlowCommonHist*)next())) {
779 pTemp->Add(toMerge->GetHistList());
780 iCount++;
781 }
782 // Now call merge for fHistList providing temp list
783 fHistList->Merge(pTemp);
784 // Cleanup
785 delete pTemp;
786
567b3738 787 //cout<<"Merged"<<endl;
e35ddff0 788 return (double)iCount;
789
790}
791
9825d4a9 792void AliFlowCommonHist::Print(Option_t *option) const
793{
20c03187 794 // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
795 // ===============================================
9825d4a9 796 // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
20c03187 797 printf( "Class.Print Name = %s, Histogram list:\n",GetName());
099e1753 798
799 if (fHistList) {
800 fHistList->Print(option);
801 }
802 else
803 {
804 printf( "Empty histogram list \n");
805 }
9825d4a9 806}
807
04f6283b 808//-----------------------------------------------------------------------
809 void AliFlowCommonHist::Browse(TBrowser *b)
810{
9825d4a9 811
04f6283b 812 if (!b) return;
813 if (fHistList) b->Add(fHistList,"AliFlowCommonHistList");
814}
9825d4a9 815
e35ddff0 816
817
818