Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 8c86774a3e53d77cc119f53a2b94a57a > files > 889

root-tutorial-5.34.14-2.fc18.noarch.rpm

//This tutorial illustrates how to create an histogram with hexagonal
//bins (TH2Poly), fill it and draw it using GL. 
//
//Author: Olivier Couet

void th2polyHoneycomb(){
   gStyle->SetCanvasPreferGL(true);
   TH2Poly *hc = new TH2Poly();
   hc->Honeycomb(0,0,.1,25,25);
   gStyle->SetPalette(1);

   TRandom ran;
   for (int i = 0; i<30000; i++) {
      hc->Fill(ran.Gaus(2.,1), ran.Gaus(2.,1));
   }

   hc->Draw("gllego");
}