]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - macros/display.C
Tom's request for steel stainless skin thickness
[u/mrichter/AliRoot.git] / macros / display.C
index 6355c2ca8bfb99ef8c482e512085a723aa7572eb..1ff5f24e3729d51179a0fa749ddc9ef3a44fe49d 100644 (file)
@@ -10,33 +10,47 @@ void display (const char *filename="galice.root",Int_t nevent=0, Int_t * tracks=
       gROOT->LoadMacro("loadlibs.C");
       loadlibs();
    } else {
+      delete gAlice->GetRunLoader();
       delete gAlice;
       gAlice = 0;
    }
       
 // Connect the Root Galice file containing Geometry, Kine and Hits
-
+   AliRunLoader *rl = 0x0;
    TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
    if(file){
      cout<<"galice.root is already open \n";
    }
-   else {
-     if(!file)file=TFile::Open(filename);
-   }
 
+   
+   rl = AliRunLoader::Open(filename,"DISPLAYED EVENT");
+   
+   if (rl == 0x0)
+    {
+      cerr<<"Error <display.C()>: can not get Run Loader. Exiting"<<endl;
+      return;
+    }
 // Get AliRun object from file or create it if not on file
+
+   rl->LoadgAlice();
+   gAlice = rl->GetAliRun();
    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");
-   }
-   
+    cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
+    return;
+  }
+    
+// Load data
+   rl->GetEvent(nevent);
+   rl->LoadKinematics();
+   rl->LoadHeader();
+   rl->LoadHits();
+
 // Create Event Display object
    AliDisplay *edisplay = new AliDisplay(750);
    if (ntracks>0) edisplay->SetTracksToDisplay(tracks, ntracks);
-
+   
 // Display the requested event
-   gAlice->GetEvent(nevent);
    edisplay->ShowNextEvent(0);
 
 // Define the buttons to switch on/off the existing modules