Skip to content

TH1D::GetRandom and histograms with non-uniform binning #9530

Open
@andrea-celentano

Description

@andrea-celentano

Assume to have a TH1D object, with non-uniform binning, representing some kind of differential quantity (for example, a particle flux as a function of the particle energy, dN/dE). The TH1D::GetRandom method will return random numbers distributed according to the histogram bins height, rather than the histogram bins area.

The code attached here (a ROOT macro) reproduces this behavior (I attach it as a .txt file, since .C files are not supported)
test.txt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions