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" //in case one wants to make print statements
24 #include "AliFlowLYZConstants.h"
25 #include "AliFlowLYZHist1.h"
31 // Class to organize the histograms in the first run
32 // in the Lee Yang Zeros Flow analysis.
33 // Also contains methods to find the first minimum R0
34 // of the generating function.
35 // author: N. van der Kolk (kolk@nikhef.nl)
38 ClassImp(AliFlowLYZHist1)
42 //-----------------------------------------------------------------------
44 AliFlowLYZHist1::AliFlowLYZHist1(Int_t theta):
50 //constructor creating histograms
51 Int_t iNbins = AliFlowLYZConstants::kNbins;
52 Double_t dMin = AliFlowLYZConstants::fgMin;
53 Double_t dMax = AliFlowLYZConstants::fgMax;
58 name = "First_Flow_Gtheta";
61 title = "First_Flow_Gtheta";
64 fHistGtheta = new TH1D(name.Data(),title.Data(),iNbins,dMin,dMax);
65 fHistGtheta->SetXTitle("r");
66 fHistGtheta->SetYTitle("|G^{#theta}(ir)|^{2}");
69 name = "First_FlowPro_ReGtheta";
72 title = "First_FlowPro_ReGtheta";
75 fHistProReGtheta = new TProfile(name.Data(),title.Data(),iNbins,dMin,dMax);
76 fHistProReGtheta->SetXTitle("r");
77 fHistProReGtheta->SetYTitle("Re G^{#theta}(ir)");
80 name = "First_FlowPro_ImGtheta";
83 title = "First_FlowPro_ImGtheta";
86 fHistProImGtheta = new TProfile(name.Data(),title.Data(),iNbins,dMin,dMax);
87 fHistProImGtheta->SetXTitle("r");
88 fHistProImGtheta->SetYTitle("Im G^{#theta}(ir)");
92 //-----------------------------------------------------------------------
94 AliFlowLYZHist1::~AliFlowLYZHist1()
98 delete fHistProReGtheta;
99 delete fHistProImGtheta;
102 //-----------------------------------------------------------------------
104 void AliFlowLYZHist1::Fill(Double_t f, TComplex c)
106 //fill the histograms
108 fHistProReGtheta->Fill(f, c.Re());
109 fHistProImGtheta->Fill(f, c.Im());
112 //-----------------------------------------------------------------------
114 TH1D* AliFlowLYZHist1::FillGtheta()
116 //fill the fHistGtheta histograms
117 Int_t iNbins = fHistGtheta->GetNbinsX();
118 for (Int_t bin=1;bin<=iNbins;bin++)
120 //get bincentre of bins in histogram
121 Double_t dBin = fHistGtheta->GetBinCenter(bin);
122 Double_t dRe = fHistProReGtheta->GetBinContent(bin);
123 Double_t dIm = fHistProImGtheta->GetBinContent(bin);
124 TComplex cGtheta(dRe,dIm);
125 //fill fHistGtheta with the modulus squared of cGtheta
126 fHistGtheta->Fill(dBin,cGtheta.Rho2());
132 //-----------------------------------------------------------------------
134 Double_t AliFlowLYZHist1::GetR0()
136 //find the first minimum of the square of the modulus of Gtheta
138 Int_t iNbins = fHistGtheta->GetNbinsX();
141 for (Int_t b=2;b<iNbins;b++)
143 Double_t dG0 = fHistGtheta->GetBinContent(b);
144 Double_t dGnext = fHistGtheta->GetBinContent(b+1);
145 Double_t dGnextnext = fHistGtheta->GetBinContent(b+2);
147 if (dGnext > dG0 && dGnextnext > dG0)
149 Double_t dGlast = fHistGtheta->GetBinContent(b-1);
150 Double_t dXlast = fHistGtheta->GetBinCenter(b-1);
151 Double_t dX0 = fHistGtheta->GetBinCenter(b);
152 Double_t dXnext = fHistGtheta->GetBinCenter(b+1);
154 dR0 = dX0 - ((dX0-dXlast)*(dX0-dXlast)*(dG0-dGnext) - (dX0-dXnext)*(dX0-dXnext)*(dG0-dGlast))/
155 (2.*((dX0-dXlast)*(dG0-dGnext) - (dX0-dXnext)*(dG0-dGlast))); //interpolated minimum
157 break; //stop loop if minimum is found
166 //-----------------------------------------------------------------------
167 Double_t AliFlowLYZHist1::GetBinCenter(Int_t i)
169 //gets bincenter of histogram
170 Double_t dR = fHistGtheta->GetBinCenter(i);
174 //-----------------------------------------------------------------------
176 Int_t AliFlowLYZHist1::GetNBins()
179 Int_t iNbins = fHistGtheta->GetNbinsX();