]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/macros/visscan_init.C
* EVE/macros/alieve_online.C
[u/mrichter/AliRoot.git] / EVE / macros / visscan_init.C
index 6076540860525c3c77a72e2e4a3138bda7b92bb2..183b584a17caad971edfca7a4872d0e43f02eff4 100644 (file)
@@ -8,45 +8,43 @@
  **************************************************************************/
 
 class AliEveMacroExecutor;
-
+class MultiView;
 class TEveProjectionManager;
 class TEveGeoShape;
 class TEveUtil;
 
-TEveGeoShape *gGeomGentle     = 0;
-TEveGeoShape *gGeomGentleRPhi = 0;
-TEveGeoShape *gGeomGentleRhoZ = 0;
-TEveGeoShape *gGeomGentleTRD  = 0;
-TEveGeoShape *gGeomGentleMUON = 0;
 
-TEveScene *gRPhiGeomScene  = 0;
-TEveScene *gRhoZGeomScene  = 0;
-TEveScene *gRPhiEventScene = 0;
-TEveScene *gRhoZEventScene = 0;
+Bool_t gShowTrd      = kTRUE;
+Bool_t gShowMuonRPhi = kFALSE;
+Bool_t gShowMuonRhoZ = kTRUE;
 
-TEveProjectionManager *gRPhiMgr = 0;
-TEveProjectionManager *gRhoZMgr = 0;
+Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
 
-TEveViewer *g3DView   = 0;
-TEveViewer *gRPhiView = 0;
-TEveViewer *gRhoZView = 0;
 
-Bool_t gShowTRD      = kFALSE;
-Bool_t gShowMUON     = kTRUE;
-Bool_t gShowMUONRPhi = kFALSE;
-Bool_t gShowMUONRhoZ = kTRUE;
+void visscan_init(const TString& cdburi = "",
+                 const TString& path   = ".", Bool_t show_extra_geo = kFALSE)
+{
+  if (cdburi.IsNull() && ! AliCDBManager::Instance()->IsDefaultStorageSet())
+  {
+    gEnv->SetValue("Root.Stacktrace", "no");
+    Fatal("visscan_init.C", "OCDB path MUST be specified as the first argument.");
+  }
 
-Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
+  if (gROOT->LoadMacro("MultiView.C+") != 0)
+  {
+    gEnv->SetValue("Root.Stacktrace", "no");
+    Fatal("visscan_init.C", "Failed loading MultiView.C in compiled mode.");
+  }
 
-void visscan_init(Bool_t show_extra_geo=kFALSE)
-{
   if (!show_extra_geo)
   {
-    gShowTRD = gShowMUON = gShowMUONRPhi = gShowMUONRhoZ = kFALSE;
+    gShowTrd = gShowMuonRPhi = gShowMuonRhoZ = kFALSE;
   }
 
+  AliEveEventManager::AddAODfriend("AliAOD.VertexingHF.root");
+
   TEveUtil::LoadMacro("alieve_init.C");
-  alieve_init(".", -1);
+  alieve_init(cdburi, path, -1);
 
   // TEveLine::SetDefaultSmooth(1);
 
@@ -54,103 +52,29 @@ void visscan_init(Bool_t show_extra_geo=kFALSE)
 
   AliEveMacroExecutor *exec    = AliEveEventManager::GetMaster()->GetExecutor();
   TEveBrowser         *browser = gEve->GetBrowser();
+  browser->ShowCloseTab(kFALSE);
+
 
   //==============================================================================
   // Geometry, scenes, projections and viewers
   //==============================================================================
 
-  browser->ShowCloseTab(kFALSE);
-
-  // Geometry
+  gMultiView = new MultiView;
 
   TEveUtil::LoadMacro("geom_gentle.C");
-  gGeomGentle = geom_gentle();
-  gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy();
-  gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy();
-  if (gShowTRD) {
-    TEveUtil::LoadMacro("geom_gentle_trd.C");
-    gGeomGentleTRD = geom_gentle_trd();
-  }
-  if (gShowMUON) {
-    TEveUtil::LoadMacro("geom_gentle_muon.C");
-    gGeomGentleMUON = geom_gentle_muon();
-  }
+  gMultiView->InitGeomGentle(geom_gentle(),
+                             geom_gentle_rphi(), 
+                             geom_gentle_rhoz());
 
-  // 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.");
-
-  // Projection managers
-
-  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(102);
-    a->SetLabelSize(0.025);
-    a->SetLabelFont(102);
-    gRPhiGeomScene->AddElement(a);
+  if (gShowTrd) {
+    TEveUtil::LoadMacro("geom_gentle_trd.C");
+    gMultiView->InitGeomGentleTrd(geom_gentle_trd());
   }
-  gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene);
-  if (gShowTRD)      gRPhiMgr->ImportElements(gGeomGentleTRD, gRPhiGeomScene);
-  if (gShowMUONRPhi) gRPhiMgr->ImportElements(gGeomGentleMUON, gRPhiGeomScene);
 
-  gRhoZMgr = new TEveProjectionManager();
-  gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
-  gEve->AddToListTree(gRhoZMgr, kFALSE);
-  {
-    TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
-    a->SetMainColor(kWhite);
-    a->SetTitle("Rho-Z");
-    a->SetTitleSize(0.05);
-    a->SetTitleFont(102);
-    a->SetLabelSize(0.025);
-    a->SetLabelFont(102);
-    gRhoZGeomScene->AddElement(a);
+  if (gShowMuonRPhi || gShowMuonRhoZ) {
+    TEveUtil::LoadMacro("geom_gentle_muon.C");
+    gMultiView->InitGeomGentleMuon(geom_gentle_muon(kFALSE), gShowMuonRPhi, gShowMuonRhoZ);
   }
-  gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene);
-  if (gShowTRD)      gRhoZMgr->ImportElements(gGeomGentleTRD, gRhoZGeomScene);
-  if (gShowMUONRhoZ) gRhoZMgr->ImportElements(gGeomGentleMUON, gRhoZGeomScene);
-
-  // 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);
 
 
   //==============================================================================
@@ -164,8 +88,10 @@ void visscan_init(Bool_t show_extra_geo=kFALSE)
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit T0",  "t0_hits.C",     "t0_hits",     "", kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit FMD", "fmd_hits.C",    "fmd_hits",    "", kFALSE));
 
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG ITS",     "its_digits.C",  "its_digits",  "", kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG FMD",     "fmd_digits.C",  "fmd_digits",  "", kFALSE));
 
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ITS",     "its_raw.C",     "its_raw",     "", kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC",     "tpc_raw.C",     "tpc_raw",     "", kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW T0",      "t0_raw.C",      "t0_raw",      "", kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD",     "fmd_raw.C",     "fmd_raw",     "", kFALSE));
@@ -187,12 +113,14 @@ void visscan_init(Bool_t show_extra_geo=kFALSE)
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0",   "esd_V0.C",              "esd_V0"));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade_points.C",  "esd_cascade_points"));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade.C",         "esd_cascade"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink_points.C",     "esd_kink_points"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink.C",            "esd_kink"));
 
   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", "esd_tracks.C", "esd_tracks_by_category", "", kTRUE));
 
