Add input file name as a parameter, default is galice.root
[u/mrichter/AliRoot.git] / MUON / MUONdisplay.C
CommitLineData
2e7b421f 1MUONdisplay (Int_t nevent=0, TString fileName="galice.root") {
fe4da5cc 2// Dynamically link some shared libs
3 if (gClassTable->GetID("AliRun") < 0) {
a897a37a 4 gROOT->LoadMacro("loadlibs.C");
5 loadlibs();
6 /*
7 } else {
8 delete gAlice;
9 gAlice = 0;
10 */
fe4da5cc 11 }
a897a37a 12
fe4da5cc 13// Connect the Root Galice file containing Geometry, Kine and Hits
2e7b421f 14 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(fileName);
15 if (!file) file = new TFile(fileName);
fe4da5cc 16
17// Get AliRun object from file or create it if not on file
18 if (!gAlice) {
19 gAlice = (AliRun*)file->Get("gAlice");
20 if (gAlice) printf("AliRun object found on file\n");
21 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
22 }
23
24// Create Event Display object
a9e2aefa 25 AliMUONDisplay *muondisplay = new AliMUONDisplay(750);
fe4da5cc 26
27// Display first event
28 gAlice->GetEvent(nevent);
29 muondisplay->ShowNextEvent(0);
30}