ROOT
master
Reference Guide
Loading...
Searching...
No Matches
fitpanel.cxx
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_exp
3
///
4
/// \macro_code
5
///
6
/// \date 2015-03-22
7
/// \warning This is part of the experimental API, which might change in the future. Feedback is welcome!
8
/// \author Axel Naumann <axel@cern.ch>
9
10
/*************************************************************************
11
* Copyright (C) 1995-2015, 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/RHist.hxx
"
19
#include "
ROOT/RHistDrawable.hxx
"
20
#include "
ROOT/RCanvas.hxx
"
21
#include "
ROOT/RFitPanel.hxx
"
22
23
using namespace
ROOT::Experimental
;
24
25
void
fitpanel() {
26
27
RAxisConfig
xaxis
(10, 0., 10.);
28
// Create the histogram.
29
auto
pHist
= std::make_shared<RH1D>(
xaxis
);
30
31
// Fill a few points.
32
pHist
->Fill(1);
33
pHist
->Fill(2);
34
pHist
->Fill(2);
35
pHist
->Fill(3);
36
37
auto
canvas = RCanvas::Create(
"RCanvas with histogram"
);
38
canvas->Draw(
pHist
);
//->SetLineColor(RColor::kRed);
39
40
canvas->Show();
41
canvas->Update();
// need to ensure canvas is drawn
42
43
auto
panel
= std::make_shared<RFitPanel>(
"FitPanel Title"
);
44
45
// TODO: how combine there methods together
46
// here std::shread_ptr<> on both sides
47
48
panel
->AssignCanvas(canvas);
49
panel
->AssignHistogram(
pHist
);
50
51
canvas->AddPanel(
panel
);
52
53
// preserve panel alive until connection is closed
54
canvas->ClearOnClose(
panel
);
55
}
RCanvas.hxx
RFitPanel.hxx
RHistDrawable.hxx
RHist.hxx
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
ROOT::Experimental::RAxisConfig
Objects used to configure the different axis types.
Definition
RAxisConfig.hxx:35
ROOT::Experimental
Definition
RDirectory.hxx:30
tutorials
experimental
fitpanel.cxx
ROOT master - Reference Guide Generated on Fri Jan 24 2025 04:37:19 (GVA Time) using Doxygen 1.10.0