]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFittingQDistribution.cxx
fix coding violations
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFittingQDistribution.cxx
CommitLineData
9bed2723 1/*************************************************************************
2* Copyright(c) 1998-2008, 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
16/********************************
17 * integrated flow estimate by *
18 * fitting q-distribution *
19 * *
20 * author: Ante Bilandzic *
21 * (anteb@nikhef.nl) *
22 *******************************/
23
24#define AliFittingQDistribution_cxx
25
26#include "Riostream.h"
27#include "AliFlowCommonConstants.h"
28#include "AliFlowCommonHist.h"
29#include "AliFlowCommonHistResults.h"
30#include "TChain.h"
31#include "TFile.h"
32#include "TList.h"
33#include "TParticle.h"
34#include "TProfile.h"
35#include "AliFlowEventSimple.h"
36#include "AliFlowTrackSimple.h"
37#include "AliFittingQDistribution.h"
1315fe58 38#include "AliFittingFunctionsForQDistribution.h"
9bed2723 39
40class TH1;
41class TGraph;
42class TPave;
43class TLatex;
44class TMarker;
45class TObjArray;
46class TList;
47class TCanvas;
48class TSystem;
49class TROOT;
50class AliFlowVector;
51class TVector;
52
53//================================================================================================================
54
55ClassImp(AliFittingQDistribution)
56
57AliFittingQDistribution::AliFittingQDistribution():
58 fTrack(NULL),
59 fHistList(NULL),
14db9c04 60 fWeightsList(NULL),
9bed2723 61 fAvMultIntFlowFQD(NULL),
62 fIntFlowResultsFQD(NULL),
1425a855 63 fSigma2(NULL),
9bed2723 64 fCommonHists(NULL),
4b2e3a73 65 fCommonHistsResults(NULL),
14db9c04 66 fQDistributionFQD(NULL),
6f5d8033 67 fUsePhiWeights(kFALSE)
9bed2723 68{
69 //constructor
14db9c04 70 fHistList = new TList();
71 fWeightsList = new TList();
9bed2723 72}
73
74AliFittingQDistribution::~AliFittingQDistribution()
75{
76 //desctructor
77 delete fHistList;
14db9c04 78 delete fWeightsList;
9bed2723 79}
80
81//================================================================================================================
82
14db9c04 83void AliFittingQDistribution::Init()
9bed2723 84{
85 //various output histograms
86
87 //avarage multiplicity
88 fAvMultIntFlowFQD = new TProfile("fAvMultIntFlowFQD","Average Multiplicity",1,0,1,"s");
89 fAvMultIntFlowFQD->SetXTitle("");
90 fAvMultIntFlowFQD->SetYTitle("");
91 fAvMultIntFlowFQD->SetLabelSize(0.06);
92 fAvMultIntFlowFQD->SetMarkerStyle(25);
4b2e3a73 93 fAvMultIntFlowFQD->SetLabelOffset(0.02);
9bed2723 94 (fAvMultIntFlowFQD->GetXaxis())->SetBinLabel(1,"Average Multiplicity");
95 fHistList->Add(fAvMultIntFlowFQD);
96
97 //final result for integrated flow
98 fIntFlowResultsFQD = new TH1D("fIntFlowResultsFQD","Integrated Flow By Fitting q-distribution",1,0,1);
99 fIntFlowResultsFQD->SetXTitle("");
100 fIntFlowResultsFQD->SetYTitle("");
101 fIntFlowResultsFQD->SetMarkerStyle(25);
102 fIntFlowResultsFQD->SetLabelSize(0.06);
1425a855 103 fIntFlowResultsFQD->SetLabelOffset(0.02);
4b2e3a73 104 (fIntFlowResultsFQD->GetXaxis())->SetBinLabel(1,"v_{n}{FQD}");
9bed2723 105 fHistList->Add(fIntFlowResultsFQD);
106
1425a855 107 //sigma^2
108 fSigma2 = new TH1D("fSigma2","#sigma^{2}",1,0,1);
109 fSigma2->SetXTitle("");
110 fSigma2->SetYTitle("");
111 fSigma2->SetMarkerStyle(25);
112 fSigma2->SetLabelSize(0.06);
113 fSigma2->SetLabelOffset(0.02);
114 (fSigma2->GetXaxis())->SetBinLabel(1,"#sigma^{2}");
115 fHistList->Add(fSigma2);
116
9bed2723 117 //q-distribution
118 fQDistributionFQD = new TH1D("fQDistributionFQD","q-distribution",100,0,10);
119 fQDistributionFQD->SetXTitle("q_{n}=Q_{n}/#sqrt{M}");
120 fQDistributionFQD->SetYTitle("Counts");
121 fHistList->Add(fQDistributionFQD);
122
123 //common control histograms
4b2e3a73 124 fCommonHists = new AliFlowCommonHist("AliFlowCommonHistFQD");
125 fHistList->Add(fCommonHists);
126
127 //common histograms for final results (2nd order)
128 fCommonHistsResults= new AliFlowCommonHistResults("AliFlowCommonHistResultsFQD");
129 fHistList->Add(fCommonHistsResults);
9bed2723 130
14db9c04 131}//end of Init()
9bed2723 132
133//================================================================================================================
134
135void AliFittingQDistribution::Make(AliFlowEventSimple* anEvent)
136{
137
138 //Int_t nPrim = anEvent->NumberOfTracks();//total multiplicity
139
140 Int_t n=2;//harmonic (to be improved)
141
142 //fill the common control histograms
143 fCommonHists->FillControlHistograms(anEvent);
144
145 //calculating Q-vector of event
146 AliFlowVector fQVector;
147 fQVector.Set(0.,0.);
148 fQVector.SetMult(0);
6f5d8033 149 fQVector=anEvent->GetQ(n,fWeightsList,fUsePhiWeights);
9bed2723 150
151 //multiplicity
152 fAvMultIntFlowFQD->Fill(0.,fQVector.GetMult(),1.);
153
154 //q = Q/sqrt(M)
155 Double_t q=0.;
156
157 if(fQVector.GetMult()!=0)
158 {
159 q = fQVector.Mod()/sqrt(fQVector.GetMult());
160 fQDistributionFQD->Fill(q,1.);
161 }
1315fe58 162}//end of Make()
9bed2723 163
164//================================================================================================================
165
166void AliFittingQDistribution::Finish()
167{
1315fe58 168 //calculate the final results
1425a855 169 AliFittingFunctionsForQDistribution finalFitting(fAvMultIntFlowFQD,fQDistributionFQD,fIntFlowResultsFQD,fSigma2,fCommonHistsResults);
1315fe58 170
171 finalFitting.Calculate();
172}
173
174//================================================================================================================
175
176void AliFittingQDistribution::WriteHistograms(TString* outputFileName)
177{
178 //store the final results in output .root file
179 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
7a2c2652 180 output->WriteObject(fHistList, "cobjFQD","SingleKey");
1315fe58 181 delete output;
9bed2723 182}
183
1315fe58 184//================================================================================================================
185
b0fda271 186void AliFittingQDistribution::WriteHistograms(TString outputFileName)
187{
188 //store the final results in output .root file
189 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
190 output->WriteObject(fHistList, "cobjFQD","SingleKey");
191 delete output;
192}
193
194//================================================================================================================
195
9bed2723 196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212