34 template <
int DIMENSION>
37 template <
int DIMENSION>
49 template <
int DIMENSIONS>
52 auto implBase = fHistImpl.Get();
58 std::array<TAxisView, DIMENSIONS> axes;
59 for (
int i = 0; i < DIMENSIONS; ++i)
60 axes[i] = implBase->GetAxis(i);
67 std::stringstream strm;
68 strm <<
"drawAdaptor" <<
this;
74 old =
new TH1D(histName.c_str(),
75 implBase->GetTitle().c_str(),
76 axes[0].GetNBins() - 2, 0., 1.);
79 old =
new TH2D(histName.c_str(),
80 implBase->GetTitle().c_str(),
81 axes[0].GetNBins() - 2, 0., 1.,
82 axes[1].GetNBins() - 2, 0., 1.);
85 old =
new TH3D(histName.c_str(),
86 implBase->GetTitle().c_str(),
87 axes[0].GetNBins() - 2, 0., 1.,
88 axes[1].GetNBins() - 2, 0., 1.,
89 axes[2].GetNBins() - 2, 0., 1.);
95 <<
" dimensional histograms not supported.";
103 for (
int i = 0; i < DIMENSIONS; ++i) {
105 oldAxes[i]->SetTitle(axes[i].GetTitle().c_str());
106 if (axes[i].GetAsEquidistant()) {
107 oldAxes[i]->Set(axes[i].GetNBins() - 2, axes[i].GetFrom(), axes[i].GetTo());
108 }
else if (
const TAxisIrregular* irr = axes[i].GetAsIrregular()) {
109 oldAxes[i]->Set(axes[i].GetNBins() - 2, &irr->GetBinBorders()[0]);
111 assert(0 &&
"Logic error; the axis is neither equidistant nor irregular.");
115 int nBins = implBase->GetNBins();
117 if (implBase->HasBinUncertainty())
121 for (
int binidx = 0; binidx < nBins; ++binidx) {
122 old->
SetBinContent(binidx, implBase->GetBinContentAsDouble(binidx));
123 old->
SetBinError(binidx, implBase->GetBinUncertainty(binidx));
131 namespace Experimental {
Namespace for new ROOT classes and functions.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
void LoadHistPainterLibrary()
virtual void SetBinError(Int_t bin, Double_t error)
See convention for numbering bins in TH1::GetBin.
THist< 3, double, THistStatContent, THistStatUncertainty > TH3D
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis from bin first to last.
R__EXTERN TSystem * gSystem
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
THistDrawableBase & operator=(THistDrawableBase &&)
An axis with non-equidistant bins (also known as "variable binning").
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
virtual void SetBinsLength(Int_t=-1)
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
virtual ~THistDrawableBase()
virtual ~THistPainterBase()
#define R__ERROR_HERE(GROUP)