Logo ROOT   6.18/05
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() {
// TODO - also keep axis correctly in the help
auto xaxis = std::make_shared<RAxisConfig>(10, 0., 10.);
// Create the histogram.
auto pHist = std::make_shared<RH1D>(*xaxis.get());
// 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);
RDirectory::Heap().Add("firstaxis", xaxis);
// 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.