#include "TControlBar.h" void* declarer; Int_t fileloaded; void Analyzer() { printf("\n *************************************\n"); printf(" * *\n"); printf(" * Analyzer *\n"); printf(" * *\n"); printf(" *************************************\n\n"); // Load TNtupleAnalyzer //gSystem->Load("libTree.so"); //gSystem->Load("libPhysics.so"); //gSystem->Load("libTNtupleAnalyzer.so"); gROOT->ProcessLine(".L NtupleClass.C+"); gROOT->ProcessLine(".L TNtupleAnalyzer.C+"); //set style and stat gROOT->SetStyle("Plain"); //Plain(); gStyle->SetOptStat(1111111); //Set Color gStyle->SetPalette(1); fileloaded=0; TNtupleAnalyzer *Analyzer = new TNtupleAnalyzer; declarer = Analyzer; Analyzer->loadFile("matchig.D3PD.aan.root"); fileloaded++; //useAtlasStyle(); // Load the menu // menuMain(); //loadfile(); run(); } void useAtlasStyle(){ gROOT->SetStyle("ATLAS"); gROOT->ForceStyle(); } void menuMain(){ barMain = new TControlBar("vertical","Monitor",820,50); barMain->SetNumberOfColumns(2); barMain->AddButton("&Load File","loadFile()","Load file"); barMain->AddButton("&Run","run()","Run over events"); barMain->AddButton("&Quit","quit()","Stop and Quit"); barMain->Show(); gROOT->SaveContext(); } void loadFile(TString fname="matchig.D3PD.aan.root"){ TNtupleAnalyzer *Analyzer = declarer; Analyzer->loadFile(fname); fileloaded++; } void run(){ TNtupleAnalyzer *Analyzer = declarer; if(fileloaded==0){ cout<<"No file loaded! Click on 'Set Dataset' to select one!"<run(); cout<<"Done running over events."<ProcessLine(".q"); }