Fill multiple histograms with different functions and automatic binning. 
Illustrates merging with the power-of-two autobin algorithm
 
 OBJ: TStatistic   min   Mean = -0.25154 +- 0.1218     RMS = 0.38529     Count = 10     Min = -0.90088    Max = 0.2036
 OBJ: TStatistic   max   Mean = 6.3271 +- 0.09007   RMS = 0.28483     Count = 10     Min = 5.8574   Max = 6.7194
 OBJ: TStatistic   dif   Mean = 6.5786 +- 0.1583    RMS = 0.50044     Count = 10     Min = 5.967    Max = 7.4114
 OBJ: TStatistic   mean     Mean = 2.9904 +- 0.007539     RMS = 0.02384     Count = 10     Min = 2.9522   Max = 3.0227
 OBJ: TStatistic   rms   Mean = 1.0128 +- 0.005124     RMS = 0.016204    Count = 10     Min = 0.99337     Max = 1.0378
 ent: 10010
TH1.Print Name  = myh0, Entries= 10010, Total sum= 10006
TH1.Print Name  = myhref, Entries= 10010, Total sum= 10008
   
 
TF1 *
gam = 
new TF1(
"gam", 
"1/(1+0.1*x*0.1*x)", -100., 100.);
 
TF1 *
gam1 = 
new TF1(
"gam", 
"1/(1+0.1*x*0.1*x)", -1., .25);
 
TF1 *
iga = 
new TF1(
"inv gam", 
"1.-1/(1+0.1*x*0.1*x)", -100., 100.);
 
TF1 *
iga1 = 
new TF1(
"inv gam", 
"1.-1/(1+0.1*x*0.1*x)", -.5, 1.);
 
 
{
 
 
 
   
   auto href = 
new TH1D(
"myhref", 
"current", 50, 0., -1.);
 
 
   
   auto href2 = 
new TH1D(
"myhref", 
"Auto P2, sequential", 50, 0., -1.);
 
 
 
 
      auto hw = 
new TH1D(
hname.Data(), 
"Auto P2, merged", nbins, 0., -1.);
 
 
 
         switch (opt) {
         case 1: 
xx = 
rndm.Gaus(3, 1); 
break;
 
         case 2: 
xx = 
rndm.Rndm() * 100. - 50.; 
break;
 
         case 3: 
xx = 
gam->GetRandom(); 
break;
 
         case 4: 
xx = 
gam1->GetRandom(); 
break;
 
         case 5: 
xx = 
iga->GetRandom(); 
break;
 
         case 6: 
xx = 
iga1->GetRandom(); 
break;
 
         default: 
xx = 
rndm.Gaus(0, 1);
 
         }
 
         }
            
         }
      }
 
   }
 
 
      return;
 
 
   if (
gROOT->GetListOfCanvases()->FindObject(
"c3"))
 
      delete gROOT->GetListOfCanvases()->FindObject(
"c3");
 
 
 
   std::cout << 
" ent: " << 
h0->GetEntries() << 
"\n";
 
 
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
 
R__EXTERN TStyle * gStyle
 
1-D histogram with a double per channel (see TH1 documentation)
 
@ kAutoBinPTwo
different than 1.
 
Random number generator class based on M.
 
Statistical variable, defined by its mean and variance (RMS).
 
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
 
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
 
- Date
 - November 2017 
 
- Author
 - Gerardo Ganis 
 
Definition in file hist101_TH1_autobinning.C.