From 5c7e574da9f46fa25dbbb396cab5669d053fdcbf Mon Sep 17 00:00:00 2001 From: jniedzie Date: Thu, 19 Feb 2015 09:48:25 +0100 Subject: [PATCH] SM checks if other SM processes are running. ED macros improved a bit. --- EVE/EveBase/AliEveEventManager.cxx | 5 ++++- EVE/macros/alieve_online_new.C | 12 +++++++----- EVE/macros/visscan_init.C | 7 +++++-- MONITOR/alistoragemanager/alistorage.cxx | 24 ++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/EVE/EveBase/AliEveEventManager.cxx b/EVE/EveBase/AliEveEventManager.cxx index bb2bab686cc..ce2a692143c 100644 --- a/EVE/EveBase/AliEveEventManager.cxx +++ b/EVE/EveBase/AliEveEventManager.cxx @@ -251,9 +251,10 @@ void AliEveEventManager::GetNextEvent() requestMessage->messageType = REQUEST_LIST_EVENTS; requestMessage->list = list; + cout<<"Sending request for marked events list"<Send(requestMessage,SERVER_COMMUNICATION_REQ); + cout<<"Waiting for response"< receivedList = eventManager->GetServerListVector(SERVER_COMMUNICATION_REQ,3000); - cout<<"EVENT DISPLAY -- received list of marked events"<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++"); TEveUtil::LoadMacro("saveViews.C"); gSystem->cd(hack); + cout<<"Standard macros added"<AddEvent(AliEveEventManager::GetMaster()); @@ -43,6 +46,8 @@ void alieve_online_new() TEveBrowser *browser = gEve->GetBrowser(); browser->ShowCloseTab(kFALSE); + + cout<<"Creating multiview"<InitGeomGentle(geom_gentle(), @@ -50,15 +55,12 @@ void alieve_online_new() geom_gentle_rhoz(), geom_gentle_rhoz()); - gROOT->ProcessLine(".L geom_gentle_trd.C++"); TEveUtil::LoadMacro("geom_gentle_trd.C"); multiView->InitGeomGentleTrd(geom_gentle_trd()); - - gROOT->ProcessLine(".L geom_gentle_muon.C++"); + TEveUtil::LoadMacro("geom_gentle_muon.C"); multiView->InitGeomGentleMuon(geom_gentle_muon(), kFALSE, kFALSE, kTRUE); - - + //============================================================================ // Standard macros to execute -- not all are enabled by default. //============================================================================ diff --git a/EVE/macros/visscan_init.C b/EVE/macros/visscan_init.C index 81f5f4801ec..c29c9b91532 100644 --- a/EVE/macros/visscan_init.C +++ b/EVE/macros/visscan_init.C @@ -230,7 +230,8 @@ void visscan_init(const TString& cdburi = "", //============================================================================== // A refresh to show proper window. - gEve->GetViewers()->SwitchColorSet(); + //gEve->GetViewers()->SwitchColorSet(); + browser->MoveResize(0, 0, gClient->GetDisplayWidth(),gClient->GetDisplayHeight() - 32); gEve->Redraw3D(kTRUE); gSystem->ProcessEvents(); @@ -239,8 +240,10 @@ void visscan_init(const TString& cdburi = "", AliEveEventManager::GetMaster()->GotoEvent(0); gEve->EditElement(g_trkcnt); - gEve->Redraw3D(kTRUE); + + // set autoload by default + AliEveEventManager::GetMaster()->SetAutoLoad(true); } /******************************************************************************/ diff --git a/MONITOR/alistoragemanager/alistorage.cxx b/MONITOR/alistoragemanager/alistorage.cxx index 01e29b15814..ca9f1ab488c 100644 --- a/MONITOR/alistoragemanager/alistorage.cxx +++ b/MONITOR/alistoragemanager/alistorage.cxx @@ -3,6 +3,9 @@ #include #include +#include +#include +#include using namespace std; @@ -22,8 +25,29 @@ void *ServerThreadHandle(void*) return 0; } +bool isStorageRunning() +{ + // check if there is events server already running + const char *pid = gSystem->GetFromPipe("pidof alistorage").Data(); + int pidSize = gSystem->GetFromPipe("pidof alistorage").Sizeof(); + std::string pidOfAll(pid,pidSize); + std::stringstream pidStream(pidOfAll); + int word_count=0; + std::string word; + while( pidStream >> word ) ++word_count; + if(word_count != 1){return true;} + return false; +} + int main() { + if(isStorageRunning()) + { + std::cout<<"There is other Storage Manager running on this machine.\n Cannot start multiple managers on the same machine. Quitting..."<