Logo ROOT   6.18/05
Reference Guide
histops.cxx File Reference

Detailed Description

/*************************************************************************
* Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#include "ROOT/RHist.hxx"
#include <iostream>
void histops()
{
using namespace ROOT;
// Create a 2D histogram with an X axis with equidistant bins, and a y axis
// with irregular binning.
Experimental::RH2D hist1({100, 0., 1.}, {{0., 1., 2., 3., 10.}});
// Fill weight 1. at the coordinate 0.01, 1.02.
hist1.Fill({0.01, 1.02});
Experimental::RH2D hist2({{{10, 0., 1.}, {{0., 1., 2., 3., 10.}}}});
// Fill weight 1. at the coordinate 0.01, 1.02.
hist2.Fill({0.01, 1.02});
Experimental::Add(hist1, hist2);
int binidx = hist1.GetImpl()->GetBinIndex({0.01, 1.02});
std::cout << hist1.GetImpl()->GetBinContent(binidx) << std::endl;
}
void Add(RHist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const RHist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
Definition: RHist.hxx:309
RHist< 2, double, RHistStatContent, RHistStatUncertainty > RH2D
Definition: RHist.hxx:291
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Date
2015-08-08
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Author
Axel Naumann axel@.nosp@m.cern.nosp@m..ch

Definition in file histops.cxx.