#include "ohpPlugins/rateHistoMapWidget.h" RateHistoMapWidget::RateHistoMapWidget(QWidget* parent,const char* name): QWidget(parent,name),parent(parent),thisWidgetsName(name) { QWidget::setMinimumSize(800,600); m_topLayout = new QVBoxLayout(this,0,1,"topLayout"); m_canvasWidget = new TQtWidget(this,"canvasWidget"); m_topLayout->addWidget(m_canvasWidget,1); } RateHistoMapWidget::~RateHistoMapWidget(void){ } void RateHistoMapWidget::DisplayHistogram(void){ TFile* file = new TFile("plots.root","READONLY"); // Get a list of keys that reference the histograms in this file TList* keyList = file->GetListOfKeys(); if(keyList->GetEntries() == 0){ std::cerr << "[RateHistoMapWidget::DisplayHistogram]: ERROR reading key list.\n"; return; } unsigned int key = 0; TKey* histoKey = (TKey*)keyList->At(key); TH2* histo = (TH2*)histoKey->ReadObj(); m_canvasWidget->GetCanvas()->cd(); histo->Draw("colz"); m_canvasWidget->GetCanvas()->Update(); }