24 for (
int i=0; i < data.numEntries() && i < 20; ++i) {
26 for (
const auto var : *data.get(i)) {
27 std::cout << std::setprecision(3) << std::right << std::fixed << std::setw(8) << static_cast<const RooAbsReal*>(var)->getVal() <<
", ";
29 std::cout <<
")\tweight=" << std::setw(10) << data.weight() << std::endl;
33 const auto &
x =
static_cast<const RooRealVar&
>(*(*data.get())[0]);
34 const auto &
y =
static_cast<const RooRealVar&
>(*(*data.get())[1]);
36 std::cout <<
"mean(x) = " << data.mean(
x) <<
"\tsigma(x) = " << std::sqrt(data.moment(
x, 2.))
40void rf408_RDataFrameToRooFit()
111 printData(rooDataSet);
112 printData(rooDataHist);
116 rf408_RDataFrameToRooFit();
RooAbsDataHelper< RooDataSet > RooDataSetHelper
Helper for creating a RooDataSet inside RDataFrame.
RooAbsDataHelper< RooDataHist > RooDataHistHelper
Helper for creating a RooDataHist inside RDataFrame.
RInterface< Proxied > Define(std::string_view name, F expression, const ColumnNames_t &columns={})
Define a new column.
Smart pointer for the return type of actions.
const T & GetValue()
Get a const reference to the encapsulated object.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Abstract base class for binned and unbinned datasets.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold N-dimensional binned data.
Container class to hold unbinned data.
Variable that can be changed from the outside.