]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
some cleanups so that it works out of the box.
authorrdm <rdm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Jul 2004 12:15:36 +0000 (12:15 +0000)
committerrdm <rdm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Jul 2004 12:15:36 +0000 (12:15 +0000)
DISPLAY/display2.C

index b7482901ee3468186c5892d29a2a4d5521bae1ae..2d6e8ec52480cf3b2f7b8cacf228a070637562fe 100644 (file)
@@ -2,60 +2,60 @@
 // Input: in the tracks contains the interesting tracks
 //        ntracks is the number of interesing tracks
 //        The default values correspond to "Show everything"
-// Note: For the moment it works only with HIJING events, the PYTHIA is 
-//       still not supported 
+// Note: For the moment it works only with HIJING events, the PYTHIA is
+//       still not supported
 //#include <ClassTable.h>
 
-void display2 (const char *filename="galice.root",Int_t nevent=0, Int_t * tracks=0, Int_t ntracks=0) {
-// Dynamically link some shared libs
+void display2(const char *filename="galice.root", Int_t nevent=0,
+              Int_t *tracks=0, Int_t ntracks=0)
+{
+   // Dynamically link some shared libs
    if (gClassTable->GetID("AliRun") < 0) {
       gROOT->LoadMacro("loadlibs.C");
       loadlibs();
    } else {
-         delete gAlice->GetRunLoader();
+      delete gAlice->GetRunLoader();
       delete gAlice;
       gAlice = 0;
    }
-    //gROOT->LoadMacro("AliDisplay2.C");  
-   gSystem->Load("libAliL3Src");
-       gSystem->Load("libDISPLAY");
-// Connect the Root Galice file containing Geometry, Kine and Hits
+   //gSystem->Load("libAliL3Src");
+   gSystem->Load("libDISPLAY");
 
-   AliRunLoader *rl = 0x0;
+   // Connect the ROOT Galice file containing Geometry, Kine and Hits
+   AliRunLoader *rl = 0;
    TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
-   if(file){
-     cout<<"galice.root is already open \n";
+   if(file) {
+      Info("display2.C", "galice.root is already open");
    }
-   rl = AliRunLoader::Open(filename,"DISPLAYED EVENT");
-   
-   if (rl == 0x0)
-    {
-      cerr<<"Error <display.C()>: can not get Run Loader. Exiting"<<endl;
+   rl = AliRunLoader::Open(filename, "DISPLAYED EVENT");
+
+   if (rl == 0) {
+      Error("display2.C", "can not get Run Loader, exiting...");
       return;
-    }
+   }
 
-// Get AliRun object from file or create it if not on file
+   // Get AliRun object from file or create it if not on file
    rl->LoadgAlice();
+
    gAlice = rl->GetAliRun();
    if (!gAlice) {
-    cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
-    return;
+      Error("display2.C", "AliRun object not found on file, exiting...");
+      return;
   }
-   
-// Create Event Display object
+
+   // Create Event Display object
    AliDisplay2 *edisplay = new AliDisplay2(gClient->GetRoot(), 900, 700);
-//   if (ntracks>0) edisplay->SetTracksToDisplay(tracks, ntracks);
+   // if (ntracks > 0) edisplay->SetTracksToDisplay(tracks, ntracks);
 
-// Display the requested event
-//   gAlice->GetEvent(nevent);
-  rl->GetEvent(nevent);
+   // Display the requested event
+   rl->GetEvent(nevent);
    rl->LoadKinematics();
    rl->LoadHeader();
    rl->LoadHits();
-   //  edisplay->FindModules();
-   edisplay->ShowNextEvent(0);  
-} 
+
+   //edisplay->FindModules();
+   edisplay->ShowNextEvent(0);
+}