Offline files disabled in online mode comletely. Problem with creation of Multi View...
authorjniedzie <jeremi.niedziela@cern.ch>
Wed, 25 Feb 2015 10:16:35 +0000 (11:16 +0100)
committerjniedzie <jeremi.niedziela@cern.ch>
Wed, 25 Feb 2015 10:16:55 +0000 (11:16 +0100)
EVE/EveBase/AliEveEventManager.cxx
EVE/alice-macros/geom_gentle_trd.C
EVE/macros/alieve_online_new.C

index 5eb2f35..6c1be1d 100644 (file)
@@ -549,230 +549,231 @@ void AliEveEventManager::Open()
     Int_t runNo = -1;
 
     // Open ESD and ESDfriends
-    
-    if ((fESDFile = TFile::Open(fgESDFileName)))
-    {
-        fESD = new AliESDEvent();
-
-        switch(fgESDvisibleTrees){
-        case AliEveEventManager::kOfflineTree :
-            fESDTree = readESDTree("esdTree", runNo);
-            break;
-        case AliEveEventManager::kHLTTree :
-            fHLTESDTree = readESDTree("HLTesdTree", runNo);
-            break;
-        default:
-            fESDTree    = readESDTree("esdTree", runNo);
-            fHLTESDTree = readESDTree("HLTesdTree", runNo);
-        }
-
-        if(!fESDTree && !fHLTESDTree){
-            // both ESD trees are == 0
-            delete fESDFile; fESDFile = 0;
-            delete fESD; fESD = 0;
-        }
-
-
-    }
-    else // esd file not readable
-    {
-        Warning(kEH, "can not read ESD file '%s'.", fgESDFileName.Data());
-    }
-    if (fESDTree == 0 && fHLTESDTree==0)
-    {
-        if (fgAssertESD)
-        {
-            throw (kEH + "ESD not initialized. Its precence was requested.");
-        } else {
-            Warning(kEH, "ESD not initialized.");
-        }
-    }
+    if(!fOnlineMode)
+      {
+       if ((fESDFile = TFile::Open(fgESDFileName)))
+         {
+           fESD = new AliESDEvent();
+
+           switch(fgESDvisibleTrees){
+           case AliEveEventManager::kOfflineTree :
+             fESDTree = readESDTree("esdTree", runNo);
+             break;
+           case AliEveEventManager::kHLTTree :
+             fHLTESDTree = readESDTree("HLTesdTree", runNo);
+             break;
+           default:
+             fESDTree    = readESDTree("esdTree", runNo);
+             fHLTESDTree = readESDTree("HLTesdTree", runNo);
+           }
 
-    // Open AOD and registered friends
-    if ( (fAODFile = TFile::Open(fgAODFileName)) )
-    {
-        fAOD = new AliAODEvent();
-        fAODTree = (TTree*) fAODFile->Get("aodTree");
-        if (fAODTree != 0)
-        {
-            // Check if AODfriends exist and attach them.
-            TIter       friends(fgAODfriends);
-            TObjString *name;
-            while ((name = (TObjString*) friends()) != 0)
-            {
-                TString p(Form("%s/%s", fgAODFileName.Data(), name->GetName()));
-                if (fgAODFileName.EndsWith(".zip")) p.Form("%s#%s",fgAODFileName.Data(),name->GetName());
-                if (gSystem->AccessPathName(p, kReadPermission) == kFALSE)
-                {
-                    fAODTree->AddFriend("aodTree", name->GetName());
-                }
-            }
+           if(!fESDTree && !fHLTESDTree){
+             // both ESD trees are == 0
+             delete fESDFile; fESDFile = 0;
+             delete fESD; fESD = 0;
+           }
 
-            fAOD->ReadFromTree(fAODTree);
 
-            if (fAODTree->GetEntry(0) <= 0)
-            {
-                delete fAODFile; fAODFile = 0;
-                delete fAOD;     fAOD     = 0;
-                Warning(kEH, "failed getting the first entry from addTree.");
-            }
-            else
-            {
-                if (runNo < 0)
-                    runNo = fAOD->GetRunNumber();
-            }
-        }
-        else // aodtree == 0
-        {
-            delete fAODFile; fAODFile = 0;
-            delete fAOD;     fAOD     = 0;
-            Warning(kEH, "failed getting the aodTree.");
-        }
-    }
-    else // aod not readable
-    {
-        Warning(kEH, "can not read AOD file '%s'.", fgAODFileName.Data());
-    }
-    if (fAODTree == 0)
-    {
-        if (fgAssertAOD)
-        {
-            throw (kEH + "AOD not initialized. Its precence was requested.");
-        } else {
-            Warning(kEH, "AOD not initialized.");
-        }
-    }
+         }
+       else // esd file not readable
+         {
+           Warning(kEH, "can not read ESD file '%s'.", fgESDFileName.Data());
+         }
+       if (fESDTree == 0 && fHLTESDTree==0)
+         {
+           if (fgAssertESD)
+             {
+               throw (kEH + "ESD not initialized. Its precence was requested.");
+             } else {
+             Warning(kEH, "ESD not initialized.");
+           }
+         }
+
+       // Open AOD and registered friends
+       if ( (fAODFile = TFile::Open(fgAODFileName)) )
+         {
+           fAOD = new AliAODEvent();
+           fAODTree = (TTree*) fAODFile->Get("aodTree");
+           if (fAODTree != 0)
+             {
+               // Check if AODfriends exist and attach them.
+               TIter       friends(fgAODfriends);
+               TObjString *name;
+               while ((name = (TObjString*) friends()) != 0)
+                 {
+                   TString p(Form("%s/%s", fgAODFileName.Data(), name->GetName()));
+                   if (fgAODFileName.EndsWith(".zip")) p.Form("%s#%s",fgAODFileName.Data(),name->GetName());
+                   if (gSystem->AccessPathName(p, kReadPermission) == kFALSE)
+                     {
+                       fAODTree->AddFriend("aodTree", name->GetName());
+                     }
+                 }
+
+               fAOD->ReadFromTree(fAODTree);
+
+               if (fAODTree->GetEntry(0) <= 0)
+                 {
+                   delete fAODFile; fAODFile = 0;
+                   delete fAOD;     fAOD     = 0;
+                   Warning(kEH, "failed getting the first entry from addTree.");
+                 }
+               else
+                 {
+                   if (runNo < 0)
+                     runNo = fAOD->GetRunNumber();
+                 }
+             }
+           else // aodtree == 0
+             {
+               delete fAODFile; fAODFile = 0;
+               delete fAOD;     fAOD     = 0;
+               Warning(kEH, "failed getting the aodTree.");
+             }
+         }
+       else // aod not readable
+         {
+           Warning(kEH, "can not read AOD file '%s'.", fgAODFileName.Data());
+         }
+       if (fAODTree == 0)
+         {
+           if (fgAssertAOD)
+             {
+               throw (kEH + "AOD not initialized. Its precence was requested.");
+             } else {
+             Warning(kEH, "AOD not initialized.");
+           }
+         }
 
-    // Open RunLoader from galice.root
-//    fgGAliceFileName = "/Users/Jerus/galice.root"; // temp
+       // Open RunLoader from galice.root
+       //    fgGAliceFileName = "/Users/Jerus/galice.root"; // temp
     
-    TFile *gafile = TFile::Open(fgGAliceFileName);
-    cout<<"Opening galice"<<endl;
-    if (gafile)
-    {
-        gafile->Close();
-        delete gafile;
-        cout<<"SETTING RUN LOADER in Open()"<<endl;
-        fRunLoader = AliRunLoader::Open(fgGAliceFileName, GetName());
-        if (fRunLoader)
-        {
-            TString alicePath(gSystem->DirName(fgGAliceFileName));
-            alicePath.Append("/");
-            fRunLoader->SetDirName(alicePath);
-
-            if (fRunLoader->LoadgAlice() != 0)
-                Warning(kEH, "failed loading gAlice via run-loader.");
-
-            if (fRunLoader->LoadHeader() == 0)
-            {
-                if (runNo < 0)
-                    runNo = fRunLoader->GetHeader()->GetRun();
-            }
-            else
-            {
-                Warning(kEH, "failed loading run-loader's header.");
-                delete fRunLoader;
-                fRunLoader = 0;
-            }
-        }
-        else // run-loader open failed
-        {
-            Warning(kEH, "failed opening ALICE run-loader from '%s'.", fgGAliceFileName.Data());
-        }
+       TFile *gafile = TFile::Open(fgGAliceFileName);
+       cout<<"Opening galice"<<endl;
+       if (gafile)
+         {
+           gafile->Close();
+           delete gafile;
+           cout<<"SETTING RUN LOADER in Open()"<<endl;
+           fRunLoader = AliRunLoader::Open(fgGAliceFileName, GetName());
+           if (fRunLoader)
+             {
+               TString alicePath(gSystem->DirName(fgGAliceFileName));
+               alicePath.Append("/");
+               fRunLoader->SetDirName(alicePath);
+
+               if (fRunLoader->LoadgAlice() != 0)
+                 Warning(kEH, "failed loading gAlice via run-loader.");
+
+               if (fRunLoader->LoadHeader() == 0)
+                 {
+                   if (runNo < 0)
+                     runNo = fRunLoader->GetHeader()->GetRun();
+                 }
+               else
+                 {
+                   Warning(kEH, "failed loading run-loader's header.");
+                   delete fRunLoader;
+                   fRunLoader = 0;
+                 }
+             }
+           else // run-loader open failed
+             {
+               Warning(kEH, "failed opening ALICE run-loader from '%s'.", fgGAliceFileName.Data());
+             }
         
-    }
-    else // galice not readable
-    {
-        Warning(kEH, "can not read '%s'.", fgGAliceFileName.Data());
-    }
-    if (fRunLoader == 0)
-    {
-        if (fgAssertRunLoader)
-            throw (kEH + "Bootstraping of run-loader failed. Its precence was requested.");
-        else
-            Warning(kEH, "Bootstraping of run-loader failed.");
-    }
-
-    // Open raw-data file
-
-    TString rawPath;
-    if (fgRawFromStandardLoc)
-    {
-        if (!fgRawFileName.BeginsWith("alien:"))
-            throw kEH + "Standard raw search requested, but the directory is not in AliEn.";
-        if (!fgRawFileName.Contains("/ESDs/"))
-            throw kEH + "Standard raw search requested, but does not contain 'ESDs' directory.";
-
-        TPMERegexp chunk("/([\\d\\.])+/?$");
-        Int_t nm = chunk.Match(fgRawFileName);
-        if (nm != 2)
-            throw kEH + "Standard raw search requested, but the path does not end with chunk-id directory.";
-
-        TPMERegexp esdstrip("/ESDs/.*");
-        rawPath = fgRawFileName;
-        esdstrip.Substitute(rawPath, "/raw/");
-        rawPath += chunk[0];
-        rawPath += ".root";
-
-        Info(kEH, "Standard raw search requested, using the following path:\n  %s\n", rawPath.Data());
-    }
-    else
-    {
-        rawPath = fgRawFileName;
-    }
-    // If i use open directly, raw-reader reports an error but i have
-    // no way to detect it.
-    // Is this (AccessPathName check) ok for xrootd / alien? Yes, not for http.
-    AliLog::EType_t oldLogLevel = (AliLog::EType_t) AliLog::GetGlobalLogLevel();
-    if (fgAssertRaw == kFALSE)
-    {
-        AliLog::SetGlobalLogLevel(AliLog::kFatal);
-    }
-    if (gSystem->AccessPathName(rawPath, kReadPermission) == kFALSE)
-    {
-        fRawReader = AliRawReader::Create(rawPath);
-    }
-    else
-    {
-        fRawReader = AliRawReader::Create(fgRawFileName);
-    }
-    if (fgAssertRaw == kFALSE)
-    {
-        AliLog::SetGlobalLogLevel(oldLogLevel);
-    }
-
-    if (fRawReader == 0)
-    {
-        if (fgAssertRaw)
-        {
-            throw (kEH + "raw-data not initialized. Its precence was requested.");
-        }
-        else
-        {
-            Warning(kEH, "raw-data not initialized.");
-        }
-    }
-
-    if (runNo < 0)
-    {
-        if (fRawReader)
-        {
-            if ( ! fRawReader->NextEvent())
-            {
-                throw (kEH + "can not go to first event in raw-reader to determine run-id.");
-            }
-            runNo = fRawReader->GetRunNumber();
-            Info(kEH, "Determining run-no from raw ... run=%d.", runNo);
-            fRawReader->RewindEvents();
-        }
-        else
-        {
-            fExternalCtrl = kTRUE;
-             fEventId = 0;
-            return;
-        }
-    }
-
+         }
+       else // galice not readable
+         {
+           Warning(kEH, "can not read '%s'.", fgGAliceFileName.Data());
+         }
+       if (fRunLoader == 0)
+         {
+           if (fgAssertRunLoader)
+             throw (kEH + "Bootstraping of run-loader failed. Its precence was requested.");
+           else
+             Warning(kEH, "Bootstraping of run-loader failed.");
+         }
+
+       // Open raw-data file
+
+       TString rawPath;
+       if (fgRawFromStandardLoc)
+         {
+           if (!fgRawFileName.BeginsWith("alien:"))
+             throw kEH + "Standard raw search requested, but the directory is not in AliEn.";
+           if (!fgRawFileName.Contains("/ESDs/"))
+             throw kEH + "Standard raw search requested, but does not contain 'ESDs' directory.";
+
+           TPMERegexp chunk("/([\\d\\.])+/?$");
+           Int_t nm = chunk.Match(fgRawFileName);
+           if (nm != 2)
+             throw kEH + "Standard raw search requested, but the path does not end with chunk-id directory.";
+
+           TPMERegexp esdstrip("/ESDs/.*");
+           rawPath = fgRawFileName;
+           esdstrip.Substitute(rawPath, "/raw/");
+           rawPath += chunk[0];
+           rawPath += ".root";
+
+           Info(kEH, "Standard raw search requested, using the following path:\n  %s\n", rawPath.Data());
+         }
+       else
+         {
+           rawPath = fgRawFileName;
+         }
+       // If i use open directly, raw-reader reports an error but i have
+       // no way to detect it.
+       // Is this (AccessPathName check) ok for xrootd / alien? Yes, not for http.
+       AliLog::EType_t oldLogLevel = (AliLog::EType_t) AliLog::GetGlobalLogLevel();
+       if (fgAssertRaw == kFALSE)
+         {
+           AliLog::SetGlobalLogLevel(AliLog::kFatal);
+         }
+       if (gSystem->AccessPathName(rawPath, kReadPermission) == kFALSE)
+         {
+           fRawReader = AliRawReader::Create(rawPath);
+         }
+       else
+         {
+           fRawReader = AliRawReader::Create(fgRawFileName);
+         }
+       if (fgAssertRaw == kFALSE)
+         {
+           AliLog::SetGlobalLogLevel(oldLogLevel);
+         }
+
+       if (fRawReader == 0)
+         {
+           if (fgAssertRaw)
+             {
+               throw (kEH + "raw-data not initialized. Its precence was requested.");
+             }
+           else
+             {
+               Warning(kEH, "raw-data not initialized.");
+             }
+         }
+
+       if (runNo < 0)
+         {
+           if (fRawReader)
+             {
+               if ( ! fRawReader->NextEvent())
+                 {
+                   throw (kEH + "can not go to first event in raw-reader to determine run-id.");
+                 }
+               runNo = fRawReader->GetRunNumber();
+               Info(kEH, "Determining run-no from raw ... run=%d.", runNo);
+               fRawReader->RewindEvents();
+             }
+           else
+             {
+               fExternalCtrl = kTRUE;
+               fEventId = 0;
+               return;
+             }
+         }
+      }
     // Initialize OCDB ... only in master event-manager
 
     InitOCDB(runNo);
