Logo ROOT  
Reference Guide
th2polyHoneycomb.C File Reference

Detailed Description

View in nbviewer Open in SWAN This tutorial illustrates how to create an histogram with hexagonal bins (TH2Poly).

The method TH2Poly::Honeycomb allows to build automatically an honeycomb binning.

void th2polyHoneycomb(){
TH2Poly *hc = new TH2Poly();
hc->SetTitle("Honeycomb example");
TRandom ran;
for (int i = 0; i<30000; i++) {
hc->Fill(ran.Gaus(2.,1), ran.Gaus(2.,1));
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
Definition: TH1.cxx:6678
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:3073
2D Histogram with Polygonal Bins
Definition: TH2Poly.h:66
void Honeycomb(Double_t xstart, Double_t ystart, Double_t a, Int_t k, Int_t s)
Bins the histogram using a honeycomb structure.
Definition: TH2Poly.cxx:938
virtual Int_t Fill(Double_t x, Double_t y)
Increment the bin containing (x,y) by 1.
Definition: TH2Poly.cxx:589
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
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...
Definition: TRandom.cxx:274
Olivier Couet

Definition in file th2polyHoneycomb.C.