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/// \author Sergey Linev <S.Linev@gsi.de>
9/// \author Iliana Betsou <Iliana.Betsou@cern.ch>
10
11/*************************************************************************
12 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
13 * All rights reserved. *
14 * *
15 * For the licensing terms see $ROOTSYS/LICENSE. *
16 * For the list of contributors see $ROOTSYS/README/CREDITS. *
17 *************************************************************************/
18
19#include <ROOT/RFitPanel.hxx>
20#include "ROOT/RDirectory.hxx"
21#include "TH1.h"
22#include "TFile.h"
23
24using namespace ROOT::Experimental;
25
26void fitpanel6()
27{
28 TFile::Open("hsimple.root");
29 if (gFile) {
30 gFile->Get("hpx");
31 gFile->Get("hpxpy");
32 gFile->Get("hprof");
33 }
34
35 // create panel
36 auto panel = std::make_shared<RFitPanel>("FitPanel");
37 RDirectory::Heap().Add("fitpanel", panel);
38
39 TH1F *test = new TH1F("test","This is test histogram",100,-4,4);
40 test->FillRandom("gaus", 10000);
41
42 panel->AssignHistogram(test);
43
44 panel->Show();
45}
46
#define gFile
Definition TFile.h:345
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:4025
1-D histogram with a float per channel (see TH1 documentation)}
Definition TH1.h:575
Definition test.py:1