@@ -910,7 +911,7 @@ void AliEveEventManager::SetEvent(AliRunLoader *runLoader, AliRawReader *rawRead
 
     fEventId++;
     fHasEvent     = kTRUE;
-    fExternalCtrl = kTRUE;
+    //fExternalCtrl = kTRUE;
 
     SetTitle("Online event in memory");
     SetName ("Online Event");
@@ -934,7 +935,7 @@ Int_t AliEveEventManager::GetMaxEventId(Bool_t refreshESD) const
 
     static const TEveException kEH("AliEveEventManager::GetMaxEventId ");
 
-    if (fExternalCtrl || fIsOpen == kFALSE)
+    if (fExternalCtrl || fIsOpen == kFALSE || fOnlineMode)
     {
         return -1;
     }
@@ -1003,7 +1004,13 @@ void AliEveEventManager::GotoEvent(Int_t event)
     }
     if (fExternalCtrl)
     {
-      // throw (kEH + "Event-loop is under external control.");
+        throw (kEH + "Event-loop is under external control.");
+    }
+    else if (!fIsOpen)
+    {
+        throw (kEH + "Event-files not opened.");
+    }
+    
 #ifdef ZMQ
       if(fOnlineMode)
        {
@@ -1086,11 +1093,7 @@ void AliEveEventManager::GotoEvent(Int_t event)
        }
 #endif 
 
