Move MultiView.C into EveBase class AliEveMultiView.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Nov 2009 15:00:59 +0000 (15:00 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Nov 2009 15:00:59 +0000 (15:00 +0000)
EVE/EveBase/AliEveMultiView.cxx [new file with mode: 0644]
EVE/EveBase/AliEveMultiView.h [new file with mode: 0644]
EVE/EveBase/EveBaseLinkDef.h
EVE/alice-macros/clusters_from_index.C
EVE/macros/MultiView.C [deleted file]
EVE/macros/alieve_online.C
EVE/macros/visscan_init.C

diff --git a/EVE/EveBase/AliEveMultiView.cxx b/EVE/EveBase/AliEveMultiView.cxx
new file mode 100644 (file)
index 0000000..9b3ea89
--- /dev/null
@@ -0,0 +1,216 @@
+// $Id$
+// Author: Matevz Tadel 2009
+
+/**************************************************************************
+ * Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#include "AliEveMultiView.h"
+
+
+//______________________________________________________________________________
+// Full description of AliEveMultiView
+//
+
+ClassImp(AliEveMultiView)
+
+AliEveMultiView* AliEveMultiView::fgInstance = 0;
+
+AliEveMultiView* AliEveMultiView::Instance()
+{
+  // Return static instance.
+
+  return fgInstance;
+}
+
+AliEveMultiView::AliEveMultiView() :
+  fGeomGentle(0), fGeomGentleRPhi(0), fGeomGentleRhoZ(0),
+  fGeomGentleTrd(0), fGeomGentleMuon(0)
+{
+  // Constructor --- creates required scenes, projection managers
+  // and GL viewers.
+
+  if (fgInstance)
+    throw TEveException("AliEveMultiView::AliEveMultiView already instantiated.");
+  fgInstance = this;
+
+  // Scenes
+  //========
+
+  fRPhiGeomScene  = gEve->SpawnNewScene("RPhi Geometry",
+                                        "Scene holding projected geometry for the RPhi view.");
+  fRhoZGeomScene  = gEve->SpawnNewScene("RhoZ Geometry",
+                                        "Scene holding projected geometry for the RhoZ view.");
+  fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
+                                        "Scene holding projected event-data for the RPhi view.");
+  fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
+                                        "Scene holding projected event-data for the RhoZ view.");
+
+
+  // Projection managers
+  //=====================
+
+  fRPhiMgr = new TEveProjectionManager();
+  fRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);
+  gEve->AddToListTree(fRPhiMgr, kFALSE);
+  {
+    TEveProjectionAxes* a = new TEveProjectionAxes(fRPhiMgr);
+    a->SetMainColor(kWhite);
+    a->SetTitle("R-Phi");
+    a->SetTitleSize(0.05);
+    a->SetTitleFont(102);
+    a->SetLabelSize(0.025);
+    a->SetLabelFont(102);
+    fRPhiGeomScene->AddElement(a);
+  }
+
+  fRhoZMgr = new TEveProjectionManager();
+  fRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
+  gEve->AddToListTree(fRhoZMgr, kFALSE);
+  {
+    TEveProjectionAxes* a = new TEveProjectionAxes(fRhoZMgr);
+    a->SetMainColor(kWhite);
+    a->SetTitle("Rho-Z");
+    a->SetTitleSize(0.05);
+    a->SetTitleFont(102);
+    a->SetLabelSize(0.025);
+    a->SetLabelFont(102);
+    fRhoZGeomScene->AddElement(a);
+  }
+
+
+  // Viewers
+  //=========
+
+  TEveWindowSlot *slot = 0;
+  TEveWindowPack *pack = 0;
+
+  slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
+  pack = slot->MakePack();
+  pack->SetElementName("Multi View");
+  pack->SetHorizontal();
+  pack->SetShowTitleBar(kFALSE);
+  pack->NewSlot()->MakeCurrent();
+  f3DView = gEve->SpawnNewViewer("3D View", "");
+  f3DView->AddScene(gEve->GetGlobalScene());
+  f3DView->AddScene(gEve->GetEventScene());
+
+  pack = pack->NewSlot()->MakePack();
+  pack->SetShowTitleBar(kFALSE);
+  pack->NewSlot()->MakeCurrent();
+  fRPhiView = gEve->SpawnNewViewer("RPhi View", "");
+  fRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
+  fRPhiView->AddScene(fRPhiGeomScene);
+  fRPhiView->AddScene(fRPhiEventScene);
+
+  pack->NewSlot()->MakeCurrent();
+  fRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
+  fRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
+  fRhoZView->AddScene(fRhoZGeomScene);
+  fRhoZView->AddScene(fRhoZEventScene);
+}
+
+//-------------------------------------------------------------------------
+
+void AliEveMultiView::InitGeomGentle(TEveGeoShape* g3d, TEveGeoShape* grphi, TEveGeoShape* grhoz)
+{
+  // Initialize gentle geometry.
+
+  fGeomGentle     = g3d;
+  fGeomGentleRPhi = grphi; fGeomGentleRPhi->IncDenyDestroy();
+  fGeomGentleRhoZ = grhoz; fGeomGentleRhoZ->IncDenyDestroy();
+
+  ImportGeomRPhi(fGeomGentleRPhi);
+  ImportGeomRhoZ(fGeomGentleRhoZ);
+}
+
+void AliEveMultiView::InitGeomGentleTrd(TEveGeoShape* gtrd)
+{
+  // Initialize gentle geometry TRD.
+
+  fGeomGentleTrd = gtrd;
+  ImportGeomRPhi(fGeomGentleTrd);
+  ImportGeomRhoZ(fGeomGentleTrd);
+}
+
+void AliEveMultiView::InitGeomGentleMuon(TEveGeoShape* gmuon, Bool_t showRPhi, Bool_t showRhoZ)
+{
+  // Initialize gentle geometry for MUON.
+
+  fGeomGentleMuon = gmuon;
+  if (showRPhi) ImportGeomRPhi(fGeomGentleMuon);
+  if (showRhoZ) ImportGeomRhoZ(fGeomGentleMuon);
+}
+
+//-------------------------------------------------------------------------
+
+void AliEveMultiView::SetDepth(Float_t d)
+{
+  // Set current depth on all projection managers.
+
+  fRPhiMgr->SetCurrentDepth(d);
+  fRhoZMgr->SetCurrentDepth(d);
+}
+
+//-------------------------------------------------------------------------
+
+void AliEveMultiView::ImportGeomRPhi(TEveElement* el)
+{ 
+  // Import el into r-phi geometry scene.
+
+  fRPhiMgr->ImportElements(el, fRPhiGeomScene);
+}
+
+void AliEveMultiView::ImportGeomRhoZ(TEveElement* el)
+{ 
+  // Import el into rho-z geometry scene.
+
+  fRhoZMgr->ImportElements(el, fRhoZGeomScene);
+}
+
+void AliEveMultiView::ImportEventRPhi(TEveElement* el)
+{ 
+  // Import el into r-phi event scene.
+
+  fRPhiMgr->ImportElements(el, fRPhiEventScene);
+}
+
+void AliEveMultiView::ImportEventRhoZ(TEveElement* el)
+{ 
+  // Import el into rho-z event scene.
+
+  fRhoZMgr->ImportElements(el, fRhoZEventScene);
+}
+
+void AliEveMultiView::DestroyEventRPhi()
+{
+  // Destroy all elements in r-phi event scene.
+
+  fRPhiEventScene->DestroyElements();
+}
+
+void AliEveMultiView::DestroyEventRhoZ()
+{
+  // Destroy all elements in rho-z event scene.
+
+  fRhoZEventScene->DestroyElements();
+}
+
+//-------------------------------------------------------------------------
+
+void AliEveMultiView::SetCenterRPhi(Double_t x, Double_t y, Double_t z)
+{
+  // Set center of r-phi manager.
+
+  fRPhiMgr->SetCenter(x, y, z);
+}
+
+void AliEveMultiView::SetCenterRhoZ(Double_t x, Double_t y, Double_t z)
+{
+  // Set center of rho-z manager.
+
+  fRhoZMgr->SetCenter(x, y, z);
+}
+
diff --git a/EVE/EveBase/AliEveMultiView.h b/EVE/EveBase/AliEveMultiView.h
new file mode 100644 (file)
index 0000000..7f45849
--- /dev/null
@@ -0,0 +1,95 @@
+// $Id$
+// Author: Matevz Tadel 2009
+
+/**************************************************************************
+ * Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifndef AliEveMultiView_H
+#define AliEveMultiView_H
+
+#include <TEveManager.h>
+
+#include <TEveViewer.h>
+#include <TGLViewer.h>
+
+#include <TEveScene.h>
+#include <TEveGeoShape.h>
+
+#include <TEveProjectionManager.h>
+#include <TEveProjectionAxes.h>
+
+#include <TEveBrowser.h>
+#include <TEveWindow.h>
+
+//______________________________________________________________________________
+// Short description of AliEveMultiView
+//
+
+class AliEveMultiView
+{
+public:
+  AliEveMultiView();
+  virtual ~AliEveMultiView() {}
+
+  static AliEveMultiView* Instance();
+
+  void InitGeomGentle(TEveGeoShape* g3d, TEveGeoShape* grphi, TEveGeoShape* grhoz);
+  void InitGeomGentleTrd(TEveGeoShape* gtrd);
+  void InitGeomGentleMuon(TEveGeoShape* gmuon, Bool_t showRPhi, Bool_t showRhoZ);
+
+  //-------------------------------------------------------------------------
+
+  void SetDepth(Float_t d);
+
+  //-------------------------------------------------------------------------
+
+  void ImportGeomRPhi(TEveElement* el);
+  void ImportGeomRhoZ(TEveElement* el);
+  void ImportEventRPhi(TEveElement* el);
+  void ImportEventRhoZ(TEveElement* el);
+
+  void DestroyEventRPhi();
+  void DestroyEventRhoZ();
+
+  void SetCenterRPhi(Double_t x, Double_t y, Double_t z);
+  void SetCenterRhoZ(Double_t x, Double_t y, Double_t z);
+
+  //-------------------------------------------------------------------------
+
+  TEveViewer* Get3DView()   { return f3DView; }
+  TEveViewer* GetRPhiView() { return fRPhiView; }
+  TEveViewer* GetRhoZView() { return fRhoZView; }
+
+
+protected:
+  TEveProjectionManager *fRPhiMgr; // Obvious meaning.
+  TEveProjectionManager *fRhoZMgr; // Obvious meaning.
+
+  TEveViewer            *f3DView;   // Obvious meaning.
+  TEveViewer            *fRPhiView; // Obvious meaning.
+  TEveViewer            *fRhoZView; // Obvious meaning.
+
+  TEveScene             *fRPhiGeomScene;  // Obvious meaning.
+  TEveScene             *fRhoZGeomScene;  // Obvious meaning.
+  TEveScene             *fRPhiEventScene; // Obvious meaning.
+  TEveScene             *fRhoZEventScene; // Obvious meaning.
+
+  TEveGeoShape          *fGeomGentle;     // Obvious meaning.
+  TEveGeoShape          *fGeomGentleRPhi; // Obvious meaning.
+  TEveGeoShape          *fGeomGentleRhoZ; // Obvious meaning.
+  TEveGeoShape          *fGeomGentleTrd;  // Obvious meaning.
+  TEveGeoShape          *fGeomGentleMuon; // Obvious meaning.
+
+  static AliEveMultiView* fgInstance;     // Obvious meaning.
+
+private:
+  AliEveMultiView(const AliEveMultiView&);            // Not implemented
+  AliEveMultiView& operator=(const AliEveMultiView&); // Not implemented
+
+  ClassDef(AliEveMultiView, 0); // Multiple-views.
+};
+
+#endif
index 773c616..d7fe817 100644 (file)
 #pragma link C++ class AliEveMacroExecutor+;
 #pragma link C++ class AliEveMacroExecutorWindow+;
 
+// Various
 #pragma link C++ class AliEveKineTools+;
 #pragma link C++ class AliEveMagField+;
 #pragma link C++ class AliEveVSDCreator+;
+#pragma link C++ class AliEveMultiView+;
 
 // AliEveTrack
 #pragma link C++ class AliEveTrack+;
index ddeec82..944557d 100644 (file)
@@ -56,10 +56,10 @@ TEvePointSet* clusters_from_index(Int_t index=0, TEveElement* cont=0)
 
   gEve->AddElement(clusters);
 
-  if (gMultiView)
+  if (AliEveMultiView::Instance())
   {
-    gMultiView->ImportEventRPhi(clusters);
-    gMultiView->ImportEventRhoZ(clusters);
+    AliEveMultiView::Instance()->ImportEventRPhi(clusters);
+    AliEveMultiView::Instance()->ImportEventRhoZ(clusters);
   }
 
   gEve->Redraw3D();
diff --git a/EVE/macros/MultiView.C b/EVE/macros/MultiView.C
deleted file mode 100644 (file)
index d8cc166..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-// Multi-view (3d, rphi, rhoz) service class using EVE Window Manager.
-// Author: Matevz Tadel 2009
-
-#include <TEveManager.h>
-
-#include <TEveViewer.h>
-#include <TGLViewer.h>
-
-#include <TEveScene.h>
-#include <TEveGeoShape.h>
-
-#include <TEveProjectionManager.h>
-#include <TEveProjectionAxes.h>
-
-#include <TEveBrowser.h>
-#include <TEveWindow.h>
-
-// MultiView
-//
-// Structure encapsulating standard views: 3D, r-phi and rho-z.
-// Includes scenes and projection managers.
-//
-// Should be used in compiled mode.
-
-class MultiView
-{
-public:
-   TEveProjectionManager *fRPhiMgr;
-   TEveProjectionManager *fRhoZMgr;
-
-   TEveViewer            *f3DView;
-   TEveViewer            *fRPhiView;
-   TEveViewer            *fRhoZView;
-
-   TEveScene             *fRPhiGeomScene;
-   TEveScene             *fRhoZGeomScene;
-   TEveScene             *fRPhiEventScene;
-   TEveScene             *fRhoZEventScene;
-
-   TEveGeoShape          *fGeomGentle;
-   TEveGeoShape          *fGeomGentleRPhi;
-   TEveGeoShape          *fGeomGentleRhoZ;
-   TEveGeoShape          *fGeomGentleTrd;
-   TEveGeoShape          *fGeomGentleMuon;
-
-   //-------------------------------------------------------------------------
-
-   MultiView() :
-      fGeomGentle(0), fGeomGentleRPhi(0), fGeomGentleRhoZ(0),
-      fGeomGentleTrd(0), fGeomGentleMuon(0)
-   {
-      // Constructor --- creates required scenes, projection managers
-      // and GL viewers.
-
-      // Scenes
-      //========
-
-      fRPhiGeomScene  = gEve->SpawnNewScene("RPhi Geometry",
-                                            "Scene holding projected geometry for the RPhi view.");
-      fRhoZGeomScene  = gEve->SpawnNewScene("RhoZ Geometry",
-                                            "Scene holding projected geometry for the RhoZ view.");
-      fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
-                                            "Scene holding projected event-data for the RPhi view.");
-      fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
-                                            "Scene holding projected event-data for the RhoZ view.");
-
-
-      // Projection managers
-      //=====================
-
-      fRPhiMgr = new TEveProjectionManager();
-      fRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);
-      gEve->AddToListTree(fRPhiMgr, kFALSE);
-      {
-         TEveProjectionAxes* a = new TEveProjectionAxes(fRPhiMgr);
-         a->SetMainColor(kWhite);
-         a->SetTitle("R-Phi");
-         a->SetTitleSize(0.05);
-         a->SetTitleFont(102);
-         a->SetLabelSize(0.025);
-         a->SetLabelFont(102);
-         fRPhiGeomScene->AddElement(a);
-      }
-
-      fRhoZMgr = new TEveProjectionManager();
-      fRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
-      gEve->AddToListTree(fRhoZMgr, kFALSE);
-      {
-         TEveProjectionAxes* a = new TEveProjectionAxes(fRhoZMgr);
-         a->SetMainColor(kWhite);
-         a->SetTitle("Rho-Z");
-         a->SetTitleSize(0.05);
-         a->SetTitleFont(102);
-         a->SetLabelSize(0.025);
-         a->SetLabelFont(102);
-         fRhoZGeomScene->AddElement(a);
-      }
-
-
-      // Viewers
-      //=========
-
-      TEveWindowSlot *slot = 0;
-      TEveWindowPack *pack = 0;
-
-      slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
-      pack = slot->MakePack();
-      pack->SetElementName("Multi View");
-      pack->SetHorizontal();
-      pack->SetShowTitleBar(kFALSE);
-      pack->NewSlot()->MakeCurrent();
-      f3DView = gEve->SpawnNewViewer("3D View", "");
-      f3DView->AddScene(gEve->GetGlobalScene());
-      f3DView->AddScene(gEve->GetEventScene());
-
-      pack = pack->NewSlot()->MakePack();
-      pack->SetShowTitleBar(kFALSE);
-      pack->NewSlot()->MakeCurrent();
-      fRPhiView = gEve->SpawnNewViewer("RPhi View", "");
-      fRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
-      fRPhiView->AddScene(fRPhiGeomScene);
-      fRPhiView->AddScene(fRPhiEventScene);
-
-      pack->NewSlot()->MakeCurrent();
-      fRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
-      fRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
-      fRhoZView->AddScene(fRhoZGeomScene);
-      fRhoZView->AddScene(fRhoZEventScene);
-   }
-
-   //-------------------------------------------------------------------------
-
-   void InitGeomGentle(TEveGeoShape* g3d, TEveGeoShape* grphi, TEveGeoShape* grhoz)
-   {
-      fGeomGentle     = g3d;
-      fGeomGentleRPhi = grphi; fGeomGentleRPhi->IncDenyDestroy();
-      fGeomGentleRhoZ = grhoz; fGeomGentleRhoZ->IncDenyDestroy();
-
-      ImportGeomRPhi(fGeomGentleRPhi);
-      ImportGeomRhoZ(fGeomGentleRhoZ);
-   }
-
-   void InitGeomGentleTrd(TEveGeoShape* gtrd)
-   {
-      fGeomGentleTrd = gtrd;
-      ImportGeomRPhi(fGeomGentleTrd);
-      ImportGeomRhoZ(fGeomGentleTrd);
-   }
-
-   void InitGeomGentleMuon(TEveGeoShape* gmuon, Bool_t showRPhi, Bool_t showRhoZ)
-   {
-      fGeomGentleMuon = gmuon;
-      if (showRPhi) ImportGeomRPhi(fGeomGentleMuon);
-      if (showRhoZ) ImportGeomRhoZ(fGeomGentleMuon);
-   }
-
-   //-------------------------------------------------------------------------
-
-   void SetDepth(Float_t d)
-   {
-      fRPhiMgr->SetCurrentDepth(d);
-      fRhoZMgr->SetCurrentDepth(d);
-   }
-
-   //-------------------------------------------------------------------------
-
-   void ImportGeomRPhi(TEveElement* el)
-   { 
-      fRPhiMgr->ImportElements(el, fRPhiGeomScene);
-   }
-
-   void ImportGeomRhoZ(TEveElement* el)
-   { 
-      fRhoZMgr->ImportElements(el, fRhoZGeomScene);
-   }
-
-   void ImportEventRPhi(TEveElement* el)
-   { 
-      fRPhiMgr->ImportElements(el, fRPhiEventScene);
-   }
-
-   void ImportEventRhoZ(TEveElement* el)
-   { 
-      fRhoZMgr->ImportElements(el, fRhoZEventScene);
-   }
-
-   void DestroyEventRPhi()
-   {
-      fRPhiEventScene->DestroyElements();
-   }
-
-   void DestroyEventRhoZ()
-   {
-      fRhoZEventScene->DestroyElements();
-   }
-
-   void SetCenterRPhi(Double_t x, Double_t y, Double_t z)
-   {
-      fRPhiMgr->SetCenter(x, y, z);
-   }
-
-   void SetCenterRhoZ(Double_t x, Double_t y, Double_t z)
-   {
-      fRhoZMgr->SetCenter(x, y, z);
-   }
-};
-
-MultiView *gMultiView = 0;
index 8b2813c..b0a88d8 100644 (file)
@@ -27,15 +27,17 @@ void alieve_online_init()
   // Gentle-geom loading changes gGeoManager.
   TEveGeoManagerHolder mgrRestore;
 
-  gMultiView = new MultiView;
+  AliEveMultiView* mv = new AliEveMultiView;
+
+  mv->SetDepth(-10);
 
   TEveUtil::LoadMacro("geom_gentle.C");
-  gMultiView->InitGeomGentle(geom_gentle(),
-                             geom_gentle_rphi(), 
-                             geom_gentle_rhoz());
+  mv->InitGeomGentle(geom_gentle(), geom_gentle_rphi(), geom_gentle_rhoz());
 
   // See visscan_init.C for how to add TRD / MUON geometry.
 
+  mv->SetDepth(0);
+
   //============================================================================
   // Standard macros to execute -- not all are enabled by default.
   //============================================================================
@@ -114,7 +116,7 @@ void alieve_online_init()
 
   gEve->FullRedraw3D(kTRUE);
 
-  TGLViewer *glv = gMultiView->f3DView->GetGLViewer();
+  TGLViewer *glv = mv->Get3DView()->GetGLViewer();
   glv->CurrentCamera().RotateRad(-0.4, 1);
   glv->DoDraw();
 }
@@ -127,13 +129,15 @@ void alieve_online_on_new_event()
 
   TEveElement* top = gEve->GetCurrentEvent();
 
-  gMultiView->DestroyEventRPhi();
+  AliEveMultiView* mv = AliEveMultiView::Instance();
+
+  mv->DestroyEventRPhi();
   if (gCenterProjectionsAtPrimaryVertex)
-    gMultiView->SetCenterRPhi(x[0], x[1], x[2]);
-  gMultiView->ImportEventRPhi(top);
+    mv->SetCenterRPhi(x[0], x[1], x[2]);
+  mv->ImportEventRPhi(top);
 
-  gMultiView->DestroyEventRhoZ();
+  mv->DestroyEventRhoZ();
   if (gCenterProjectionsAtPrimaryVertex)
-    gMultiView->SetCenterRhoZ(x[0], x[1], x[2]);
-  gMultiView->ImportEventRhoZ(top);
+    mv->SetCenterRhoZ(x[0], x[1], x[2]);
+  mv->ImportEventRhoZ(top);
 }
index 2f6e6aa..069f07e 100644 (file)
@@ -8,7 +8,6 @@
  **************************************************************************/
 
 class AliEveMacroExecutor;
-class MultiView;
 class TEveProjectionManager;
 class TEveGeoShape;
 class TEveUtil;
@@ -30,12 +29,6 @@ void visscan_init(const TString& cdburi = "",
     Fatal("visscan_init.C", "OCDB path MUST be specified as the first argument.");
   }
 
-  if (gROOT->LoadMacro("MultiView.C+") != 0)
-  {
-    gEnv->SetValue("Root.Stacktrace", "no");
-    Fatal("visscan_init.C", "Failed loading MultiView.C in compiled mode.");
-  }
-
   if (!show_extra_geo)
   {
     gShowTrd = gShowMuonRPhi = gShowMuonRhoZ = kFALSE;
@@ -59,26 +52,24 @@ void visscan_init(const TString& cdburi = "",
   // Geometry, scenes, projections and viewers
   //==============================================================================
 
-  gMultiView = new MultiView;
+  AliEveMultiView *mv = new AliEveMultiView;
 
-  gMultiView->SetDepth(-10);
+  mv->SetDepth(-10);
 
   TEveUtil::LoadMacro("geom_gentle.C");
-  gMultiView->InitGeomGentle(geom_gentle(),
-                             geom_gentle_rphi(), 
-                             geom_gentle_rhoz());
+  mv->InitGeomGentle(geom_gentle(), geom_gentle_rphi(), geom_gentle_rhoz());
 
   if (gShowTrd) {
     TEveUtil::LoadMacro("geom_gentle_trd.C");
-    gMultiView->InitGeomGentleTrd(geom_gentle_trd());
+    mv->InitGeomGentleTrd(geom_gentle_trd());
   }
 
   if (gShowMuonRPhi || gShowMuonRhoZ) {
     TEveUtil::LoadMacro("geom_gentle_muon.C");
-    gMultiView->InitGeomGentleMuon(geom_gentle_muon(kFALSE), gShowMuonRPhi, gShowMuonRhoZ);
+    mv->InitGeomGentleMuon(geom_gentle_muon(kFALSE), gShowMuonRPhi, gShowMuonRhoZ);
   }
 
-  gMultiView->SetDepth(0);
+  mv->SetDepth(0);
 
   //==============================================================================
   // Registration of per-event macros
@@ -129,7 +120,7 @@ void visscan_init(const TString& cdburi = "",
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_by_category",  "", kTRUE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_by_anal_cuts", "", kFALSE));
 
-  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kFALSE));
 
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC",      "esd_zdc.C", "esd_zdc", "", kFALSE));
 
@@ -232,13 +223,15 @@ void on_new_event()
 
   TEveElement* top = gEve->GetCurrentEvent();
 
-  gMultiView->DestroyEventRPhi();
+  AliEveMultiView *mv = AliEveMultiView::Instance();
+
+  mv->DestroyEventRPhi();
   if (gCenterProjectionsAtPrimaryVertex)
-    gMultiView->SetCenterRPhi(x[0], x[1], x[2]);
-  gMultiView->ImportEventRPhi(top);
+    mv->SetCenterRPhi(x[0], x[1], x[2]);
+  mv->ImportEventRPhi(top);
 
-  gMultiView->DestroyEventRhoZ();
+  mv->DestroyEventRhoZ();
   if (gCenterProjectionsAtPrimaryVertex)
-    gMultiView->SetCenterRhoZ(x[0], x[1], x[2]);
-  gMultiView->ImportEventRhoZ(top);
+    mv->SetCenterRhoZ(x[0], x[1], x[2]);
+  mv->ImportEventRhoZ(top);
 }