#include "TString.h"
#include "TH1D.h" //needed as include
#include "TMath.h" //needed as include
+#include "TList.h"
class TH1F;
class AliFlowVector;
//-----------------------------------------------------------------------
- AliFlowCommonHistResults::AliFlowCommonHistResults(TString input): TObject(),
- fHistIntFlow(0),
- fHistDiffFlow(0),
- fHistChi(0)
- {
+ AliFlowCommonHistResults::AliFlowCommonHistResults():
+ TObject(),
+ fHistIntFlow(0),
+ fHistDiffFlow(0),
+ fHistChi(0),
+ fHistList(NULL)
+{
+ //default constructor
+}
+
+//-----------------------------------------------------------------------
+
+ AliFlowCommonHistResults::AliFlowCommonHistResults(TString input):
+ TObject(),
+ fHistIntFlow(0),
+ fHistDiffFlow(0),
+ fHistChi(0),
+ fHistList(NULL)
+{
//constructor creating histograms
Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
TString name;
fHistChi = new TH1D(name.Data(), name.Data(),1,0.5,1.5);
fHistChi ->SetXTitle("");
fHistChi ->SetYTitle("Chi");
+
+ //list of histograms
+ fHistList = new TList();
+ fHistList-> Add(fHistIntFlow);
+ fHistList-> Add(fHistDiffFlow);
+ fHistList-> Add(fHistChi);
+
}
//-----------------------------------------------------------------------
delete fHistIntFlow;
delete fHistDiffFlow;
delete fHistChi;
+ delete fHistList;
}
//-----------------------------------------------------------------------
}
//-----------------------------------------------------------------------
+ Double_t AliFlowCommonHistResults::Merge(TCollection *aList)
+{
+ //merge fuction
+ cout<<"entering merge function"<<endl;
+ if (!aList) return 0;
+ if (aList->IsEmpty()) return 0; //no merging is needed
+
+ Int_t iCount = 0;
+ TIter next(aList); // list is supposed to contain only objects of the same type as this
+ AliFlowCommonHistResults *toMerge;
+ // make a temporary list
+ TList *pTemp = new TList();
+ while ((toMerge=(AliFlowCommonHistResults*)next())) {
+ pTemp->Add(toMerge->GetHistList());
+ iCount++;
+ }
+ // Now call merge for fHistList providing temp list
+ fHistList->Merge(pTemp);
+ // Cleanup
+ delete pTemp;
+
+ cout<<"Merged"<<endl;
+ return (double)iCount;
+
+}
class TH1F;
class TH1D;
+class TCollection;
+class TList;
// AliFlowCommonHistResults:
// Class to organize the common histograms for Flow Analysis
class AliFlowCommonHistResults : public TObject {
public:
-
+ AliFlowCommonHistResults(); //default constructor
AliFlowCommonHistResults(TString input); //constructor
virtual ~AliFlowCommonHistResults(); //destructor
TH1D* GetfHistDiffFlow() {return fHistDiffFlow; } ;
TH1D* GetfHistChi() {return fHistChi; } ;
TH1D* GetfHistIntFlow() {return fHistIntFlow; } ;
-
+ TList* GetHistList() {return fHistList;} ;
+
+ virtual Double_t Merge(TCollection *aList); //merge function
+
private:
AliFlowCommonHistResults(const AliFlowCommonHistResults& aSetOfResultHists); //copy constructor
AliFlowCommonHistResults& operator=(const AliFlowCommonHistResults& aSetOfResultHists); //assignment operator
- //integrated flow
- TH1D* fHistIntFlow;
- //differential flow
- TH1D* fHistDiffFlow;
- //resolution
- TH1D* fHistChi;
-
+ TH1D* fHistIntFlow; //integrated flow
+ TH1D* fHistDiffFlow; //differential flow
+ TH1D* fHistChi; //resolution
+ TList* fHistList; //list to hold all histograms
+
ClassDef(AliFlowCommonHistResults,0) // macro for rootcint
};
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-*/
//#include "Riostream.h" //in case one wants to make print statements
#include "TProfile.h"
#include "TString.h"
-#include "TComplex.h"
+#include "TComplex.h"
+#include "TList.h"
#include "AliFlowLYZConstants.h"
#include "AliFlowLYZHist1.h"
-
class TH1D;
-
// Class to organize the histograms in the first run
// in the Lee Yang Zeros Flow analysis.
// Also contains methods to find the first minimum R0
// of the generating function.
// author: N. van der Kolk (kolk@nikhef.nl)
-
ClassImp(AliFlowLYZHist1)
-
+//-----------------------------------------------------------------------
+
+ AliFlowLYZHist1::AliFlowLYZHist1():
+ TObject(),
+ fHistGtheta(0),
+ fHistProReGtheta(0),
+ fHistProImGtheta(0),
+ fHistList(NULL)
+{
+ //default constructor
+}
//-----------------------------------------------------------------------
AliFlowLYZHist1::AliFlowLYZHist1(Int_t theta):
+ TObject(),
fHistGtheta(0),
fHistProReGtheta(0),
- fHistProImGtheta(0)
+ fHistProImGtheta(0),
+ fHistList(NULL)
{
//constructor creating histograms
fHistProImGtheta = new TProfile(name.Data(),title.Data(),iNbins,dMin,dMax);
fHistProImGtheta->SetXTitle("r");
fHistProImGtheta->SetYTitle("Im G^{#theta}(ir)");
+
+ //list of histograms
+ fHistList = new TList();
+ fHistList-> Add(fHistGtheta);
+ fHistList-> Add(fHistProReGtheta);
+ fHistList-> Add(fHistProImGtheta);
}
delete fHistGtheta;
delete fHistProReGtheta;
delete fHistProImGtheta;
+ delete fHistList;
}
//-----------------------------------------------------------------------
return iNbins;
}
+//-----------------------------------------------------------------------
+ Double_t AliFlowLYZHist1::Merge(TCollection *aList)
+{
+ //merge fuction
+ if (!aList) return 0;
+ if (aList->IsEmpty()) return 0; //no merging is needed
+
+ Int_t iCount = 0;
+ TIter next(aList); // list is supposed to contain only objects of the same type as this
+ AliFlowLYZHist1 *toMerge;
+ // make a temporary list
+ TList *pTemp = new TList();
+ while ((toMerge=(AliFlowLYZHist1*)next())) {
+ pTemp->Add(toMerge->GetHistList());
+ iCount++;
+ }
+ // Now call merge for fHistList providing temp list
+ fHistList->Merge(pTemp);
+ // Cleanup
+ delete pTemp;
+
+ return (double)iCount;
+
+}
+
#include "TComplex.h" //explicitly called in void Fill(Float_t f, TComplex C);
class TH1D;
+class TCollection;
+class TList;
+
// Description: Class to organise histograms for Flow
// by the LeeYangZeros method in the first run.
// in the generating function.
-class AliFlowLYZHist1 {
+class AliFlowLYZHist1: public TObject {
public:
+ AliFlowLYZHist1(); //default constructor
AliFlowLYZHist1(Int_t theta); //constructor
virtual ~AliFlowLYZHist1(); //destructor
Double_t GetR0(); //get R0
Double_t GetBinCenter(Int_t i); //Get a bincentre of fHistGtheta
Int_t GetNBins(); //Gets Nbins
+ TList* GetHistList() {return fHistList;} ;
+
+ virtual Double_t Merge(TCollection *aList); //merge function
private:
AliFlowLYZHist1(const AliFlowLYZHist1& aAnalysis); //copy constructor
AliFlowLYZHist1& operator=(const AliFlowLYZHist1& aAnalysis); //assignment operator
- TH1D* fHistGtheta; //holds |Gtheta|^2(r)
- TProfile* fHistProReGtheta; //holds Re of Gtheta(r)
- TProfile* fHistProImGtheta; //holds Im of Gtheta(r)
-
+ TH1D* fHistGtheta; //holds |Gtheta|^2(r)
+ TProfile* fHistProReGtheta; //holds Re of Gtheta(r)
+ TProfile* fHistProImGtheta; //holds Im of Gtheta(r)
+ TList* fHistList; //list to hold all histograms
+
- ClassDef(AliFlowLYZHist1,0) // macro for rootcint
+ ClassDef(AliFlowLYZHist1,0) // macro for rootcint
};
#include "TProfile2D.h"
#include "TString.h"
#include "TComplex.h"
+#include "TList.h"
class TH1D;
ClassImp(AliFlowLYZHist2)
-
+//-----------------------------------------------------------------------
+ AliFlowLYZHist2::AliFlowLYZHist2():
+ TObject(),
+ fHistProReNumer(0),
+ fHistProImNumer(0),
+ fHistProReNumerPt(0),
+ fHistProImNumerPt(0),
+ fHistProReNumer2D(0),
+ fHistProImNumer2D(0),
+ fHistList(NULL)
+{
+ //default constructor
+}
+
//-----------------------------------------------------------------------
AliFlowLYZHist2::AliFlowLYZHist2(Int_t theta):
+ TObject(),
fHistProReNumer(0),
fHistProImNumer(0),
fHistProReNumerPt(0),
fHistProImNumerPt(0),
fHistProReNumer2D(0),
- fHistProImNumer2D(0)
+ fHistProImNumer2D(0),
+ fHistList(NULL)
{
//constructor creating histograms
fHistProImNumer2D = new TProfile2D(name.Data(),title.Data(),iNbinsEta,dEtaMin,dEtaMax,iNbinsPt,dPtMin,dPtMax);
fHistProImNumer2D->SetXTitle("eta");
fHistProImNumer2D->SetYTitle("Pt (GeV/c)");
+
+ //list of histograms
+ fHistList = new TList();
+ fHistList-> Add(fHistProReNumer);
+ fHistList-> Add(fHistProImNumer);
+ fHistList-> Add(fHistProReNumerPt);
+ fHistList-> Add(fHistProImNumerPt);
+ fHistList-> Add(fHistProReNumer2D);
+ fHistList-> Add(fHistProImNumer2D);
+
}
//-----------------------------------------------------------------------
delete fHistProImNumerPt;
delete fHistProReNumer2D;
delete fHistProImNumer2D;
+ delete fHistList;
}
//-----------------------------------------------------------------------
-void AliFlowLYZHist2::Fill(Double_t f1, Double_t f2, TComplex c)
+void AliFlowLYZHist2::Fill(Double_t d1, Double_t d2, TComplex c)
{
//fill the real and imaginary part of fNumer
- fHistProReNumer->Fill(f1, c.Re());
- fHistProImNumer->Fill(f1, c.Im());
+ fHistProReNumer->Fill(d1, c.Re());
+ fHistProImNumer->Fill(d1, c.Im());
- fHistProReNumerPt->Fill(f2, c.Re());
- fHistProImNumerPt->Fill(f2, c.Im());
+ fHistProReNumerPt->Fill(d2, c.Re());
+ fHistProImNumerPt->Fill(d2, c.Im());
- fHistProReNumer2D->Fill(f1, f2, c.Re());
- fHistProImNumer2D->Fill(f1, f2, c.Im());
+ fHistProReNumer2D->Fill(d1, d2, c.Re());
+ fHistProImNumer2D->Fill(d1, d2, c.Im());
}
//-----------------------------------------------------------------------
return cNumer;
}
+//-----------------------------------------------------------------------
+ Double_t AliFlowLYZHist2::Merge(TCollection *aList)
+{
+ //merge fuction
+ if (!aList) return 0;
+ if (aList->IsEmpty()) return 0; //no merging is needed
+
+ Int_t iCount = 0;
+ TIter next(aList); // list is supposed to contain only objects of the same type as this
+ AliFlowLYZHist2 *toMerge;
+ // make a temporary list
+ TList *pTemp = new TList();
+ while ((toMerge=(AliFlowLYZHist2*)next())) {
+ pTemp->Add(toMerge->GetHistList());
+ iCount++;
+ }
+ // Now call merge for fHistList providing temp list
+ fHistList->Merge(pTemp);
+ // Cleanup
+ delete pTemp;
+
+ return (double)iCount;
+
+}
class TComplex;
class TProfile2D;
-
+class TCollection;
+class TList;
// Description: Class to organise histograms for Flow
// by the LeeYangZeros method in the second run.
// which are called in AliFlowLeeYandZerosMaker::Finish().
-class AliFlowLYZHist2 {
+class AliFlowLYZHist2: public TObject {
public:
+ AliFlowLYZHist2(); //default constructor
AliFlowLYZHist2(Int_t theta); //constructor
virtual ~AliFlowLYZHist2(); //destructor
- void Fill(Double_t f1,Double_t f2, TComplex c); //fill the histograms
- Int_t GetNbinsX()
+ void Fill(Double_t d1,Double_t d2, TComplex c); //fill the histograms
+ Int_t GetNbinsX()
{Int_t iMaxEtaBins = fHistProReNumer->GetNbinsX(); return iMaxEtaBins;}
- Int_t GetNbinsXPt()
+ Int_t GetNbinsXPt()
{Int_t iMaxPtBins = fHistProReNumerPt->GetNbinsX(); return iMaxPtBins;}
Double_t GetBinCenter(Int_t i)
{Double_t dEta = fHistProReNumer->GetXaxis()->GetBinCenter(i); return dEta;}
{Double_t dPt = fHistProReNumerPt->GetXaxis()->GetBinCenter(i); return dPt;}
TComplex GetNumerEta(Int_t i); //get numerator for diff. flow (eta)
TComplex GetNumerPt(Int_t i); //get numerator for diff. flow (pt)
+ TList* GetHistList()
+ {return fHistList;}
+ virtual Double_t Merge(TCollection *aList); //merge function
+
private:
AliFlowLYZHist2(const AliFlowLYZHist2& aAnalysis); //copy constructor
AliFlowLYZHist2& operator=(const AliFlowLYZHist2& aAnalysis); //assignment operator
- TProfile* fHistProReNumer; //holds Re of Numerator(eta)
- TProfile* fHistProImNumer; //holds Im of Numerator(eta)
- TProfile* fHistProReNumerPt; //holds Re of Numerator(pt)
- TProfile* fHistProImNumerPt; //holds Im of Numerator(pt)
- TProfile2D* fHistProReNumer2D; //holds Re of Numerator
- TProfile2D* fHistProImNumer2D; //holds Im of Numerator
-
-
- ClassDef(AliFlowLYZHist2,0) // macro for rootcint
+ TProfile* fHistProReNumer; //holds Re of Numerator(eta)
+ TProfile* fHistProImNumer; //holds Im of Numerator(eta)
+ TProfile* fHistProReNumerPt; //holds Re of Numerator(pt)
+ TProfile* fHistProImNumerPt; //holds Im of Numerator(pt)
+ TProfile2D* fHistProReNumer2D; //holds Re of Numerator
+ TProfile2D* fHistProImNumer2D; //holds Im of Numerator
+ TList* fHistList; //list to hold all histograms
+
+ ClassDef(AliFlowLYZHist2,0) // macro for rootcint
};