The plot will contain one line for each filled bin, with the bin's coordinates on each axis, and the bin's content on the rightmost axis.
{
Int_t dim =
h->GetNdimensions();
TString title(
h->GetTitle()); title +=
" tree";
branchname += ":";
branchname += "/D";
}
tree->Branch(
"coord",
x, branchname);
tree->Branch(
"bincontent", &
x[dim],
"bincontent/D");
for (
Long64_t i = 0; i <
h->GetNbins(); ++i) {
x[dim] =
h->GetBinContent(i, bins);
x[
d] =
h->GetAxis(
d)->GetBinCenter(bins[
d]);
}
}
delete [] bins;
}
{
while ((leaf = (
const TLeaf*)iLeaf())) {
whatToDraw += ":";
}
tree->Draw(whatToDraw,
"",
"para");
}
}
void drawsparse()
{
Int_t bins[ndims] = {10, 10, 5, 30, 10, 4, 18, 12};
Double_t xmin[ndims] = {-5., -10., -1000., -3., 0., 0., 0., 0.};
Double_t xmax[ndims] = {10., 70., 3000., 3., 5., 2., 2., 5.};
for (
Long_t i = 0; i < 100000; ++i) {
case 1:
case 2:
}
}
}
drawsparse_draw(hs);
}
THnSparseT< TArrayD > THnSparseD
R__EXTERN TRandom * gRandom
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Class to manage histogram axis.
const char * GetTitle() const
Returns title of object.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual void Draw(Option_t *option="")
Draw this histogram with options.
3-D histogram with a double per channel (see TH1 documentation)}
Long64_t Fill(const Double_t *x, Double_t w=1.)
Efficient multidimensional histogram.
TH1D * Projection(Int_t xDim, Option_t *option="") const
Forwards to THnBase::Projection().
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
void SetTitle(const char *)
Set the title of the TNamed.
void SetHistogramBinning(Int_t n=100)
Set the histogram binning.
void SetCurrentLimits(Double_t min, Double_t max)
Set the limits within which one the entries must be painted.
Parallel Coordinates class.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual Double_t Rndm()
Machine independent random number generator.
A TTree represents a columnar dataset.