49 RooPlot *frame =
x.frame(
Title(
"Imported TH1 with Poisson error bars"));
65 RooPlot *frame2 =
x.frame(
Title(
"Imported TH1 with internal errors"));
102 std::ofstream outstream(
"rf102_testData.txt");
110 std::cout <<
"\n-----------------------\nReading data from ASCII\n";
116 dataReadBack->
Print(
"V");
118 std::cout <<
"\nOriginal data, line 20:\n";
119 ds.get(20)->Print(
"V");
121 std::cout <<
"\nRead-back data, line 20:\n";
131 RooPlot *frame3 =
y.frame(
Title(
"Unbinned data shown in default frame binning"));
135 RooPlot *frame4 =
y.frame(
Title(
"Unbinned data shown with custom binning"));
136 ds.plotOn(frame4,
Binning(20));
138 RooPlot *frame5 =
y.frame(
Title(
"Unbinned data read back from ASCII file"));
139 ds.plotOn(frame5,
Binning(20));
143 TCanvas *
c =
new TCanvas(
"rf102_dataimport",
"rf102_dataimport", 1000, 800);
146 gPad->SetLeftMargin(0.15);
150 gPad->SetLeftMargin(0.15);
155 gPad->SetLeftMargin(0.15);
159 gPad->SetLeftMargin(0.15);
163 gPad->SetLeftMargin(0.15);
171 TH1D *hh =
new TH1D(
"hh",
"hh", 25, -10, 10);
172 for (
int i = 0;
i < 100;
i++) {
184 tree->Branch(
"x", px,
"x/D");
185 tree->Branch(
"y",
py,
"y/D");
186 for (
int i = 0;
i < 100;
i++) {
R__EXTERN TRandom * gRandom
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
RooArgList is a container object that can hold multiple RooAbsArg objects.
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.
const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
static RooDataSet * read(const char *filename, const RooArgList &variables, const char *opts="", const char *commonPath="", const char *indexCatName=nullptr)
Read data from a text file and create a dataset from it.
Plot frame and a container for graphics objects within that frame.
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.
1-D histogram with a double per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
A TTree represents a columnar dataset.
RooCmdArg Title(const char *name)
RooCmdArg Import(const char *state, TH1 &histo)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg DataError(Int_t)
RooCmdArg MarkerColor(Color_t color)
RooCmdArg Binning(const RooAbsBinning &binning)
RooCmdArg MarkerStyle(Style_t style)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...