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.))
37 <<
"\n" <<
"mean(y) = " << data.
mean(
y) <<
"\tsigma(y) = " << std::sqrt(data.
moment(
y, 2.)) << std::endl;
48 .Define(
"y", [](){
return gRandom->
Gaus(1., 3.); });
71 auto rooDataSet = dd.Book<
double,
double>(
89 auto rooDataHist = dd.Book<
double,
double>(std::move(rdhMaker), {
"x",
"y"});
98 printData(*rooDataSet);
99 printData(*rooDataHist);
RooAbsDataHelper< RooDataSet > RooDataSetHelper
Helper for creating a RooDataSet inside RDataFrame.
R__EXTERN TRandom * gRandom
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTree,...
This is a helper for an RDataFrame action, which fills RooFit data classes.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
virtual Double_t weight() const =0
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Double_t moment(const RooRealVar &var, Double_t order, const char *cutSpec=0, const char *cutRange=0) const
Calculate moment of requested order.
Double_t mean(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooRealVar represents a variable that can be changed from the outside.
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...
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).