Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
fitpanel6.cxx
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_v7
3///
4/// \macro_code
5///
6/// \date 2019-04-11
7/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
8/// \authors Sergey Linev <S.Linev@gsi.de>, Iliana Betsou <Iliana.Betsou@cern.ch>
9
10/*************************************************************************
11 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
12 * All rights reserved. *
13 * *
14 * For the licensing terms see $ROOTSYS/LICENSE. *
15 * For the list of contributors see $ROOTSYS/README/CREDITS. *
16 *************************************************************************/
17
18#include <ROOT/RFitPanel.hxx>
19#include "TH1.h"
20#include "TFile.h"
21
22void fitpanel6()
23{
24 TFile::Open("hsimple.root");
25 if (gFile) {
26 gFile->Get("hpx");
27 gFile->Get("hpxpy");
28 gFile->Get("hprof");
29 }
30
31 // create panel
32 auto panel = std::make_shared<ROOT::Experimental::RFitPanel>("FitPanel");
33
34 TH1F *test = new TH1F("test","This is test histogram",100,-4,4);
35 test->FillRandom("gaus", 10000);
36
37 panel->AssignHistogram(test);
38
39 panel->Show();
40
41 panel->ClearOnClose(panel);
42}
43
#define gFile
Definition TFile.h:347
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition TFile.cxx:4089
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:621
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
Definition TH1.cxx:3519