File indexing completed on 2024-04-06 12:00:02
0001 {
0002 string filename;
0003 cout<<"filename: "<<endl;
0004 cin >> filename;
0005
0006 TFile f(filename.c_str());
0007 f.cd("ecalMipGraphs");
0008
0009 TTree* namesListTree = (TTree*) gDirectory->Get("canvasNames");
0010
0011 std::vector<std::string>* canvasNames = new std::vector<std::string>();
0012 namesListTree->SetBranchAddress("names",&canvasNames);
0013 namesListTree->GetEntry(0);
0014
0015 TCanvas* currentCanvas;
0016 TCanvas canB("navigation","navigation",10,50,180,200);
0017 TButton *but = new TButton ("Next",".x $CMSSW_BASE/src/CaloOnlineTools/EcalTools/data/macro/DrawCanvasNext.C",0,0,1,.5);
0018 but->Draw();
0019 TButton *butPrev = new TButton ("Prev",".x $CMSSW_BASE/src/CaloOnlineTools/EcalTools/data/macro/DrawCanvasPrev.C",0,.5,1,1);
0020 butPrev->Draw();
0021 int canvasNum=0;
0022 std::string name = canvasNames->at(canvasNum);
0023 currentCanvas = (TCanvas*) gDirectory->Get(name.c_str());
0024 currentCanvas->Draw();
0025 currentCanvas->SetWindowPosition(200,50);
0026 currentCanvas->SetWindowSize(900,900);
0027 }