]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
SM checks if other SM processes are running. ED macros improved a bit.
authorjniedzie <jeremi.niedziela@cern.ch>
Thu, 19 Feb 2015 08:48:25 +0000 (09:48 +0100)
committerjniedzie <jeremi.niedziela@cern.ch>
Thu, 19 Feb 2015 08:48:41 +0000 (09:48 +0100)
EVE/EveBase/AliEveEventManager.cxx
EVE/macros/alieve_online_new.C
EVE/macros/visscan_init.C
MONITOR/alistoragemanager/alistorage.cxx

index bb2bab686ccae3312eddd8fce2df904602a56bcb..ce2a692143c9572a99f12703e1c9bd058f2ca87d 100644 (file)
@@ -251,9 +251,10 @@ void AliEveEventManager::GetNextEvent()
     requestMessage->messageType = REQUEST_LIST_EVENTS;
     requestMessage->list = list;
     
+    cout<<"Sending request for marked events list"<<endl;
     eventManager->Send(requestMessage,SERVER_COMMUNICATION_REQ);
+    cout<<"Waiting for response"<<endl;
     vector<serverListStruct> receivedList = eventManager->GetServerListVector(SERVER_COMMUNICATION_REQ,3000);
-    
     cout<<"EVENT DISPLAY -- received list of marked events"<<endl;
     
     for(int i=0;i<receivedList.size();i++)
@@ -262,6 +263,8 @@ void AliEveEventManager::GetNextEvent()
     }
     
     int iter=0;
+
+    cout<<"Starting subscriber's loop"<<endl;
     while(!fFinished)
     {
       cout<<"not finished"<<endl;
index 2894625728c9bfcb6db1a7fd938c0f4c29472a85..73d5891a0170bcc60ae50e667a104c35f07ff384 100644 (file)
@@ -31,8 +31,11 @@ void alieve_online_new()
     alieve_init_import_macros();
     gSystem->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"<<endl;
     
     new AliEveEventManager("online", -1);
     gEve->AddEvent(AliEveEventManager::GetMaster());
@@ -43,6 +46,8 @@ void alieve_online_new()
     TEveBrowser *browser = gEve->GetBrowser();
     browser->ShowCloseTab(kFALSE);
     
+
+    cout<<"Creating multiview"<<endl;
     AliEveMultiView *multiView = new AliEveMultiView(kTRUE);
     TEveUtil::LoadMacro("geom_gentle.C");
     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.
     //============================================================================
index 81f5f4801ec28415d46dbc47547bdb4809a48057..c29c9b9153236deecb481d5f06a9deeed1d48135 100644 (file)
@@ -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);
 }
 
 /******************************************************************************/
index 01e29b158148c4a1099608d571fe5bc62d24f06e..ca9f1ab488cea17812dbec8bd58eab8468f10fbe 100644 (file)
@@ -3,6 +3,9 @@
 
 #include <TThread.h>
 #include <iostream>
+#include <string.h>
+#include <sstream>
+#include <cstdlib>
 
 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..."<<std::endl;
+      return 0;
+    }
+
+
        TThread *clientThread = new TThread("clientThread", ClientThreadHandle,NULL);
        TThread *serverThread = new TThread("serverThread", ServerThreadHandle,NULL);