Updated macro for alieve-based reconstruction.
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Jul 2009 13:50:04 +0000 (13:50 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Jul 2009 13:50:04 +0000 (13:50 +0000)
EVE/macros/alieve_online.C

index 9709f2d..945b6c7 100644 (file)
@@ -4,8 +4,26 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
+class TEveProjectionManager;
+class TEveGeoShape;
+class TEveUtil;
+
 TEveGeoShape *gGeomGentle = 0;
 
+TEveScene *gRPhiGeomScene  = 0;
+TEveScene *gRhoZGeomScene  = 0;
+TEveScene *gRPhiEventScene = 0;
+TEveScene *gRhoZEventScene = 0;
+
+TEveProjectionManager *gRPhiMgr = 0;
+TEveProjectionManager *gRhoZMgr = 0;
+
+TEveViewer *g3DView   = 0;
+TEveViewer *gRPhiView = 0;
+TEveViewer *gRhoZView = 0;
+
+Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
+
 void alieve_online_init()
 {
   gROOT->LoadMacro("geom_gentle.C");
@@ -25,46 +43,94 @@ void alieve_online_init()
 
   TEveUtil::AssertMacro("VizDB_scan.C");
 
+  TEveBrowser         *browser = gEve->GetBrowser();
+  browser->ShowCloseTab(kFALSE);
+
   // Temp fix !!!
   TGeoManager *man = gGeoManager;
   gGeomGentle = geom_gentle();
+  gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy();
+  gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy();
   // Temp fix !!!
   gGeoManager = man;
 
-  gROOT->ProcessLine(".L SplitGLView.C++g"); // !!!! debug-mode
-
-  TEveBrowser* browser = gEve->GetBrowser();
-  browser->ShowCloseTab(kFALSE);
-
-  browser->ExecPlugin("SplitGLView", 0, "new SplitGLView(gClient->GetRoot(), 600, 450, kTRUE)");
-
-  if (gRPhiMgr) {
+  // Scenes
+  gRPhiGeomScene  = gEve->SpawnNewScene("RPhi Geometry",
+                    "Scene holding projected geometry for the RPhi view.");
+  gRhoZGeomScene  = gEve->SpawnNewScene("RhoZ Geometry",
+                   "Scene holding projected geometry for the RhoZ view.");
+  gRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
+                   "Scene holding projected geometry for the RPhi view.");
+  gRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
+                   "Scene holding projected geometry for the RhoZ view.");
+
+  gRPhiMgr = new TEveProjectionManager();
+  gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);
+  gEve->AddToListTree(gRPhiMgr, kFALSE);
+  {
     TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);
     a->SetMainColor(kWhite);
     a->SetTitle("R-Phi");
     a->SetTitleSize(0.05);
-    a->SetTitleFont();
+    a->SetTitleFont(102);
     a->SetLabelSize(0.025);
-    a->SetLabelFont();
-    gEve->GetScenes()->FindChild("R-Phi Projection")->AddElement(a);
+    a->SetLabelFont(102);
+    gRPhiGeomScene->AddElement(a);
   }
-  if (gRhoZMgr) {
+  gRPhiMgr->SetCurrentDepth(-10);
+  gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene);
+  gRPhiMgr->SetCurrentDepth(0);
+
+  gRhoZMgr = new TEveProjectionManager();
+  gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
+  gEve->AddToListTree(gRhoZMgr, kFALSE);
+  {
     TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
     a->SetMainColor(kWhite);
-    a->SetTitle("Rho-Phi");
+    a->SetTitle("Rho-Z");
     a->SetTitleSize(0.05);
-    a->SetTitleFont();
+    a->SetTitleFont(102);
     a->SetLabelSize(0.025);
-    a->SetLabelFont();
-    gEve->GetScenes()->FindChild("Rho-Z Projection")->AddElement(a);
+    a->SetLabelFont(102);
+    gRhoZGeomScene->AddElement(a);
   }
+  gRhoZMgr->SetCurrentDepth(-10);
+  gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene);
+  gRhoZMgr->SetCurrentDepth(0);
+
+  // Viewers
+  TEveWindowSlot *slot = 0;
+  TEveWindowPack *pack = 0;
+
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  pack = slot->MakePack();
+  pack->SetElementName("Multi View");
+  pack->SetHorizontal();
+  pack->SetShowTitleBar(kFALSE);
+  pack->NewSlot()->MakeCurrent();
+  g3DView = gEve->SpawnNewViewer("3D View", "");
+  g3DView->AddScene(gEve->GetGlobalScene());
+  g3DView->AddScene(gEve->GetEventScene());
+
+  pack = pack->NewSlot()->MakePack();
+  pack->SetShowTitleBar(kFALSE);
+  pack->NewSlot()->MakeCurrent();
+  gRPhiView = gEve->SpawnNewViewer("RPhi View", "");
+  gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
+  gRPhiView->AddScene(gRPhiGeomScene);
+  gRPhiView->AddScene(gRPhiEventScene);
+
+  pack->NewSlot()->MakeCurrent();
+  gRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
+  gRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
+  gRhoZView->AddScene(gRhoZGeomScene);
+  gRhoZView->AddScene(gRhoZEventScene);
+
 
   browser->StartEmbedding(TRootBrowser::kBottom);
   new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
   browser->StopEmbedding("EventCtrl");
 
-  browser->ShowCloseTab(kTRUE);
-
   gEve->Redraw3D(kTRUE);
 }
 
@@ -95,18 +161,18 @@ void alieve_online_on_new_event()
 
   TEveElement* top = gEve->GetCurrentEvent();
 
-  if (gRPhiMgr && top) {
-    gRPhiMgr->DestroyElements();
-    gRPhiMgr->SetCenter(x[0], x[1], x[2]);
-    gRPhiMgr->ImportElements(gGeomGentle);
-    gRPhiMgr->ImportElements(top);
+  if (gRPhiMgr && top)
+  {
+    gRPhiEventScene->DestroyElements();
+    if (gCenterProjectionsAtPrimaryVertex)
+      gRPhiMgr->SetCenter(x[0], x[1], x[2]);
+    gRPhiMgr->ImportElements(top, gRPhiEventScene);
   }
-  if (gRhoZMgr && top) {
-    gRhoZMgr->DestroyElements();
-    gRhoZMgr->SetCenter(x[0], x[1], x[2]);
-    gRhoZMgr->ImportElements(gGeomGentle);
-    gRhoZMgr->ImportElements(top);
+  if (gRhoZMgr && top)
+  {
+    gRhoZEventScene->DestroyElements();
+    if (gCenterProjectionsAtPrimaryVertex)
+      gRhoZMgr->SetCenter(x[0], x[1], x[2]);
+    gRhoZMgr->ImportElements(top, gRhoZEventScene);
   }
-
-  gROOT->ProcessLine("SplitGLView::UpdateSummary()");
 }