37 c.defineType(
"Plus", +1);
38 c.defineType(
"Minus", -1);
52 for (i = 0; i < 1000; i++) {
55 c.setLabel((i % 2) ?
"Plus" :
"Minus");
73 d.get(900)->Print(
"v");
80 cout << endl <<
">> d1 has only columns x,c" << endl;
84 cout << endl <<
">> d2 has only column y" << endl;
88 cout << endl <<
">> d3 has only the points with y>5.17" << endl;
92 cout << endl <<
">> d4 has only columns x,c for data points with y>5.17" << endl;
97 cout << endl <<
">> merge d2(y) with d1(x,c) to form d1(x,c,y)" << endl;
102 cout << endl <<
">> append data points of d3 to d1" << endl;
112 cout <<
">> construct dh (binned) from d(unbinned) but only take the x and y dimensions," << endl
113 <<
">> the category 'c' will be projected in the filling process" << endl;
127 cout <<
">> number of bins in dh : " << dh.numEntries() << endl;
128 cout <<
">> sum of weights in dh : " << dh.sum(
false) << endl;
129 cout <<
">> integral over histogram: " << dh.sum(
true) << endl;
134 cout <<
">> retrieving the properties of the bin enclosing coordinate (x,y) = (0.3,20.5) " << endl;
135 cout <<
" bin center:" << endl;
137 cout <<
" weight = " << dh.weight() << endl;
143 cout <<
">> Creating 1-dimensional projection on y of dh for bins with x>0" << endl;
154 cout << endl <<
">> Persisting d via ROOT I/O" << endl;
155 TFile f(
"rf402_datahandling.root",
"RECREATE");
163 new TCanvas(
"rf402_datahandling",
"rf402_datahandling", 600, 600);
164 gPad->SetLeftMargin(0.15);
Storage_t const & get() const
Const access to the underlying stl container.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
RooFit::OwningPtr< RooAbsData > reduce(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={})
Create a reduced copy of this dataset.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
Container class to hold N-dimensional binned data.
RooPlot * plotOn(RooPlot *frame, PlotOpt o) const override
Back end function to plotting functionality.
Container class to hold unbinned data.
bool merge(RooDataSet *data1, RooDataSet *data2=nullptr, RooDataSet *data3=nullptr, RooDataSet *data4=nullptr, RooDataSet *data5=nullptr, RooDataSet *data6=nullptr)
void append(RooDataSet &data)
Add all data points of given data set to this data set.
Plot frame and a container for graphics objects within that frame.
static RooPlot * frame(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins)
Create a new frame for a given variable in x.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Variable that can be changed from the outside.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
RooCmdArg Bins(Int_t nbin)
RooCmdArg MarkerColor(Color_t color)
RooCmdArg LineColor(Color_t color)
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...