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"
21 #include "AliFlowLYZHist1.h"
22 #include "AliFlowLYZConstants.h" //??
30 // Class to organize the histograms in the first run
31 // in the Lee Yang Zeros Flow analysis.
32 // Also contains methods to find the first minimum R0
33 // of the generating function.
34 // author: N. van der Kolk (kolk@nikhef.nl)
37 ClassImp(AliFlowLYZHist1)
41 //-----------------------------------------------------------------------
43 AliFlowLYZHist1::AliFlowLYZHist1(Int_t theta, Int_t har)
45 //constructor creating histograms
46 Int_t fNbins = AliFlowLYZConstants::kNbins;
47 Float_t fMin = AliFlowLYZConstants::fgMin;
48 Float_t fMax = AliFlowLYZConstants::fgMax;
53 name = "FirstHist_FlowLYZ_Gtheta";
57 title = "FirstHist_FlowLYZ_Gtheta";
61 fHistGtheta = new TH1D(name.Data(),title.Data(),fNbins,fMin,fMax);
62 fHistGtheta->SetXTitle("r");
63 fHistGtheta->SetYTitle("|G^{#theta}(ir)|^{2}");
66 name = "FirstHist_FlowProLYZ_ReGtheta";
70 title = "FirstHist_FlowProLYZ_ReGtheta";
74 fHistProReGtheta = new TProfile(name.Data(),title.Data(),fNbins,fMin,fMax);
75 fHistProReGtheta->SetXTitle("r");
76 fHistProReGtheta->SetYTitle("Re G^{#theta}(ir)");
79 name = "FirstHist_FlowProLYZ_ImGtheta";
83 title = "FirstHist_FlowProLYZ_ImGtheta";
87 fHistProImGtheta = new TProfile(name.Data(),title.Data(),fNbins,fMin,fMax);
88 fHistProImGtheta->SetXTitle("r");
89 fHistProImGtheta->SetYTitle("Im G^{#theta}(ir)");
96 //-----------------------------------------------------------------------
98 AliFlowLYZHist1::~AliFlowLYZHist1()
102 delete fHistProReGtheta;
103 delete fHistProImGtheta;
108 //-----------------------------------------------------------------------
110 void AliFlowLYZHist1::Fill(Float_t f, TComplex C)
112 //fill the histograms
114 fHistProReGtheta->Fill(f, C.Re());
115 fHistProImGtheta->Fill(f, C.Im());
120 //-----------------------------------------------------------------------
122 TH1D* AliFlowLYZHist1::FillGtheta()
124 //fill the fHistGtheta histograms
125 Int_t fNbins = fHistGtheta->GetNbinsX();
126 for (Int_t bin=1;bin<=fNbins;bin++)
128 //get bincentre of bins in histogram
129 Float_t fBin = fHistGtheta->GetBinCenter(bin);
130 Float_t fRe = fHistProReGtheta->GetBinContent(bin);
131 Float_t fIm = fHistProImGtheta->GetBinContent(bin);
132 TComplex fGtheta(fRe,fIm);
133 //fill fHistGtheta with the modulus squared of fGtheta
134 fHistGtheta->Fill(fBin,fGtheta.Rho2());
140 //-----------------------------------------------------------------------
142 Float_t AliFlowLYZHist1::GetR0()
144 //find the first minimum of the square of the modulus of Gtheta
146 Int_t fNbins = fHistGtheta->GetNbinsX();
149 for (Int_t b=2;b<fNbins;b++)
151 Float_t fG0 = fHistGtheta->GetBinContent(b);
152 Float_t fGnext = fHistGtheta->GetBinContent(b+1);
153 Float_t fGnextnext = fHistGtheta->GetBinContent(b+2);
154 //fprintf(fTemp,"%f\t %f\t %f\n",fG0,fGnext,fGnextnext);
156 if (fGnext > fG0 && fGnextnext > fG0)
158 Float_t fGlast = fHistGtheta->GetBinContent(b-1);
159 Float_t fXlast = fHistGtheta->GetBinCenter(b-1);
160 Float_t fX0 = fHistGtheta->GetBinCenter(b);
161 Float_t fXnext = fHistGtheta->GetBinCenter(b+1);
163 fR0 = fX0 - ((fX0-fXlast)*(fX0-fXlast)*(fG0-fGnext) - (fX0-fXnext)*(fX0-fXnext)*(fG0-fGlast))/
164 (2.*((fX0-fXlast)*(fG0-fGnext) - (fX0-fXnext)*(fG0-fGlast))); //interpolated minimum
166 break; //stop loop if minimum is found
175 //-----------------------------------------------------------------------
176 Float_t AliFlowLYZHist1::GetBinCenter(Int_t i)
178 //gets bincenter of histogram
179 Float_t fR = fHistGtheta->GetBinCenter(i);
184 //-----------------------------------------------------------------------
186 Int_t AliFlowLYZHist1::GetNBins()
189 Int_t fNbins = fHistGtheta->GetNbinsX();