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 "AliFlowLYZHist2.h"
22 #include "AliFlowCommonConstants.h"
24 #include "TProfile2D.h"
32 // Class to organize the histograms in the second run
33 // in the Lee Yang Zeros Flow analysis.
34 // Also contains methods to get values from the histograms
35 // which are called in AliFlowLeeYandZerosMaker::Finish().
36 // author: N. van der Kolk (kolk@nikhef.nl)
38 ClassImp(AliFlowLYZHist2)
40 //-----------------------------------------------------------------------
42 AliFlowLYZHist2::AliFlowLYZHist2():
55 //-----------------------------------------------------------------------
57 AliFlowLYZHist2::AliFlowLYZHist2(Int_t theta, const char* aSelection, const char *anInput, Bool_t useSum):
58 TNamed(anInput,anInput),
68 //constructor creating histograms
69 TString title, name, addlast;
71 if (useSum) { addlast = "LYZSUM"; }
72 else { addlast = "LYZPROD"; }
74 Int_t iNbinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
75 Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
77 Double_t dPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
78 Double_t dPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
79 Double_t dEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
80 Double_t dEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
83 name = "Second_FlowPro_ReNumer";
88 fHistProReNumer = new TProfile(name.Data(),title.Data(),iNbinsEta,dEtaMin,dEtaMax);
89 fHistProReNumer->SetXTitle("eta");
90 fHistProReNumer->SetYTitle("v (%)");
93 name = "Second_FlowPro_ImNumer";
98 fHistProImNumer = new TProfile(name.Data(),title.Data(),iNbinsEta,dEtaMin,dEtaMax);
99 fHistProImNumer->SetXTitle("eta");
100 fHistProImNumer->SetYTitle("v (%)");
103 name = "Second_FlowPro_ReNumerPt";
108 fHistProReNumerPt = new TProfile(name.Data(),title.Data(),iNbinsPt,dPtMin,dPtMax);
109 fHistProReNumerPt->SetXTitle("Pt");
110 fHistProReNumerPt->SetYTitle("v (%)");
113 name = "Second_FlowPro_ImNumerPt";
118 fHistProImNumerPt = new TProfile(name.Data(),title.Data(),iNbinsPt,dPtMin,dPtMax);
119 fHistProImNumerPt->SetXTitle("Pt");
120 fHistProImNumerPt->SetYTitle("v (%)");
123 name = "Second_FlowPro_ReNumer2D";
128 fHistProReNumer2D = new TProfile2D(name.Data(),title.Data(),iNbinsEta,dEtaMin,dEtaMax,iNbinsPt,dPtMin,dPtMax);
129 fHistProReNumer2D->SetXTitle("eta");
130 fHistProReNumer2D->SetYTitle("Pt (GeV/c)");
133 name = "Second_FlowPro_ImNumer2D";
138 fHistProImNumer2D = new TProfile2D(name.Data(),title.Data(),iNbinsEta,dEtaMin,dEtaMax,iNbinsPt,dPtMin,dPtMax);
139 fHistProImNumer2D->SetXTitle("eta");
140 fHistProImNumer2D->SetYTitle("Pt (GeV/c)");
143 fHistList = new TList();
144 fHistList-> Add(fHistProReNumer);
145 fHistList-> Add(fHistProImNumer);
146 fHistList-> Add(fHistProReNumerPt);
147 fHistList-> Add(fHistProImNumerPt);
148 fHistList-> Add(fHistProReNumer2D);
149 fHistList-> Add(fHistProImNumer2D);
153 //-----------------------------------------------------------------------
155 AliFlowLYZHist2::~AliFlowLYZHist2()
158 delete fHistProReNumer;
159 delete fHistProImNumer;
160 delete fHistProReNumerPt;
161 delete fHistProImNumerPt;
162 delete fHistProReNumer2D;
163 delete fHistProImNumer2D;
167 //-----------------------------------------------------------------------
168 void AliFlowLYZHist2::Fill(Double_t d1, Double_t d2, TComplex c)
170 //fill the real and imaginary part of fNumer
172 fHistProReNumer->Fill(d1, c.Re());
173 fHistProImNumer->Fill(d1, c.Im());
175 fHistProReNumerPt->Fill(d2, c.Re());
176 fHistProImNumerPt->Fill(d2, c.Im());
178 fHistProReNumer2D->Fill(d1, d2, c.Re());
179 fHistProImNumer2D->Fill(d1, d2, c.Im());
182 //-----------------------------------------------------------------------
183 TComplex AliFlowLYZHist2::GetNumerEta(Int_t i)
185 //get the real and imaginary part of fNumer
186 Double_t dReNumer = fHistProReNumer->GetBinContent(i);
187 Double_t dImNumer = fHistProImNumer->GetBinContent(i);
188 TComplex cNumer(dReNumer,dImNumer);
189 //if (dNumer.Rho()==0) {cerr<<"modulus of dNumer is zero in AliFlowLYZHist2::GetNumer(Int_t i)"<<endl;}
193 //-----------------------------------------------------------------------
194 TComplex AliFlowLYZHist2::GetNumerPt(Int_t i)
196 //get the real and imaginary part of fNumer
197 Double_t dReNumer = fHistProReNumerPt->GetBinContent(i);
198 Double_t dImNumer = fHistProImNumerPt->GetBinContent(i);
199 TComplex cNumer(dReNumer,dImNumer);
203 //-----------------------------------------------------------------------
204 Double_t AliFlowLYZHist2::Merge(TCollection *aList)
207 if (!aList) return 0;
208 if (aList->IsEmpty()) return 0; //no merging is needed
211 TIter next(aList); // list is supposed to contain only objects of the same type as this
212 AliFlowLYZHist2 *toMerge;
213 // make a temporary list
214 TList *pTemp = new TList();
215 while ((toMerge=(AliFlowLYZHist2*)next())) {
216 pTemp->Add(toMerge->GetHistList());
219 // Now call merge for fHistList providing temp list
220 fHistList->Merge(pTemp);
224 return (double)iCount;
228 //-----------------------------------------------------------------------
229 void AliFlowLYZHist2::Print(Option_t *option) const
231 // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
232 // ===============================================
233 // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
234 printf( "Class.Print Name = %s, Histogram list:\n",GetName());
237 fHistList->Print(option);
241 printf( "Empty histogram list \n");
245 //-----------------------------------------------------------------------
246 void AliFlowLYZHist2::Browse(TBrowser *b)
250 if (fHistList) b->Add(fHistList,"AliFlowLYZHist2List");