]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/MUONdisplay.C
04-mar-2004 NvE Functionality of AliObjMatrix extended to provide the number of refer...
[u/mrichter/AliRoot.git] / MUON / MUONdisplay.C
index d68ebde5c2284dab4857a8934dc1ff025121de72..08672ffaf57fa6a8eb740c077eda07989022f2e4 100644 (file)
@@ -1,30 +1,28 @@
 MUONdisplay (Int_t nevent=0, TString fileName="galice.root") {
-// Dynamically link some shared libs
-   if (gClassTable->GetID("AliRun") < 0) {
-      gROOT->LoadMacro("loadlibs.C");
-      loadlibs();
-      /*
-   } else {
-      delete gAlice;
-      gAlice = 0;
-      */
-   }
+  // Getting runloader 
+  AliRunLoader * RunLoader = AliRunLoader::Open(fileName,"MUONFolder","READ");
+  if (RunLoader == 0x0) {
+    Error("MUONdisplay","Inut file %s error!",fileName);
+    return;   
+  }
+  RunLoader->LoadHeader();
+  RunLoader->LoadKinematics("READ");
 
-// Connect the Root Galice file containing Geometry, Kine and Hits
-   TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(fileName);
-   if (!file) file = new TFile(fileName);
+  // Getting MUONloader 
+  AliLoader * MUONLoader  = RunLoader->GetLoader("MUONLoader");
+  MUONLoader->LoadHits("READ");
+  MUONLoader->LoadDigits("READ");
+  MUONLoader->LoadRecPoints("READ");
+
+  //  if (RunLoader->GetAliRun() == 0x0) 
+  RunLoader->LoadgAlice();
+  gAlice = RunLoader->GetAliRun();
 
-// Get AliRun object from file or create it if not on file
-   if (!gAlice) {
-      gAlice = (AliRun*)file->Get("gAlice");
-      if (gAlice) printf("AliRun object found on file\n");
-      if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
-   }
-   
-// Create Event Display object
-   AliMUONDisplay *muondisplay = new AliMUONDisplay(750);
 
-// Display first event
-   gAlice->GetEvent(nevent);
+// Create Event Display object
+   AliMUONDisplay *muondisplay = new AliMUONDisplay(750, MUONLoader);
+   RunLoader->GetEvent(nevent);
    muondisplay->ShowNextEvent(0);
 }