#include "TApplication.h" #include "TROOT.h" #include "TObject.h" #include "TFile.h" #include "TKey.h" #include "TCanvas.h" void daqmon() { TFile *file = new TFile("muon.root","READ"); TCanvas *canvas = NULL; if ( file->IsOpen()) { TKey *key = file->FindKeyAny("multPerEventME11Chamber29;1"); if ( key != NULL ) { canvas = (TCanvas *)key->ReadObj(); if ( canvas != NULL ) { canvas->Draw(); } } file->Close(); } if ( canvas != NULL ) { canvas->Print("muon.png");} } int main(int argc, char **arg) { gROOT->SetBatch(kTRUE); TApplication * app = new TApplication("daqmon", &argc, arg); daqmon(); return(0); }