### Histogram Libraries

### THn, THnBase, THNSparse

- The new, non-sparse n-dimensional histogram `THn` has been introduced. It follows the same interfaces as `THnSparse`, and thus also implements `THnF THnD THnC THnS THnI THnL`.
  NOTE: the memory usage of this class increases with the number of bins, i.e. exponentially with the number of dimensions! A 5-dimensional `THnD` with 100 bins per dimension uses more than 80GB of RAM! Better use `THnSparse` if only a small fraction of the bins are filled.
- Most algorithms are now implemented in `THnBase`, the new common base class of `THnSparse` and `THn`. If a function does not care about the actual storage format on in incoming objects it might as well reference a `THnBase`.
- The bins of `THn` are held by objects of the new type `TNDArray`: an n-dimensional array with lazy allocation (only when a bin is set) that implements an `operator []`.
- `THn` and `THnSparse` can be created from histograms and from each other, allowing for easy conversion. There is currently no support for drawing a `THnBase`-derived object; project it into a `TH1/2/3` first.

### THistPainter

- When 1D histograms are painted with the options TEXT and BAR simultaneously, the text for each bin is placed taking into account the bar offset and bar width attributes. Previously, when several histogram were drawn that way, the texts overlapped.
- When a `TF1` was clipped vertically, horizotal lines appeared at the maximum and minimum when the function was draw with a line width greater than 1. The follwoing macro reproduces the problem:

      {
         TCanvas *c1=new TCanvas("c1", "A canvas", 10,0, 800, 600);
         c1->SetLogy();
         histo_dummy=c1->DrawFrame(0,1e-4,27,10);
         TF1 gaussian_func("gaussian_func","gaus",0,25.4);
         gaussian_func.SetLineColor(kRed);
         gaussian_func.SetParameters(1e-2,10,3);
         gaussian_func.Draw("same");
      }

- When two histograms where painted on top of each other with the option BOX (the 2nd one with BOX,SAME) the plot was wrong if the minimum of the first histogram was not zero.
- Take into account the absolute value of the histogram's minimum to compute the maximal boxes' size when an histogram is drawn with the option BOX.
- Add support for drawing the asymmetric errors for the TH1 and TH2
- The fit function was not drawn in the correct range when a fitted 2D histogram was painted with the option lego or surf.
- With option TEXT, do not draw the bins with 0 content for 1D histograms to be consistent with the 2D histograms case. Example:

      root [0] TH1D * histo = new TH1D ("histo","",20,-5.,5.) ;
      root [1] histo->FillRandom("gaus",1000) ;
      root [2] histo->Draw("hist,text") ;

### TAxis

- A time axis defined with the GMT option, saved into a root file in a given time zone, was different when displayed in an other time zone. The time zone offset in which the axis was created is now saved with the time axis offset allowing to make the right adjustments when the axis is displayed in an other time zone.

### TGraph2DPainter

- Because of the range along the Z axis, the following macro produced a wrong plot. The markers' colors did not match the palette and some of them were not clipped.

      {
         Double_t x[10] = {1.,2.,3.,4.,5.,6.,7.,8.,9.,10.};
         Double_t y[10] = {.4,.5,.1,.3,.8,.4,.5,.6,.2,.1};
         Double_t z[10] = {1.,2.,3.,4.,5.,6.,7.3,8.,9.,10.};
         TGraph2D *gr = new TGraph2D("graph2d","graph2d",10,x,y,z);
         gr->SetMarkerStyle(20);
         gr->SetMaximum(7.5);
         gr->SetMinimum(2.5);
         gr->Draw("zpcol");
      }

### TMultiGraph

- A new option `3D` allows to draw the graphs in a 3D space. See the following example:

      {
         c1 = new TCanvas("c1","multigraph L3",200,10,700,500);
         c1->SetFrameFillColor(30);

         TMultiGraph *mg = new TMultiGraph();

         TGraph *gr1 = new TGraph(); gr1->SetLineColor(kBlue);
         TGraph *gr2 = new TGraph(); gr2->SetLineColor(kRed);
         TGraph *gr3 = new TGraph(); gr3->SetLineColor(kGreen);
         TGraph *gr4 = new TGraph(); gr4->SetLineColor(kOrange);

         Double_t dx = 6.28/100;
         Double_t x  = -3.14;
         for (int i=0; i<=100; i++) {
            x = x+dx;
            gr1->SetPoint(i,x,2.*TMath::Sin(x));
            gr2->SetPoint(i,x,TMath::Cos(x));
            gr3->SetPoint(i,x,TMath::Cos(x*x));
            gr4->SetPoint(i,x,TMath::Cos(x*x*x));
         }

         mg->Add(gr4); gr4->SetTitle("Cos(x*x*x)"); gr4->SetLineWidth(3);
         mg->Add(gr3); gr3->SetTitle("Cos(x*x)")  ; gr3->SetLineWidth(3);
         mg->Add(gr2); gr2->SetTitle("Cos(x)")    ; gr2->SetLineWidth(3);
         mg->Add(gr1); gr1->SetTitle("2*Sin(x)")  ; gr1->SetLineWidth(3);

         mg->Draw("a fb  l3d");
      }

### TH1

- A canvas saved in a `.C` file generated wrong code if it contained an histogram drawn with the option `COLZ`.
- Add the support for asymmetric errors, by adding the methods `TH1::GetBinErrorLow(ibin)` and `TH1::GetBinErrorUp(ibin)`.
- Add possibility to use different bin error types with `TH1::SetBinErrorOption(type)`. The type of errors which one can set are:
  - `TH1::kNormal`: this are the default errors (symmetric) based on the normal approximation. Bin error = sqrt(N). In case of a weighted histogram (non-integer bin content), the normal approximation is always used
  - TH1::kPoisson: in this case the lower and upper error are defined by the 68% classical (frequentist) Poisson interval for N counts (Garwood Poisson interval).
  - TH1::kPoisson2: as above but in this case a 95% (2-sigma) Poisson interval is used.
- Change all the `TH1::Add`, `TH1::Divide`, `TH1::Multiply`, methods and those in the derived classes (e.g. in TProfile classes) to return a boolean. The boolean is set to false in case the method fails (e.g when the histograms are not consistent, they have different bins)
- Add in TH1::Add a check for the labels. If the histogram axes to be added have same bin labels no warning is produced