From 647814a28c6622e39e2eb36b4d7001f2381f95b3 Mon Sep 17 00:00:00 2001 From: mtadel Date: Wed, 7 May 2008 18:25:12 +0000 Subject: [PATCH] AliEveEventManager::AssertGeometry() - consolidate with changes in TEveManager::GetGeometry(), assign the geo-manager to gGeoManager as well. SplitGLView.C - disable summary html view for now (it was not populated). acorde_raw.C, geom_acorde.C - minor cleanup while trying to get ACORDE geometry from CDB. --- EVE/EveBase/AliEveEventManager.cxx | 20 ++++---- EVE/alice-macros/SplitGLView.C | 73 ++++++++++++++++-------------- EVE/alice-macros/acorde_raw.C | 6 ++- EVE/alice-macros/geom_acorde.C | 6 ++- 4 files changed, 58 insertions(+), 47 deletions(-) diff --git a/EVE/EveBase/AliEveEventManager.cxx b/EVE/EveBase/AliEveEventManager.cxx index bd9efd9a04a..36eac983c34 100644 --- a/EVE/EveBase/AliEveEventManager.cxx +++ b/EVE/EveBase/AliEveEventManager.cxx @@ -464,16 +464,18 @@ TGeoManager* AliEveEventManager::AssertGeometry() { // Make sure AliGeomManager is initialized and returns the // corresponding TGeoManger. - // gGeoManager is not set, maybe it should be. - // Throws exception in case run-loader is not available. + // gGeoManager is set to the return value. + // Throws exception if geometry can not be loaded or if it is not + // available and the TGeoManager is locked. // Static utility for macros. - // !!!! Should we set gGeoManager here? - static const TEveException kEH("AliEveEventManager::AssertGeometry "); if (AliGeomManager::GetGeometry() == 0) { + if (TGeoManager::IsLocked()) + throw (kEH + "geometry is not loaded but TGeoManager is locked."); + gGeoManager = 0; AliGeomManager::LoadGeometry(); if ( ! AliGeomManager::GetGeometry()) @@ -486,12 +488,14 @@ TGeoManager* AliEveEventManager::AssertGeometry() // throw (kEH + "could not apply align objs."); } - // Temporary fix. + // @@NEWROOT@@ Temporary fix. // In AliEve several simplified geometries can be loaded at a later stage. - // Should handle this inTEveManager::GetGeometry() by properly - // unlocking and re-locking the geo-manager. + // Locking/unlocking is now handled properly in + // TEveManager::GetGeometry() but we're waiting for next root + // version due on 14.5.2008. TGeoManager::UnlockGeometry(); } - return AliGeomManager::GetGeometry(); + gGeoManager = AliGeomManager::GetGeometry(); + return gGeoManager; } diff --git a/EVE/alice-macros/SplitGLView.C b/EVE/alice-macros/SplitGLView.C index eb4ab6a1a75..b464877a4dc 100644 --- a/EVE/alice-macros/SplitGLView.C +++ b/EVE/alice-macros/SplitGLView.C @@ -653,13 +653,13 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : // create the main menu bar fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame); fMenuBar->AddPopup("&File", fMenuFile, new TGLayoutHints(kLHintsTop | - kLHintsLeft, 0, 4, 0, 0)); + kLHintsLeft, 0, 4, 0, 0)); fMenuBar->AddPopup("&Camera", fMenuCamera, new TGLayoutHints(kLHintsTop | - kLHintsLeft, 0, 4, 0, 0)); + kLHintsLeft, 0, 4, 0, 0)); fMenuBar->AddPopup("&Scene", fMenuScene, new TGLayoutHints(kLHintsTop | - kLHintsLeft, 0, 4, 0, 0)); + kLHintsLeft, 0, 4, 0, 0)); fMenuBar->AddPopup("&Help", fMenuHelp, new TGLayoutHints(kLHintsTop | - kLHintsRight)); + kLHintsRight)); AddFrame(fMenuBar, new TGLayoutHints(kLHintsTop | kLHintsExpandX)); @@ -683,7 +683,7 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : fStatusBar = new TGStatusBar(this, 50, 10); fStatusBar->SetParts(parts, 4); AddFrame(fStatusBar, new TGLayoutHints(kLHintsBottom | kLHintsExpandX, - 0, 0, 10, 0)); + 0, 0, 10, 0)); } // create eve pad (our geometry container) @@ -692,30 +692,29 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : // create the split frames fSplitFrame = new TGSplitFrame(this, 800, 600); AddFrame(fSplitFrame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); - // split it once - fSplitFrame->VSplit(796); - // then split each part again (this will make four parts) - fSplitFrame->GetFirst()->HSplit(300); - fSplitFrame->GetFirst()->GetSecond()->VSplit(400); + // split horizontaly + fSplitFrame->HSplit(350); + // split bottom part vartically + fSplitFrame->GetSecond()->VSplit(400); // get top (main) split frame - frm = fSplitFrame->GetFirst()->GetFirst(); + frm = fSplitFrame->GetFirst(); // create (embed) a GL viewer inside fViewer0 = new TGLEmbeddedViewer(frm, fPad); frm->AddFrame(fViewer0->GetFrame(), new TGLayoutHints(kLHintsExpandX | - kLHintsExpandY)); + kLHintsExpandY)); // set the camera to perspective (XOZ) for this viewer fViewer0->SetCurrentCamera(TGLViewer::kCameraPerspXOZ); // connect signal we are interested to fViewer0->Connect("MouseOver(TGLPhysicalShape*)", "SplitGLView", this, - "OnMouseOver(TGLPhysicalShape*)"); + "OnMouseOver(TGLPhysicalShape*)"); fViewer0->Connect("Activated()", "SplitGLView", this, - "OnViewerActivated()"); + "OnViewerActivated()"); fViewer0->Connect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)", - "SplitGLView", this, - "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)"); + "SplitGLView", this, + "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)"); fViewer0->Connect("Clicked(TObject*)", "SplitGLView", this, - "OnClicked(TObject*)"); + "OnClicked(TObject*)"); fViewer[0] = new TEveViewer("SplitGLViewer[0]"); fViewer[0]->SetGLViewer(fViewer0); fViewer[0]->IncDenyDestroy(); @@ -731,7 +730,7 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : } // get bottom left split frame - frm = fSplitFrame->GetFirst()->GetSecond()->GetFirst(); + frm = fSplitFrame->GetSecond()->GetFirst(); hfrm = new TGHorizontalFrame(frm); button= new TGPictureButton(hfrm, gClient->GetPicture("$ALICE_ROOT/EVE/alice-data/swap.png")); @@ -742,21 +741,21 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : // create (embed) a GL viewer inside fViewer1 = new TGLEmbeddedViewer(hfrm, fPad); hfrm->AddFrame(fViewer1->GetFrame(), new TGLayoutHints(kLHintsExpandX | - kLHintsExpandY)); + kLHintsExpandY)); frm->AddFrame(hfrm, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); // set the camera to orthographic (XOY) for this viewer fViewer1->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); // connect signal we are interested to fViewer1->Connect("MouseOver(TGLPhysicalShape*)", "SplitGLView", this, - "OnMouseOver(TGLPhysicalShape*)"); + "OnMouseOver(TGLPhysicalShape*)"); fViewer1->Connect("Activated()", "SplitGLView", this, - "OnViewerActivated()"); + "OnViewerActivated()"); fViewer1->Connect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)", - "SplitGLView", this, - "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)"); + "SplitGLView", this, + "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)"); fViewer1->Connect("Clicked(TObject*)", "SplitGLView", this, - "OnClicked(TObject*)"); + "OnClicked(TObject*)"); fViewer[1] = new TEveViewer("SplitGLViewer[1]"); fViewer[1]->SetGLViewer(fViewer1); fViewer[1]->IncDenyDestroy(); @@ -775,8 +774,8 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : gEve->AddToListTree(fRPhiMgr, kTRUE); } - // get bottom center split frame - frm = fSplitFrame->GetFirst()->GetSecond()->GetSecond(); + // get bottom right frame + frm = fSplitFrame->GetSecond()->GetSecond(); // create (embed) a GL viewer inside hfrm = new TGHorizontalFrame(frm); button= new TGPictureButton(hfrm, gClient->GetPicture("$ALICE_ROOT/EVE/alice-data/swap.png")); @@ -787,21 +786,21 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : // create (embed) a GL viewer inside fViewer2 = new TGLEmbeddedViewer(hfrm, fPad); hfrm->AddFrame(fViewer2->GetFrame(), new TGLayoutHints(kLHintsExpandX | - kLHintsExpandY)); + kLHintsExpandY)); frm->AddFrame(hfrm, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); // set the camera to orthographic (XOY) for this viewer fViewer2->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); // connect signal we are interested to fViewer2->Connect("MouseOver(TGLPhysicalShape*)", "SplitGLView", this, - "OnMouseOver(TGLPhysicalShape*)"); + "OnMouseOver(TGLPhysicalShape*)"); fViewer2->Connect("Activated()", "SplitGLView", this, - "OnViewerActivated()"); + "OnViewerActivated()"); fViewer2->Connect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)", - "SplitGLView", this, - "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)"); + "SplitGLView", this, + "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)"); fViewer2->Connect("Clicked(TObject*)", "SplitGLView", this, - "OnClicked(TObject*)"); + "OnClicked(TObject*)"); fViewer[2] = new TEveViewer("SplitGLViewer[2]"); fViewer[2]->SetGLViewer(fViewer2); fViewer[2]->IncDenyDestroy(); @@ -814,7 +813,8 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : gRPhiMgr = fRPhiMgr; } - // get bottom right split frame + /* + // Summary view ... incomplete frm = fSplitFrame->GetSecond(); hfrm = new TGHorizontalFrame(frm); @@ -826,10 +826,11 @@ SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) : fgHtml = new TGHtml(hfrm, 100, 100, -1); hfrm->AddFrame(fgHtml, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); frm->AddFrame(hfrm, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); + */ if (fIsEmbedded && gEve) { gEve->GetListTree()->Connect("Clicked(TGListTreeItem*, Int_t, Int_t, Int_t)", - "SplitGLView", this, "ItemClicked(TGListTreeItem*, Int_t, Int_t, Int_t)"); + "SplitGLView", this, "ItemClicked(TGListTreeItem*, Int_t, Int_t, Int_t)"); } fShapedToolTip = new TGShapedToolTip("$ALICE_ROOT/EVE/alice-data/Default.png", 120, 22, 160, 110, @@ -1325,7 +1326,7 @@ void SplitGLView::SwapToMainView() TGFrame *source = dynamic_cast(parent->GetList()->Last())->fFrame; if (!source) return; - TGSplitFrame *dest = fSplitFrame->GetFirst()->GetFirst(); + TGSplitFrame *dest = fSplitFrame->GetFirst(); TGFrame *prev = (TGFrame *)(dest->GetFrame()); @@ -1337,6 +1338,8 @@ void SplitGLView::SwapToMainView() void SplitGLView::UpdateSummary() { // Update summary of current event. + // Currently unused. + return; TEveElement::List_i i; TEveElement::List_i j; diff --git a/EVE/alice-macros/acorde_raw.C b/EVE/alice-macros/acorde_raw.C index 0c13c9a100d..fca1c54ef4f 100644 --- a/EVE/alice-macros/acorde_raw.C +++ b/EVE/alice-macros/acorde_raw.C @@ -12,6 +12,9 @@ TString acorde_module_path(Int_t module); void acorde_raw() { + // AliEveEventManager::AssertGeometry(); + gEve->GetGeometry("geometry.root"); + AliRawReader * reader = AliEveEventManager::AssertRawReader(); AliACORDERawStream * stream = new AliACORDERawStream(reader); @@ -26,8 +29,6 @@ void acorde_raw() printf ("ACORDE event 0x%08x 0x%08x 0x%08x 0x%08x\n", dy[0], dy[1], dy[2], dy[3]); - gGeoManager = gEve->GetGeometry("geometry.root"); - TEveElementList* acorde = new TEveElementList("ACORDE Raw"); gEve->AddElement(acorde); @@ -49,6 +50,7 @@ void acorde_raw() eg_shape->RefMainTrans().SetFrom(* gGeoManager->GetCurrentMatrix()); + // @@NEWROOT@@ Temporary hack. // Hack to set shape pointer, no interface available in TEveGeoShape. * (TGeoShape**) (((char*)eg_shape) + shape_offset) = gGeoManager->GetCurrentVolume()->GetShape(); diff --git a/EVE/alice-macros/geom_acorde.C b/EVE/alice-macros/geom_acorde.C index c04fe6bb130..b6cba157629 100644 --- a/EVE/alice-macros/geom_acorde.C +++ b/EVE/alice-macros/geom_acorde.C @@ -9,11 +9,13 @@ void geom_acorde() { - gGeoManager = gEve->GetGeometry("geometry.root"); + // AliEveEventManager::AssertGeometry(); + gEve->GetGeometry("geometry.root"); TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("ACORDE_1"); if (!node) { - Warning("geom_acorde()", "Node ACORDE_1 not found,"); + Warning("geom_acorde()", "Node ACORDE_1 not found."); + return; } TEveElementList* list = new TEveElementList("ACORDE"); -- 2.43.0