40 Int_t dim =
h->GetNdimensions();
46 memset(
x, 0,
sizeof(
Double_t) * (dim + 1));
49 for (
Int_t d = 0; d < dim; ++d) {
52 TAxis* axis =
h->GetAxis(d);
56 tree->Branch(
"coord",
x, branchname);
57 tree->Branch(
"bincontent", &
x[dim],
"bincontent/D");
60 for (
Long64_t i = 0; i <
h->GetNbins(); ++i) {
62 for (
Int_t d = 0; d < dim; ++d) {
83 const TLeaf* leaf = 0;
84 while ((leaf = (
const TLeaf*)iLeaf())) {
87 whatToDraw += leaf->GetName();
89 tree->Draw(whatToDraw,
"",
"para");
95 TAxis* axis =
h->GetAxis(d);
96 var->SetHistogramBinning(axis->
GetNbins());
100 var->SetTitle(
"bin content");
107 const Int_t ndims = 8;
108 Int_t bins[ndims] = {10, 10, 5, 30, 10, 4, 18, 12};
109 Double_t xmin[ndims] = {-5., -10., -1000., -3., 0., 0., 0., 0.};
110 Double_t xmax[ndims] = {10., 70., 3000., 3., 5., 2., 2., 5.};
115 for (
Long_t i = 0; i < 100000; ++i) {
116 for (
Int_t d = 0; d < ndims; ++d) {
121 case 3:
x[d] = (
x[d-1]*
x[d-1] - 1.5)/1.5 + (0.5*
gRandom->
Rndm());
break;
129 TFile* f =
new TFile(
"drawsparse.root",
"RECREATE");
131 TCanvas* canv =
new TCanvas(
"hDrawSparse",
"Drawing a sparse hist");
143 h3proj->
Draw(
"lego1");
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.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
Long64_t Fill(const Double_t *x, Double_t w=1.)
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 GetBinContent(Int_t bin) const
Return content of bin number bin.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
THnSparseT< TArrayD > THnSparseD
Efficient multidimensional histogram.
TH1D * Projection(Int_t xDim, Option_t *option="") const
virtual Double_t Rndm()
Machine independent random number generator.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
const char * GetTitle() const
Returns title of object.
Class to manage histogram axis.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
3-D histogram with a double per channel (see TH1 documentation)}
R__EXTERN TRandom * gRandom
Parallel Coordinates class.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
A TTree object has a header with a name and a title.
virtual void SetTitle(const char *title)
Change (i.e.
virtual const char * GetTitle() const
Returns title of object.