-  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kTRUE));
 
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC",      "esd_zdc.C", "esd_zdc", "", kFALSE));
 
@@ -202,6 +130,11 @@ void visscan_init(Bool_t show_extra_geo=kFALSE)
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C+", "trd_clusters"));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C+", "tof_clusters"));
 
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "vplot_tpc.C+",    "vplot_tpc", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA HF",   "aod_HF.C",   "aod_HF",   "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA Jets", "jetplane.C", "jetplane", "", kFALSE));
+
 
   //==============================================================================
   // Additional GUI components
@@ -218,6 +151,12 @@ void visscan_init(Bool_t show_extra_geo=kFALSE)
   new AliQAHistViewer(gClient->GetRoot(), 600, 400, kTRUE);
   slot->StopEmbedding("QA histograms");
 
+  //event selection tab
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  slot->StartEmbedding();
+  new AliEveEventSelectorWindow(gClient->GetRoot(), 600, 400, AliEveEventManager::GetMaster()->GetEventSelector());
+  slot->StopEmbedding("Selections");
+
   browser->GetTabRight()->SetTab(1);
 
   browser->StartEmbedding(TRootBrowser::kBottom);
@@ -231,6 +170,7 @@ void visscan_init(Bool_t show_extra_geo=kFALSE)
     "are placed here when the main-frame is closed.");
   gEve->GetWindowManager()->SetDefaultContainer(store_tab);
 
+
   //==============================================================================
   // AliEve objects - global tools
   //==============================================================================
@@ -296,6 +236,16 @@ void on_new_event()
     Warning("on_new_event", "g_esd_tracks_by_category_container not initialized.");
   }
 
+  TEveTrackList *tracklets = dynamic_cast<TEveTrackList*>(gEve->GetCurrentEvent()->FindChild("SPD Tracklets"));
+  if (tracklets)
+  {
+    g_trkcnt->RegisterTracklets(tracklets, kTRUE);
+  }
+  else
+  {
+    Warning("on_new_event", "'SPD Tracklets' not found.");
+  }
+
   Double_t x[3] = { 0, 0, 0 };
 
   if (AliEveEventManager::HasESD())
@@ -313,18 +263,13 @@ void on_new_event()
 
   TEveElement* top = gEve->GetCurrentEvent();
 
-  if (gRPhiMgr && top)
-  {
-    gRPhiEventScene->DestroyElements();
-    if (gCenterProjectionsAtPrimaryVertex)
-      gRPhiMgr->SetCenter(x[0], x[1], x[2]);
-    gRPhiMgr->ImportElements(top, gRPhiEventScene);
-  }
-  if (gRhoZMgr && top)
-  {
-    gRhoZEventScene->DestroyElements();
-    if (gCenterProjectionsAtPrimaryVertex)
-      gRhoZMgr->SetCenter(x[0], x[1], x[2]);
-    gRhoZMgr->ImportElements(top, gRhoZEventScene);
-  }
+  gMultiView->DestroyEventRPhi();
+  if (gCenterProjectionsAtPrimaryVertex)
+    gMultiView->SetCenterRPhi(x[0], x[1], x[2]);
+  gMultiView->ImportEventRPhi(top);
+
+  gMultiView->DestroyEventRhoZ();
+  if (gCenterProjectionsAtPrimaryVertex)
+    gMultiView->SetCenterRhoZ(x[0], x[1], x[2]);
+  gMultiView->ImportEventRhoZ(top);
 }