-    }
-    else if (!fIsOpen)
-    {
-        throw (kEH + "Event-files not opened.");
-    }
+   
 
     fEventInfo.Reset();
 
@@ -1270,13 +1273,13 @@ void AliEveEventManager::NextEvent()
 
     static const TEveException kEH("AliEveEventManager::NextEvent ");
 
-    if (fAutoLoadTimerRunning){throw (kEH + "Event auto-load timer is running.");}
+    if (fAutoLoadTimerRunning){throw (kEH + "Event auto-load timer is running.");}    
+    if (fExternalCtrl){throw (kEH + "External control");}
     
-    if (fExternalCtrl)
-    {
+    if(fOnlineMode)
+      {
 #ifdef ZMQ
-      if(fOnlineMode)
-       {
+      
          if(fIsNewEventAvaliable)
            {
              fMutex->Lock();
@@ -1303,9 +1306,8 @@ void AliEveEventManager::NextEvent()
              cout<<"No new event is avaliable."<<endl;
              NoEventLoaded();
            }
-       }
 #endif
-    }
+      }
     else if ((fESDTree!=0) || (fHLTESDTree!=0))
     {
       cout<<"There is ESD or HLTESD tree"<<endl;
index 6cd4ebc..3f7b006 100644 (file)
 TEveGeoShape* geom_gentle_trd()
 {
   TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_trd.root");
-  //TFile f("/local/cdb/GRP/Geometry/Data/Run0_999999999_v1_s0.root");
   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD");
   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
   gEve->AddGlobalElement(gsre);
   f.Close();
 
-  const Int_t smInstalled[]={0, 1, 2, 3,4,5, 6, 7, 8, 9, 10, 11,12,13,14, 15, 16, 17};
+  const Int_t smInstalled[]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
   const Int_t nInstalled = static_cast<Int_t>(sizeof(smInstalled)/sizeof(Int_t));
   Int_t sm = 0;
   // Fix visibility, color and transparency
index 73d5891..37518fc 100644 (file)
@@ -4,19 +4,48 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
+#include "AliEveEventManager.h"
+#include "AliEveEventManagerEditor.h"
+#include "AliEveMultiView.h"
+#include "AliEveMacroExecutor.h"
+#include "AliEveMacro.h"
+#include "AliSysInfo.h"
+
+#include <TH2D.h>
+#include <TTimeStamp.h>
+#include <TROOT.h>
+#include <TEveManager.h>
+#include <TEveBrowser.h>
+#include <TEveMacro.h>
+#include <TGTab.h>
+#include <TGFileBrowser.h>
+#include <TInterpreter.h>
+#include <TEnv.h>
+#include <TPRegexp.h>
+#include <TFolder.h>
+#include <TSystem.h>
+#include <TSystemDirectory.h>
+#include <TList.h>
+
+#include <iostream>
+
+using namespace std;
+
 class TEveProjectionManager;
 class TEveGeoShape;
 class TEveUtil;
 class AliTriggerAnalysis;
 class AliSysInfo;
 
-TH2D* V0StateHistogram;
+TH2D *V0StateHistogram;
 Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
 
 Int_t      g_pic_id  = 0;
 Int_t      g_pic_max = 100;
 TTimeStamp g_pic_prev(0, 0);
 
+void alieve_init_import_macros();
+
 void alieve_online_new()
 {
     // set OCDB path:
@@ -25,35 +54,42 @@ void alieve_online_new()
     AliEveEventManager::SetCdbUri("local:///local/cdb");         // current OCDB snapshot
     //AliEveEventManager::SetCdbUri("raw://");                   // reading OCDB from alien
     
+    cout<<"Creating multiview...";
+    AliEveMultiView *multiView = new AliEveMultiView(kTRUE);
+    cout<<"created"<<endl;
     
     Info("alieve_init", "Adding standard macros.");
     TString  hack = gSystem->pwd(); // Problem with TGFileBrowser cding
     alieve_init_import_macros();
     gSystem->cd(Form("%s/../src/",gSystem->Getenv("ALICE_ROOT")));
-    gROOT->ProcessLine(".L saveViews.C++");
-    gROOT->ProcessLine(".L geom_gentle_muon.C++");
-    gROOT->ProcessLine(".L geom_gentle_trd.C++");
+    gROOT->ProcessLine(".L saveViews.C+");
+    gROOT->ProcessLine(".L geom_gentle.C+");
+    gROOT->ProcessLine(".L geom_gentle_muon.C+");
+    gROOT->ProcessLine(".L geom_gentle_trd.C+");
     TEveUtil::LoadMacro("saveViews.C");
     gSystem->cd(hack);
     cout<<"Standard macros added"<<endl;
     
+
     new AliEveEventManager("online", -1);
     gEve->AddEvent(AliEveEventManager::GetMaster());
+    cout<<"Event manager created"<<endl;
     
     TEveUtil::AssertMacro("VizDB_scan.C");
     gSystem->ProcessEvents();
-    
+    cout<<"VizDB_scan loaded"<<endl;
     TEveBrowser *browser = gEve->GetBrowser();
     browser->ShowCloseTab(kFALSE);
+    cout<<"browser created"<<endl;
     
-
-    cout<<"Creating multiview"<<endl;
-    AliEveMultiView *multiView = new AliEveMultiView(kTRUE);
     TEveUtil::LoadMacro("geom_gentle.C");
+    cout<<"geom gentle loaded"<<endl;
+    
     multiView->InitGeomGentle(geom_gentle(),
                               geom_gentle_rphi(),
                               geom_gentle_rhoz(),
                               geom_gentle_rhoz());
+    cout<<"geom gentl inited"<<endl;
     
     TEveUtil::LoadMacro("geom_gentle_trd.C");
     multiView->InitGeomGentleTrd(geom_gentle_trd());
@@ -68,7 +104,8 @@ void alieve_online_new()
     printf("============ Setting macro executor ============\n");
     
     AliEveMacroExecutor *exec = AliEveEventManager::GetMaster()->GetExecutor();
-    
+    printf("exec created\n");
+    /*
     exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX",         "primary_vertex.C", "primary_vertex",             "",                kTRUE));
     exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse",     "",                kTRUE));
     exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box",     "primary_vertex.C", "primary_vertex_box",         "kFALSE, 3, 3, 3", kFALSE));
@@ -81,24 +118,25 @@ void alieve_online_new()
     exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track",      "esd_tracks.C",        "esd_tracks",             "", kFALSE));
     exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track",      "esd_tracks.C",        "esd_tracks_MI",          "", kFALSE));
     exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track MUON", "esd_muon_tracks.C", "esd_muon_tracks",        "kTRUE,kFALSE", kTRUE));
-    
+    */
     // these macros were leaking:
-    exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track",      "esd_tracks.C",        "esd_tracks_by_category", "", kTRUE));// just a little
-    exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC FMD",        "fmd_esd.C",           "fmd_esd",                "", kTRUE));//huge leak
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track","esd_tracks.C",        "esd_tracks_by_category", "", kTRUE));// just a little
+    //exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC FMD",        "fmd_esd.C",           "fmd_esd",                "", kTRUE));//huge leak
     //
     
     // ???
     // exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC TRD", "trd_detectors.C", "trd_detectors",         "", kFALSE));
     // trd_tracks disabled due to memory leaks
-    
+    cout<<"macros added to exec"<<endl;
+
     //----------------------------------------------------------------------------
-    
+    /* something is wrong here:
     slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
     slot->StartEmbedding();
     AliEveMacroExecutorWindow* exewin = new AliEveMacroExecutorWindow(exec);
     slot->StopEmbedding("DataSelection");
     exewin->PopulateMacros();
-    
+    */
     //============================================================================
     // Final GUI setup
     //============================================================================
@@ -107,7 +145,7 @@ void alieve_online_new()
     browser->StartEmbedding(TRootBrowser::kBottom);
     new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
     browser->StopEmbedding("EventCtrl");
+    
     browser->MoveResize(0, 0, gClient->GetDisplayWidth(),gClient->GetDisplayHeight() - 32);
     
     gEve->FullRedraw3D(kTRUE);
@@ -134,11 +172,11 @@ void alieve_online_new()
 void alieve_online_on_new_event()
 {
     AliSysInfo::AddStamp("on_new_event_start");
-    
-    Double_t x[3] = { 0, 0, 0 };
-    
+       
     if (AliEveEventManager::HasESD())
-    {
+      {
+       Double_t x[3] = { 0, 0, 0 };
+
         AliESDEvent* esd = AliEveEventManager::AssertESD();
         esd->GetPrimaryVertex()->GetXYZ(x);
         
@@ -148,66 +186,69 @@ void alieve_online_on_new_event()
         win_title += "; Event # in ESD file: ";
         win_title += esd->GetEventNumberInFile();
         gEve->GetBrowser()->SetWindowName(win_title);
-    }
     
-    TEveElement* top = gEve->GetCurrentEvent();
     
-    AliEveMultiView *mv = AliEveMultiView::Instance();
+       TEveElement* top = gEve->GetCurrentEvent();
+    
+       AliEveMultiView *mv = AliEveMultiView::Instance();
     
-    //mv->DestroyEventRPhi();
-    if (gCenterProjectionsAtPrimaryVertex)
-        mv->SetCenterRPhi(x[0], x[1], x[2]);
-    mv->ImportEventRPhi(top);
+       mv->DestroyEventRPhi();
+       if (gCenterProjectionsAtPrimaryVertex){
+         mv->SetCenterRPhi(x[0], x[1], x[2]);
+       }
+       mv->ImportEventRPhi(top);
     
-    //mv->DestroyEventRhoZ();
-    if (gCenterProjectionsAtPrimaryVertex)
-        mv->SetCenterRhoZ(x[0], x[1], x[2]);
-    mv->ImportEventRhoZ(top);
+       mv->DestroyEventRhoZ();
+       if (gCenterProjectionsAtPrimaryVertex){
+         mv->SetCenterRhoZ(x[0], x[1], x[2]);
+       }
+       mv->ImportEventRhoZ(top);
     
-    if (gCenterProjectionsAtPrimaryVertex)
-        mv->SetCenterMuon(x[0], x[1], x[2]);
-    mv->ImportEventMuon(top);
+       if (gCenterProjectionsAtPrimaryVertex)
+         mv->SetCenterMuon(x[0], x[1], x[2]);
+       mv->ImportEventMuon(top);
     
     
-     // Register image to amore.
-     // const TString pichost("aldaqacrs3");
-     const TString pichost(gEnv->GetValue("AliEve.imageDumpHost", "localhost"));
-     TTimeStamp now;
-     Double_t delta = now.AsDouble() - g_pic_prev.AsDouble();
+       // Register image to amore.
+       // const TString pichost("aldaqacrs3");
+       const TString pichost(gEnv->GetValue("AliEve.imageDumpHost", "localhost"));
+       TTimeStamp now;
+       Double_t delta = now.AsDouble() - g_pic_prev.AsDouble();
      
-     printf("Pre image dump: host='%s', delta=%f.\n",gSystem->HostName(), delta);
+       printf("Pre image dump: host='%s', delta=%f.\n",gSystem->HostName(), delta);
      
-     AliSysInfo::AddStamp("on_new_event_pic");
-     // if (pichost == gSystem->HostName() && delta >= 30)
-     {
-       TString id;      id.Form("online-viz-%03d", g_pic_id);
-       TString pic(id); pic += ".png";
+       AliSysInfo::AddStamp("on_new_event_pic");
+       // if (pichost == gSystem->HostName() && delta >= 30)
+       {
+         TString id;      id.Form("online-viz-%03d", g_pic_id);
+         TString pic(id); pic += ".png";
      
-       printf("In image dump: file='%s'.\n", pic.Data());
+         printf("In image dump: file='%s'.\n", pic.Data());
      
-       gEve->GetBrowser()->RaiseWindow();
-       gEve->FullRedraw3D();
-       gSystem->ProcessEvents();
+         gEve->GetBrowser()->RaiseWindow();
+         gEve->FullRedraw3D();
+         gSystem->ProcessEvents();
      
-       Int_t status;
+         Int_t status;
      
-       // create screenshots from OpenGL views
-       saveViews(pic.Data());
+         // create screenshots from OpenGL views
+         saveViews(pic.Data());
      
-       // send screenshot to AMORE
-       cout<<"Sending:"<<TString::Format("SendImageToAmore %s %s %d",id.Data(), pic.Data(),AliEveEventManager::AssertESD()->GetRunNumber())<<endl;
+         // send screenshot to AMORE
+         cout<<"Sending:"<<TString::Format("SendImageToAmore %s %s %d",id.Data(), pic.Data(),AliEveEventManager::AssertESD()->GetRunNumber())<<endl;
 
-       status = gSystem->Exec(TString::Format("SendImageToAmore %s %s %d",
-                                             id.Data(), pic.Data(),
-                                             AliEveEventManager::AssertESD()->GetRunNumber()));
+         status = gSystem->Exec(TString::Format("SendImageToAmore %s %s %d",
+                                                id.Data(), pic.Data(),
+                                                AliEveEventManager::AssertESD()->GetRunNumber()));
      
-       printf("Post AMORE reg -- status=%d, run=%d.\n", status,
-             AliEveEventManager::AssertESD()->GetRunNumber());
+         printf("Post AMORE reg -- status=%d, run=%d.\n", status,
+                AliEveEventManager::AssertESD()->GetRunNumber());
      
-       if (++g_pic_id >= g_pic_max)
-        g_pic_id = 0;
-       g_pic_prev.Set();
-     }
+         if (++g_pic_id >= g_pic_max)
+           g_pic_id = 0;
+         g_pic_prev.Set();
+       }
+      }
     AliSysInfo::AddStamp("on_new_event_end");
 }
 
@@ -216,12 +257,13 @@ void alieve_init_import_macros()
     // Put macros in the list of browsables, add a macro browser to
     // top-level GUI.
     
+  TString macdir("$(ALICE_ROOT)/EVE/alice-macros");
+
     if (gSystem->Getenv("ALICE_ROOT") != 0)
     {
         gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT")));
         gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
-        TString macdir("$(ALICE_ROOT)/EVE/alice-macros");
-        gSystem->ExpandPathName(macdir);
+       gSystem->ExpandPathName(macdir);
     }
     
     
@@ -232,7 +274,7 @@ void alieve_init_import_macros()
         char* filename;
         TPMERegexp re("\\.C$");
         TObjArray names;
-        while ((filename = gSystem->GetDirEntry(dirhandle)) != 0)
+        while ((filename = (char*)(gSystem->GetDirEntry(dirhandle))) != 0)
         {
             if (re.Match(filename))
                 names.AddLast(new TObjString(filename));