29void rf102_dataimport()
52 RooPlot* frame =
x.frame(
Title(
"Imported TH1 with Poisson error bars")) ;
68 RooPlot* frame2 =
x.frame(
Title(
"Imported TH1 with internal errors")) ;
70 gauss.plotOn(frame2) ;
88 TTree*
tree = makeTTree() ;
108 std::ofstream outstream(
"/tmp/rf102_testData.txt");
117 std::cout <<
"\n-----------------------\nReading data from ASCII\n";
122 dataReadBack->
Print(
"V");
124 std::cout <<
"\nOriginal data, line 20:\n";
125 ds.get(20)->Print(
"V");
127 std::cout <<
"\nRead-back data, line 20:\n";
139 RooPlot* frame3 =
y.frame(
Title(
"Unbinned data shown in default frame binning")) ;
143 RooPlot* frame4 =
y.frame(
Title(
"Unbinned data shown with custom binning")) ;
144 ds.plotOn(frame4,
Binning(20)) ;
146 RooPlot* frame5 =
y.frame(
Title(
"Unbinned data read back from ASCII file")) ;
147 ds.plotOn(frame5,
Binning(20)) ;
151 TCanvas*
c =
new TCanvas(
"rf102_dataimport",
"rf102_dataimport",1000,800) ;
169 TH1D* hh =
new TH1D(
"hh",
"hh",25,-10,10) ;
170 for (
int i=0 ; i<100 ; i++) {
181 TTree*
tree =
new TTree(
"tree",
"tree") ;
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
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Calls RooPlot* plotOn(RooPlot* frame, const RooLinkedList& cmdList) const ;.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooDataSet is a container class to hold N-dimensional binned data.
RooDataSet is a container class to hold unbinned data.
virtual const RooArgSet * get(Int_t index) const
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=0)
Read given list of ascii files, and construct a data set, using the given ArgList as structure defini...
A RooPlot is a plot frame and a container for graphics objects within that frame.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
1-D histogram with a double per channel (see TH1 documentation)}
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
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).
RooCmdArg MarkerColor(Color_t color)
RooCmdArg Binning(const RooAbsBinning &binning)
RooCmdArg MarkerStyle(Style_t style)
RooCmdArg Import(const char *state, TH1 &histo)
RooCmdArg DataError(Int_t)
static constexpr double gauss