Logo ROOT  
Reference Guide
fitpanel.cxx File Reference

Detailed Description

/*************************************************************************
* Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#include "ROOT/RHist.hxx"
#include "ROOT/RCanvas.hxx"
#include "ROOT/RFitPanel.hxx"
using namespace ROOT::Experimental;
void fitpanel() {
RAxisConfig xaxis(10, 0., 10.);
// Create the histogram.
auto pHist = std::make_shared<RH1D>(xaxis);
// Fill a few points.
pHist->Fill(1);
pHist->Fill(2);
pHist->Fill(2);
pHist->Fill(3);
auto canvas = RCanvas::Create("Canvas Title");
canvas->Draw(pHist); //->SetLineColor(RColor::kRed);
canvas->Show();
canvas->Update(); // need to ensure canvas is drawn
auto panel = std::make_shared<RFitPanel>("FitPanel Title");
RDirectory::Heap().Add("fitpanel", panel);
RDirectory::Heap().Add("firsthisto", pHist);
// TODO: how combine there methods together
// here std::shread_ptr<> on both sides
panel->AssignCanvas(canvas);
panel->AssignHistogram(pHist);
canvas->AddPanel(panel);
}
Date
2015-03-22
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Author
Axel Naumann axel@.nosp@m.cern.nosp@m..ch

Definition in file fitpanel.cxx.

RHist.hxx
ROOT::Experimental::RAxisConfig
Definition: RAxisConfig.hxx:47
RHistDrawable.hxx
ROOT::Experimental::RDirectory::Add
void Add(std::string_view name, const std::shared_ptr< T > &ptr)
Add an existing object (rather a shared_ptr to it) to the RDirectory.
Definition: RDirectory.hxx:184
ROOT::Experimental::RCanvas::Create
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
Definition: RCanvas.cxx:70
RDirectory.hxx
RCanvas.hxx
TCanvas::Draw
virtual void Draw(Option_t *option="")
Draw a canvas.
Definition: TCanvas.cxx:841
TCanvas::Show
void Show()
Show canvas.
Definition: TCanvas.cxx:2236
TCanvas::Update
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2500
ROOT::Experimental::RDirectory::Heap
static RDirectory & Heap()
Dedicated, process-wide RDirectory.
Definition: RFile.cxx:23
ROOT::Experimental
Definition: RDirectory.hxx:36