]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/SPECTRA/Nuclei/B2/AliLnHistoMap.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / AliLnHistoMap.cxx
index 5129a72e319add9bd63836bd653c230c51538b2b..e87599f0b4413e928826dce81e98d627cd3aa29f 100644 (file)
@@ -37,7 +37,7 @@ AliLnHistoMap::AliLnHistoMap()
 // Default constructor
 //
        fHistoMap = new TMap();
-       fHistoMap->SetOwner(kTRUE);
+       fHistoMap->SetOwner(kFALSE);
 }
 
 AliLnHistoMap::~AliLnHistoMap()
@@ -49,6 +49,7 @@ AliLnHistoMap::~AliLnHistoMap()
        
 }
 
+/*
 Int_t AliLnHistoMap::Write(const char *name, Int_t option, Int_t bsize) const
 {
 //
@@ -75,6 +76,7 @@ Int_t AliLnHistoMap::Write(const char *name, Int_t option, Int_t bsize)
 //
        return ((const AliLnHistoMap*)this)->Write(name,option,bsize);
 }
+*/
 
 TObject* AliLnHistoMap::Add(const TString& keyname, TObject* value)
 {
@@ -118,6 +120,17 @@ TH1D* AliLnHistoMap::Add(const TString& name, Int_t nbins, Double_t xmin, Double
        return value;
 }
 
+TH1D* AliLnHistoMap::Add(const TString& name, Int_t nbins, Double_t* xbins, const TString& title, const TString& xlabel, const TString& ylabel)
+{
+//
+// Add a TH1D histogram with variable bin size
+//
+       TH1D* h = this->Add(name,nbins,xbins[0],xbins[nbins],title,xlabel,ylabel);
+       h->GetXaxis()->Set(nbins, xbins);
+       
+       return h;
+}
+
 TH2D* AliLnHistoMap::Add(const TString& name, Int_t xbins, Double_t xmin, Double_t xmax, Int_t ybins, Double_t ymin, Double_t ymax, const TString& title, const TString& xlabel, const TString& ylabel, Bool_t logx, Bool_t logy)
 {
 //
@@ -145,6 +158,40 @@ TH2D* AliLnHistoMap::Add(const TString& name, Int_t xbins, Double_t xmin, Double
        return value;
 }
 
+TH2D* AliLnHistoMap::Add(const TString& name, Int_t nbinsx, Double_t* xbins, Int_t nbinsy, Double_t* ybins, const TString& title, const TString& xlabel, const TString& ylabel)
+{
+//
+// Add a TH2D histogram with variable bin size
+//
+       TH2D* h = this->Add(name, nbinsx, xbins[0], xbins[nbinsx], nbinsy, ybins[0], ybins[nbinsy], title, xlabel, ylabel);
+       h->GetXaxis()->Set(nbinsx, xbins);
+       h->GetYaxis()->Set(nbinsy, ybins);
+       
+       return h;
+}
+
+TH2D* AliLnHistoMap::Add(const TString& name, Int_t nbins, Double_t* xbins, Int_t ybins, Double_t ymin, Double_t ymax, const TString& title, const TString& xlabel, const TString& ylabel)
+{
+//
+// Add a TH2D histogram with variable bin size
+//
+       TH2D* h = this->Add(name, nbins, xbins[0], xbins[nbins], ybins, ymin, ymax, title, xlabel, ylabel);
+       h->GetXaxis()->Set(nbins, xbins);
+       
+       return h;
+}
+
+TH2D* AliLnHistoMap::Add(const TString& name, Int_t xbins, Double_t xmin, Double_t xmax, Int_t nbins, Double_t* ybins, const TString& title, const TString& xlabel, const TString& ylabel)
+{
+//
+// Add a TH2D histogram with variable bin size
+//
+       TH2D* h = this->Add(name, xbins, xmin, xmax, nbins, ybins[0], ybins[nbins], title, xlabel, ylabel);
+       h->GetYaxis()->Set(nbins, ybins);
+       
+       return h;
+}
+
 Bool_t AliLnHistoMap::SetLogXaxis(TH1* h)
 {
 //