]>
Commit | Line | Data |
---|---|---|
f456b167 | 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 | ||
f456b167 | 16 | |
448e8856 | 17 | //#include "Riostream.h" //in case one wants to make print statements |
f456b167 | 18 | #include "TProfile.h" |
19 | #include "TString.h" | |
8de6876d | 20 | #include "TComplex.h" |
21 | #include "TList.h" | |
448e8856 | 22 | #include "AliFlowLYZConstants.h" |
23 | #include "AliFlowLYZHist1.h" | |
9d062fe3 | 24 | #include "TBrowser.h" |
448e8856 | 25 | |
f456b167 | 26 | class TH1D; |
27 | ||
f456b167 | 28 | // Class to organize the histograms in the first run |
29 | // in the Lee Yang Zeros Flow analysis. | |
30 | // Also contains methods to find the first minimum R0 | |
31 | // of the generating function. | |
32 | // author: N. van der Kolk (kolk@nikhef.nl) | |
33 | ||
f456b167 | 34 | ClassImp(AliFlowLYZHist1) |
35 | ||
8de6876d | 36 | //----------------------------------------------------------------------- |
37 | ||
38 | AliFlowLYZHist1::AliFlowLYZHist1(): | |
9d062fe3 | 39 | TNamed(), |
8de6876d | 40 | fHistGtheta(0), |
41 | fHistProReGtheta(0), | |
42 | fHistProImGtheta(0), | |
43 | fHistList(NULL) | |
44 | { | |
45 | //default constructor | |
46 | } | |
f456b167 | 47 | |
48 | //----------------------------------------------------------------------- | |
49 | ||
9d062fe3 | 50 | AliFlowLYZHist1::AliFlowLYZHist1(Int_t theta, const char *anInput,const char *aTitle): |
51 | TNamed(anInput,aTitle), | |
448e8856 | 52 | fHistGtheta(0), |
53 | fHistProReGtheta(0), | |
8de6876d | 54 | fHistProImGtheta(0), |
55 | fHistList(NULL) | |
f456b167 | 56 | { |
448e8856 | 57 | |
f456b167 | 58 | //constructor creating histograms |
882ffd6a | 59 | Int_t iNbins = AliFlowLYZConstants::kNbins; |
60 | Double_t dMin = AliFlowLYZConstants::fgMin; | |
61 | Double_t dMax = AliFlowLYZConstants::fgMax; | |
f456b167 | 62 | TString title, name; |
63 | ||
64 | ||
65 | //fHistGtheta | |
448e8856 | 66 | name = "First_Flow_Gtheta"; |
f456b167 | 67 | name +=theta; |
448e8856 | 68 | name +="_LYZ"; |
69 | title = "First_Flow_Gtheta"; | |
f456b167 | 70 | title +=theta; |
448e8856 | 71 | title +="_LYZ"; |
882ffd6a | 72 | fHistGtheta = new TH1D(name.Data(),title.Data(),iNbins,dMin,dMax); |
f456b167 | 73 | fHistGtheta->SetXTitle("r"); |
74 | fHistGtheta->SetYTitle("|G^{#theta}(ir)|^{2}"); | |
75 | ||
76 | //fHistProReGtheta | |
448e8856 | 77 | name = "First_FlowPro_ReGtheta"; |
f456b167 | 78 | name +=theta; |
448e8856 | 79 | name +="_LYZ"; |
80 | title = "First_FlowPro_ReGtheta"; | |
f456b167 | 81 | title +=theta; |
448e8856 | 82 | title +="_LYZ"; |
882ffd6a | 83 | fHistProReGtheta = new TProfile(name.Data(),title.Data(),iNbins,dMin,dMax); |
f456b167 | 84 | fHistProReGtheta->SetXTitle("r"); |
85 | fHistProReGtheta->SetYTitle("Re G^{#theta}(ir)"); | |
86 | ||
87 | //fHistProImGtheta | |
448e8856 | 88 | name = "First_FlowPro_ImGtheta"; |
f456b167 | 89 | name +=theta; |
448e8856 | 90 | name +="_LYZ"; |
91 | title = "First_FlowPro_ImGtheta"; | |
f456b167 | 92 | title +=theta; |
448e8856 | 93 | title +="_LYZ"; |
882ffd6a | 94 | fHistProImGtheta = new TProfile(name.Data(),title.Data(),iNbins,dMin,dMax); |
f456b167 | 95 | fHistProImGtheta->SetXTitle("r"); |
96 | fHistProImGtheta->SetYTitle("Im G^{#theta}(ir)"); | |
8de6876d | 97 | |
98 | //list of histograms | |
99 | fHistList = new TList(); | |
100 | fHistList-> Add(fHistGtheta); | |
101 | fHistList-> Add(fHistProReGtheta); | |
102 | fHistList-> Add(fHistProImGtheta); | |
448e8856 | 103 | |
f456b167 | 104 | } |
105 | ||
f456b167 | 106 | //----------------------------------------------------------------------- |
107 | ||
108 | AliFlowLYZHist1::~AliFlowLYZHist1() | |
109 | { | |
110 | //deletes histograms | |
111 | delete fHistGtheta; | |
112 | delete fHistProReGtheta; | |
113 | delete fHistProImGtheta; | |
8de6876d | 114 | delete fHistList; |
f456b167 | 115 | } |
116 | ||
f456b167 | 117 | //----------------------------------------------------------------------- |
118 | ||
882ffd6a | 119 | void AliFlowLYZHist1::Fill(Double_t f, TComplex c) |
f456b167 | 120 | { |
121 | //fill the histograms | |
122 | ||
882ffd6a | 123 | fHistProReGtheta->Fill(f, c.Re()); |
124 | fHistProImGtheta->Fill(f, c.Im()); | |
f456b167 | 125 | } |
126 | ||
f456b167 | 127 | //----------------------------------------------------------------------- |
128 | ||
129 | TH1D* AliFlowLYZHist1::FillGtheta() | |
130 | { | |
131 | //fill the fHistGtheta histograms | |
882ffd6a | 132 | Int_t iNbins = fHistGtheta->GetNbinsX(); |
133 | for (Int_t bin=1;bin<=iNbins;bin++) | |
f456b167 | 134 | { |
135 | //get bincentre of bins in histogram | |
882ffd6a | 136 | Double_t dBin = fHistGtheta->GetBinCenter(bin); |
137 | Double_t dRe = fHistProReGtheta->GetBinContent(bin); | |
138 | Double_t dIm = fHistProImGtheta->GetBinContent(bin); | |
139 | TComplex cGtheta(dRe,dIm); | |
140 | //fill fHistGtheta with the modulus squared of cGtheta | |
141 | fHistGtheta->Fill(dBin,cGtheta.Rho2()); | |
f456b167 | 142 | } |
143 | ||
144 | return fHistGtheta; | |
145 | } | |
146 | ||
147 | //----------------------------------------------------------------------- | |
148 | ||
448e8856 | 149 | Double_t AliFlowLYZHist1::GetR0() |
f456b167 | 150 | { |
151 | //find the first minimum of the square of the modulus of Gtheta | |
152 | ||
882ffd6a | 153 | Int_t iNbins = fHistGtheta->GetNbinsX(); |
154 | Double_t dR0 = 0.; | |
f456b167 | 155 | |
882ffd6a | 156 | for (Int_t b=2;b<iNbins;b++) |
f456b167 | 157 | { |
882ffd6a | 158 | Double_t dG0 = fHistGtheta->GetBinContent(b); |
159 | Double_t dGnext = fHistGtheta->GetBinContent(b+1); | |
160 | Double_t dGnextnext = fHistGtheta->GetBinContent(b+2); | |
448e8856 | 161 | |
882ffd6a | 162 | if (dGnext > dG0 && dGnextnext > dG0) |
f456b167 | 163 | { |
882ffd6a | 164 | Double_t dGlast = fHistGtheta->GetBinContent(b-1); |
165 | Double_t dXlast = fHistGtheta->GetBinCenter(b-1); | |
166 | Double_t dX0 = fHistGtheta->GetBinCenter(b); | |
167 | Double_t dXnext = fHistGtheta->GetBinCenter(b+1); | |
f456b167 | 168 | |
882ffd6a | 169 | dR0 = dX0 - ((dX0-dXlast)*(dX0-dXlast)*(dG0-dGnext) - (dX0-dXnext)*(dX0-dXnext)*(dG0-dGlast))/ |
170 | (2.*((dX0-dXlast)*(dG0-dGnext) - (dX0-dXnext)*(dG0-dGlast))); //interpolated minimum | |
f456b167 | 171 | |
172 | break; //stop loop if minimum is found | |
173 | } //if | |
174 | ||
175 | }//b | |
176 | ||
177 | ||
882ffd6a | 178 | return dR0; |
f456b167 | 179 | } |
180 | ||
181 | //----------------------------------------------------------------------- | |
448e8856 | 182 | Double_t AliFlowLYZHist1::GetBinCenter(Int_t i) |
f456b167 | 183 | { |
184 | //gets bincenter of histogram | |
882ffd6a | 185 | Double_t dR = fHistGtheta->GetBinCenter(i); |
186 | return dR; | |
f456b167 | 187 | } |
188 | ||
189 | //----------------------------------------------------------------------- | |
190 | ||
191 | Int_t AliFlowLYZHist1::GetNBins() | |
192 | { | |
882ffd6a | 193 | //gets iNbins |
194 | Int_t iNbins = fHistGtheta->GetNbinsX(); | |
195 | return iNbins; | |
f456b167 | 196 | } |
197 | ||
8de6876d | 198 | //----------------------------------------------------------------------- |
199 | Double_t AliFlowLYZHist1::Merge(TCollection *aList) | |
200 | { | |
201 | //merge fuction | |
202 | if (!aList) return 0; | |
203 | if (aList->IsEmpty()) return 0; //no merging is needed | |
204 | ||
205 | Int_t iCount = 0; | |
206 | TIter next(aList); // list is supposed to contain only objects of the same type as this | |
207 | AliFlowLYZHist1 *toMerge; | |
208 | // make a temporary list | |
209 | TList *pTemp = new TList(); | |
210 | while ((toMerge=(AliFlowLYZHist1*)next())) { | |
211 | pTemp->Add(toMerge->GetHistList()); | |
212 | iCount++; | |
213 | } | |
214 | // Now call merge for fHistList providing temp list | |
215 | fHistList->Merge(pTemp); | |
216 | // Cleanup | |
217 | delete pTemp; | |
218 | ||
219 | return (double)iCount; | |
220 | ||
221 | } | |
222 | ||
9d062fe3 | 223 | //----------------------------------------------------------------------- |
224 | void AliFlowLYZHist1::Print(Option_t *option) const | |
225 | { | |
226 | // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-* | |
227 | // =============================================== | |
228 | // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights()); | |
229 | printf( "Class.Print Name = %s, Histogram list:\n",GetName()); | |
230 | ||
231 | if (fHistList) { | |
232 | fHistList->Print(option); | |
233 | } | |
234 | else | |
235 | { | |
236 | printf( "Empty histogram list \n"); | |
237 | } | |
238 | } | |
239 | ||
240 | //----------------------------------------------------------------------- | |
241 | void AliFlowLYZHist1::Browse(TBrowser *b) | |
242 | { | |
243 | ||
244 | if (!b) return; | |
245 | if (fHistList) b->Add(fHistList,"AliFlowLYZHist1List"); | |
246 | } | |
247 | ||
248 | ||
249 |