Merging STORAGE-dev to master
authorhristov <Peter.Hristov@cern.ch>
Tue, 12 Aug 2014 13:23:18 +0000 (15:23 +0200)
committerhristov <Peter.Hristov@cern.ch>
Tue, 12 Aug 2014 13:23:35 +0000 (15:23 +0200)
95 files changed:
.gitignore
CMakeLists.txt
EVE/CMakebinalieve.pkg
EVE/CMakelibEveBase.pkg
EVE/EveBase/AliEveConfigManager.cxx
EVE/EveBase/AliEveConfigManager.h
EVE/EveBase/AliEveEventManager.cxx
EVE/EveBase/AliEveEventManager.h
EVE/EveBase/AliEveEventManagerEditor.cxx
EVE/EveBase/AliEveEventManagerEditor.h
EVE/EveBase/AliEveMainWindow.cxx
EVE/EveBase/AliEveTrackCounter.cxx
EVE/EveBase/EveBaseLinkDef.h
EVE/alieve_main/alieve_main.cxx
EVE/macros/alieve_online.C
EVE/macros/alieve_online_new.C
EVE/macros/online.C [new file with mode: 0644]
MONITOR/AliEventServerUtil.cxx [deleted file]
MONITOR/AliEventServerWindow.h [deleted file]
MONITOR/AliNetMessage.cxx [deleted file]
MONITOR/AliNetMessage.h [deleted file]
MONITOR/AliRecoServer.cxx [deleted file]
MONITOR/AliRecoServer.h [deleted file]
MONITOR/AliRecoServerThread.cxx [deleted file]
MONITOR/AliRecoServerThread.h [deleted file]
MONITOR/AliSocket.cxx [deleted file]
MONITOR/AliSocket.h [deleted file]
MONITOR/AliThreadedSocket.cxx [deleted file]
MONITOR/AliThreadedSocket.h [deleted file]
MONITOR/CMakeLists.txt
MONITOR/CMakelibMONITOR.pkg
MONITOR/CMakelibMONITORzmq.pkg
MONITOR/MONITORLinkDef.h
MONITOR/MONITORzmqLinkDef.h
MONITOR/alieventserver/AliEventServerPreferencesWindow.cxx [moved from MONITOR/AliEventServerPreferencesWindow.cxx with 100% similarity]
MONITOR/alieventserver/AliEventServerPreferencesWindow.h [moved from MONITOR/AliEventServerPreferencesWindow.h with 100% similarity]
MONITOR/alieventserver/AliEventServerReconstruction.cxx [new file with mode: 0644]
MONITOR/alieventserver/AliEventServerReconstruction.h [new file with mode: 0644]
MONITOR/alieventserver/AliEventServerUtil.h [moved from MONITOR/AliEventServerUtil.h with 81% similarity]
MONITOR/alieventserver/AliEventServerWindow.cxx [moved from MONITOR/AliEventServerWindow.cxx with 57% similarity]
MONITOR/alieventserver/AliEventServerWindow.h [new file with mode: 0644]
MONITOR/alieventserver/CMakebinalieventserver.pkg [moved from MONITOR/CMakebinalieventserver.pkg with 95% similarity]
MONITOR/alieventserver/alieventserver.cxx [moved from MONITOR/alieventserver.cxx with 95% similarity]
MONITOR/alieventserver/alieventserver.rootrc [moved from MONITOR/alieventserver.rootrc with 96% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanel.cxx [moved from STORAGE/AliStorageAdministratorPanel.cxx with 82% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanel.h [moved from STORAGE/AliStorageAdministratorPanel.h with 85% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanelListEvents.cxx [moved from STORAGE/AliStorageAdministratorPanelListEvents.cxx with 86% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanelListEvents.h [moved from STORAGE/AliStorageAdministratorPanelListEvents.h with 87% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanelMarkEvent.cxx [moved from STORAGE/AliStorageAdministratorPanelMarkEvent.cxx with 87% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanelMarkEvent.h [moved from STORAGE/AliStorageAdministratorPanelMarkEvent.h with 91% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanelSetStorageParams.cxx [moved from STORAGE/AliStorageAdministratorPanelSetStorageParams.cxx with 92% similarity]
MONITOR/alistoragemanager/AliStorageAdministratorPanelSetStorageParams.h [moved from STORAGE/AliStorageAdministratorPanelSetStorageParams.h with 92% similarity]
MONITOR/alistoragemanager/AliStorageClientThread.cxx [moved from STORAGE/AliStorageClientThread.cxx with 75% similarity]
MONITOR/alistoragemanager/AliStorageClientThread.h [moved from STORAGE/AliStorageClientThread.h with 85% similarity]
MONITOR/alistoragemanager/AliStorageDatabase.cxx [moved from STORAGE/AliStorageDatabase.cxx with 76% similarity]
MONITOR/alistoragemanager/AliStorageDatabase.h [moved from STORAGE/AliStorageDatabase.h with 98% similarity]
MONITOR/alistoragemanager/AliStorageEventManager.cxx [new file with mode: 0644]
MONITOR/alistoragemanager/AliStorageEventManager.h [new file with mode: 0644]
MONITOR/alistoragemanager/AliStorageServerThread.cxx [moved from STORAGE/AliStorageServerThread.cxx with 70% similarity]
MONITOR/alistoragemanager/AliStorageServerThread.h [moved from STORAGE/AliStorageServerThread.h with 68% similarity]
MONITOR/alistoragemanager/AliStorageTypes.h [moved from STORAGE/AliStorageTypes.h with 71% similarity]
MONITOR/alistoragemanager/CMakebinalifakedisplay.pkg [new file with mode: 0644]
MONITOR/alistoragemanager/CMakebinalistorage.pkg [new file with mode: 0644]
MONITOR/alistoragemanager/CMakebinalistorageadmin.pkg [new file with mode: 0644]
MONITOR/alistoragemanager/CMakebinalistoragegetpoints.pkg [new file with mode: 0644]
MONITOR/alistoragemanager/CMakebinalistorageminimalexample.pkg [new file with mode: 0644]
MONITOR/alistoragemanager/StorageLinkDef.h [moved from STORAGE/StorageLinkDef.h with 100% similarity, mode: 0644]
MONITOR/alistoragemanager/alifakedisplay.cxx [new file with mode: 0644]
MONITOR/alistoragemanager/alistorage.cxx [moved from STORAGE/alistorage_main/alistorage_main.cxx with 93% similarity]
MONITOR/alistoragemanager/alistorageadmin.cxx [moved from STORAGE/alistorageadmin_main/alistorageadmin_main.cxx with 100% similarity]
MONITOR/alistoragemanager/alistoragegetpoints.cxx [new file with mode: 0644]
MONITOR/alistoragemanager/alistorageminimalexample.cxx [new file with mode: 0644]
MONITOR/alistoragemanager/clearAll.sh [moved from STORAGE/clearAll.sh with 77% similarity, mode: 0644]
MONITOR/alistoragemanager/setupStorageDatabase.sh [moved from STORAGE/setupStorageDatabase.sh with 71% similarity, mode: 0644]
MONITOR/alitestproc/AliTestChildProc.cxx [moved from MONITOR/AliTestChildProc.cxx with 100% similarity]
MONITOR/alitestproc/AliTestChildProc.h [moved from MONITOR/AliTestChildProc.h with 100% similarity]
MONITOR/alitestproc/CMakebinalitestproc.pkg [moved from MONITOR/CMakebinalitestproc.pkg with 97% similarity]
MONITOR/alitestproc/alitestproc.cxx [moved from MONITOR/alitestproc.cxx with 100% similarity]
MONITOR/deroot/CMakebinderoot.pkg [moved from MONITOR/CMakebinderoot.pkg with 95% similarity]
MONITOR/deroot/deroot.cxx [moved from MONITOR/deroot.cxx with 100% similarity]
MONITOR/deroot/deroot.h [moved from MONITOR/deroot.h with 100% similarity]
MONITOR/deroot/root2date.cxx [moved from MONITOR/root2date.cxx with 100% similarity]
MONITOR/deroot/root2date.h [moved from MONITOR/root2date.h with 100% similarity]
MONITOR/monitorCheck/CMakebinmonitorCheck.pkg [moved from MONITOR/CMakebinmonitorCheck.pkg with 89% similarity]
MONITOR/monitorCheck/monitorCheck.cxx [moved from MONITOR/monitorCheck.cxx with 100% similarity]
MONITOR/monitorGDC/CMakebinmonitorGDC.pkg [moved from MONITOR/CMakebinmonitorGDC.pkg with 88% similarity]
MONITOR/monitorGDC/monitorGDC.cxx [moved from MONITOR/monitorGDC.cxx with 100% similarity]
STORAGE/AliStorageEventManager.cxx [deleted file]
STORAGE/AliStorageEventManager.h [deleted file]
STORAGE/CMakeLists.txt [deleted file]
STORAGE/CMakebinalifakedisplay.pkg [deleted file]
STORAGE/CMakebinalistorage.pkg [deleted file]
STORAGE/CMakebinalistorageadmin.pkg [deleted file]
STORAGE/CMakelibStorage.pkg [deleted file]
STORAGE/alifakedisplay.cxx [deleted file]

index f8af51a..3b7ccf0 100644 (file)
@@ -1,3 +1,8 @@
+
+AliRootProject/
+*.DS_Store
+*.xworkspace
+
 # Compiled Object files
 *.slo
 *.lo
@@ -36,6 +41,8 @@ G__*.h
 # Backup files from common editors
 *.swp
 *~
+.[#]*
+[#]*[#]
 
 # /
 /bin
index 13c5d7d..f24b4c3 100644 (file)
@@ -141,7 +141,7 @@ set(BINLIBDIRS "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
 
 # Standard Modules
 # ------------------------------
-set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS AD ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR STORAGE ANALYSIS JETAN HLT STAT TTherminator CORRFW DPMJET TDPMjet STARLIGHT PWGPP PWG PWGCF PWGGA PWGHF PWGDQ PWGJE PWGLF PWGUD TRIGGER PYTHIA8 TAmpt OADB MFT TEvtGen FIT)
+set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS AD ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT STAT TTherminator CORRFW DPMJET TDPMjet STARLIGHT PWGPP PWG PWGCF PWGGA PWGHF PWGDQ PWGJE PWGLF PWGUD TRIGGER PYTHIA8 TAmpt OADB MFT TEvtGen FIT)
 
 if(THydjet)
   list(APPEND ALIROOTMODULES THydjet)
index dcfc9ac..a6ca8f4 100644 (file)
@@ -32,13 +32,15 @@ set ( CSRCS )
 set ( EINCLUDE )
 set ( ELIBSDIR )
 
-set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
+set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB MONITOR)
 
 if(PYTHIA6)
   list (APPEND ELIBS EVGEN HepMC HepMCParser)
 endif(PYTHIA6)
 
-set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve ${SYSLIBS} )
+set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+
+set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lMONITOR ${SYSLIBS} )
 
 if( ALICE_TARGET STREQUAL "macosx")
                        
@@ -61,6 +63,13 @@ if( ALICE_TARGET STREQUAL "macosx")
        
 endif( ALICE_TARGET STREQUAL "macosx")
 
+set ( ELIBS ${ELIBS} EveBase MONITOR )
+
+if(ZEROMQ_FOUND)
+set ( ELIBS ${ELIBS} MONITORzmq )
+set ( CXXFLAGS  "-DZMQ ${CXXFLAGS}") 
+ENDIF(ZEROMQ_FOUND)
+
 install (DIRECTORY macros 
         DESTINATION EVE/ 
         PATTERN ".svn" EXCLUDE 
index 8314fad..660b495 100644 (file)
@@ -78,12 +78,7 @@ string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
 set ( DHDR  EveBase/EveBaseLinkDef.h)
 
-set ( EINCLUDE  RAW ITS TPC TPC/Base TPC/Sim EVE/EveBase STEER/STEER STEER/AOD STEER/CDB STEER/ESD STEER/STEERBase)
-
-if(ZEROMQ_FOUND)
-       set ( ELIBS ${ELIBS} MONITOR MONITORzmq ${ZEROMQ_LIBRARY} )
-       set ( CXXFLAGS  "-DZMQ ${CXXFLAGS}") 
-endif(ZEROMQ_FOUND)
+set ( EINCLUDE  RAW ITS TPC TPC/Base TPC/Sim EVE/EveBase STEER/STEER STEER/AOD STEER/CDB STEER/ESD STEER/STEERBase MONITOR MONITOR/alistoragemanager)
 
 set ( EXPORT 
   EveBase/AliEveUtil.h
index 332b7ca..23232d7 100644 (file)
 #include "AliEveMacroExecutorWindow.h"
 #include "AliEveMacro.h"
 
+//Storage Manager:
+#include "AliStorageAdministratorPanelListEvents.h"
+#include "AliStorageAdministratorPanelMarkEvent.h"
+
 class AliEveMacroExecutor;
 class TEveProjectionManager;
 class TEveGeoShape;
@@ -42,7 +46,7 @@ namespace
 {
  enum EAliEveMenu_e
  {
-   kAEMDefault, kAEMScreen, kAEMProjector, kAEMNotransparency, kAEMTransparentDark, kAEMTransparentLight, kAEMTransparentMonoDark, kAEMTransparentMonoLight, kAEMGreen, kAEMBright, kAEMYellow, kAEMTpc, kAEMAll, kAEM3d, kAEMRphi, kAEMRhoz, kAEMAllhr, kAEM3dhr, kAEMRphihr, kAEMRhozhr, kAEMSavemacros, kAEMLoadmacros, kAEMSave, kAEMOpen, kAEMSetDefault, kAEMResiduals,  kAEMCuts, kAEMVectors, kAEMGui
+        kAEMDefault, kAEMScreen, kAEMProjector, kAEMNotransparency, kAEMTransparentDark, kAEMTransparentLight, kAEMTransparentMonoDark, kAEMTransparentMonoLight, kAEMGreen, kAEMBright, kAEMYellow, kAEMTpc, kAEMAll, kAEM3d, kAEMRphi, kAEMRhoz, kAEMAllhr, kAEM3dhr, kAEMRphihr, kAEMRhozhr, kAEMSavemacros, kAEMLoadmacros, kAEMSave, kAEMOpen, kAEMSetDefault, kAEMResiduals,  kAEMCuts, kAEMVectors, kAEMGui, kStorageListEvents, kStorageMarkEvent
  };
 }
  
@@ -179,6 +183,14 @@ AliEveConfigManager::AliEveConfigManager() :
   fAnalysisPopup->Connect("Activated(Int_t)", "AliEveConfigManager",
                         this, "AliEvePopupHandler(Int_t)");
 
+  //Storage Manager:
+  fStoragePopup = new TGPopupMenu(gClient->GetRoot());
+  fStoragePopup->AddEntry("&List events",kStorageListEvents);
+  fStoragePopup->AddEntry("&Mark event",kStorageMarkEvent);
+
+  fStoragePopup->Connect("Activated(Int_t)","AliEveConfigManager",
+                        this, "AliEvePopupHandler(Int_t)");
+  
   fLoadCheck = kFALSE;
 
 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4)
@@ -186,6 +198,9 @@ AliEveConfigManager::AliEveConfigManager() :
   mBar->AddPopup("&AliEve", fAliEvePopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
   ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout();
   mBar->AddPopup("&Tools", fAnalysisPopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
+    ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout();
+   mBar->AddPopup("&Storage Manager",fStoragePopup,new TGLayoutHints(kLHintsTop | kLHintsLeft,0,4,0,0));
+  
   gEve->GetBrowser()->GetTopMenuFrame()->Layout();
 #else
   // Uber hack as TRootBrowser does not provede manu-bar getter.
@@ -201,6 +216,8 @@ AliEveConfigManager::AliEveConfigManager() :
   ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout();
   mBar->AddPopup("&Tools", fAnalysisPopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
   ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout();
+  mBar->AddPopup("&Storage Manager",fStoragePopup,new TGLayoutHints(kLHintsTop | kLHintsLeft,0,4,0,0));
+    ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout();
 #endif
 }
 
@@ -1014,6 +1031,24 @@ void AliEveConfigManager::AliEvePopupHandler(Int_t id)
 
     }
 */
+  case kStorageListEvents:
+  {
+      fListEventsWindow =
+                 AliStorageAdministratorPanelListEvents::GetInstance();
+      
+      fListEventsWindow->Connect("SelectedEvent()","AliEveConfigManager",this,"SetEventInEventManager()");
+      
+      
+         break;
+
+  }
+   case kStorageMarkEvent:
+  {
+         AliStorageAdministratorPanelMarkEvent *markEventWindow =
+                 AliStorageAdministratorPanelMarkEvent::GetInstance();
+         break;
+
+  }
 
     default:
     {
@@ -1022,3 +1057,20 @@ void AliEveConfigManager::AliEvePopupHandler(Int_t id)
     }
   }
 }
+
+void AliEveConfigManager::SetEventInEventManager()
+{
+    AliEveEventManager *manager = AliEveEventManager::GetMaster();
+    AliESDEvent *event = fListEventsWindow->GetSelectedEvent();
+    
+    if(event)
+    {
+           cout<<"SETTING EVENT IN ED"<<endl;
+           //fListEventsWindow->onExit();
+        manager->SetAutoLoad(kFALSE);
+        manager->PrepareForNewEvent(event);
+    }
+    
+}
+
+
index 81e73a2..664c278 100644 (file)
@@ -11,6 +11,7 @@
 #define AliEveConfigManager_H
 
 #include "TObject.h"
+#include "AliStorageAdministratorPanelListEvents.h"
 
 class TGPopupMenu;
 
@@ -21,39 +22,40 @@ class TGPopupMenu;
 class AliEveConfigManager : public TObject
 {
 public:
-  static AliEveConfigManager* InitializeMaster();
-  static AliEveConfigManager* GetMaster();
-
-  virtual ~AliEveConfigManager() {}
-
-  void AliEvePopupHandler(Int_t id);
-
+    static AliEveConfigManager* InitializeMaster();
+    static AliEveConfigManager* GetMaster();
+    
+    virtual ~AliEveConfigManager() {}
+    
+    void AliEvePopupHandler(Int_t id);
+    void SetEventInEventManager();
+    
 protected:
-  static AliEveConfigManager* fgMaster;  // Main instance.
-
-  TGPopupMenu      *fAnalysisPopup; // AliEve menu with analysis tools.
-
-  TGPopupMenu      *fAliEvePopup; // AliEve menu.
-
-  TGPopupMenu      *fAliEveGeometries; // AliEve submenu - geometries.
-
-  TGPopupMenu      *fAliEvePictures; // AliEve submenu - saving pictures.
-
-  TGPopupMenu      *fAliEvePicturesHR; // AliEve submenu - saving pictures in high resolution.
-
-  TGPopupMenu      *fAliEveDataSelection; // AliEve submenu - Saving/Opening DataSelection macros.
-
-  TGPopupMenu      *fAliEveVizDBs; // AliEve submenu - Saving/Opening VizDB macros.
-
-  Bool_t           fLoadCheck; //for Data Selection Save/Load
-
+    static AliEveConfigManager* fgMaster;  // Main instance.
+    
+    TGPopupMenu      *fAnalysisPopup; // AliEve menu with analysis tools.
+    TGPopupMenu      *fAliEvePopup; // AliEve menu.
+    TGPopupMenu      *fAliEveGeometries; // AliEve submenu - geometries.
+    TGPopupMenu      *fAliEvePictures; // AliEve submenu - saving pictures.
+    TGPopupMenu      *fAliEvePicturesHR; // AliEve submenu - saving pictures in high resolution.
+    TGPopupMenu      *fAliEveDataSelection; // AliEve submenu - Saving/Opening DataSelection macros.
+    TGPopupMenu      *fAliEveVizDBs; // AliEve submenu - Saving/Opening VizDB macros.
+    
+    Bool_t           fLoadCheck; //for Data Selection Save/Load
+    
+    // Storage Manager:
+    TGPopupMenu *fStoragePopup;
+    
 private:
-  AliEveConfigManager();
-
-  AliEveConfigManager(const AliEveConfigManager&);            // Not implemented
-  AliEveConfigManager& operator=(const AliEveConfigManager&); // Not implemented
-
-  ClassDef(AliEveConfigManager, 0); // Short description.
+    AliEveConfigManager();
+    
+    AliStorageAdministratorPanelListEvents *fListEventsWindow;
+
+    
+    AliEveConfigManager(const AliEveConfigManager&);            // Not implemented
+    AliEveConfigManager& operator=(const AliEveConfigManager&); // Not implemented
+    
+    ClassDef(AliEveConfigManager, 0); // Short description.
 };
 
 #endif
index 2409073..3c86ce8 100644 (file)
@@ -59,8 +59,7 @@
 #include <TMap.h>
 
 #ifdef ZMQ
-#include <AliNetMessage.h>
-#include <AliSocket.h>
+#include "AliStorageEventManager.h"
 #endif
 
 //==============================================================================
@@ -120,24 +119,48 @@ Bool_t   AliEveEventManager::fgUniformField = kFALSE;
 AliEveEventManager* AliEveEventManager::fgMaster  = 0;
 AliEveEventManager* AliEveEventManager::fgCurrent = 0;
 
-zmq::context_t* AliEveEventManager::fgSubContext=0;
-AliSocket* AliEveEventManager::fgSubSock=0;
-
-bool AliEveEventManager::ConnectToServer(const char* host, int port)
+void AliEveEventManager::GetNextEvent()
 {
-
 #ifdef ZMQ
-       // make a zeromq socket
-         fgSubContext = new zmq::context_t(1);
-    fgSubSock = new AliSocket(&*fgSubContext, ZMQ_SUB);
-    fgSubSock->Subscribe("");
-    fgSubSock->Connect(Form("%s:%d", host, port) );
-#else
-       fgSubContext=0;
-       fgSubSock =0;
+  AliStorageEventManager *eventManager =
+    AliStorageEventManager::GetEventManagerInstance();
+  eventManager->CreateSocket(EVENTS_SERVER_SUB);
+
+  fCurrentEvent[0]=0;
+  fCurrentEvent[1]=0;
+  fCurrentTree[0]=0;
+  fCurrentTree[1]=0;
+  AliESDEvent *tmpEvent = NULL;
+  TTree *tmpTree = NULL;
+  
+  while(1)
+  {
+    //if(tmpEvent){delete tmpEvent;tmpEvent=0;}
+    tmpEvent = eventManager->GetEvent(EVENTS_SERVER_SUB,-1,&tmpTree);
+
+    if(tmpEvent)
+    {
+      if(tmpEvent->GetRunNumber()>=0)
+      {
+        fMutex.Lock();
+        if(fEventInUse == 0){fWritingToEventIndex = 1;}
+        else if(fEventInUse == 1){fWritingToEventIndex = 0;}
+        cout<<"Writing to:"<<fWritingToEventIndex<<endl;
+        if(fCurrentEvent[fWritingToEventIndex])
+        {
+          cout<<"DELETING:"<<fCurrentEvent[fWritingToEventIndex]<<endl;
+          delete fCurrentEvent[fWritingToEventIndex];
+          fCurrentEvent[fWritingToEventIndex]=0;
+          delete fCurrentTree[fWritingToEventIndex];
+        }
+        fCurrentEvent[fWritingToEventIndex] = tmpEvent;
+        fCurrentTree[fWritingToEventIndex] = tmpTree;
+        fIsNewEventAvaliable = true;
+        fMutex.UnLock();
+      }
+    }  
+  }
 #endif
-       
-  return true;
 }
 
 void AliEveEventManager::InitInternals()
@@ -179,7 +202,6 @@ void AliEveEventManager::InitInternals()
 
 AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) :
     TEveEventManager(name, ""),
-
     fEventId(-1),
     fRunLoader (0),
     fESDFile   (0), fESDTree (0), fHLTESDTree(0), fESD (0),
@@ -192,10 +214,14 @@ AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) :
     fExecutor    (0), fTransients(0), fTransientLists(0),
     fPEventSelector(0),
     fSubManagers (0),
-    fAutoLoadTimerRunning(kFALSE)
+    fAutoLoadTimerRunning(kFALSE),
+    fgSubSock(EVENTS_SERVER_SUB),
+    fEventInUse(1),
+    fWritingToEventIndex(0),
+    fIsNewEventAvaliable(false)
 {
     // Constructor with event-id.
-
+               
     InitInternals();
 
     Open();
@@ -203,6 +229,14 @@ AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) :
     {
         GotoEvent(ev);
     }
+    
+#ifdef ZMQ
+    cout<<"ZMQ FOUND. Starting subscriber thread."<<endl;
+    fGetEventThread = new TThread("fGetEventThread",Dispatch,(void*)this);
+    fGetEventThread->Run();
+#else
+    cout<<"NO ZMQ FOUND. Online events not avaliable."<<endl;
+#endif
 }
 
 AliEveEventManager::~AliEveEventManager()
@@ -288,7 +322,6 @@ void AliEveEventManager::SetRawFileName(const TString& raw)
 void AliEveEventManager::SetCdbUri(const TString& cdb)
 {
     // Set path to CDB, there is no default.
-
     if ( ! cdb.IsNull()) fgCdbUri = cdb;
 }
 
@@ -591,8 +624,10 @@ void AliEveEventManager::Open()
     }
 
     // Initialize OCDB ... only in master event-manager
+
                InitOCDB(runNo);
 
+
     fIsOpen = kTRUE;
 }
 
@@ -624,7 +659,7 @@ void AliEveEventManager::InitOCDB(int runNo)
                 cdb->SetDefaultStorage("MC", "Full");
             else if (fgCdbUri == "local://") {
                 fgCdbUri = Form("local://%s/OCDB", gSystem->Getenv("ALICE_ROOT"));
-                cdb->SetDefaultStorage(fgCdbUri);
+               cdb->SetDefaultStorage(fgCdbUri);
             } else
                 cdb->SetDefaultStorage(fgCdbUri);
 
@@ -938,6 +973,16 @@ void AliEveEventManager::Timeout()
     Emit("Timeout()");
 }
 
+void AliEveEventManager::PrepareForNewEvent(AliESDEvent *event)
+{      
+       DestroyElements();
+               
+       InitOCDB(event->GetRunNumber());
+                       
+       printf("======================= setting event to %d\n", fEventId);
+       SetEvent(0,0,event,0);
+}
+
 void AliEveEventManager::NextEvent()
 {
     // Loads next event.
@@ -952,65 +997,52 @@ void AliEveEventManager::NextEvent()
 
     if (fExternalCtrl)
     {
-        // !!! This should really go somewhere else. It is done in GotoEvent(),
-        // so here we should do it in SetEvent().
-          DestroyElements();
-        
-                       #ifdef ZMQ
-                       AliNetMessage *mess;
-                       fgSubSock->Recv(mess);
-        
-        
-                                   AliESDEvent* data = (AliESDEvent*)(mess->ReadObjectAny(AliESDEvent::Class()));
+#ifdef ZMQ
 
-               if (data){
-                   printf("Got DATA:\n");
+      cout<<fIsNewEventAvaliable<<"\t"<<"\t"<<fWritingToEventIndex<<endl;
 
-                   printf("Event Number in File:%d Run:%d ObjectsInList:%d\n", data->GetEventNumberInFile(),  data->GetRunNumber(), data->GetList()->GetEntries());
-                       
-                       TTree* tree= new TTree("esdTree", "esdTree");
-                   data->WriteToTree(tree);
-                   tree-> Fill();
-                   //tree->Write();
-                       
-                       printf("======================= Tree has %d entries\n", tree->GetEntries());
-                       
-                       AliESDEvent* event= new AliESDEvent();
-                                                               event->ReadFromTree(tree);
-                                                       
-                                               tree->GetEntry(0);
-                       
-                       InitOCDB(event->GetRunNumber());
-                       
-                       printf("======================= setting event to %d\n", fEventId);
-                       SetEvent(0,0,event,0);
-                   
-                           delete event;
-                       delete tree;
-                       
-               }
-               else
-                  printf("NO DATA!!!\n");
-                                    
-               delete data; data=0;
-               delete mess; mess=0;
-               #endif
-               
+      if(fIsNewEventAvaliable)
+      {
+        cout<<"new event"<<endl;
+        fMutex.Lock();
+        if(fWritingToEventIndex == 0) fEventInUse = 0;
+        else if(fWritingToEventIndex == 1) fEventInUse = 1;
+        cout<<"Using:"<<fEventInUse<<endl;
+
+        if(fCurrentEvent[fEventInUse])
+        {
+          if(fCurrentEvent[fEventInUse]->GetRunNumber() >= 0)
+          {
+            printf("======================= setting event to %d\n", fEventId);
+
+            DestroyElements();
+            InitOCDB(fCurrentEvent[fEventInUse]->GetRunNumber());
+            SetEvent(0,0,fCurrentEvent[fEventInUse],0);
+          }
+        }
+        fIsNewEventAvaliable = false;
+        fMutex.UnLock();
+      }
+      else{cout<<"No new event is avaliable."<<endl;}
+
+#endif 
     }
     else if ((fESDTree!=0) || (fHLTESDTree!=0))
     {
-        Int_t nextevent=0;
-        if (fPEventSelector->FindNext(nextevent))
-        {
-            GotoEvent(nextevent);
-        }
+      Int_t nextevent=0;
+      if (fPEventSelector->FindNext(nextevent))
+      {
+        GotoEvent(nextevent);
+      }
     }
     else if (fEventId < GetMaxEventId(kTRUE))
     {
-        GotoEvent(fEventId + 1);
+      GotoEvent(fEventId + 1);
     }
     
-     gSystem->ProcessEvents();
+    gSystem->ProcessEvents();
+
+    //if(fGetEventThread){delete fGetEventThread;fGetEventThread=0;}
 }
 
 void AliEveEventManager::PrevEvent()
@@ -1042,6 +1074,57 @@ void AliEveEventManager::PrevEvent()
     }
 }
 
+void AliEveEventManager::MarkCurrentEvent()
+{
+#ifdef ZMQ
+       struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
+       struct eventStruct mark;
+       mark.runNumber = fESD->GetRunNumber();
+       mark.eventNumber = fESD->GetEventNumberInFile();
+       requestMessage->messageType = REQUEST_MARK_EVENT;
+       requestMessage->event = mark;
+
+       AliStorageEventManager *eventManager =
+               AliStorageEventManager::GetEventManagerInstance();
+       eventManager->CreateSocket(SERVER_COMMUNICATION_REQ);
+
+       /*
+       std::future<bool> unused = std::async([]()
+       {
+               eventManager->Send(requestMessage,SERVER_COMMUNICATION_REQ);
+               bool response =  eventManager->GetBool(SERVER_COMMUNICATION_REQ);
+
+               if(response)
+               {
+               //fStatusLabel->SetText("Event marked");
+               cout<<"ADMIN PANEL -- Event marked succesfully"<<endl;
+               }
+               else
+               {
+               //fStatusLabel->SetText("Couldn't mark this event");
+               cout<<"ADMIN PANEL -- Could not matk event"<<endl;
+               }
+       });
+       */
+       
+       eventManager->Send(requestMessage,SERVER_COMMUNICATION_REQ);
+       bool response =  eventManager->GetBool(SERVER_COMMUNICATION_REQ);
+       
+       
+       if(response)
+       {
+               //fStatusLabel->SetText("Event marked");
+               cout<<"ADMIN PANEL -- Event marked succesfully"<<endl;
+       }
+       else
+       {
+               //fStatusLabel->SetText("Couldn't mark this event");
+               cout<<"ADMIN PANEL -- Could not matk event"<<endl;
+       }
+       if(requestMessage){delete requestMessage;}
+#endif
+}
+
 void AliEveEventManager::Close()
 {
     // Close the event data-files and delete ESD, ESDfriend, run-loader
@@ -1295,11 +1378,6 @@ AliRecoParam* AliEveEventManager::AssertRecoParams()
     return fgRecoParam;
 }
 
-AliSocket* AliEveEventManager::AssertSubscriber()
-{
-       return fgSubSock;
-}
-
 Bool_t AliEveEventManager::InitRecoParam()
 {
     // This is mostly a reap-off from reconstruction
@@ -1597,23 +1675,23 @@ void AliEveEventManager::StopAutoLoadTimer()
 
 void AliEveEventManager::AutoLoadNextEvent()
 {
-    // Called from auto-load timer, so it has to be public.
-    // Do NOT call it directly.
+       // Called from auto-load timer, so it has to be public.
+       // Do NOT call it directly.
 
-         static const TEveException kEH("AliEveEventManager::AutoLoadNextEvent ");
+       static const TEveException kEH("AliEveEventManager::AutoLoadNextEvent ");
          
-               Info(kEH, "called!");
-
-    if ( ! fAutoLoadTimerRunning || ! fAutoLoadTimer->HasTimedOut())
-    {
-        Warning(kEH, "Called unexpectedly - ignoring the call. Should ONLY be called from an internal timer.");
-        return;
-    }
-
-    StopAutoLoadTimer();
-    NextEvent();
-    if (fAutoLoad)
-        StartAutoLoadTimer();
+       Info(kEH, "called!");
+
+       if ( ! fAutoLoadTimerRunning || ! fAutoLoadTimer->HasTimedOut())
+       {
+               Warning(kEH, "Called unexpectedly - ignoring the call. Should ONLY be called from an internal timer.");
+               return;
+       }
+
+       StopAutoLoadTimer();
+       NextEvent();
+       if (fAutoLoad)
+               StartAutoLoadTimer();
 }
 
 //------------------------------------------------------------------------------
@@ -1622,47 +1700,43 @@ void AliEveEventManager::AutoLoadNextEvent()
 
 void AliEveEventManager::AfterNewEventLoaded()
 {
-    // Execute registered macros and commands.
-    // At the end emit NewEventLoaded signal.
-    //
-    // Virtual from TEveEventManager.
+  // Execute registered macros and commands.
+  // At the end emit NewEventLoaded signal.
+  //
+  // Virtual from TEveEventManager.
 
-    static const TEveException kEH("AliEveEventManager::AfterNewEventLoaded ");
+  static const TEveException kEH("AliEveEventManager::AfterNewEventLoaded ");
 
   Info(kEH, "------------------!!!------------");
                       
-    NewEventDataLoaded();
-
-    if (fExecutor)
-        fExecutor->ExecMacros();
-
-    TEveEventManager::AfterNewEventLoaded();
-
-    NewEventLoaded();
-
-    if (this == fgMaster && fSubManagers != 0)
-    {
-        TIter next(fSubManagers);
-        while ((fgCurrent = dynamic_cast<AliEveEventManager*>(next())) != 0)
-        {
-            gEve->SetCurrentEvent(fgCurrent);
-            try
-            {
-                fgCurrent->GotoEvent(fEventId);
-            }
-            catch (TEveException& exc)
-            {
-                // !!! Should somehow tag / disable / remove it?
-                Error(kEH, "Getting event %d for sub-event-manager '%s' failed: '%s'.",
-                      fEventId, fgCurrent->GetName(), exc.Data());
-            }
-              Info(kEH, "------------------!!! while() gEve->SetCurrentEvent() ------------");
-        }
-        fgCurrent = fgMaster;
-        Info(kEH, "------------------!!! while() gEve->SetCurrentEvent(MASTER) ------------");
-        gEve->SetCurrentEvent(fgMaster);
+  NewEventDataLoaded();
+  if (fExecutor) fExecutor->ExecMacros();
+
+  TEveEventManager::AfterNewEventLoaded();
+  NewEventLoaded();
+
+  if (this == fgMaster && fSubManagers != 0)
+  {
+    TIter next(fSubManagers);
+    while ((fgCurrent = dynamic_cast<AliEveEventManager*>(next())) != 0)
+    {
+      gEve->SetCurrentEvent(fgCurrent);
+      try
+      {
+        fgCurrent->GotoEvent(fEventId);
+      }
+      catch (TEveException& exc)
+      {
+        // !!! Should somehow tag / disable / remove it?
+        Error(kEH, "Getting event %d for sub-event-manager '%s' failed: '%s'.",
+              fEventId, fgCurrent->GetName(), exc.Data());
+      }
+      Info(kEH, "------------------!!! while() gEve->SetCurrentEvent() ------------");
     }
-    
+    fgCurrent = fgMaster;
+    Info(kEH, "------------------!!! while() gEve->SetCurrentEvent(MASTER) ------------");
+    gEve->SetCurrentEvent(fgMaster);
+  }
 }
 
 void AliEveEventManager::NewEventDataLoaded()
index bfcf572..8d17a72 100644 (file)
 #include <TEveEventManager.h>
 #include <TQObject.h>
 #include <TObjArray.h>
+#include <TThread.h>
 
 #include <AliEventInfo.h>
-
 #include <AliESDEvent.h>
-
-
-#ifdef ZMQ
-#include <zmq.hpp>
-#else
-namespace zmq{
-       class context_t;
-}
-#endif
+#include "AliStorageTypes.h"
 
 class AliEveMacroExecutor;
 class AliEveEventSelector; 
-class AliSocket;
 
 class AliRunLoader;
 class AliESDEvent;
@@ -57,10 +48,12 @@ class TMap;
 //
 
 
-class AliEveEventManager : public TEveEventManager,
-        public TQObject
+class AliEveEventManager : public TEveEventManager, public TQObject
 {
 public:
+    AliEveEventManager(const TString& name="Event", Int_t ev=0);
+    virtual ~AliEveEventManager();
+       
     enum EVisibleESDTrees{ kOfflineTree, kHLTTree };
 
     static void SetESDFileName(const TString& esd, EVisibleESDTrees shown=kOfflineTree);
@@ -76,21 +69,19 @@ public:
     // assumes the filenames of ESD, AOD, etc are standard ALICE names
     // (AliESDs.root, AliESDfriends.root, AliAOD.root, AliAODfriend.root, galice.root,raw.root)
     static void SetFilesPath(const TString& path);
-
     static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd,
                                   Bool_t assertAod, Bool_t assertRaw);
     static void SearchRawForCentralReconstruction();
 
-    AliEveEventManager(const TString& name="Event", Int_t ev=0);
-    virtual ~AliEveEventManager();
-
     virtual void  Open();
-    void          SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd, AliESDfriend *esdf);
     virtual Int_t GetMaxEventId(Bool_t refreshESD=kFALSE) const;
     virtual void  GotoEvent(Int_t event);
     virtual void  NextEvent();
     virtual void  PrevEvent();
+    void MarkCurrentEvent();
     virtual void  Close();
+
+    void          SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd, AliESDfriend *esdf);
     void Timeout(); // * SIGNAL*
 
     Int_t         GetEventId()         const { return fEventId; }
@@ -109,10 +100,7 @@ public:
     TString       GetEventInfoVertical()   const;
     const AliEventInfo*        GetEventInfo();
 
-               static bool ConnectToServer(const char* host, int port); // connect to the events server
-
     static Int_t  CurrentEventId();
-
     static Bool_t HasRunLoader();
     static Bool_t HasESD();
     static Bool_t HasESDfriend();
@@ -124,23 +112,17 @@ public:
     static AliESDfriend* AssertESDfriend();
     static AliAODEvent*  AssertAOD();
     static AliRawReader* AssertRawReader();
-
     static AliMagF*      AssertMagField();
     static TGeoManager*  AssertGeometry();
     static AliRecoParam* AssertRecoParams();
-    
-    static AliSocket* AssertSubscriber();
 
     static AliEveEventManager* AddDependentManager(const TString& name, const TString& path);
     static AliEveEventManager* GetDependentManager(const TString& name);
-
     static AliEveEventManager* GetMaster();
     static AliEveEventManager* GetCurrent();
-
     static void                RegisterTransient    (TEveElement* element);
     static void                RegisterTransientList(TEveElement* element);
 
-
     Double_t      GetAutoLoadTime()        const { return fAutoLoadTime; }
     Bool_t        GetAutoLoad()            const { return fAutoLoad;     }
     void          SetAutoLoadTime(Float_t time);
@@ -162,7 +144,9 @@ public:
     void          NewEventLoaded();      // *SIGNAL*
 
     AliEveMacroExecutor* GetExecutor() const { return fExecutor; }
-           void InitOCDB(int runNo=-1);
+    void InitOCDB(int runNo=-1);
+
+    void PrepareForNewEvent(AliESDEvent *event);
 protected:
     Int_t         fEventId;            // Id of current event.
 
@@ -223,27 +207,36 @@ protected:
     static AliRecoParam* fgRecoParam;
     static Bool_t        fgUniformField;  // Track with uniform field.
 
-               static zmq::context_t* fgSubContext;
-               static AliSocket* fgSubSock;
-private:
-    AliEveEventManager(const AliEveEventManager&);            // Not implemented
-    AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented
 
+private:
     void InitInternals();
 
     void StartAutoLoadTimer();
     void StopAutoLoadTimer();
+    Bool_t fAutoLoadTimerRunning; // State of auto-load timer.
 
     static Bool_t InitGRP();
     static Bool_t InitRecoParam();
-
     TTree* readESDTree(const char* treeName, int &run);
 
-    Bool_t fAutoLoadTimerRunning; // State of auto-load timer.
-
     static AliEveEventManager* fgMaster;
     static AliEveEventManager* fgCurrent;
 
+
+    static void* Dispatch(void *arg){static_cast<AliEveEventManager*>(arg)->GetNextEvent();}
+    void GetNextEvent();
+    TThread *fGetEventThread;
+    TMutex fMutex;
+    AliESDEvent *fCurrentEvent[2];
+    TTree *fCurrentTree[2];
+    int fEventInUse;
+    int fWritingToEventIndex;
+    bool fIsNewEventAvaliable;
+    storageSockets fgSubSock;
+    
+    AliEveEventManager(const AliEveEventManager&);            // Not implemented
+    AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented
+    
     ClassDef(AliEveEventManager, 0); // Interface for getting all event components in a uniform way.
 };
 
index fde062b..f7ccefb 100644 (file)
@@ -147,6 +147,8 @@ AliEveEventManagerWindow::AliEveEventManagerWindow(AliEveEventManager* mgr) :
     b->Connect("Clicked()", cls, this, "DoNextEvent()");
     fLastEvent = b = MkTxtButton(f, "Last", width);
     b->Connect("Clicked()", cls, this, "DoLastEvent()");
+    fMarkEvent = b = MkTxtButton(f, "Mark", width);
+    b->Connect("Clicked()", cls, this, "DoMarkEvent()");
 
     MkLabel(f, "||", 0, 8, 8);
 
@@ -225,6 +227,13 @@ void AliEveEventManagerWindow::DoLastEvent()
 }
 
 //______________________________________________________________________________
+void AliEveEventManagerWindow::DoMarkEvent()
+{
+  // Mark current event
+  fM->MarkCurrentEvent();
+}
+
+//______________________________________________________________________________
 void AliEveEventManagerWindow::DoSetEvent()
 {
   // Set current event
index 31ecf81..b54f587 100644 (file)
@@ -44,7 +44,6 @@ public:
 
 protected:
    AliEveEventManager  *fM;             // Model object.
-
    TGTextButton        *fDumpEventInfo; // Button that dumps event-info into a file.
    TGTextView          *fEventInfo;     // Text box with event info.
 
@@ -74,6 +73,7 @@ public:
   void DoPrevEvent();
   void DoNextEvent();
   void DoLastEvent();
+  void DoMarkEvent();
 
   void DoSetEvent();
 
@@ -92,6 +92,7 @@ protected:
   TGTextButton         *fNextEvent;    // Go to next event
   TGTextButton         *fLastEvent;    // Go to last event
   TGTextButton         *fRefresh;      // Refresh event-file state
+  TGTextButton         *fMarkEvent;    // Mark current event
 
   TGNumberEntry        *fEventId;      // Display/edit current event id
   TGLabel              *fInfoLabel;    // Display last available event id
index 36f4e15..bf03cac 100644 (file)
@@ -11,8 +11,6 @@
 #include <TInterpreter.h>
 #include <TROOT.h>
 
-
-
 #include <TEveManager.h>
 #include <TEveSelection.h>
 
@@ -32,9 +30,6 @@
 #include "AliEveUtil.h"
 #include "AliEveFileDialog.h"
 
-#include <iostream>
-using namespace std;
-
 AliEveMainWindow::AliEveMainWindow(const char* title, UInt_t width, UInt_t height)
     : TGMainFrame(gClient->GetRoot(), width, height),
       fMenuBar(0),
@@ -51,6 +46,9 @@ AliEveMainWindow::AliEveMainWindow(const char* title, UInt_t width, UInt_t heigh
       fEve(0),
       fFileDialog(0)
 {
+       static const TEveException kEH("AliEveMainWindow");
+       Info(kEH.Data(),"Constructor called");
+       
     AliEveUtil::Init();
     fPicturePool = AliEveUtil::GetPicturePool();
    
@@ -202,6 +200,7 @@ void AliEveMainWindow::onMenuGoItem(UInt_t id)
 
 void AliEveMainWindow::setupMenus()
 {
+
     fMenuBar = new TGMenuBar(this);
 
     // File Menu
@@ -325,7 +324,6 @@ void AliEveMainWindow::setupToolbars()
     AddFrame(new TGHorizontal3DLine(this), new TGLayoutHints(kLHintsExpandX));
 
 
-
     //fToolBar->Connect("Clicked(Int_t)", "RCMainWindow", this, "openFile()");
 }
 
index 22be937..8da442e 100644 (file)
@@ -102,14 +102,16 @@ void AliEveTrackCounter::Reset()
     TEveTrackList* tlist;
     while ((tlist = dynamic_cast<TEveTrackList*>(next())))
       tlist->DecDenyDestroy();
-    fTrackLists.Clear("nodelete");
+    //fTrackLists.Clear("nodelete");
+        fTrackLists.Clear();
   }
   {
     TIter next(&fTrackletLists);
     TEveTrackList* tlist;
     while ((tlist = dynamic_cast<TEveTrackList*>(next())))
       tlist->DecDenyDestroy();
-    fTrackletLists.Clear("nodelete");
+    //fTrackletLists.Clear("nodelete");
+        fTrackletLists.Clear();
   }
 
   fEventId = AliEveEventManager::GetMaster()->GetEventId();
index 85f4d0d..71320e1 100644 (file)
 // AliEveBeamInfo
 #pragma link C++ class AliEveBeamsInfo+;
 #pragma link C++ class AliEveBeamsInfoEditor+;
+
index 91e8d06..6b7a668 100644 (file)
@@ -32,7 +32,8 @@
 
 int main(int argc, char **argv)
 {
-
+    static const TEveException kEH("alieve::main");
+       
     if(argc>1)
     {
         if(strcmp(argv[1],"-dev")==0 ){
@@ -46,10 +47,11 @@ int main(int argc, char **argv)
             return 0;
         }
     }
-
-
-    static const TEveException kEH("alieve::main");
-
+    else
+    {
+           Info(kEH.Data(),"No parameters");
+    }
+    
     if (gSystem->Getenv("ALICE_ROOT") == 0)
     {
         Error(kEH.Data(), "ALICE_ROOT is not defined, aborting.");
index f0fda58..485112e 100644 (file)
@@ -4,6 +4,8 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
+#include <../../MONITOR/AliSocket.h>
+
 class TEveProjectionManager;
 class TEveGeoShape;
 class TEveUtil;
@@ -14,23 +16,44 @@ TH2D* V0StateHistogram;
 
 Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
 
-void alieve_online_init()
+void alieve_online()
 {
     printf("alieve_online_init() ...\n");
-    
-  if (gSystem->Getenv("ALICE_ROOT") != 0)
+ printf("================================ Correct macro r ...\n");
+       if (gSystem->Getenv("ALICE_ROOT") != 0)
   {
     gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT")));
     gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
   }
   
+   AliEveEventManager::SetCdbUri("local://$ALICE_ROOT/OCDB");
+  
+  Info("alieve_init", "Adding standard macros.");
+  TString  hack = gSystem->pwd(); // Problem with TGFileBrowser cding
+  alieve_init_import_macros();
+  gSystem->cd(hack);
+  
+  new AliEveEventManager("online", -1);
+  //AliEveEventManager::GetMaster()->AddNewEventCommand("alieve_online_on_new_event()");
+  gEve->AddEvent(AliEveEventManager::GetMaster());
+  
+  
   TEveUtil::AssertMacro("VizDB_scan.C");
-
-  TEveBrowser *browser = gEve->GetBrowser();
+  
+  gSystem->ProcessEvents();
+   
+  
+  
+  
+  AliEveMacroExecutor *exec  = AliEveEventManager::GetMaster()->GetExecutor();
+  TEveBrowser         *browser = gEve->GetBrowser();
   browser->ShowCloseTab(kFALSE);
+  
 
   // Gentle-geom loading changes gGeoManager.
-  TEveGeoManagerHolder mgrRestore;
+  //TEveGeoManagerHolder mgrRestore;
 
   AliEveMultiView *multiView = new AliEveMultiView(kTRUE);
 
@@ -50,6 +73,9 @@ void alieve_online_init()
   // Standard macros to execute -- not all are enabled by default.
   //============================================================================
 
+  
+   printf("============ Setting macro executor\n");
+
   AliEveMacroExecutor *exec = AliEveEventManager::GetMaster()->GetExecutor();
 
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX",         "primary_vertex.C", "primary_vertex",             "",                kTRUE));
@@ -62,31 +88,31 @@ void alieve_online_init()
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "",                kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box",     "primary_vertex.C", "primary_vertex_box_tpc",     "kFALSE, 3, 3, 3", kFALSE));
 
-  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS",   "its_clusters.C++",   "its_clusters"));
-  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC",   "tpc_clusters.C++",   "tpc_clusters"));
-  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 HMPID", "hmpid_clusters.C++", "hmpid_clusters"));
-  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus MUON",  "muon_clusters.C++",  "muon_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS",   "its_clusters.C",   "its_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC",   "tpc_clusters.C",   "tpc_clusters"));
+  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 HMPID", "hmpid_clusters.C", "hmpid_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus MUON",  "muon_clusters.C",  "muon_clusters"));
 
-  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG EMCAL",   "emcal_digits.C++",   "emcal_digits"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG EMCAL",   "emcal_digits.C",   "emcal_digits"));
 
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ITS",     "its_raw.C",     "its_raw"));
   //  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC",     "tpc_raw.C",     "tpc_raw"));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TOF",     "tof_raw.C",     "tof_raw"));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO",   "vzero_raw.C",   "vzero_raw", "", kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE",  "acorde_raw.C",  "acorde_raw", "", kFALSE));
-  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW MUON",    "muon_raw.C++",  "muon_raw"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW MUON",    "muon_raw.C",  "muon_raw"));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD",     "fmd_raw.C",     "fmd_raw"));
 
-  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 Track MUON", "esd_muon_tracks.C++", "esd_muon_tracks",        "kTRUE,kFALSE", kTRUE));
+  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 Track MUON", "esd_muon_tracks.C", "esd_muon_tracks",        "kTRUE,kFALSE", kTRUE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC FMD",        "fmd_esd.C",           "fmd_esd",                "", kTRUE));
 
   // ???
-  // exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC TRD", "trd_detectors.C++", "trd_detectors",         "", kFALSE));
+  // exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC TRD", "trd_detectors.C", "trd_detectors",         "", kFALSE));
   // trd_tracks disabled due to memory leaks
 
   //----------------------------------------------------------------------------
@@ -98,31 +124,6 @@ void alieve_online_init()
   exewin->PopulateMacros();
 
   //============================================================================
-  // VZERO state histogram
-  //============================================================================
-
-  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
-  slot->StartEmbedding();  
-  TCanvas* pad = new TCanvas();
-
-  gStyle->SetCanvasColor(0);
-
-  V0StateHistogram = new TH2D("V0 Histogram","V0 Trigger State", 4, 0, 4, 4, 0, 4);
-  V0StateHistogram->Draw("colz");
-
-  V0StateHistogram->GetXaxis()->SetBinLabel(1,"V0A Invalid");
-  V0StateHistogram->GetXaxis()->SetBinLabel(2,"V0A Empty");
-  V0StateHistogram->GetXaxis()->SetBinLabel(3,"V0A BB");
-  V0StateHistogram->GetXaxis()->SetBinLabel(4,"V0A BG");
-
-  V0StateHistogram->GetYaxis()->SetBinLabel(1,"V0C Invalid");
-  V0StateHistogram->GetYaxis()->SetBinLabel(2,"V0C Empty");
-  V0StateHistogram->GetYaxis()->SetBinLabel(3,"V0C BB");
-  V0StateHistogram->GetYaxis()->SetBinLabel(4,"V0C BG");
-
-  slot->StopEmbedding("V0 Trigger State");
-
-  //============================================================================
   // Final GUI setup
   //============================================================================
 
@@ -136,38 +137,8 @@ void alieve_online_init()
                      gClient->GetDisplayHeight() - 32);
 
   gEve->GetViewers()->SwitchColorSet();
-
-  TString autoRun(gSystem->Getenv("ONLINERECO_AUTORUN"));
-  if (autoRun == "1" || autoRun.CompareTo("true", TString::kIgnoreCase) == 0)
-  {
-    AliEveEventManager::GetMaster()->SetAutoLoad(kTRUE);
-  }
-
-  {
-    TGTab *tab = gEve->GetBrowser()->GetTab(2);
-
-    TGHorizontalFrame *hf = (TGHorizontalFrame*) tab->GetParent();
-    TGVerticalFrame   *vf = (TGVerticalFrame*)   hf ->GetParent();
-
-    hf->Resize(hf->GetWidth(), hf->GetHeight() + 80);
-    vf->Layout();
-  }
-
-  gEve->GetWindowManager()->HideAllEveDecorations();
-
-  if(gEve->GetScenes()->FindChild("Geometry scene")->FindChild("Gentle MUON"))
-  {
-    gEve->GetScenes()->FindChild("Geometry scene")->FindChild("Gentle MUON")->SetRnrSelf(kFALSE);
-    gEve->GetScenes()->FindChild("Geometry scene")->FindChild("Gentle MUON")->SetRnrChildren(kFALSE);
-  }
-
-  if(gEve->GetScenes()->FindChild("Muon Geometry")->FindChild("Gentle MUON [P]"))
-  {
-    gEve->GetScenes()->FindChild("Muon Geometry")->FindChild("Gentle MUON [P]")->SetRnrSelf(kTRUE);
-    gEve->GetScenes()->FindChild("Muon Geometry")->FindChild("Gentle MUON [P]")->SetRnrChildren(kTRUE);
-  }
-
   gEve->FullRedraw3D(kTRUE);
+       gSystem->ProcessEvents();
 
   TGLViewer *glv1 = multiView->Get3DView()->GetGLViewer();
   TGLViewer *glv2 = multiView->GetRPhiView()->GetGLViewer();
@@ -178,9 +149,33 @@ void alieve_online_init()
   glv3->CurrentCamera().Dolly(1500, kFALSE, kFALSE);
 
   gEve->FullRedraw3D();
+  gSystem->ProcessEvents();
+  
+  // Register command to call on each event.
+  // AliEveEventManager::GetMaster()->AddNewEventCommand("alieve_online_on_new_event();");
+  //AliEveEventManager::GetMaster()->GotoEvent(-1);
+  printf("================================ Connecting to Server ...\n");
+   
+    //AliEveEventManager::ConnectToServer("tcp://137.138.55.173", 5024);
+  if(AliEveEventManager::ConnectToServer("tcp://137.138.93.150", 5024))
+  {
+         printf("\nconnected\n");
+  }    else printf("not connected\n");
+    
+    AliSocket* subscriber = AliEveEventManager::AssertSubscriber();
+  
+       if(subscriber ==0) {
+               printf("===================== Not connected! ====================\n");
+    }
 
+  
+
+  gEve->Redraw3D(kTRUE);
+    
 }
 
+
 Int_t      g_pic_id  = 0;
 Int_t      g_pic_max = 100;
 TTimeStamp g_pic_prev(0, 0);
@@ -188,223 +183,55 @@ TTimeStamp g_pic_prev(0, 0);
 void alieve_online_on_new_event()
 {
   AliSysInfo::AddStamp("on_new_event_start");
-
-  AliTriggerAnalysis atr;
-
-  AliESDEvent* esd = AliEveEventManager::AssertESD();
-  Double_t x[3] = { 0, 0, 0 };
-  esd->GetPrimaryVertex()->GetXYZ(x);
-
-  TEveElement* top = gEve->GetCurrentEvent();
-
-  AliEveMultiView *multiView = AliEveMultiView::Instance();
-
-/*
-  TGLViewer *glv = (dynamic_cast<TEveViewer*>(gEve->GetViewers()->FindChild("3D View")))->GetGLViewer();
-  
-  if(gEve->GetScenes()->FirstChild()->FindChild("Gentle MUON"))
-  {
-    if (esd->GetNumberOfMuonTracks() == 0 && !gEve->GetKeepEmptyCont())
-    {
-      gEve->GetScenes()->FirstChild()->FindChild("Gentle MUON")->SetRnrChildren(kFALSE);
-      
-      if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters"))
-        gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters")->SetRnrSelf(kFALSE);
-      if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits"))
-        gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits")->SetRnrChildren(kFALSE);
-
-      gEve->FullRedraw3D(kTRUE);
-      glv->CurrentCamera().RotateRad(-0.4, -1.8);
-    }
-    else
-    {
-      gEve->GetScenes()->FirstChild()->FindChild("Gentle MUON")->SetRnrChildren(kTRUE);
-
-      if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters"))
-        gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters")->SetRnrSelf(kTRUE);
-      if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits"))
-        gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits")->SetRnrChildren(kTRUE);
-
-      gEve->FullRedraw3D(kTRUE);
-      glv->CurrentCamera().RotateRad(-0.4, 1);
-    }
-  }
-
-  glv->DoDraw();
-*/
-
-  AliTriggerAnalysis::V0Decision decisionV0a = 
-    atr.V0Trigger(esd, AliTriggerAnalysis::kASide, kFALSE);
-  AliTriggerAnalysis::V0Decision decisionV0c = 
-    atr.V0Trigger(esd, AliTriggerAnalysis::kCSide, kFALSE);
-
-  Double_t a = 0;
-  Double_t c = 0;
-
-  if( decisionV0a == AliTriggerAnalysis::kV0Invalid ) a = 0.5;
-  if( decisionV0a == AliTriggerAnalysis::kV0Empty ) a = 1.5;
-  if( decisionV0a == AliTriggerAnalysis::kV0BB ) a = 2.5;
-  if( decisionV0a == AliTriggerAnalysis::kV0BG ) a = 3.5;
-
-  if( decisionV0c == AliTriggerAnalysis::kV0Invalid ) c = 0.5;
-  if( decisionV0c == AliTriggerAnalysis::kV0Empty ) c = 1.5;
-  if( decisionV0c == AliTriggerAnalysis::kV0BB ) c = 2.5;
-  if( decisionV0c == AliTriggerAnalysis::kV0BG ) c = 3.5;
-
-  V0StateHistogram->Fill(a,c);
-  AliSysInfo::AddStamp("on_new_event_after_trig");
-
-  TGLViewer *glv = multiView->Get3DView()->GetGLViewer();
-  TGLViewer *glv1 = multiView->GetRPhiView()->GetGLViewer();
-  TGLViewer *glv2 = multiView->GetRhoZView()->GetGLViewer();
  
-  Double_t RPhiCameraFrustrumCenter = TMath::Sqrt(glv1->CurrentCamera().FrustumCenter().X()*glv1->CurrentCamera().FrustumCenter().X() + glv1->CurrentCamera().FrustumCenter().Y()*glv1->CurrentCamera().FrustumCenter().Y());
-
-  Double_t RhoZCameraFrustrumCenter = TMath::Sqrt(glv2->CurrentCamera().FrustumCenter().X()*glv2->CurrentCamera().FrustumCenter().X() + glv2->CurrentCamera().FrustumCenter().Y()*glv2->CurrentCamera().FrustumCenter().Y());
-
-  if(RPhiCameraFrustrumCenter > 500 || RhoZCameraFrustrumCenter > 500)
-  {
-
-    glv->ResetCurrentCamera();
-    glv1->ResetCurrentCamera();
-    glv2->ResetCurrentCamera();
-
-    glv->CurrentCamera().RotateRad(-0.4, -1.8);
-    glv1->CurrentCamera().Dolly(450, kFALSE, kFALSE);
-    glv2->CurrentCamera().Dolly(1500, kFALSE, kFALSE);
-
-    gEve->FullRedraw3D();
-
-  }
-
-  multiView->DestroyEventRPhi();
-  if (gCenterProjectionsAtPrimaryVertex)
-    multiView->SetCenterRPhi(x[0], x[1], x[2]);
-  multiView->ImportEventRPhi(top);
-
-  multiView->DestroyEventRhoZ();
-  if (gCenterProjectionsAtPrimaryVertex)
-    multiView->SetCenterRhoZ(x[0], x[1], x[2]);
-  multiView->ImportEventRhoZ(top);
-
-  AliSysInfo::AddStamp("on_new_event_after_rozphi");
-
-  if(multiView->IsMuonView()) { multiView->DestroyEventMuon(); multiView->ImportEventMuon(top); }
-
-  if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Clusters"))
-  {
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Clusters")->SetRnrSelf(kFALSE);
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Clusters")->SetRnrChildren(kFALSE);
-  }
+       AliSysInfo::AddStamp("on_new_event_end");
+}
 
-  if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Clusters"))
-  {
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Clusters")->SetRnrSelf(kFALSE);
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Clusters")->SetRnrChildren(kFALSE);
-  }
+void alieve_init_import_macros()
+{
+  // Put macros in the list of browsables, add a macro browser to
+  // top-level GUI.
 
-  if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Tracks"))
-  {
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Tracks")->SetRnrSelf(kFALSE);
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Tracks")->SetRnrChildren(kFALSE);
-  }
+  TString macdir("$(ALICE_ROOT)/EVE/alice-macros");
+  gSystem->ExpandPathName(macdir);
 
-  if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Raw digits"))
+  TFolder* f = gEve->GetMacroFolder();
+  void* dirhandle = gSystem->OpenDirectory(macdir.Data());
+  if (dirhandle != 0)
   {
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Raw digits")->SetRnrSelf(kFALSE);
-    gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Raw digits")->SetRnrChildren(kFALSE);
-  }
-
-  if(gEve->GetScenes()->FindChild("Muon Event Data"))
-  {
-    if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]"))
+    char* filename;
+    TPMERegexp re("\\.C$");
+    TObjArray names;
+    while ((filename = gSystem->GetDirEntry(dirhandle)) != 0)
     {
-      if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("MUON Clusters [P]"))
-      {
-       gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("MUON Clusters [P]")->SetRnrSelf(kTRUE);
-       gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("MUON Clusters [P]")->SetRnrChildren(kTRUE);
-      }
-
-      if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Clusters [P]"))
-      {
-       gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Clusters [P]")->SetRnrSelf(kTRUE);
-       gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Clusters [P]")->SetRnrChildren(kTRUE);
-      }
-
-      if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Tracks [P]"))
-      {
-       gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Tracks [P]")->SetRnrSelf(kTRUE);
-       gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Tracks [P]")->SetRnrChildren(kTRUE);
-      }
+      if (re.Match(filename))
+       names.AddLast(new TObjString(filename));
     }
-  }
+    names.Sort();
 
-  if(gEve->GetScenes()->FindChild("RhoZ Event Data"))
-  {
-    if(gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]"))
+    for (Int_t ii=0; ii<names.GetEntries(); ++ii)
     {
-      if(gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]"))
-      {
-       gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrSelf(kFALSE);
-       gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrChildren(kFALSE);
-      }
+      TObjString * si = (TObjString*) names.At(ii);
+       f->Add(new TEveMacro(Form("%s/%s", macdir.Data(), (si->GetString()).Data())));
     }
   }
+  gSystem->FreeDirectory(dirhandle);
+
+  gROOT->GetListOfBrowsables()->Add(new TSystemDirectory(macdir.Data(), macdir.Data()));
 
-  if(gEve->GetScenes()->FindChild("RPhi Event Data"))
   {
-    if(gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]"))
+    TEveBrowser   *br = gEve->GetBrowser();
+    TGFileBrowser *fb = 0;
+    fb = br->GetFileBrowser();
+    fb->GotoDir(macdir);
     {
-      if(gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]"))
-      {
-        gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrSelf(kFALSE);
-        gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrChildren(kFALSE);
-      }
+      br->StartEmbedding(0);
+      fb = br->MakeFileBrowser();
+      fb->BrowseObj(f);
+      fb->Show();
+      br->StopEmbedding();
+      br->SetTabTitle("Macros", 0);
+      br->SetTab(0, 0);
     }
   }
-  AliSysInfo::AddStamp("on_new_event_after_muon");
-
-  gEve->FullRedraw3D();
-
-  // Register image to amore.
-  // const TString pichost("aldaqacrs3");
-  const TString pichost(gEnv->GetValue("AliEve.imageDumpHost", "aldaqacrs3"));
-  TTimeStamp now;
-  Double_t delta = now.AsDouble() - g_pic_prev.AsDouble();
-
-  printf("Pre image dump: host='%s', delta=%f.\n",
-        gSystem->HostName(), delta);
-
-  AliSysInfo::AddStamp("on_new_event_pic");
-  if (pichost == gSystem->HostName() && delta >= 30)
-  {
-    TString id;      id.Form("online-viz-%03d", g_pic_id);
-    TString pic(id); pic += ".png";
-
-    printf("In image dump: file='%s'.\n", pic.Data());
-
-    gEve->GetBrowser()->RaiseWindow();
-    gEve->FullRedraw3D();
-    gSystem->ProcessEvents();
-
-    Int_t status;
-
-    status = gSystem->Exec(TString::Format("xwd -id %u | convert - %s",
-                          gEve->GetBrowser()->GetId(), pic.Data()));
-
-    printf("Post capture -- status=%d.\n", status);
-
-    status = gSystem->Exec(TString::Format("SendImageToAmore %s %s %d",
-                         id.Data(), pic.Data(),
-                         AliEveEventManager::AssertRawReader()->GetRunNumber()));
-
-    printf("Post AMORE reg -- status=%d, run=%d.\n", status,
-          AliEveEventManager::AssertRawReader()->GetRunNumber());
-
-    if (++g_pic_id >= g_pic_max)
-      g_pic_id = 0;
-    g_pic_prev.Set();
-  }
-  AliSysInfo::AddStamp("on_new_event_end");
-
 }
index f5c1baa..25bb6d8 100644 (file)
@@ -4,8 +4,6 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
-#include <../../MONITOR/AliSocket.h>
-
 class TEveProjectionManager;
 class TEveGeoShape;
 class TEveUtil;
@@ -19,13 +17,12 @@ Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
 void alieve_online_new()
 {
     printf("alieve_online_init() ...\n");
- printf("================================ Correct macro r ...\n");
  
-       if (gSystem->Getenv("ALICE_ROOT") != 0)
-  {
-    gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT")));
-    gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
-  }
+ if (gSystem->Getenv("ALICE_ROOT") != 0)
+ {
+        gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT")));
+        gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
+ }
   
    AliEveEventManager::SetCdbUri("local://$ALICE_ROOT/OCDB");
   
@@ -63,11 +60,13 @@ void alieve_online_new()
                              geom_gentle_rhoz(),
                              geom_gentle_rhoz());
 
-  TEveUtil::LoadMacro("geom_gentle_trd.C");
-  multiView->InitGeomGentleTrd(geom_gentle_trd());
+    //These macros crashes on mac os. To be checked
+    
+  //TEveUtil::LoadMacro("geom_gentle_trd.C");
+  //multiView->InitGeomGentleTrd(geom_gentle_trd());
 
-  TEveUtil::LoadMacro("geom_gentle_muon.C");
-  multiView->InitGeomGentleMuon(geom_gentle_muon(), kFALSE, kFALSE, kTRUE);
+  //TEveUtil::LoadMacro("geom_gentle_muon.C");
+  //multiView->InitGeomGentleMuon(geom_gentle_muon(), kFALSE, kFALSE, kTRUE);
 
   //============================================================================
   // Standard macros to execute -- not all are enabled by default.
@@ -148,31 +147,12 @@ void alieve_online_new()
   glv2->CurrentCamera().Dolly(450, kFALSE, kFALSE);
   glv3->CurrentCamera().Dolly(1500, kFALSE, kFALSE);
 
+//////
+  AliEveEventManager::GetMaster()->AddNewEventCommand("alieve_online_on_new_event();");
+   ///////
   gEve->FullRedraw3D();
   gSystem->ProcessEvents();
-  
-  // Register command to call on each event.
-  // AliEveEventManager::GetMaster()->AddNewEventCommand("alieve_online_on_new_event();");
-  //AliEveEventManager::GetMaster()->GotoEvent(-1);
-  printf("================================ Connecting to Server ...\n");
-   
-    //AliEveEventManager::ConnectToServer("tcp://137.138.55.173", 5024);
-  if(AliEveEventManager::ConnectToServer("tcp://137.138.93.150", 5024))
-  {
-         printf("\nconnected\n");
-  }    else printf("not connected\n");
-    
-    AliSocket* subscriber = AliEveEventManager::AssertSubscriber();
-  
-       if(subscriber ==0) {
-               printf("===================== Not connected! ====================\n");
-    }
-
-  
-
   gEve->Redraw3D(kTRUE);
-    
 }
 
 
@@ -182,8 +162,41 @@ TTimeStamp g_pic_prev(0, 0);
 
 void alieve_online_on_new_event()
 {
-  AliSysInfo::AddStamp("on_new_event_start");
+       AliSysInfo::AddStamp("on_new_event_start");
+
+       Double_t x[3] = { 0, 0, 0 };
+
+       if (AliEveEventManager::HasESD())
+       {
+               AliESDEvent* esd = AliEveEventManager::AssertESD();
+               esd->GetPrimaryVertex()->GetXYZ(x);
+
+               TTimeStamp ts(esd->GetTimeStamp());
+               TString win_title("Eve Main Window -- Timestamp: ");
+               win_title += ts.AsString("s");
+               win_title += "; Event # in ESD file: ";
+               win_title += esd->GetEventNumberInFile();
+               gEve->GetBrowser()->SetWindowName(win_title);
+       }
+
+       TEveElement* top = gEve->GetCurrentEvent();
+
+       AliEveMultiView *mv = AliEveMultiView::Instance();
+
+       //mv->DestroyEventRPhi();
+       if (gCenterProjectionsAtPrimaryVertex)
+               mv->SetCenterRPhi(x[0], x[1], x[2]);
+       mv->ImportEventRPhi(top);
+
+       //mv->DestroyEventRhoZ();
+       if (gCenterProjectionsAtPrimaryVertex)
+               mv->SetCenterRhoZ(x[0], x[1], x[2]);
+       mv->ImportEventRhoZ(top);
+
+       if (gCenterProjectionsAtPrimaryVertex)
+               mv->SetCenterMuon(x[0], x[1], x[2]);
+       mv->ImportEventMuon(top);
+
        AliSysInfo::AddStamp("on_new_event_end");
 }
 
diff --git a/EVE/macros/online.C b/EVE/macros/online.C
new file mode 100644 (file)
index 0000000..7d05227
--- /dev/null
@@ -0,0 +1,326 @@
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#include <zmq.hpp>
+
+class TEveProjectionManager;
+class TEveGeoShape;
+class TEveUtil;
+class AliTriggerAnalysis;
+class AliSysInfo;
+
+TH2D* V0StateHistogram;
+
+Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
+//Container for gGeoManager till it is broken
+TGeoManager *fGeoManager = 0;
+
+void online()
+{
+    printf("online() ...\n");
+    
+  if (gSystem->Getenv("ALICE_ROOT") != 0)
+  {
+    gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT")));
+    gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
+  }
+  
+    Info("alieve_init", "Adding standard macros.");
+    TString  hack = gSystem->pwd(); // Problem with TGFileBrowser cding
+    alieve_init_import_macros();
+    gSystem->cd(hack);
+  
+  TEveUtil::LoadMacro("alieve_init.C");
+  alieve_init("local:///opt/OCDB/2013", ".", -1);
+  
+  TEveUtil::AssertMacro("VizDB_scan.C");
+  
+  AliEveMacroExecutor *exec    = AliEveEventManager::GetMaster()->GetExecutor();
+  TEveBrowser         *browser = gEve->GetBrowser();
+  browser->ShowCloseTab(kFALSE);
+
+
+  //==============================================================================
+  // Geometry, scenes, projections and viewers
+  //==============================================================================
+
+  AliEveMultiView *mv = new AliEveMultiView;
+
+  mv->SetDepth(-10);
+
+  TEveUtil::LoadMacro("geom_gentle.C");
+  mv->InitGeomGentle(geom_gentle(), geom_gentle_rphi(), geom_gentle_rhoz(), 0);
+
+
+    TEveUtil::LoadMacro("geom_gentle_trd.C");
+    mv->InitGeomGentleTrd(geom_gentle_trd());
+  
+
+  
+    TEveUtil::LoadMacro("geom_gentle_muon.C");
+    mv->InitGeomGentleMuon(geom_gentle_muon(kFALSE), kFALSE, kFALSE, kFALSE);
+  
+
+  mv->SetDepth(0);
+
+  //==============================================================================
+  // Registration of per-event macros
+  //==============================================================================
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track",   "kine_tracks.C", "kine_tracks", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits ITS", "its_hits.C",    "its_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TPC", "tpc_hits.C",    "tpc_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits T0",  "t0_hits.C",     "t0_hits",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits FMD", "fmd_hits.C",    "fmd_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits ACORDE", "acorde_hits.C",    "acorde_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits EMCAL", "emcal_hits.C",    "emcal_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TOF",  "tof_hits.C",     "tof_hits",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TRD", "trd_hits.C",    "trd_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits VZERO", "vzero_hits.C",    "vzero_hits",    "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG ITS",     "its_digits.C",  "its_digits",  "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG TPC",     "tpc_digits.C",  "tpc_digits",  "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG TOF",     "tof_digits.C",  "tof_digits",  "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG HMPID",   "hmpid_digits.C","hmpid_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 TOF",     "tof_raw.C",     "tof_raw",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW HMPID",   "hmpid_raw.C",   "hmpid_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));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO",   "vzero_raw.C",   "vzero_raw",   "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE",  "acorde_raw.C",  "acorde_raw",  "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX",             "primary_vertex.C", "primary_vertex",             "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse",     "primary_vertex.C", "primary_vertex_ellipse",     "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box",         "primary_vertex.C", "primary_vertex_box",         "kFALSE, 3, 3, 3", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX SPD",         "primary_vertex.C", "primary_vertex_spd",         "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse SPD", "primary_vertex.C", "primary_vertex_ellipse_spd", "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box SPD",     "primary_vertex.C", "primary_vertex_box_spd",     "kFALSE, 3, 3, 3", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX TPC",         "primary_vertex.C", "primary_vertex_tpc",         "",                kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse TPC", "primary_vertex.C", "primary_vertex_ellipse_tpc", "",                kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box TPC",     "primary_vertex.C", "primary_vertex_box_tpc",     "kFALSE, 3, 3, 3", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0",   "esd_V0_points.C",       "esd_V0_points_onfly"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0",   "esd_V0_points.C",       "esd_V0_points_offline"));
+  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 Tracks",              "esd_tracks.C", "esd_tracks",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks ITS standalone",          "esd_tracks.C", "esd_tracks_ITS_standalone",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks ITS",          "esd_tracks.C", "esd_tracks_ITS",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks TPC",           "esd_tracks.C", "esd_tracks_TPC",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks MI",           "esd_tracks.C", "esd_tracks_MI",           "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by category",  "esd_tracks.C", "esd_tracks_by_category",  "", kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by anal cuts", "esd_tracks.C", "esd_tracks_by_anal_cuts", "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Lego", "lego.C", "lego", "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Beams Info", "beams_info.C", "beams_info", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklets SPD", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kTRUE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC",      "esd_zdc.C", "esd_zdc", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters",     "clusters.C",     "clusters", "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters ITS", "its_clusters.C", "its_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TPC", "tpc_clusters.C", "tpc_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TRD", "trd_clusters.C", "trd_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TOF", "tof_clusters.C", "tof_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters HMPID", "hmpid_clusters.C", "hmpid_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters PHOS", "phos_clusters.C", "phos_clusters"));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters 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));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "DUMP VZERO",   "vzero_dump.C",   "vzero_dump",   "", kFALSE));
+  /*
+  if (showMuon)
+  {
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM TrackRef MUON", "muon_trackRefs.C", "muon_trackRefs", "kTRUE", kFALSE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW MUON", "muon_raw.C", "muon_raw", "", kFALSE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG MUON", "muon_digits.C", "muon_digits", "", kFALSE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters MUON", "muon_clusters.C", "muon_clusters", "", kTRUE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks MUON", "esd_muon_tracks.C", "esd_muon_tracks", "kTRUE,kFALSE", kTRUE));
+  }
+  */
+
+  //==============================================================================
+  // Additional GUI components
+  //==============================================================================
+
+  // Macro / data selection
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  slot->StartEmbedding();
+  AliEveMacroExecutorWindow* exewin = new AliEveMacroExecutorWindow(exec);
+  slot->StopEmbedding("DataSelection");
+  exewin->PopulateMacros();
+
+  // Event selection tab
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  slot->StartEmbedding();
+  new AliEveEventSelectorWindow(gClient->GetRoot(), 600, 400, AliEveEventManager::GetMaster()->GetEventSelector());
+  slot->StopEmbedding("Selections");
+
+  // QA viewer
+/*
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  slot->StartEmbedding();
+  new AliQAHistViewer(gClient->GetRoot(), 600, 400, kTRUE);
+  slot->StopEmbedding("QA histograms");
+
+  browser->GetTabRight()->SetTab(1);
+*/
+  browser->StartEmbedding(TRootBrowser::kBottom);
+  new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
+  browser->StopEmbedding("EventCtrl");
+
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  TEveWindowTab *store_tab = slot->MakeTab();
+  store_tab->SetElementNameTitle("WindowStore",
+    "Undocked windows whose previous container is not known\n"
+    "are placed here when the main-frame is closed.");
+  gEve->GetWindowManager()->SetDefaultContainer(store_tab);
+
+
+  //==============================================================================
+  // AliEve objects - global tools
+  //==============================================================================
+
+  AliEveTrackFitter* fitter = new AliEveTrackFitter();
+  gEve->AddToListTree(fitter, 1);
+  gEve->AddElement(fitter, gEve->GetEventScene());
+
+  AliEveTrackCounter* g_trkcnt = new AliEveTrackCounter("Primary Counter");
+  gEve->AddToListTree(g_trkcnt, kFALSE);
+
+
+
+printf("================================ Connecting to Server ...\n");
+
+AliEveEventManager::GetMaster()->ConnectToServer("tcp://*",5024);
+
+zmq::socket_t* subscriber = AliEveEventManager::GetMaster()->AssertSubscriber();
+
+if(subscriber ==0) {
+    printf("===================== Not connected! ====================\n");
+}
+
+
+  //==============================================================================
+  // Final stuff
+  //==============================================================================
+
+  // A refresh to show proper window.
+  gEve->GetViewers()->SwitchColorSet();
+  gEve->Redraw3D(kTRUE);
+  gSystem->ProcessEvents();
+
+  // Register command to call on each event.
+  AliEveEventManager::GetMaster()->AddNewEventCommand("on_new_event();");
+  AliEveEventManager::GetMaster()->GotoEvent(0);
+
+  gEve->EditElement(g_trkcnt);
+  gEve->Redraw3D(kTRUE);
+}
+
+
+/******************************************************************************/
+
+void on_new_event()
+{
+  Double_t x[3] = { 0, 0, 0 };
+
+  if (AliEveEventManager::HasESD())
+  {
+    AliESDEvent* esd = AliEveEventManager::AssertESD();
+    esd->GetPrimaryVertex()->GetXYZ(x);
+
+    TTimeStamp ts(esd->GetTimeStamp());
+    TString win_title("Eve Main Window -- Timestamp: ");
+    win_title += ts.AsString("s");
+    win_title += "; Event # in ESD file: ";
+    win_title += esd->GetEventNumberInFile();
+    gEve->GetBrowser()->SetWindowName(win_title);
+  }
+
+  TEveElement* top = gEve->GetCurrentEvent();
+
+  AliEveMultiView *mv = AliEveMultiView::Instance();
+
+  //mv->DestroyEventRPhi();
+  if (gCenterProjectionsAtPrimaryVertex)
+    mv->SetCenterRPhi(x[0], x[1], x[2]);
+  mv->ImportEventRPhi(top);
+
+  //mv->DestroyEventRhoZ();
+  if (gCenterProjectionsAtPrimaryVertex)
+    mv->SetCenterRhoZ(x[0], x[1], x[2]);
+  mv->ImportEventRhoZ(top);
+}
+
+
+Int_t      g_pic_id  = 0;
+Int_t      g_pic_max = 100;
+TTimeStamp g_pic_prev(0, 0);
+
+
+void alieve_init_import_macros()
+{
+  // Put macros in the list of browsables, add a macro browser to
+  // top-level GUI.
+
+  TString macdir("$(ALICE_ROOT)/EVE/alice-macros");
+  gSystem->ExpandPathName(macdir);
+
+  TFolder* f = gEve->GetMacroFolder();
+  void* dirhandle = gSystem->OpenDirectory(macdir.Data());
+  if (dirhandle != 0)
+  {
+    char* filename;
+    TPMERegexp re("\\.C$");
+    TObjArray names;
+    while ((filename = gSystem->GetDirEntry(dirhandle)) != 0)
+    {
+      if (re.Match(filename))
+       names.AddLast(new TObjString(filename));
+    }
+    names.Sort();
+
+    for (Int_t ii=0; ii<names.GetEntries(); ++ii)
+    {
+      TObjString * si = (TObjString*) names.At(ii);
+       f->Add(new TEveMacro(Form("%s/%s", macdir.Data(), (si->GetString()).Data())));
+    }
+  }
+  gSystem->FreeDirectory(dirhandle);
+
+  gROOT->GetListOfBrowsables()->Add(new TSystemDirectory(macdir.Data(), macdir.Data()));
+
+  {
+    TEveBrowser   *br = gEve->GetBrowser();
+    TGFileBrowser *fb = 0;
+    fb = br->GetFileBrowser();
+    fb->GotoDir(macdir);
+    {
+      br->StartEmbedding(0);
+      fb = br->MakeFileBrowser();
+      fb->BrowseObj(f);
+      fb->Show();
+      br->StopEmbedding();
+      br->SetTabTitle("Macros", 0);
+      br->SetTab(0, 0);
+    }
+  }
+}
diff --git a/MONITOR/AliEventServerUtil.cxx b/MONITOR/AliEventServerUtil.cxx
deleted file mode 100644 (file)
index 6311d41..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <TSystem.h>
-#include <TString.h>
-
-#include "AliEventServerUtil.h"
-
-const char* AliEventServerUtil::GetPathToServerConf()
-{
-       return Form("%s/MONITOR/%s", gSystem->Getenv("ALICE_ROOT"), ALIEVENTSERVER_CONF);
-}
diff --git a/MONITOR/AliEventServerWindow.h b/MONITOR/AliEventServerWindow.h
deleted file mode 100644 (file)
index 1d9f25e..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// Author: Mihai Niculesu 2013
-
-/**************************************************************************
- * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-
-#ifndef AliEventServerWindow_H
-#define AliEventServerWindow_H
-
-#include <TObject.h>
-#include <TString.h>
-#include <TGFrame.h>
-#include <TGLabel.h>
-
-class TGTextButton;
-class TGCheckButton;
-class TGListBox;
-
-class AliRecoServer;
-class AliDimIntNotifier;
-
-//______________________________________________________________________________
-// Short description of AliEventServerWindow
-//
-
-class AliEventServerWindow : public TGMainFrame
-{
-public:
-enum TOOLBUTTON{
-       TOOLBUTTON_START=1,
-       TOOLBUTTON_STOP,
-       TOOLBUTTON_PREFERENCES,
-       TOOLBUTTON_EXIT         
-  };
-  
-  AliEventServerWindow();
-  virtual ~AliEventServerWindow();
-
-  //------------------------------------------------------------------------------
-  // Handlers of DIM signals.
-  //------------------------------------------------------------------------------
-
-  void StartOfRun(Int_t run);
-  void EndOfRun(Int_t run);
-  
-  //------------------------------------------------------------------------------
-  // Handlers of button signals.
-  //------------------------------------------------------------------------------
-       void onStartServer();
-       void onStopServer();
-       void onExit();
-
-       void HandleToolBarAction(Int_t id=-1);
-
-   
-private:
-  AliEventServerWindow(const AliEventServerWindow&);            // Not implemented
-  AliEventServerWindow& operator=(const AliEventServerWindow&); // Not implemented
-       void InitDIMListeners();
-       void FillRunsFromDatabase();
-       void SetupToolbar();
-       
-       void LaunchRecoServer();        
-       void StartReco(Int_t run);
-       bool StopRecoServer();
-       
-  // GUI components.
-  TGListBox     *fRunList;    // List-box for listing current runs.
-  TGTextButton  *fStartServButt;  // Start server for selected run.
-  TGTextButton  *fStopServButt;   // Close server for selected run.
-  TGTextButton  *fExitButt;   // Close server and do Exit.
-  
-  // DIM interface. Could do without members and just leak them ...
-  AliDimIntNotifier *fDimSORListener[5]; // DIM listeners for SOR.
-  AliDimIntNotifier *fDimEORListener[5]; // DIM listeners for EOR.
-
-  // server state & process management
-  Int_t fRunRunning;   // Run which is executed.
-       AliRecoServer* fRecoServer;
-
-
-  ClassDef(AliEventServerWindow, 0);
-};
-
-#endif
diff --git a/MONITOR/AliNetMessage.cxx b/MONITOR/AliNetMessage.cxx
deleted file mode 100644 (file)
index b298d39..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-#include <TVirtualStreamerInfo.h>
-#include <Bytes.h>
-#include <TFile.h>
-#include <TClass.h>
-
-#include "AliNetMessage.h"
-
-Bool_t AliNetMessage::fgEvolution = kFALSE;
-
-ClassImp(AliNetMessage)
-
-//______________________________________________________________________________
-AliNetMessage::AliNetMessage(UInt_t what) 
-  :
-  TBufferFile(kWrite),
-  fWhat(what),
-  fClass(0),
-  fBufUncompressed(0), 
-  fInfos(NULL), 
-  fEvolution(kFALSE)
-{
-   // Create a AliNetMessage object for storing objects. The "what" integer
-   // describes the type of message. Predifined ROOT system message types
-   // can be found in MessageTypes.h. Make sure your own message types are
-   // unique from the ROOT defined message types (i.e. 0 - 10000 are
-   // reserved by ROOT). In case you OR "what" with kMESS_ACK, the message
-   // will wait for an acknowledgement from the remote side. This makes
-   // the sending process synchronous. In case you OR "what" with kMESS_ZIP,
-   // the message will be compressed in TSocket using the zip algorithm
-   // (only if message is > 256 bytes).
-
-   // space at the beginning of the message reserved for the message length
-   UInt_t   reserved = 0;
-   *this << reserved;
-
-   *this << what;
-
-   SetBit(kCannotHandleMemberWiseStreaming);
-}
-
-
-//______________________________________________________________________________
-AliNetMessage::AliNetMessage(void *buf, Int_t bufsize)
-  :
-  TBufferFile(kRead, bufsize, buf),
-  fWhat(0),
-  fClass(0),
-  fBufUncompressed(0), 
-  fInfos(NULL), 
-  fEvolution(kFALSE)
-{
-   // Create a AliNetMessage object for reading objects. The objects will be
-   // read from buf. Use the What() method to get the message type.
-
-   // skip space at the beginning of the message reserved for the message length
-   fBufCur += sizeof(UInt_t);
-
-   *this >> fWhat;
-
-   if (fWhat == kMESS_OBJECT) {
-      InitMap();
-      fClass = ReadClass();     // get first the class stored in message
-      SetBufferOffset(sizeof(UInt_t) + sizeof(fWhat));
-      ResetMap();
-   } else {
-      fClass = 0;
-   }
-}
-
-//______________________________________________________________________________
-AliNetMessage::~AliNetMessage()
-{
-   // Clean up
-  Reset();
-}
-
-//______________________________________________________________________________
-void AliNetMessage::EnableSchemaEvolutionForAll(Bool_t enable)
-{
-   // Static function enabling or disabling the automatic schema evolution.
-   // By default schema evolution support is off.
-
-   fgEvolution = enable;
-}
-
-//______________________________________________________________________________
-Bool_t AliNetMessage::UsesSchemaEvolutionForAll()
-{
-   // Static function returning status of global schema evolution.
-
-   return fgEvolution;
-}
-
-//______________________________________________________________________________
-void AliNetMessage::ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t /* force */)
-{
-   // Force writing the TStreamerInfo to the message.
-
-   if (fgEvolution || fEvolution) {
-      if (!fInfos) fInfos = new TList();
-                               fInfos->Add(info);
-   }
-}
-
-//______________________________________________________________________________
-void AliNetMessage::Forward()
-{
-   // Change a buffer that was received into one that can be send, i.e.
-   // forward a just received message.
-
-   if (IsReading()) {
-      SetWriteMode();
-      SetBufferOffset(fBufSize);
-      SetBit(kCannotHandleMemberWiseStreaming);
-   }
-}
-
-//______________________________________________________________________________
-void AliNetMessage::TagStreamerInfo(TVirtualStreamerInfo *info)
-{
-   // Remember that the StreamerInfo is being used in writing.
-
-   if (fgEvolution || fEvolution) {
-      if (!fInfos) fInfos = new TList();
-      fInfos->Add(info);
-   }
-}
-
-//______________________________________________________________________________
-void AliNetMessage::IncrementLevel(TVirtualStreamerInfo *info)
-{
-   // Increment level.
-
-   TBufferFile::IncrementLevel(info);
-
-   if (!info) return;
-   if (fgEvolution || fEvolution) {
-      if (!fInfos) fInfos = new TList();
-
-      // add the streamer info, but only once
-      // this assumes that there is only one version
-      if (fInfos->FindObject(info->GetName())==NULL) {
-                               fInfos->Add(info);
-      }
-   }
-}
-
-//______________________________________________________________________________
-void AliNetMessage::Reset()
-{
-   // Reset the message buffer so we can use (i.e. fill) it again.
-
-   SetBufferOffset(sizeof(UInt_t) + sizeof(fWhat));
-   ResetMap();
-
-   if (fBufUncompressed) {
-     delete [] fBufUncompressed;
-     fBufUncompressed=NULL;
-   }
-}
-
-//______________________________________________________________________________
-void AliNetMessage::SetLength() const
-{
-   // Set the message length at the beginning of the message buffer.
-
-   if (IsWriting()) {
-      char *buf = Buffer();
-      *((UInt_t*)buf) = (UInt_t)(Length() - sizeof(UInt_t));
-   }
-}
-
-//______________________________________________________________________________
-void AliNetMessage::SetWhat(UInt_t what)
-{
-   // Using this method one can change the message type a-posteriory.
-   // In case you OR "what" with kMESS_ACK, the message will wait for
-   // an acknowledgement from the remote side. This makes the sending
-   // process synchronous.
-
-   fWhat = what;
-
-   char *buf = Buffer();
-   buf += sizeof(UInt_t);   // skip reserved length space
-   tobuf(buf, what);
-}
-
-//______________________________________________________________________________
-void AliNetMessage::WriteObject(const TObject *obj)
-{
-   // Write object to message buffer.
-   // When support for schema evolution is enabled the list of TStreamerInfo
-   // used to stream this object is kept in fInfos. This information is used
-   // by TSocket::Send that sends this list through the socket. This list is in
-   // turn used by TSocket::Recv to store the TStreamerInfo objects in the
-   // relevant TClass in case the TClass does not know yet about a particular
-   // class version. This feature is implemented to support clients and servers
-   // with either different ROOT versions or different user classes versions.
-
-   if (fgEvolution || fEvolution) {
-      if (fInfos)
-         fInfos->Clear();
-      else
-         fInfos = new TList();
-   }
-
-   WriteObjectAny(obj, TObject::Class());
-}
-
diff --git a/MONITOR/AliNetMessage.h b/MONITOR/AliNetMessage.h
deleted file mode 100644 (file)
index c23f570..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef AliNetMessage_H
-#define AliNetMessage_H
-
-// adapted from AliHLTMessage
-
-#include <TBufferFile.h>
-
-#ifndef ROOT_MessageTypes
-#include <MessageTypes.h>
-#endif
-#ifndef ROOT_TBits
-#include <TBits.h>
-#endif
-
-class AliNetMessage : public TBufferFile
-{
-public:
-       AliNetMessage(UInt_t what = kMESS_ANY);
-       AliNetMessage(void *buf, Int_t bufsize);
-       virtual ~AliNetMessage();
-       
-        void     ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force);
-   void     Forward();
-   void                TagStreamerInfo(TVirtualStreamerInfo *info);
-   TClass  *GetClass() const { return fClass;}
-   void     IncrementLevel(TVirtualStreamerInfo* info);
-   void     Reset();
-   void     Reset(UInt_t what) { SetWhat(what); Reset(); }
-   UInt_t   What() const { return fWhat; }
-   void                        SetLength() const;
-   void     SetWhat(UInt_t what);
-
-   void     EnableSchemaEvolution(Bool_t enable = kTRUE) { fEvolution = enable; }
-   Bool_t   UsesSchemaEvolution() const { return fEvolution; }
-   void     WriteObject(const TObject *obj);
-
-   static void   EnableSchemaEvolutionForAll(Bool_t enable = kTRUE);
-   static Bool_t UsesSchemaEvolutionForAll();
-
-   const TList* GetStreamerInfos() const {return fInfos;}
-
-private:
-       AliNetMessage(const AliNetMessage &); 
-       void operator=(const AliNetMessage &);
-       
-   UInt_t   fWhat;        //!Message type
-   TClass  *fClass;       //!If message is kMESS_OBJECT pointer to object's class
-   char    *fBufUncompressed; //!Uncompressed buffer
-   TList   *fInfos;       //Array of TStreamerInfo used in WriteObject
-   Bool_t   fEvolution;   //True if support for schema evolution required
-
-   static Bool_t fgEvolution;  //True if global support for schema evolution required
-  
-       ClassDef(AliNetMessage, 1);
-};
-#endif
diff --git a/MONITOR/AliRecoServer.cxx b/MONITOR/AliRecoServer.cxx
deleted file mode 100644 (file)
index e11a2c4..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-// Author: Mihai Niculescu 2013
-
-/**************************************************************************
- * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-#include <TEnv.h>
-#include <TSystem.h>
-#include <TThread.h>
-
-#include <AliLog.h>
-#include <AliESDEvent.h>
-#include <AliCDBManager.h>
-#include <AliGRPPreprocessor.h>
-#include <AliReconstruction.h>
-#include <AliTPCRecoParam.h>
-
-#include <zmq.hpp>
-
-#include "AliEventServerUtil.h"
-#include "AliRecoServer.h"
-#include "AliRecoServerThread.h"
-
-ClassImp(AliRecoServer)
-AliRecoServer::AliRecoServer()
-  : TQObject(),
-  fContext(0),
-  fReco(0),
-  fCDBman(0),
-  fCurrentRunId(0),
-  fIsListenning(kFALSE),
-  fSettings(0),
-  fRecoTh(0)
-{
-#if (ZMQ_VERSION_MAJOR>=3)
-               fContext = new zmq::context_t;
-#else
-               fContext = new zmq::context_t(1);
-#endif /* (ZMQ_VERSION_MAJOR>=3) */
-}
-
-AliRecoServer::~AliRecoServer()
-{
-  Close(); // Full Close Server
-  delete fSettings;
-}
-
-void AliRecoServer::Close()
-{
-  if(fIsListenning){
-       Info("AliRecoServer::Close", "Closing Server");
-       
-       StopReconstruction();
-       
-    delete fContext; fContext=0;
-     fIsListenning = kFALSE;
-  }
-
-}
-
-const char* AliRecoServer::GetError() const
-{}
-
-Bool_t AliRecoServer::IsListenning() const
-{
-  return fIsListenning;
-}
-
-void AliRecoServer::ThreadFinished(Int_t status)
-{
-       Emit("ThreadFinished(Int_t) ", status); 
-}
-
-Bool_t AliRecoServer::StartReconstruction(Int_t run, const char* input)
-{
-       fCurrentRunId = run;
-       
-  // stop current reconstruction
-  StopReconstruction();
-
-       // re-read settings
-       if(fSettings) delete fSettings;
-       fSettings = new TEnv(Form("%s/MONITOR/%s", gSystem->Getenv("ALICE_ROOT"), ALIEVENTSERVER_CONF) );
-       
-       TString recoBaseDir = fSettings->GetValue("server.saveRecoDir", DEFAULT_SERVER_SAVE_RECO_DIR);
-       
-   // Create directories and logfile
-       TString logFile = Form("%s/log/run%d.log",
-                              recoBaseDir.Data(),
-                              run);
-       Info("DoStart","Reconstruction log will be written to %s",logFile.Data());
-       if( gSystem->RedirectOutput(logFile.Data())!=0){
-               printf(Form("AliRecoServer::StartReconstruction [] Error while trying to redirect output to [%s]. Exiting...", logFile.Data()) );
-               return kFALSE;
-       }
-
-       gSystem->cd(recoBaseDir.Data());
-
-       TString gdcs;
-       if (RetrieveGRP(run,gdcs) <= 0 || gdcs.IsNull()) 
-         return kFALSE;
-         
-       gSystem->mkdir(Form("run%d", run));
-       gSystem->cd(Form("run%d", run));
-
-  // Create Reco and Reco Thread
-  SetupReco(input);
-       fReco->InitRun(input);
-       
-       fRecoTh = new AliRecoServerThread(fContext, fReco);
-       fRecoTh->Start( Form("%s:%d", fSettings->GetValue("server.host", DEFAULT_SERVER_HOST), fSettings->GetValue("server.port", DEFAULT_SERVER_PORT)) );
-       fIsListenning = kTRUE;
-}
-
-void AliRecoServer::StopReconstruction()
-{
-  if(!fRecoTh) return;
-  
-  fRecoTh->Stop();
-  
-       delete fReco; fReco = 0;
-       delete fCDBman; fCDBman = 0;
-       
-       // Emit signal
-       ThreadFinished(0);
-}
-
-Int_t AliRecoServer::RetrieveGRP(UInt_t run, TString &gdc)
-{
-       if(!fSettings) return (-1);
-
-  // Retrieve GRP entry for given run from aldaqdb.
-       TString dbHost = fSettings->GetValue("logbook.host", DEFAULT_LOGBOOK_HOST);
-       Int_t dbPort =  fSettings->GetValue("logbook.port", DEFAULT_LOGBOOK_PORT);
-       TString dbName =  fSettings->GetValue("logbook.db", DEFAULT_LOGBOOK_DB);
-       TString user =  fSettings->GetValue("logbook.user", DEFAULT_LOGBOOK_USER);
-       TString password = fSettings->GetValue("logbook.pass", DEFAULT_LOGBOOK_PASS);
-       
-  Int_t ret=AliGRPPreprocessor::ReceivePromptRecoParameters(run, dbHost.Data(),
-                                                       dbPort, dbName.Data(),
-                                                       user.Data(), password.Data(),
-                                                       Form("local://%s",gSystem->pwd()),
-                                                       gdc);
-
-  if(ret>0) Info("RetrieveGRP","Last run of the same type is: %d",ret);
-  else if(ret==0) Warning("RetrieveGRP","No previous run of the same type found");
-  else if(ret<0) Error("Retrieve","Error code while retrieving GRP parameters returned: %d",ret);
-  return(ret);
-}
-
-void AliRecoServer::SetupReco(const char* input)
-{
-       if(!fSettings) return;
-
-  //AliTPCRecoParam::SetUseTimeCalibration(kFALSE); //-- !probably should be set from conf file!
-
-       printf(Form("=========================[local://%s/..]===========\n",gSystem->pwd()));
-
-  /* Settings CDB */
-       fCDBman = AliCDBManager::Instance();
-  
-  fCDBman->SetDefaultStorage(fSettings->GetValue("cdb.defaultStorage", DEFAULT_CDB_STORAGE));
-  fCDBman->SetSpecificStorage(fSettings->GetValue( "cdb.specificStoragePath1", DEFAULT_CDB_SPEC_STORAGE_PATH1),  
-                                                                                                                                                                                                       fSettings->GetValue( "cdb.specificStorageValue1", DEFAULT_CDB_SPEC_STORAGE_VALUE1));
-
-       fCDBman->SetSpecificStorage(fSettings->GetValue( "cdb.specificStoragePath2", DEFAULT_CDB_SPEC_STORAGE_PATH2),  
-                                                                                                                                                                                                       fSettings->GetValue( "cdb.specificStorageValue2", DEFAULT_CDB_SPEC_STORAGE_VALUE2));
-  
-       fCDBman->SetSpecificStorage(fSettings->GetValue( "cdb.specificStoragePath3", DEFAULT_CDB_SPEC_STORAGE_PATH3),  
-                                                                                                                                                                                                       fSettings->GetValue( "cdb.specificStorageValue3", DEFAULT_CDB_SPEC_STORAGE_VALUE3));
-  
-  /* Reconstruction settings */
-  if(fReco) delete fReco;
-  
-       AliReconstruction* rec = new AliReconstruction;
-       
-  // QA options
-  rec->SetRunQA(fSettings->GetValue( "qa.runDetectors", DEFAULT_QA_RUN));
-  rec->SetRunGlobalQA(fSettings->GetValue( "qa.runGlobal", DEFAULT_QA_RUN_GLOBAL));
-  rec->SetQARefDefaultStorage(fSettings->GetValue( "qa.defaultStorage",DEFAULT_QAREF_STORAGE)) ;
-  rec->SetRunPlaneEff(fSettings->GetValue( "reco.runPlaneEff", DEFAULT_RECO_RUN_PLANE_EFF));
-
-  // AliReconstruction settings
-  rec->SetWriteESDfriend(fSettings->GetValue( "reco.writeESDfriend", DEFAULT_RECO_WRITE_ESDF));
-  rec->SetWriteAlignmentData(fSettings->GetValue( "reco.writeAlignment",DEFAULT_RECO_WRITE_ALIGN));
-  rec->SetInput(input); // reconstruct data from this input
-  rec->SetRunReconstruction(fSettings->GetValue( "reco.detectors", DEFAULT_RECO_DETECTORS));
-  rec->SetUseTrackingErrorsForAlignment("ITS"); //-- !should be set from conf file!
-
-  // switch off cleanESD
-  rec->SetCleanESD(fSettings->GetValue( "reco.cleanESD",DEFAULT_RECO_CLEAN_ESD));
-
-       fReco = rec;
-}
diff --git a/MONITOR/AliRecoServer.h b/MONITOR/AliRecoServer.h
deleted file mode 100644 (file)
index 2d73a55..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Author: Mihai Niculescu 2013
-
-/**************************************************************************
- * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-#ifndef __AliRecoServer_H__
-#define __AliRecoServer_H__
-
-#include <TObjString.h>
-#include <TQObject.h>
-#include <RQ_OBJECT.h>
-
-class TEnv;
-class AliCDBManager;
-class AliReconstruction;
-class AliRecoServerThread;
-
-namespace zmq
-{
-       class context_t;
-}
-
-class AliRecoServer : public TQObject
-{
-       RQ_OBJECT("AliRecoServer")
-public:
-  AliRecoServer();
-  virtual ~AliRecoServer();
-  
-  // Closes the server. The server will no longer listen/serve
-  void Close();
-  
-  Bool_t IsListenning() const;
-  
-  Int_t GetRunId() const {  return fCurrentRunId; }
-  const char* GetError() const;//TODO: not implemented
-  
-  Bool_t StartReconstruction(Int_t run, const char* input="mem://@*:");
-  void  StopReconstruction();
-
-  void ThreadFinished(Int_t status); // *SIGNAL*
-  
-private:
-  Int_t RetrieveGRP(UInt_t run, TString &gdc);
-  void SetupReco(const char* input);
-
-  AliRecoServer(const AliRecoServer&);            // Not implemented
-  AliRecoServer& operator=(const AliRecoServer&); // Not implemented
-
-private:
-       // thread shared
-       zmq::context_t* fContext;
-  AliReconstruction* fReco;
-  AliCDBManager* fCDBman;
-
-       // not shared
-  Int_t                                                                                 fCurrentRunId;
-  Bool_t fIsListenning;
-  TEnv*                                                                 fSettings;
-  AliRecoServerThread* fRecoTh;
-
-public:
-
-  ClassDef(AliRecoServer, 0);
-};
-
-#endif /* __AliRecoServer_H__ */
diff --git a/MONITOR/AliRecoServerThread.cxx b/MONITOR/AliRecoServerThread.cxx
deleted file mode 100644 (file)
index 584d960..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-// Author: Mihai Niculescu 2013
-
-/**************************************************************************
- * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-
-#include <RVersion.h>
-#include <stdlib.h>
-
-#include <TCondition.h>
-#include <TBufferFile.h>
-#include <TMessage.h>
-#include <TObjArray.h>
-#include <TStreamerInfo.h>
-#include <TThread.h>
-
-#include <AliESDEvent.h>
-#include <AliESDfriend.h>
-#include <AliRawReader.h>
-#include <AliRunLoader.h>
-#include <AliReconstruction.h>
-
-#include <AliNetMessage.h>
-#include <AliSocket.h>
-
-#include <zmq.hpp>
-
-#include "AliRecoServerThread.h"
-
-ClassImp(AliRecoServerThread)
-AliRecoServerThread::AliRecoServerThread(zmq::context_t *context, AliReconstruction* reco)
-  : AliThreadedSocket(context, AliThreadedSocket::kWRITE),
-       fReco(0),
-    fCond(0)
-{
-       fReco = reco;
-}
-
-AliRecoServerThread::~AliRecoServerThread()
-{
-       Wait();
-       Stop();
-}
-
-Bool_t AliRecoServerThread::Start(const char* endpoint)
-{
-       fHost = endpoint;
-       
-       return AliThreadedSocket::Start();
-}
-
-void AliRecoServerThread::RunThrdWrite()
-{
-       TThread::SetCancelAsynchronous();
-       TThread::SetCancelOn();
-       
- // generate a publish socket
-       AliSocket publisher(fContext, ZMQ_PUB);
-       publisher.Bind(fHost);
-       
-  if(fReco==0) return;
-  
-  AliESDEvent* event;
-  
-       fReco->Begin(NULL);
-  if (fReco->GetAbort() != TSelector::kContinue) return;
-  
-  fReco->SlaveBegin(NULL);
-       if (fReco->GetAbort() != TSelector::kContinue) return;
-  
-  //******* The loop over events
-    Int_t iEvent = 0;
-    while ( fReco->HasNextEventAfter(iEvent) ) {
-      // check if process has enough resources 
-      if (!fReco->HasEnoughResources(iEvent)) break;
-      Bool_t status = fReco->ProcessEvent(iEvent);
-      
-      if (status)
-      {
-                   event = fReco->GetESDEvent();
-                   
-       AliNetMessage tmess(kMESS_OBJECT);
-                       tmess.Reset();
-                       tmess.WriteObject(event);
-                               
-                               publisher.Send(tmess);
-
-                       sleep(1);
-     }
-      else {
-        fReco->Abort("ProcessEvent",TSelector::kAbortFile);
-      }
-               
-      fReco->CleanProcessedEvent();
-      /*
-      if(fCond->TimedWaitRelative(500)==0){
-                               break;
-                               }                       */
-      iEvent++;
-    }
-    fReco->SlaveTerminate();
-    if (fReco->GetAbort() != TSelector::kContinue) return;
-    fReco->Terminate();
-    if (fReco->GetAbort() != TSelector::kContinue) return;
-  
-}
diff --git a/MONITOR/AliRecoServerThread.h b/MONITOR/AliRecoServerThread.h
deleted file mode 100644 (file)
index 74bcc36..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Author: Mihai Niculescu 2013
-
-/**************************************************************************
- * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-#ifndef __AliRecoServerThread_H__
-#define __AliRecoServerThread_H__
-
-#include <TQObject.h>
-#include <RQ_OBJECT.h>
-#include <TMutex.h>
-#include <TCondition.h>
-
-#include "AliThreadedSocket.h"
-
-class TCondition;
-class TThread;
-
-class AliReconstruction;
-class AliESDEvent;
-
-class AliRecoServerThread : public AliThreadedSocket
-{
-public:
-  AliRecoServerThread(zmq::context_t *context, AliReconstruction* reco);
-  virtual ~AliRecoServerThread();
-
-
-       Bool_t Start(const char* endpoint);
-
-       const char* GetHost() const { return fHost.Data(); }    
-       AliReconstruction*      GetReconstruction() { return fReco; }
-       TCondition*                                     Condition() { return fCond; }
-       
-private:
-       void RunThrdWrite();
-       
-       AliReconstruction* fReco;
-
-       // local        
-  TCondition*                                          fCond; // condition whether to stop reco/clean exit thread
-  TString fHost;
-
-private:
-  AliRecoServerThread(const AliRecoServerThread&);            // Not implemented
-  AliRecoServerThread& operator=(const AliRecoServerThread&); // Not implemented
-  
-public:
-  
-  ClassDef(AliRecoServerThread, 0);  
-};
-#endif /* __AliReconstructionThread_H__ */
-
diff --git a/MONITOR/AliSocket.cxx b/MONITOR/AliSocket.cxx
deleted file mode 100644 (file)
index 23af362..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#include <cstring>
-
-#include <zmq.hpp>
-
-#include "AliNetMessage.h"
-#include "AliSocket.h"
-
-void __freeBuffer (void *data, void *hint)
-{
-    free(data);
-}
-
-
-ClassImp(AliSocket);
-AliSocket::AliSocket(zmq::context_t *context,int type)
-       : TObject(),
-       fContext(context)
-{
-       fSocket = new zmq::socket_t(*context,type);
-}
-
-AliSocket::~AliSocket()
-{
-       fSocket->close();
-}
-
-void AliSocket::Bind(const char* endpoint)
-{
-       fEndPoint = endpoint;
-       
-       fSocket->bind(endpoint);
-}
-
-void AliSocket::Connect(const char* endpoint)
-{
-       fEndPoint = endpoint;
-       
-       fSocket->connect(endpoint);
-}
-
-void AliSocket::Subscribe(const char* filter)
-{
-       fSocket->setsockopt(ZMQ_SUBSCRIBE, filter, strlen(filter) );
-}
-
-bool AliSocket::Recv(AliNetMessage *&mess, int flags)
-{
-       zmq::message_t message;
-         
-       if(!fSocket->recv(&message, flags))
-               return false;   
-       
-       int bufSize = (int)message.size();
-               
-       // buffer will be adopted by AliNetMessage, no need to free it
-       char* buf = new char[bufSize];
-       memcpy(buf, (char*)message.data(), bufSize);
-       
-       mess = new AliNetMessage(buf, bufSize);
-
-       return true;
-}
-
-bool AliSocket::Send(AliNetMessage &mess, int flags)
-{
-       //NOTE: this is already done by AliNetMessage, should we do this too?
-       // send length of the message
-       int bufSize = mess.BufferSize();
-       
-       // we need to copy it elsewhere because zmq takes ownership of the buffer data
-       char* buf = new char[bufSize];
-       memcpy(buf, (char*)mess.Buffer(), bufSize);
-
-       zmq::message_t message(buf, bufSize, __freeBuffer, NULL);
-               
-       //fwrite(mess.Buffer(), sizeof(char), bufSize, stdout);
-       
-       return fSocket->send(message, flags);
-}
diff --git a/MONITOR/AliSocket.h b/MONITOR/AliSocket.h
deleted file mode 100644 (file)
index 7dafdfd..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef ALISOCKET_H
-#define ALISOCKET_H
-
-#include <TObject.h>
-#include <TString.h>
-
-class AliNetMessage;
-
-namespace zmq
-{
-       class context_t;
-       class socket_t;
-}
-
-class AliSocket : public TObject
-{
-public:
-       AliSocket(zmq::context_t* context, int type);
-       virtual ~AliSocket();
-       
-       void Bind(const char* endpoint);
-       void Connect(const char* endpoint);
-       void Subscribe(const char* filter);
-       
-  bool Recv(AliNetMessage *&mess, int flags = 0);
-  bool Send(AliNetMessage &message, int flags = 0);
-  
-private:
-       AliSocket(const AliSocket &); // Not implemented
-       void operator=(const AliSocket &); // Not implemented
-       
-       zmq::context_t *fContext; //! the zmq context
-       zmq::socket_t *fSocket; //! the socket
-       TString fEndPoint; //!
-       
-  ClassDef(AliSocket, 0);  
-};
-
-#endif
diff --git a/MONITOR/AliThreadedSocket.cxx b/MONITOR/AliThreadedSocket.cxx
deleted file mode 100644 (file)
index 56566b0..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-#include <zmq.hpp>
-
-#include <TThread.h>
-
-#include "AliNetMessage.h"
-#include "AliSocket.h"
-#include "AliThreadedSocket.h"
-
-ClassImp(AliThreadedSocket)
-AliThreadedSocket::AliThreadedSocket(zmq::context_t *context, EOpenMode mode)
-       : TQObject(),
-       fThread(0),
-       fContext(context),
-       fOpenMode(mode)
-{
-
-}
-
-AliThreadedSocket::~AliThreadedSocket()
-{
-       Wait();
-       Stop();
-}
-
-Bool_t AliThreadedSocket::Start()
-{
-       if(!fThread){
-               fThread = new TThread("AliThreadedSocket", (void(*) (void *) ) &Dispatch, (void*)  this );
-  
-       if(fThread->Run()==0){ 
-               Emit("Started()");
-               return kTRUE; 
-       }
-       }
-       
-       return kFALSE;
-}
-
-Bool_t AliThreadedSocket::Stop()
-{
-       if(fThread){
-               fThread->Delete();
-               fThread=0;
-       }
-
-       Emit("Stopped()");
-       return kTRUE;
-}
-
-Bool_t AliThreadedSocket::Kill()
-{
-       if(fThread){
-               if(fThread->Kill()!=0) return kFALSE;
-               fThread->Delete();
-               fThread=0;
-               
-               Emit("Stopped()");
-               return kTRUE;
-       }
-}
-
-void AliThreadedSocket::Continue()
-{
-       
-}
-
-void AliThreadedSocket::Wait()
-{
-       if(fThread && fThread->GetState()==TThread::kRunningState)
-       {
-               fThread->Join();
-       }
-}
-
-zmq::context_t* AliThreadedSocket::GetContext() const
-{
-       return fContext;
-}
-
-TThread* AliThreadedSocket::GetThread() const
-{
-       return fThread;
-}
-
-void AliThreadedSocket::Started()
-{
-       Emit("Started()");
-}
-
-void AliThreadedSocket::Stopped()
-{
-       Emit("Stopped()");
-}
-
-void AliThreadedSocket::RunThrdRead()
-{
-       AliNetMessage* mess=0;
-       AliSocket sock(fContext, ZMQ_SUB);
-               
-       do{
-               sock.Recv(mess);
-       }
-       while(mess==0);
-       
-       Stopped();
-}
-
-void AliThreadedSocket::RunThrdWrite()
-{
-       AliNetMessage* mess=0;
-       AliSocket sock(fContext, ZMQ_PUB);
-       
-       do{
-               sock.Send(*mess);
-       }
-       while(1);
-       
-       Stopped();
-}
diff --git a/MONITOR/AliThreadedSocket.h b/MONITOR/AliThreadedSocket.h
deleted file mode 100644 (file)
index c360f39..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Main authors: Mihai Niculescu 2014
-
-/**************************************************************************
- * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-
-#ifndef AliThreadedSocket_H
-#define AliThreadedSocket_H
-
-#include <TQObject.h>
-
-class TThread;
-class AliNetMessage;
-
-namespace zmq {
-       class context_t;
-}
-
-class AliThreadedSocket : public TQObject
-{
-public:
-       enum EOpenMode{kREAD, kWRITE};
-
-       AliThreadedSocket(zmq::context_t *context, EOpenMode mode);
-       virtual ~AliThreadedSocket();
-
-       Bool_t Start();
-       Bool_t Stop();
-       Bool_t Kill();
-       void Wait();
-       
-       zmq::context_t* GetContext() const;
-       TThread* GetThread() const;
-       EOpenMode GetMode() const { return fOpenMode; }
-               
-       void Started(); // *SIGNAL*
-       void Stopped(); // *SIGNAL*
-
-       void Continue();
-       
-protected:
-  AliThreadedSocket(const AliThreadedSocket&);            // Not implemented
-  AliThreadedSocket& operator=(const AliThreadedSocket&); // Not implemented
-
-       // Reimplement these in a derived Class
-       virtual void RunThrdRead(); // function to run in a thread when in Read mode
-       virtual void RunThrdWrite(); // function to run in a thread when in Write mode
-
-       TThread* fThread;
-       zmq::context_t* fContext;
-       EOpenMode fOpenMode;
-
-private:
-       static void* Dispatch(void* arg)
-       {
-               AliThreadedSocket* th = static_cast<AliThreadedSocket*>(arg);
-               
-               if(th->GetMode()==kREAD)
-                       th->RunThrdRead();
-               else
-                       th->RunThrdWrite();
-                       
-                       return NULL;
-       }
-
-  ClassDef(AliThreadedSocket, 0);  
-};
-#endif
index ad00c3c..11438d8 100644 (file)
@@ -6,18 +6,24 @@
 cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
 
 # This will only build MONITOR only if ZeroMQ is found
+
 set (PACKAGES
-  CMakebinalitestproc.pkg
-  CMakebinderoot.pkg
-  CMakebinmonitorCheck.pkg
-  CMakebinmonitorGDC.pkg
   CMakelibMONITOR.pkg
+  alitestproc/CMakebinalitestproc.pkg
+  deroot/CMakebinderoot.pkg
+  monitorCheck/CMakebinmonitorCheck.pkg
+  monitorGDC/CMakebinmonitorGDC.pkg 
 )
 
 if(ZEROMQ_FOUND)
 set(PACKAGES "${PACKAGES}"
   CMakelibMONITORzmq.pkg
-  CMakebinalieventserver.pkg
+  alistoragemanager/CMakebinalistorage.pkg
+  alistoragemanager/CMakebinalistorageadmin.pkg
+  alistoragemanager/CMakebinalifakedisplay.pkg
+  alistoragemanager/CMakebinalistorageminimalexample.pkg
+  alistoragemanager/CMakebinalistoragegetpoints.pkg
+  alieventserver/CMakebinalieventserver.pkg
 )
 ENDIF(ZEROMQ_FOUND)
 
index 7456b80..7a7aa96 100644 (file)
@@ -1,49 +1,21 @@
-# -*- mode: CMake -*- 
-#--------------------------------------------------------------------------------#
-# Package File for MONITOR                                                       #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#--------------------------------------------------------------------------------#
-
 set ( SRCS   
     AliQAHistNavigator.cxx 
     AliQAHistViewer.cxx 
     AliOnlineRecoTrigger.cxx 
     AliDimIntNotifier.cxx 
     AliChildProcTerminator.cxx
-    AliEventServerPreferencesWindow.cxx
-    AliEventServerUtil.cxx
-    AliTestChildProc.cxx 
-    )
+    alitestproc/AliTestChildProc.cxx
+    alieventserver/AliEventServerPreferencesWindow.cxx
+    alieventserver/AliEventServerReconstruction.cxx
+    alieventserver/AliEventServerWindow.cxx
+)
 
 string ( REPLACE ".cxx" ".h" CINTHDRS "${SRCS}" )
-
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
 set ( DHDR  MONITORLinkDef.h)
 
-set ( EINCLUDE  TPC TPC/Rec ITS RAW STEER/STEER STEER/CDB STEER/STEERBase)
+set ( EINCLUDE TPC TPC/Rec ITS RAW STEER/STEER STEER/CDB STEER/STEERBase MONITOR/alistoragemanager)
 
 set(DIMDIR $ENV{DIMDIR})
 set(ODIR $ENV{ODIR})
@@ -54,13 +26,14 @@ if(DIMDIR)
   set ( ELIBS  dim)
   set ( ELIBSDIR  ${DIMDIR}/${ODIR})
   if(ELIBSDIR STREQUAL "${DIMDIR}/")
-    set (ELIBSDIR ${DIMDIR}/linux)
+    Aset (ELIBSDIR ${DIMDIR}/linux)
   endif(ELIBSDIR STREQUAL "${DIMDIR}/")
 
   set ( CXXFLAGS  "-DALI_DIM ${CXXFLAGS}")
 endif(DIMDIR)
 
-set ( ELIBS ${ELIBS} )
+set (ELIBSDIR ${ELIBSDIR})
 
-# this must be set in a better way
-set ( ELIBSDIR ${ELIBSDIR}  /usr/lib64)
+set (EXPORT 
+  alistoragemanager/AliStorageTypes.h
+)
\ No newline at end of file
index 18fbe55..3b7719e 100644 (file)
@@ -1,47 +1,21 @@
-# -*- mode: CMake -*- 
-#--------------------------------------------------------------------------------#
-# Package File for MONITOR                                                       #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#--------------------------------------------------------------------------------#
-
-set ( SRCS
-    AliNetMessage.cxx
-    AliSocket.cxx
-    AliThreadedSocket.cxx
-    AliRecoServerThread.cxx
-    AliRecoServer.cxx
-    AliEventServerWindow.cxx
-    )
+set ( SRCS   
+    alistoragemanager/AliStorageEventManager.cxx
+    alistoragemanager/AliStorageClientThread.cxx
+    alistoragemanager/AliStorageServerThread.cxx
+    alistoragemanager/AliStorageAdministratorPanel.cxx
+    alistoragemanager/AliStorageAdministratorPanelMarkEvent.cxx
+    alistoragemanager/AliStorageAdministratorPanelListEvents.cxx
+    alistoragemanager/AliStorageAdministratorPanelSetStorageParams.cxx
+    alistoragemanager/AliStorageEventManager.cxx
+    alistoragemanager/AliStorageDatabase.cxx
+)
 
 string ( REPLACE ".cxx" ".h" CINTHDRS "${SRCS}" )
-
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
 set ( DHDR  MONITORzmqLinkDef.h)
 
-set ( EINCLUDE STEER/STEERBase ) # ${ZEROMQ_INCLUDE_DIR})
+set ( EINCLUDE TPC TPC/Rec ITS RAW STEER/STEER STEER/CDB STEER/STEERBase MONITOR/alistoragemanager)
 
 set(DIMDIR $ENV{DIMDIR})
 set(ODIR $ENV{ODIR})
@@ -52,19 +26,17 @@ if(DIMDIR)
   set ( ELIBS  dim)
   set ( ELIBSDIR  ${DIMDIR}/${ODIR})
   if(ELIBSDIR STREQUAL "${DIMDIR}/")
-    set (ELIBSDIR ${DIMDIR}/linux)
+    Aset (ELIBSDIR ${DIMDIR}/linux)
   endif(ELIBSDIR STREQUAL "${DIMDIR}/")
 
   set ( CXXFLAGS  "-DALI_DIM ${CXXFLAGS}")
 endif(DIMDIR)
 
-set (ELIBS ${ELIBS} ${ZEROMQ_LIBRARIES} )
-
-# this must be set in a better way
-set ( ELIBSDIR ${ELIBSDIR}  /usr/lib64)
+set (ELIBS ${ELIBS} ${ZEROMQ_LIBRARIES})
+set (ELIBSDIR ${ELIBSDIR}  /usr/lib64)
+set ( CXXFLAGS  "-DZMQ ${CXXFLAGS}") 
 
 set (EXPORT 
-               AliSocket.h
-               AliNetMessage.h
-       AliThreadedSocket.h
-  )
+  alistoragemanager/AliStorageEventManager.h
+  alistoragemanager/AliStorageTypes.h
+)
\ No newline at end of file
index cdeb0b2..ef487a3 100644 (file)
@@ -21,4 +21,7 @@
 #pragma link C++ class AliChildProcTerminator+;
 #pragma link C++ class AliTestChildProc+;
 
+#pragma link C++ class AliEventServerWindow+;
+#pragma link C++ class AliEventServerReconstruction+;
+
 #endif
index 4dad292..9bac783 100644 (file)
@@ -9,11 +9,14 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ class AliNetMessage+;
-#pragma link C++ class AliSocket+;
-#pragma link C++ class AliThreadedSocket+;
-#pragma link C++ class AliRecoServerThread+;
-#pragma link C++ class AliEventServerWindow+;
-#pragma link C++ class AliRecoServer+;
+// storage manager:
+#pragma link C++ class AliStorageDatabase+;
+#pragma link C++ class AliStorageClientThread+;
+#pragma link C++ class AliStorageServerThread+;
+#pragma link C++ class AliStorageEventManager+;     
+#pragma link C++ class AliStorageAdministratorPanel+;
+#pragma link C++ class AliStorageAdministratorPanelMarkEvent+;
+#pragma link C++ class AliStorageAdministratorPanelListEvents+;
+#pragma link C++ class AliStorageAdministratorPanelSetStorageParams+;
 
 #endif
diff --git a/MONITOR/alieventserver/AliEventServerReconstruction.cxx b/MONITOR/alieventserver/AliEventServerReconstruction.cxx
new file mode 100644 (file)
index 0000000..60199a0
--- /dev/null
@@ -0,0 +1,237 @@
+// Author: Mihai Niculescu 2013
+
+/**************************************************************************
+ * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+#include <TEnv.h>
+#include <TSystem.h>
+#include <TThread.h>
+#include <TXMLEngine.h>
+
+#include <AliLog.h>
+#include <AliESDEvent.h>
+#include <AliCDBManager.h>
+#include <AliGRPPreprocessor.h>
+#include <AliReconstruction.h>
+#include <AliTPCRecoParam.h>
+
+#include <iostream>
+#include <sstream>
+
+#include "AliEventServerUtil.h"
+#include "AliEventServerReconstruction.h"
+#include "AliStorageEventManager.h"
+#include "AliStorageTypes.h"
+
+#include "AliESDEvent.h"
+#include "AliESDtrack.h"
+#include "AliTrackPointArray.h"
+#include "AliESDfriendTrack.h"
+#include "AliExternalTrackParam.h"
+#include "AliTrackerBase.h"
+#include "AliTracker.h"
+
+using namespace std;
+
+AliEventServerReconstruction::AliEventServerReconstruction()
+       : TQObject(),
+         fAliReco(0),
+         fCDBmanager(0),
+         fCurrentRunId(0),
+         fIsListenning(kFALSE),
+         fSettings(0),
+         fHost(0),
+         fRecoThread(0)
+{}
+
+AliEventServerReconstruction::~AliEventServerReconstruction()
+{
+       Close();
+       if(fSettings){delete fSettings;fSettings=0;}
+}
+
+void AliEventServerReconstruction::Close()
+{
+       if(fIsListenning)
+       {
+               Info("AliRecoServer::Close", "Closing Server");
+               StopReconstruction();
+               fIsListenning = kFALSE;
+       }
+}
+
+Bool_t AliEventServerReconstruction::StartReconstruction(Int_t run, const char* input)
+{
+       fCurrentRunId = run;
+
+       StopReconstruction();
+
+       // re-read settings
+       if(fSettings){delete fSettings;}
+       fSettings = new TEnv(AliEventServerUtil::GetPathToServerConf());
+       
+       TString recoBaseDir = fSettings->GetValue("server.saveRecoDir",
+                                                 DEFAULT_SERVER_SAVE_RECO_DIR);
+       
+       // Create directories and logfile
+       TString logFile = Form("%s/log/run%d.log",
+                              recoBaseDir.Data(),
+                              run);
+       
+       Info("DoStart","Reconstruction log will be written to %s",logFile.Data());
+       if( gSystem->RedirectOutput(logFile.Data())!=0)
+       {
+               printf(Form("AliRecoServer::StartReconstruction [] Error while trying to redirect output to [%s]. Exiting...", logFile.Data()) );
+               return kFALSE;
+       }
+
+       gSystem->cd(recoBaseDir.Data());
+
+       TString gdcs;
+       if (RetrieveGRP(run,gdcs) <= 0 || gdcs.IsNull()){return kFALSE;}
+         
+       gSystem->mkdir(Form("run%d", run));
+       gSystem->cd(Form("run%d", run));
+
+       // Create Reco and Reco Thread
+       SetupReco(input);
+       fAliReco->InitRun(input);
+
+       fHost = (const char*)Form("%s:%d", fSettings->GetValue("server.host", DEFAULT_SERVER_HOST), fSettings->GetValue("server.port", DEFAULT_SERVER_PORT));
+       
+       fRecoThread = new TThread("AliEventServerReconstruction",
+                              Dispatch,
+                              (void*)this);
+       fRecoThread->Run();
+       fIsListenning = kTRUE;
+
+       return true;
+}
+
+void AliEventServerReconstruction::StopReconstruction()
+{
+       if(!fRecoThread) return;
+       delete fRecoThread;
+       fRecoThread=0;
+       Emit("Stopped()");
+  
+       if(fAliReco){delete fAliReco;fAliReco=0;}
+       if(fCDBmanager){delete fCDBmanager;fCDBmanager=0;}
+}
+
+void AliEventServerReconstruction::ReconstructionHandle()
+{
+       TThread::SetCancelAsynchronous();
+       TThread::SetCancelOn();
+       
+       if(!fAliReco) return;
+       
+       AliESDEvent* event;
+       
+       AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
+       eventManager->CreateSocket(EVENTS_SERVER_PUB);
+       eventManager->CreateSocket(XML_PUB);
+
+       fAliReco->Begin(NULL);
+       if (fAliReco->GetAbort() != TSelector::kContinue) return;
+       fAliReco->SlaveBegin(NULL);
+       if (fAliReco->GetAbort() != TSelector::kContinue) return;
+
+       //******* The loop over events
+       Int_t iEvent = 0;
+       while (fAliReco->HasNextEventAfter(iEvent))
+       {
+               // check if process has enough resources 
+               if (!fAliReco->HasEnoughResources(iEvent)) break;
+               Bool_t status = fAliReco->ProcessEvent(iEvent);
+      
+               if (status)
+               {
+                       event = fAliReco->GetESDEvent();
+                       eventManager->Send(event,EVENTS_SERVER_PUB);
+                       eventManager->SendAsXml(event,XML_PUB);
+               }
+               else
+               {
+                       fAliReco->Abort("ProcessEvent",TSelector::kAbortFile);
+               }
+               
+               fAliReco->CleanProcessedEvent();
+               iEvent++;
+       }
+       fAliReco->SlaveTerminate();
+       if (fAliReco->GetAbort() != TSelector::kContinue) return;
+       fAliReco->Terminate();
+       if (fAliReco->GetAbort() != TSelector::kContinue) return;  
+}
+
+Int_t AliEventServerReconstruction::RetrieveGRP(UInt_t run, TString &gdc)
+{
+       if(!fSettings) return (-1);
+
+       // Retrieve GRP entry for given run from aldaqdb.
+       TString dbHost = fSettings->GetValue("logbook.host", DEFAULT_LOGBOOK_HOST);
+       Int_t dbPort =  fSettings->GetValue("logbook.port", DEFAULT_LOGBOOK_PORT);
+       TString dbName =  fSettings->GetValue("logbook.db", DEFAULT_LOGBOOK_DB);
+       TString user =  fSettings->GetValue("logbook.user", DEFAULT_LOGBOOK_USER);
+       TString password = fSettings->GetValue("logbook.pass", DEFAULT_LOGBOOK_PASS);
+       
+       Int_t ret=AliGRPPreprocessor::ReceivePromptRecoParameters(run, dbHost.Data(),
+                                                                 dbPort, dbName.Data(),
+                                                                 user.Data(), password.Data(),
+                                                                 Form("local://%s",gSystem->pwd()),
+                                                                 gdc);
+
+       if(ret>0) Info("RetrieveGRP","Last run of the same type is: %d",ret);
+       else if(ret==0) Warning("RetrieveGRP","No previous run of the same type found");
+       else if(ret<0) Error("Retrieve","Error code while retrieving GRP parameters returned: %d",ret);
+       return(ret);
+}
+
+void AliEventServerReconstruction::SetupReco(const char* input)
+{
+       if(!fSettings) return;
+
+       //AliTPCRecoParam::SetUseTimeCalibration(kFALSE); //-- !probably should be set from conf file!
+
+       printf(Form("=========================[local://%s/..]===========\n",gSystem->pwd()));
+
+       /* Settings CDB */
+       fCDBmanager = AliCDBManager::Instance();
+  
+       fCDBmanager->SetDefaultStorage(fSettings->GetValue("cdb.defaultStorage", DEFAULT_CDB_STORAGE));
+       fCDBmanager->SetSpecificStorage(fSettings->GetValue( "cdb.specificStoragePath1", DEFAULT_CDB_SPEC_STORAGE_PATH1),  
+                                   fSettings->GetValue( "cdb.specificStorageValue1", DEFAULT_CDB_SPEC_STORAGE_VALUE1));
+
+       fCDBmanager->SetSpecificStorage(fSettings->GetValue( "cdb.specificStoragePath2", DEFAULT_CDB_SPEC_STORAGE_PATH2),  
+                                   fSettings->GetValue( "cdb.specificStorageValue2", DEFAULT_CDB_SPEC_STORAGE_VALUE2));
+  
+       fCDBmanager->SetSpecificStorage(fSettings->GetValue( "cdb.specificStoragePath3", DEFAULT_CDB_SPEC_STORAGE_PATH3),  
+                                   fSettings->GetValue( "cdb.specificStorageValue3", DEFAULT_CDB_SPEC_STORAGE_VALUE3));
+  
+       /* Reconstruction settings */
+       if(fAliReco) delete fAliReco;
+  
+       AliReconstruction* rec = new AliReconstruction;
+       
+       // QA options
+       rec->SetRunQA(fSettings->GetValue( "qa.runDetectors", DEFAULT_QA_RUN));
+       rec->SetRunGlobalQA(fSettings->GetValue( "qa.runGlobal", DEFAULT_QA_RUN_GLOBAL));
+       rec->SetQARefDefaultStorage(fSettings->GetValue( "qa.defaultStorage",DEFAULT_QAREF_STORAGE)) ;
+       rec->SetRunPlaneEff(fSettings->GetValue( "reco.runPlaneEff", DEFAULT_RECO_RUN_PLANE_EFF));
+
+       // AliReconstruction settings
+       rec->SetWriteESDfriend(fSettings->GetValue( "reco.writeESDfriend", DEFAULT_RECO_WRITE_ESDF));
+       rec->SetWriteAlignmentData(fSettings->GetValue( "reco.writeAlignment",DEFAULT_RECO_WRITE_ALIGN));
+       rec->SetInput(input); // reconstruct data from this input
+       rec->SetRunReconstruction(fSettings->GetValue( "reco.detectors", DEFAULT_RECO_DETECTORS));
+       rec->SetUseTrackingErrorsForAlignment("ITS"); //-- !should be set from conf file!
+
+       // switch off cleanESD
+       rec->SetCleanESD(fSettings->GetValue( "reco.cleanESD",DEFAULT_RECO_CLEAN_ESD));
+
+       fAliReco = rec;
+}
diff --git a/MONITOR/alieventserver/AliEventServerReconstruction.h b/MONITOR/alieventserver/AliEventServerReconstruction.h
new file mode 100644 (file)
index 0000000..1feee67
--- /dev/null
@@ -0,0 +1,55 @@
+// Author: Mihai Niculescu 2013
+
+/**************************************************************************
+ * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+#ifndef __AliRecoServer_H__
+#define __AliRecoServer_H__
+
+#include <TObjString.h>
+#include <TQObject.h>
+#include <RQ_OBJECT.h>
+#include <TThread.h>
+
+class TEnv;
+class AliCDBManager;
+class AliReconstruction;
+class AliRecoServerThread;
+
+class AliEventServerReconstruction : public TQObject
+{
+public:
+       AliEventServerReconstruction();
+       virtual ~AliEventServerReconstruction();
+
+       Bool_t StartReconstruction(Int_t run, const char* input="mem://@*:");
+       void  StopReconstruction();  
+       
+       // Closes the server. The server will no longer listen/serve
+       void Close();
+  
+       Bool_t IsListenning() const{return fIsListenning;}
+       Int_t GetRunId() const {return fCurrentRunId;}  
+private:
+    static void* Dispatch(void *arg){static_cast<AliEventServerReconstruction*>(arg)->ReconstructionHandle();}
+       void ReconstructionHandle();
+
+       Int_t RetrieveGRP(UInt_t run, TString &gdc);
+       void SetupReco(const char* input);
+
+       // thread shared
+       AliReconstruction *fAliReco;
+       AliCDBManager *fCDBmanager;
+       Int_t fCurrentRunId;
+       Bool_t fIsListenning;
+       TEnv *fSettings;
+       TString fHost;
+       TThread *fRecoThread;
+
+       AliEventServerReconstruction(const AliEventServerReconstruction&);
+       AliEventServerReconstruction& operator=(const AliEventServerReconstruction&);
+};
+#endif
similarity index 81%
rename from MONITOR/AliEventServerUtil.h
rename to MONITOR/alieventserver/AliEventServerUtil.h
index d052b67..b9cc9a0 100644 (file)
@@ -7,7 +7,7 @@
 //______________DEFAULT SETTINGS________________
 #define DEFAULT_SERVER_HOST "tcp://*"
 #define DEFAULT_SERVER_PORT 5024
-#define DEFAULT_SERVER_SAVE_RECO_DIR "opt/reco"
+#define DEFAULT_SERVER_SAVE_RECO_DIR "/opt/reco"
 #define DEFAULT_CDB_STORAGE "local:///opt/OCDB/2013"
 #define DEFAULT_CDB_SPEC_STORAGE_PATH1 "opt/reco/GRP/GRP/Data"
 #define DEFAULT_CDB_SPEC_STORAGE_VALUE1 ""
@@ -19,7 +19,7 @@
 #define DEFAULT_QAREF_STORAGE "local://$ALICE_ROOT/QAref"
 #define DEFAULT_QA_RUN_GLOBAL 1
 #define DEFAULT_RECO_RUN_PLANE_EFF 1
-#define DEFAULT_RECO_WRITE_ESDF 1
+#define DEFAULT_RECO_WRITE_ESDF 0
 #define DEFAULT_RECO_WRITE_ALIGN 1
 #define DEFAULT_RECO_CLEAN_ESD 0
 #define DEFAULT_RECO_DETECTORS "ALL -PHOS -EMCAL"
 #define DEFAULT_LOGBOOK_USER "dqm"
 #define DEFAULT_LOGBOOK_PASS "dqm123"
 
+#include <TSystem.h>
+#include <TString.h>
+
 namespace AliEventServerUtil
 {
-
 // return full path to the server configuration file
-const char* GetPathToServerConf();
+       inline const char* GetPathToServerConf()
+       {
+               return Form("%s/MONITOR/%s",
+                           gSystem->Getenv("ALICE_ROOT"),
+                           ALIEVENTSERVER_CONF);
+       }
 }
 
 #endif /* __ALIEVENTSERVER_UTIL_H__ */
similarity index 57%
rename from MONITOR/AliEventServerWindow.cxx
rename to MONITOR/alieventserver/AliEventServerWindow.cxx
index c519760..2b3d2bb 100644 (file)
 
 #include <AliLog.h>
 #include <AliReconstruction.h>
+#include <AliDimIntNotifier.h>
 
 #include "AliEventServerUtil.h"
 #include "AliEventServerWindow.h"
 #include "AliEventServerPreferencesWindow.h"
-#include "AliDimIntNotifier.h"
-#include "AliRecoServer.h"
+#include "AliEventServerReconstruction.h"
 
 //______________________________________________________________________________
 // Full description of AliEventServerWindow
 ClassImp(AliEventServerWindow)
 
 AliEventServerWindow::AliEventServerWindow() :
-  TGMainFrame(gClient->GetRoot(), 400, 400),
-  fRunList(0), 
-  fStartServButt(0), 
-  fStopServButt(0), 
-  fExitButt(0),
-  fRunRunning(0), 
-  fRecoServer(0)
+TGMainFrame(gClient->GetRoot(), 400, 400),
+       fRunList(0), 
+       fStartServButt(0), 
+       fStopServButt(0), 
+       fExitButt(0),
+       fRunRunning(0), 
+       fRecoServer(0)
 {
        SetCleanup(kDeepCleanup);
-
        SetupToolbar();
   
        fRunList = new TGListBox(this);
   
        AddFrame(fRunList,  new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY));
        
-  for(Int_t i=0; i<5; ++i)
-  {
-       fDimSORListener[i] = 0;
-       fDimEORListener[i] = 0;
-  }
+       for(Int_t i=0; i<5; ++i)
+       {
+               fDimSORListener[i] = 0;
+               fDimEORListener[i] = 0;
+       }
   
-  Connect("CloseWindow()", "AliEventServerWindow", this, "onExit()");
-  SetWindowName("ALICE Event Server");
+       Connect("CloseWindow()", "AliEventServerWindow", this, "onExit()");
+       SetWindowName("ALICE Event Server");
  
-  MapSubwindows();
-  Resize(250,300);
-  MapWindow();
+       MapSubwindows();
+       Resize(250,300);
+       MapWindow();
   
-  FillRunsFromDatabase();
-  InitDIMListeners();
+       FillRunsFromDatabase();
+       InitDIMListeners();
 }
 
 AliEventServerWindow::~AliEventServerWindow()
 {
-  // Destructor.
-       
        for (Int_t i = 0; i < 5; ++i)
        {
                if(fDimSORListener[i]) delete fDimSORListener[i];
@@ -84,28 +81,27 @@ AliEventServerWindow::~AliEventServerWindow()
                fDimSORListener[i] = 0;
                fDimEORListener[i] = 0;
        }
 }
 
 void AliEventServerWindow::InitDIMListeners()
 {
        // DIM interface.  
-   for (Int_t i = 0; i < 5; ++i)
-  {
-       if (i == 0)
-    {
-      fDimSORListener[i] = new AliDimIntNotifier("/LOGBOOK/SUBSCRIBE/DAQ_SOR_PHYSICS");
-      fDimEORListener[i] = new AliDimIntNotifier("/LOGBOOK/SUBSCRIBE/DAQ_EOR_PHYSICS");
-    }
-    else
-    {
-      fDimSORListener[i] = new AliDimIntNotifier(Form("/LOGBOOK/SUBSCRIBE/DAQ_SOR_PHYSICS_%d", i));
-      fDimEORListener[i] = new AliDimIntNotifier(Form("/LOGBOOK/SUBSCRIBE/DAQ_EOR_PHYSICS_%d", i));
-    }
+       for (Int_t i = 0; i < 5; ++i)
+       {
+               if (i == 0)
+               {
+                       fDimSORListener[i] = new AliDimIntNotifier("/LOGBOOK/SUBSCRIBE/DAQ_SOR_PHYSICS");
+                       fDimEORListener[i] = new AliDimIntNotifier("/LOGBOOK/SUBSCRIBE/DAQ_EOR_PHYSICS");
+               }
+               else
+               {
+                       fDimSORListener[i] = new AliDimIntNotifier(Form("/LOGBOOK/SUBSCRIBE/DAQ_SOR_PHYSICS_%d", i));
+                       fDimEORListener[i] = new AliDimIntNotifier(Form("/LOGBOOK/SUBSCRIBE/DAQ_EOR_PHYSICS_%d", i));
+               }
     
-    fDimSORListener[i]->Connect("DimMessage(Int_t)", "AliEventServerWindow", this, "StartOfRun(Int_t)");
-    fDimEORListener[i]->Connect("DimMessage(Int_t)", "AliEventServerWindow", this, "EndOfRun(Int_t)");
-  }
+               fDimSORListener[i]->Connect("DimMessage(Int_t)", "AliEventServerWindow", this, "StartOfRun(Int_t)");
+               fDimEORListener[i]->Connect("DimMessage(Int_t)", "AliEventServerWindow", this, "EndOfRun(Int_t)");
+       }
 
 }
 
@@ -124,33 +120,34 @@ void AliEventServerWindow::FillRunsFromDatabase()
 
        AliInfo(Form("connecting to %s", connStr.Data()) );
 
-  TSQLServer* server = TSQLServer::Connect(connStr.Data(), user.Data(), password.Data());
-  if (!server) {
-    AliWarning("ERROR: Could not connect to DAQ Logbook");
-    return;
-  }
-  TString sqlQuery;
-  TTimeStamp ts;
-  sqlQuery.Form("SELECT run FROM logbook WHERE DAQ_time_start > %u AND DAQ_time_end IS NULL AND `partition` REGEXP 'PHYSICS.*'",
-    (UInt_t)ts.GetSec()-86400);
-  TSQLResult* result = server->Query(sqlQuery);
-  if (!result)
-  {
-    AliWarning( Form("ERROR: Can't execute query <%s>!", sqlQuery.Data()) );
-    return;
-  }
-  if (result->GetRowCount() != 0)
-  {
-    for (Int_t iRow = 0; iRow < result->GetRowCount(); iRow++)
-    {
-      TSQLRow* row = result->Next();
-      TString runStr = row->GetField(0);
-      if (runStr.IsDigit())
-        StartOfRun(runStr.Atoi());
-      delete row;
-    }
-  }
-  delete result;
+       TSQLServer* server = TSQLServer::Connect(connStr.Data(), user.Data(), password.Data());
+       if (!server)
+       {
+               AliWarning("ERROR: Could not connect to DAQ Logbook");
+               return;
+       }
+       TString sqlQuery;
+       TTimeStamp ts;
+       sqlQuery.Form("SELECT run FROM logbook WHERE DAQ_time_start > %u AND DAQ_time_end IS NULL AND `partition` REGEXP 'PHYSICS.*'",
+                     (UInt_t)ts.GetSec()-86400);
+       TSQLResult* result = server->Query(sqlQuery);
+       if (!result)
+       {
+               AliWarning( Form("ERROR: Can't execute query <%s>!", sqlQuery.Data()) );
+               return;
+       }
+       if (result->GetRowCount() != 0)
+       {
+               for (Int_t iRow = 0; iRow < result->GetRowCount(); iRow++)
+               {
+                       TSQLRow* row = result->Next();
+                       TString runStr = row->GetField(0);
+                       if (runStr.IsDigit())
+                               StartOfRun(runStr.Atoi());
+                       delete row;
+               }
+       }
+       delete result;
 
 }
 
@@ -189,64 +186,65 @@ void AliEventServerWindow::HandleToolBarAction(Int_t id)
                onExit();
                break;
        }
-       
+       default:break;
        }
        
 }
 
 /*
-void AliEventServerWindow::FinishedReconstruction(Int_t status)
-{
+  void AliEventServerWindow::FinishedReconstruction(Int_t status)
+  {
 // Slot called on termination of child process.
-       Int_t run = fServer->GetRunId();
+Int_t run = fServer->GetRunId();
        
-  Info("FinishedReconstruction", "Reconstruction Thread finished \tRunId:%d \tstatus=%d", run, status);
+Info("FinishedReconstruction", "Reconstruction Thread finished \tRunId:%d \tstatus=%d", run, status);
 
-  mIntInt_i i =fRun2PidMap.find(run);
-  if (i != fRun2PidMap.end())
-  {
-    fRunList->RemoveEntry(run);
+mIntInt_i i =fRun2PidMap.find(run);
+if (i != fRun2PidMap.end())
+{
+fRunList->RemoveEntry(run);
     
-    // clean (remove) run's reconstructed directory
-    //gSystem->Exec(Form("rm -rf %s/reco/run%d_%d",gSystem->Getenv("ONLINERECO_BASE_DIR"),run,pid));
+// clean (remove) run's reconstructed directory
+//gSystem->Exec(Form("rm -rf %s/reco/run%d_%d",gSystem->Getenv("ONLINERECO_BASE_DIR"),run,pid));
       
-    if (status == 0)
-    {
-      fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED", run), run);
-    }
-    else
-    {
-      fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED [%d]", run, status), run);
-    }
-    fRunList->Layout();
+if (status == 0)
+{
+fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED", run), run);
+}
+else
+{
+fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED [%d]", run, status), run);
+}
+fRunList->Layout();
     
-  }
-  else
-  {
-    Warning("FinishedReconstruction", "Run number %d not registered.", run);
-  }
+}
+else
+{
+Warning("FinishedReconstruction", "Run number %d not registered.", run);
+}
 
 }
 */
-//------------------------------------------------------------------------------
-// Private methods
-//------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------
+ // Private methods
+ //------------------------------------------------------------------------------
 
 void AliEventServerWindow::StartReco(Int_t run)
 {
-  AliInfo(Form("Starting Reco for run %d", run));
+       AliInfo(Form("Starting Reco for run %d", run));
   
-  TString eventSource = Form("mem://%s/run%d", gSystem->Getenv("ONLINERECO_RAWFILES_DIR"), run);
+       TString eventSource = Form("mem://%s/run%d", gSystem->Getenv("ONLINERECO_RAWFILES_DIR"), run);
   
-  if(!fRecoServer) LaunchRecoServer();
+       if(!fRecoServer) LaunchRecoServer();
     
-  fRecoServer->StartReconstruction(run, eventSource.Data());
+       fRecoServer->StartReconstruction(run, eventSource.Data());
   
-  if(fRecoServer->IsListenning()){
-    fRunList->RemoveEntry(run);
-    fRunList->AddEntrySort(TString::Format("%-20d -- RUNNING", run), run);
-    fRunList->Layout();
-  }
+       if(fRecoServer->IsListenning())
+       {
+               fRunList->RemoveEntry(run);
+               fRunList->AddEntrySort(TString::Format("%-20d -- RUNNING", run), run);
+               fRunList->Layout();
+       }
 }
 
 
@@ -258,7 +256,7 @@ void AliEventServerWindow::StartOfRun(Int_t run)
 {
        if(run<=0) return;
 
-  // Slot called from DIM handler on start of run.
+       // Slot called from DIM handler on start of run.
        AliInfo(Form("called for Run %d ", run));
 
        fRunList->AddEntrySort(TString::Format("%d", run), run);
@@ -272,13 +270,13 @@ void AliEventServerWindow::EndOfRun(Int_t run)
 {
        if(run<=0) return;
        
-   // Slot called from DIM handler on stop of run.
+       // Slot called from DIM handler on stop of run.
        AliInfo(Form("called for Run %d", run) );
        if(fRecoServer) fRecoServer->StopReconstruction();
        
-  fRunList->RemoveEntry(run);
-  fRunList->Layout();
-  gClient->NeedRedraw(fRunList);
+       fRunList->RemoveEntry(run);
+       fRunList->Layout();
+       gClient->NeedRedraw(fRunList);
 }
 
 ///------------------------------------------------------------------------------
@@ -287,8 +285,8 @@ void AliEventServerWindow::EndOfRun(Int_t run)
 
 void AliEventServerWindow::onStartServer()
 {
-  // Slot called from Start button.
-  AliInfo("Starting server...");
+       // Slot called from Start button.
+       AliInfo("Starting server...");
        if(fRecoServer!=0) StopRecoServer();
        
        LaunchRecoServer();
@@ -296,7 +294,7 @@ void AliEventServerWindow::onStartServer()
 
 void AliEventServerWindow::onStopServer()
 {
-  // Slot called from Stop button.
+       // Slot called from Stop button.
        AliInfo("Closing server...");
        
        StopRecoServer();
@@ -314,7 +312,7 @@ void AliEventServerWindow::onExit()
 
 void AliEventServerWindow::LaunchRecoServer()
 {
-       fRecoServer = new AliRecoServer;                
+       fRecoServer = new AliEventServerReconstruction();               
 }
 
 bool AliEventServerWindow::StopRecoServer()
diff --git a/MONITOR/alieventserver/AliEventServerWindow.h b/MONITOR/alieventserver/AliEventServerWindow.h
new file mode 100644 (file)
index 0000000..8d92733
--- /dev/null
@@ -0,0 +1,87 @@
+// Author: Mihai Niculesu 2013
+
+/**************************************************************************
+ * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifndef AliEventServerWindow_H
+#define AliEventServerWindow_H
+
+#include <TObject.h>
+#include <TString.h>
+#include <TGFrame.h>
+#include <TGLabel.h>
+
+class TGTextButton;
+class TGCheckButton;
+class TGListBox;
+
+class AliEventServerReconstruction;
+class AliDimIntNotifier;
+
+//______________________________________________________________________________
+// Short description of AliEventServerWindow
+//
+
+class AliEventServerWindow : public TGMainFrame
+{
+public:
+       enum TOOLBUTTON{
+               TOOLBUTTON_START=1,
+               TOOLBUTTON_STOP,
+               TOOLBUTTON_PREFERENCES,
+               TOOLBUTTON_EXIT         
+       };
+  
+       AliEventServerWindow();
+       virtual ~AliEventServerWindow();
+
+       //-------------------------------------------------------
+       // Handlers of DIM signals.
+       //-------------------------------------------------------
+
+       void StartOfRun(Int_t run);
+       void EndOfRun(Int_t run);
+  
+       //-------------------------------------------------------
+       // Handlers of button signals.
+       //-------------------------------------------------------
+       void onStartServer();
+       void onStopServer();
+       void onExit();
+
+       void HandleToolBarAction(Int_t id=-1);
+
+private:
+
+       void InitDIMListeners();
+       void FillRunsFromDatabase();
+       void SetupToolbar();
+       
+       void LaunchRecoServer();        
+       void StartReco(Int_t run);
+       bool StopRecoServer();
+       
+       // GUI components.
+       TGListBox     *fRunList;    // List-box for listing current runs.
+       TGTextButton  *fStartServButt;  // Start server for selected run.
+       TGTextButton  *fStopServButt;   // Close server for selected run.
+       TGTextButton  *fExitButt;   // Close server and do Exit.
+  
+       // DIM interface. Could do without members and just leak them ...
+       AliDimIntNotifier *fDimSORListener[5]; // DIM listeners for SOR.
+       AliDimIntNotifier *fDimEORListener[5]; // DIM listeners for EOR.
+
+       // server state & process management
+       Int_t fRunRunning;   // Run which is executed.
+       AliEventServerReconstruction* fRecoServer;
+
+
+       AliEventServerWindow(const AliEventServerWindow&);
+       AliEventServerWindow& operator=(const AliEventServerWindow&);
+       ClassDef(AliEventServerWindow, 0);
+};
+
+#endif
similarity index 95%
rename from MONITOR/CMakebinalieventserver.pkg
rename to MONITOR/alieventserver/CMakebinalieventserver.pkg
index f163a98..fb629a5 100644 (file)
@@ -25,7 +25,7 @@
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS  alieventserver.cxx)
+set ( SRCS  alieventserver/alieventserver.cxx)
 
 set ( EINCLUDE ${EINCLUDE}  TPC ITS RAW)
 
@@ -33,7 +33,7 @@ set ( PACKBLIBS  ${ROOTCLIBS} ${SYSLIBS})
 
 set ( ELIBSDIR )
 
-set ( ELIBS MUONevaluation MUONmapping MUONshuttle MUONgraphics MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCbase TPCsim TPCrec ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec FASTSIM microcern HLTbase TRIGGERbase STEER STAT CDB AOD  STEERBase ESD ANALYSIS RAWDatasim RAWDatarec RAWDatabase)
+set ( ELIBS MUONevaluation MUONmapping MUONshuttle MUONgraphics MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCbase TPCsim TPCrec ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec FASTSIM microcern HLTbase TRIGGERbase STEER STAT CDB AOD  STEERBase ESD ANALYSIS RAWDatasim RAWDatarec RAWDatabase MONITOR MONITORzmq)
 
 if(PYTHIA6)
   list(APPEND ELIBS EVGEN HepMC HepMCParser)
@@ -70,8 +70,9 @@ list(APPEND SRCS ${GFILES})
 set ( SHLIBS  ${BINLIBDIRS} EVGEN -lEGPythia6 Pythia6 -lpythia6 AliPythia6 lhapdf THijing hijing THerwig herwig TPHIC FASTSIM microcern)
 
 set ( EINCLUDE STEER/STEER )
-set ( ELIBS ${ELIBS} MONITOR MONITORzmq )
+set ( ELIBS ${ELIBS} MONITOR)
 
+set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lMONITOR -lMONITORzmq ${SYSLIBS} )
 
 set ( DATE_ROOT $ENV{DATE_ROOT})
 
similarity index 95%
rename from MONITOR/alieventserver.cxx
rename to MONITOR/alieventserver/alieventserver.cxx
index affed46..96b82cc 100644 (file)
@@ -16,8 +16,7 @@ int main(int argc, char **argv)
   AliEventServerWindow *win = new AliEventServerWindow;
   app.Run(kTRUE);
   
-  if(win) delete win;
-  win=0;
+  if(win){delete win;}
   
   return 0;
 }
similarity index 96%
rename from MONITOR/alieventserver.rootrc
rename to MONITOR/alieventserver/alieventserver.rootrc
index da80b89..0744efe 100644 (file)
@@ -12,7 +12,7 @@ qa.runDetectors:                         :
 qa.defaultStorage:                       local://$ALICE_ROOT/QAref
 qa.runGlobal:                            1
 reco.runPlaneEff:                        1
-reco.writeESDfriend:                     1
+reco.writeESDfriend:                     0
 reco.writeAlignment:                     1
 reco.cleanESD:                           0
 reco.detectors:                          ALL  -PHOS -EMCAL
@@ -4,14 +4,12 @@
 #include "AliStorageAdministratorPanelSetStorageParams.h"
 #include "AliESDEvent.h"
 
-#include "zmq.hpp"
-#include <iostream>
 #include <fstream>
+#include <iostream>
 
 #include <TGMenu.h>
 
 using namespace std;
-using namespace zmq;
 
 ClassImp(AliStorageAdministratorPanel);
 
@@ -55,84 +53,21 @@ AliStorageAdministratorPanel::AliStorageAdministratorPanel() :
        fRemoveEvents(0),
        fEventsInChunk(0),
        fCommunicationThread(0),
-       fCommunicationContext(0),
-       fCommunicationSocket(0),
-       fStorageServer(""),
-       fServerContext(0),
-       fServerSocket(0),
+       fCommunicationSocket(CLIENT_COMMUNICATION_REQ),
+       fServerSocket(SERVER_COMMUNICATION_REQ),
        fEventManager(0)
 {
        InitWindow();
-
-    //read config file
-    TThread::Lock();
-       ifstream configFile (Form("%s/STORAGE/setupStorageDatabase.sh",
-                              gSystem->Getenv("ALICE_ROOT")));
-    
-       if (configFile.is_open())
-       {
-               string line;
-               int from,to;
-               while(configFile.good())
-               {
-                       getline(configFile,line);
-                       from = line.find("\"")+1;
-                       to = line.find_last_of("\"");
-                       if(line.find("STORAGE_SERVER=")==0)
-                       {
-                               fStorageServer=line.substr(from,to-from);
-                       }
-               }
-               if(configFile.eof())
-               {
-                       configFile.clear();
-               }
-               configFile.close();
-       }
-       else
-       {
-               cout<<"ADMIN -- Unable to open config file"<<endl;
-       }
-       TThread::UnLock();
     
        //create event manager
-       fEventManager = new AliStorageEventManager();
-       
-       //start communication with server
-       fServerContext = new context_t(1);
-       fServerSocket = new socket_t(*fServerContext,ZMQ_REQ);
-       fServerSocket->connect(Form("tcp://%s:%d",fStorageServer.c_str(),gServerCommunicationPort));
-
-       
-       int linger = 0;
-       fServerSocket->setsockopt (ZMQ_LINGER, &linger, sizeof(linger));
-       
-       if(fServerSocket)
-       {
-               cout<<"\nADMIN -- Connected to server socket"<<endl;
-       }
-       else
-       {
-               cout<<"ADMIN -- ERROR - could not connect to server's socket"<<endl;
-       }
+       fEventManager = AliStorageEventManager::GetEventManagerInstance();
+       fEventManager->CreateSocket(fServerSocket);
+       fEventManager->CreateSocket(fCommunicationSocket);
 
-       //start communication with client
-       fCommunicationContext = new context_t(1);
-       fCommunicationSocket = new socket_t(*fCommunicationContext,ZMQ_REQ);
-       fCommunicationSocket->connect(Form("tcp://%s:%d",fStorageServer.c_str(), gClientCommunicationPort));
-       if(fCommunicationSocket)
-       {
-               cout<<"\nADMIN -- Connected to client communication socket:"<<Form("tcp://%s:%d",fStorageServer.c_str(), gClientCommunicationPort)<<endl;
-       }
-       else
-       {
-               cout<<"ADMIN -- ERROR - could not connect to client's communication socket"<<endl;
-       }
+       // start communication with client thread
        fCommunicationThread = new TThread("fCommunicationThread",
-                                          AliStorageAdministratorPanel::CheckStateHandler,(void*)this);
+                                       Dispatch,(void*)this);
        fCommunicationThread->Run();
-       
-
 }
 
 AliStorageAdministratorPanel::~AliStorageAdministratorPanel()
@@ -141,57 +76,46 @@ AliStorageAdministratorPanel::~AliStorageAdministratorPanel()
        cout<<" --- OK"<<endl;
 }
 
-void* AliStorageAdministratorPanel::CheckStateHandler(void *arg)//ask client about its state
+void AliStorageAdministratorPanel::CheckStateHandle()//ask client about its state
 {
-       AliStorageAdministratorPanel *panelInstance = static_cast<AliStorageAdministratorPanel*>(arg);
-
-
-       while(!(panelInstance->fPanelQuited))
+       while(!fPanelQuited)
        {
-               panelInstance->CheckClientState(REQUEST_CONNECTION);
+               CheckClientState(REQUEST_CONNECTION);
                sleep(1);
-               panelInstance->CheckClientState(REQUEST_RECEIVING);
+               CheckClientState(REQUEST_RECEIVING);
                sleep(1);
-               panelInstance->CheckClientState(REQUEST_SAVING);
+               CheckClientState(REQUEST_SAVING);
                sleep(1);
-               panelInstance->CheckClientState(REQUEST_CURRENT_SIZE);
+               CheckClientState(REQUEST_CURRENT_SIZE);
                sleep(1);
-               panelInstance->CheckClientState(REQUEST_GET_PARAMS);
+               CheckClientState(REQUEST_GET_PARAMS);
                sleep(1);
        }
-       return NULL;
 }
 
 void AliStorageAdministratorPanel::CheckClientState(int option)
 {
-       pollitem_t items[1] =  {{*fCommunicationSocket,0,ZMQ_POLLIN,0}} ;
-
        struct clientRequestStruct *request = new struct clientRequestStruct;
        request->messageType = option;
-
-       char *buffer  = (char*)(request);
-       message_t *message = new message_t((void*)buffer,
-                                          sizeof(struct clientRequestStruct),0);
-       fCommunicationSocket->send(*message);
-       if(poll (&items[0], 1, 10000)==0)
+       if(!fEventManager->Send(request,fCommunicationSocket,10000))
        {
                SetLabel(fConnectionLabel,STATUS_DOWN);
                SetLabel(fDataLabel,STATUS_DOWN);
                SetLabel(fSavingLabel,STATUS_DOWN);
                cout<<"ADMIN -- CLIENT IS DOWN"<<endl;
+               return;
        }
 
-       message_t *responseMessage = new message_t;
        long response = -1;
-       fCommunicationSocket->recv(responseMessage);    
        struct clientRequestStruct *responseParams = NULL;
+       
        if(option == REQUEST_GET_PARAMS)
        {
-               responseParams = static_cast<struct clientRequestStruct*>(responseMessage->data());
+               responseParams = fEventManager->GetClientStruct(fCommunicationSocket);
        }
        else
        {
-               response = atoi(static_cast<char*>(responseMessage->data()));
+               response = fEventManager->GetLong(fCommunicationSocket);
        }
        switch(option)
        {
@@ -405,16 +329,14 @@ void AliStorageAdministratorPanel::onServerListEvents()
 {
        AliStorageAdministratorPanelListEvents *listEventsWindow =
                AliStorageAdministratorPanelListEvents::GetInstance();
-
-       listEventsWindow->SetSocket(fServerSocket);
+       if(listEventsWindow){cout<<"List events window created"<<endl;}
 }
 
 void AliStorageAdministratorPanel::onServerMarkEvent()
 {
        AliStorageAdministratorPanelMarkEvent *markEventWindow =
                AliStorageAdministratorPanelMarkEvent::GetInstance();
-
-       markEventWindow->SetSocket(fServerSocket);
+       if(markEventWindow){cout<<"Mark event window created"<<endl;}
 }
 
 void AliStorageAdministratorPanel::onClientSetParams()
@@ -3,12 +3,6 @@
 
 #include "AliStorageEventManager.h"
 
-namespace zmq
-{
-       class context_t;
-       class socket_t;
-}
-
 #include <TGFrame.h>
 #include <TGLabel.h>
 #include <TThread.h>
@@ -67,14 +61,12 @@ private:
         
        //socket connection
        TThread *fCommunicationThread;
-       zmq::context_t *fCommunicationContext;
-       zmq::socket_t *fCommunicationSocket;
-       std::string fStorageServer;
-       static void* CheckStateHandler(void *arg);
+       storageSockets fCommunicationSocket;
+    static void* Dispatch(void *arg){static_cast<AliStorageAdministratorPanel*>(arg)->CheckStateHandle();}
+       void CheckStateHandle();
        void CheckClientState(int option);
        
-       zmq::context_t *fServerContext;
-       zmq::socket_t *fServerSocket;//socket for two-way communication with AliStorageServerThread
+       storageSockets fServerSocket;//socket for two-way communication with AliStorageServerThread
        AliStorageEventManager *fEventManager;
 
        AliStorageAdministratorPanel(const AliStorageAdministratorPanel&);
@@ -8,10 +8,7 @@
 #include <TGButton.h>
 #include <TGFrame.h>
 
-#include "zmq.hpp"
-
 using namespace std;
-using namespace zmq;
 
 AliStorageAdministratorPanelListEvents *AliStorageAdministratorPanelListEvents::fInstance=0;
 
@@ -27,7 +24,8 @@ enum BUTTON{
        BUTTON_CHECK_PBPB,
        BUTTON_CHECK_TEMP,
        BUTTON_CHECK_PERM,
-       BUTTON_MARK_EVENT
+       BUTTON_MARK_EVENT,
+    BUTTON_LOAD_EVENT
 };
 
 enum TEXTENTRY{
@@ -54,17 +52,17 @@ AliStorageAdministratorPanelListEvents::AliStorageAdministratorPanelListEvents()
        fPermCheckButton(0),
        fEventsList(0),
        fEventsListVector(0),
-       fServerSocket(0),
+       fServerSocket(SERVER_COMMUNICATION_REQ),
        fEventManager(0)
 {
-       fEventManager = new AliStorageEventManager();
+       fEventManager = AliStorageEventManager::GetEventManagerInstance();
+       fEventManager->CreateSocket(fServerSocket);
        InitWindow();
 }
 
 AliStorageAdministratorPanelListEvents::~AliStorageAdministratorPanelListEvents()
 {
        cout<<"ADMIN PANEL -- List events descructor called";
-//     DestroyWindow();
        cout<<" --- OK"<<endl;
 }
 
@@ -74,9 +72,10 @@ AliStorageAdministratorPanelListEvents* AliStorageAdministratorPanelListEvents::
        return fInstance;
 }
 
-void AliStorageAdministratorPanelListEvents::SetSocket(socket_t *socket)
+
+void AliStorageAdministratorPanelListEvents::SelectedEvent()
 {
-       fServerSocket = socket;
+    Emit("SelectedEvent()");
 }
 
 void AliStorageAdministratorPanelListEvents::InitWindow()
@@ -191,6 +190,9 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
        AddFrame(new TGTextButton(this,"Mark selected event",BUTTON_MARK_EVENT),
                 new TGLayoutHints(kLHintsRight));
 
+    AddFrame(new TGTextButton(this,"Load event",BUTTON_LOAD_EVENT),
+             new TGLayoutHints(kLHintsRight));
+    
 
        //event's list
        fEventsList = new TGListBox(this,0);
@@ -316,12 +318,9 @@ void AliStorageAdministratorPanelListEvents::onMarkButton()
 
        fEventManager->Send(requestMessage,fServerSocket);
 
-       message_t *response = new message_t();
-       fServerSocket->recv(response);
-       char *result = (char*)response->data();
-       //if(response)delete response;
-       
-       if(!strcmp("true",result))
+       bool response = fEventManager->GetBool(fServerSocket);
+               
+       if(response)
        {
                fStatusLabel->SetText("Event marked");
                cout<<"ADMIN PANEL -- Event marked succesfully"<<endl;
@@ -333,6 +332,36 @@ void AliStorageAdministratorPanelListEvents::onMarkButton()
        }
 }
 
+void AliStorageAdministratorPanelListEvents::onLoadButton()
+{
+    int selectedEventNumber = fEventsList->GetSelected()-1;
+    int runNumber=fEventsListVector[selectedEventNumber].runNumber;
+    int eventNumber=fEventsListVector[selectedEventNumber].eventNumber;
+    
+    
+    struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
+    struct eventStruct eventToLoad;
+    eventToLoad.runNumber = runNumber;
+    eventToLoad.eventNumber = eventNumber;
+    requestMessage->messageType = REQUEST_GET_EVENT;
+    requestMessage->event = eventToLoad;
+    
+    fEventManager->Send(requestMessage,fServerSocket);
+    AliESDEvent *resultEvent = fEventManager->GetEvent(fServerSocket);
+    
+    if(resultEvent)
+    {
+        cout<<"ADMIN -- received event"<<endl;
+        fCurrentEvent = resultEvent;
+    }
+    else
+    {
+        cout<<"ADMIN -- received no event"<<endl;
+    }
+
+    SelectedEvent();
+}
+
 void AliStorageAdministratorPanelListEvents::onCloseButton(){onExit();}
 void AliStorageAdministratorPanelListEvents::CloseWindow(){onExit();}
 
@@ -356,6 +385,7 @@ Bool_t AliStorageAdministratorPanelListEvents::ProcessMessage(Long_t msg, Long_t
                        case BUTTON_CLOSE:onCloseButton();break;
                        case BUTTON_GET_LIST:onGetListButton();break;
                        case BUTTON_MARK_EVENT:onMarkButton();break;
+            case BUTTON_LOAD_EVENT:onLoadButton();break;
                        default:break;
                        }
                        break;
@@ -7,23 +7,23 @@
 #include <TGLabel.h>
 #include <TGNumberEntry.h>
 #include <TGListBox.h>
-
-namespace zmq
-{
-       class socket_t;
-}
+#include <TQObject.h>
 
 class AliStorageAdministratorPanelListEvents : public TGMainFrame
 {
 public:
        static AliStorageAdministratorPanelListEvents* GetInstance();
-       void SetSocket(zmq::socket_t *socket);
+    AliESDEvent* GetSelectedEvent(){return fCurrentEvent;}
+       void onExit();
+    void SelectedEvent(); //*SIGNAL*
 private:
        AliStorageAdministratorPanelListEvents();
        virtual ~AliStorageAdministratorPanelListEvents();
        
        static AliStorageAdministratorPanelListEvents *fInstance;
        
+    
+    
        //gui components and methods
        TGLabel *fStatusLabel;
        TGNumberEntry *fRunNumberMinEntry;
@@ -44,15 +44,17 @@ private:
        void onCloseButton();
        void onGetListButton();
        void onMarkButton();
-       void onExit();
+    void onLoadButton();
 
        std::vector<serverListStruct> fEventsListVector;
 
        virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t);
        void CloseWindow();
 
-       zmq::socket_t *fServerSocket;
+       storageSockets fServerSocket;
        AliStorageEventManager *fEventManager;
+    
+    AliESDEvent *fCurrentEvent;
        
        AliStorageAdministratorPanelListEvents(const AliStorageAdministratorPanelListEvents&);
        AliStorageAdministratorPanelListEvents& operator=(const AliStorageAdministratorPanelListEvents&);
@@ -2,13 +2,11 @@
 #include "AliStorageTypes.h"
 
 #include <iostream>
-#include "zmq.hpp"
 
 #include <TGFrame.h>
 #include <TGButton.h>
 
 using namespace std;
-using namespace zmq;
 
 AliStorageAdministratorPanelMarkEvent *AliStorageAdministratorPanelMarkEvent::fInstance=0;
 
@@ -32,21 +30,17 @@ AliStorageAdministratorPanelMarkEvent::AliStorageAdministratorPanelMarkEvent() :
        fStatusLabel(0),
        fRunNumberEntry(0),
        fEventNumberEntry(0),
-       fServerSocket(0),
+       fServerSocket(SERVER_COMMUNICATION_REQ),
        fEventManager(0)
 {
-       fEventManager = new AliStorageEventManager();
+       fEventManager = AliStorageEventManager::GetEventManagerInstance();
+       fEventManager->CreateSocket(fServerSocket);
        InitWindow();
 }
 
 AliStorageAdministratorPanelMarkEvent::~AliStorageAdministratorPanelMarkEvent()
 {
        cout<<"ADMIN PANEL -- Mark Window descructor called";
-//     if(fStatusLabel)delete fStatusLabel;
-//     if(fRunNumberEntry)delete fRunNumberEntry;
-//     if(fEventNumberEntry)delete fEventNumberEntry;
-       //if(fServerSocket)delete fServerSocket;
-//     DestroyWindow();
        cout<<" --- OK"<<endl;
 }
 
@@ -56,11 +50,6 @@ AliStorageAdministratorPanelMarkEvent* AliStorageAdministratorPanelMarkEvent::Ge
        return fInstance;
 }
 
-void AliStorageAdministratorPanelMarkEvent::SetSocket(socket_t *socket)
-{
-       fServerSocket = socket;
-}
-
 void AliStorageAdministratorPanelMarkEvent::InitWindow()
 {
        SetCleanup(kDeepCleanup);
@@ -123,12 +112,9 @@ void AliStorageAdministratorPanelMarkEvent::onMarkButton()
        requestMessage->event = mark;
 
        fEventManager->Send(requestMessage,fServerSocket);
-
-       message_t *response = new message_t();
-       fServerSocket->recv(response);
-       char *result = (char*)response->data();
+       bool response = fEventManager->GetBool(fServerSocket);
        
-       if(!strcmp("true",result))
+       if(response)
        {
                fStatusLabel->SetText("Event marked");
                cout<<"ADMIN PANEL -- Event marked succesfully"<<endl;
@@ -7,16 +7,10 @@
 #include <TGNumberEntry.h>
 #include <TG3DLine.h>
 
-namespace zmq
-{
-       class socket_t;
-}
-
 class AliStorageAdministratorPanelMarkEvent : public TGMainFrame
 {
 public:
        static AliStorageAdministratorPanelMarkEvent* GetInstance();
-       void SetSocket(zmq::socket_t *socket);
 private:
        AliStorageAdministratorPanelMarkEvent();
        virtual ~AliStorageAdministratorPanelMarkEvent();
@@ -36,7 +30,7 @@ private:
        virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t);
        void CloseWindow();
 
-       zmq::socket_t *fServerSocket;
+       storageSockets fServerSocket;
        AliStorageEventManager *fEventManager;
        
        AliStorageAdministratorPanelMarkEvent(const AliStorageAdministratorPanelMarkEvent&);
@@ -2,13 +2,11 @@
 #include "AliStorageTypes.h"
 
 #include <iostream>
-#include "zmq.hpp"
 
 #include <TGFrame.h>
 #include <TGButton.h>
 
 using namespace std;
-using namespace zmq;
 
 AliStorageAdministratorPanelSetStorageParams *AliStorageAdministratorPanelSetStorageParams::fInstance=0;
 
@@ -36,10 +34,11 @@ AliStorageAdministratorPanelSetStorageParams::AliStorageAdministratorPanelSetSto
        fMaxOccupationEntry(0),
        fRemoveEventsEntry(0),
        fEventsInChunkEntry(0),
-       fClientSocket(0),
+       fClientSocket(CLIENT_COMMUNICATION_REQ),
        fEventManager(0)
 {
-       fEventManager = new AliStorageEventManager();
+       fEventManager = AliStorageEventManager::GetEventManagerInstance();
+       fEventManager->CreateSocket(fClientSocket);
        InitWindow();
 }
 
@@ -51,7 +50,7 @@ AliStorageAdministratorPanelSetStorageParams* AliStorageAdministratorPanelSetSto
        return fInstance;
 }
 
-void AliStorageAdministratorPanelSetStorageParams::Setup(socket_t *socket, int maxStorageSize, int maxOccupation, int removeEvents, int eventsInChunk)
+void AliStorageAdministratorPanelSetStorageParams::Setup(storageSockets socket, int maxStorageSize, int maxOccupation, int removeEvents, int eventsInChunk)
 {
        fClientSocket = socket;
        fMaxStorageSizeEntry->SetIntNumber(maxStorageSize);
@@ -144,12 +143,9 @@ void AliStorageAdministratorPanelSetStorageParams::onSetParamsButton()
        requestMessage->eventsInChunk = fEventsInChunkEntry->GetIntNumber();
 
        fEventManager->Send(requestMessage,fClientSocket);
-
-       message_t *response = new message_t();
-       fClientSocket->recv(response);
-       char *result = (char*)response->data();
+       bool response = fEventManager->GetBool(fClientSocket);
        
-       if(!strcmp("true",result))
+       if(response)
        {
                fStatusLabel->SetText("Params set");
                cout<<"ADMIN PANEL -- Params set succesfully"<<endl;
@@ -7,16 +7,11 @@
 #include <TGNumberEntry.h>
 #include <TG3DLine.h>
 
-namespace zmq
-{
-       class socket_t;
-}
-
 class AliStorageAdministratorPanelSetStorageParams : public TGMainFrame
 {
 public:
        static AliStorageAdministratorPanelSetStorageParams* GetInstance();
-       void Setup(zmq::socket_t *socket,
+       void Setup(storageSockets socket,
                   int maxStorageSize,
                   int maxOccupation,
                   int removeEvents,
@@ -42,7 +37,7 @@ private:
        virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t);
        void CloseWindow();
        
-       zmq::socket_t *fClientSocket;
+       storageSockets fClientSocket;
        AliStorageEventManager *fEventManager;
 
        AliStorageAdministratorPanelSetStorageParams(const AliStorageAdministratorPanelSetStorageParams&);
similarity index 75%
rename from STORAGE/AliStorageClientThread.cxx
rename to MONITOR/alistoragemanager/AliStorageClientThread.cxx
index 3be9465..76d2efb 100644 (file)
@@ -1,12 +1,8 @@
 #include "AliStorageClientThread.h"
 #include "AliMultiplicity.h"
 #include "AliStorageTypes.h"
-#include "AliSocket.h"
 #include "AliStorageEventManager.h"
 
-//#include "zhelpers.hpp"
-#include "zmq.hpp"
-
 #include <sstream>
 #include <signal.h>
 #include <fstream>
@@ -17,7 +13,6 @@
 #include <TFile.h>
 
 using namespace std;
-using namespace zmq;
 
 bool gClientQuit = false;    // signal flag
 void GotSignalClient(int){gClientQuit = true;}
@@ -26,7 +21,6 @@ AliStorageClientThread::AliStorageClientThread() :
 fConnectionStatus(STATUS_WAITING),
 fReceivingStatus(STATUS_WAITING),
 fSavingStatus(STATUS_WAITING),
-fEventServer(""),
 fCommunicationThread(0),
 fCurrentFile(0),
 fDatabase(0),
@@ -46,8 +40,7 @@ fRemoveEventsPercentage(0)
        
        //load storage parameters from file
        TThread::Lock();
-       ifstream configFile (Form("%s/STORAGE/setupStorageDatabase.sh",
-                                 gSystem->Getenv("ALICE_ROOT")));
+       ifstream configFile (GetConfigFilePath());
        if (configFile.is_open())
        {
                string line;
@@ -77,10 +70,6 @@ fRemoveEventsPercentage(0)
                        {
                                fNumberOfEventsInFile=atoi(line.substr(from,to-from).c_str());
                        }
-            else if(line.find("EVENT_SERVER=")==0)
-                       {
-                               fEventServer=line.substr(from,to-from);
-                       }
                }
                if(configFile.eof())
                {
@@ -104,7 +93,7 @@ fRemoveEventsPercentage(0)
 
        //create two-way commynication thread
        fCommunicationThread = new TThread("fCommunicationThread",
-                                          AliStorageClientThread::CommunicationHandler,(void*)this);
+                                       Dispatch,(void*)this);
        fCommunicationThread->Run();
 }
 
@@ -120,69 +109,59 @@ AliStorageClientThread::~AliStorageClientThread()
        cout<<" --- OK"<<endl;
 }
 
-void* AliStorageClientThread::CommunicationHandler(void *arg)
+void AliStorageClientThread::CommunicationHandle()
 {
-       AliStorageClientThread *clientInstance = static_cast<AliStorageClientThread*>(arg);
-
-//create socket for two-way communication
-       context_t *context = new context_t();
-        socket_t *socket = new socket_t(*context,ZMQ_REP);
-       socket->bind(Form("tcp://*:%d",gClientCommunicationPort));      
-
-       AliStorageEventManager *eventManager = new AliStorageEventManager();
+       AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
+       storageSockets socket = CLIENT_COMMUNICATION_REP;
+       eventManager->CreateSocket(socket);
        
-       message_t *requestMessage = new message_t();
-       struct clientRequestStruct *request = new struct clientRequestStruct;
+       struct clientRequestStruct *request;
        struct clientRequestStruct *response = new struct clientRequestStruct;
 
        cout<<"CLIENT -- Communication stated"<<endl;
        
        while(!gClientQuit)
        {
-               socket->recv(requestMessage);
-               request = static_cast<struct clientRequestStruct*>(requestMessage->data());
+               request = eventManager->GetClientStruct(socket);
                switch(request->messageType)
                {
                case REQUEST_CONNECTION:
-                       eventManager->Send((long)clientInstance->fConnectionStatus,socket);
+                       eventManager->Send((long)fConnectionStatus,socket);
                        break;
                case REQUEST_RECEIVING:
-                       eventManager->Send((long)clientInstance->fReceivingStatus,socket);
+                       eventManager->Send((long)fReceivingStatus,socket);
                        break;
                case REQUEST_SAVING:
-                       eventManager->Send((long)clientInstance->fSavingStatus,socket);
+                       eventManager->Send((long)fSavingStatus,socket);
                        break;
                case REQUEST_CURRENT_SIZE:
-                       eventManager->Send((long)clientInstance->fCurrentStorageSize,socket);
+                       eventManager->Send((long)fCurrentStorageSize,socket);
                        break;
                case REQUEST_GET_PARAMS:
-                       response->maxStorageSize = clientInstance->fMaximumStorageSize;
-                       response->maxOccupation = clientInstance->fStorageOccupationLevel;
-                       response->removeEvents = clientInstance->fRemoveEventsPercentage;
-                       response->eventsInChunk = clientInstance->fNumberOfEventsInFile;
+                       response->maxStorageSize = fMaximumStorageSize;
+                       response->maxOccupation = fStorageOccupationLevel;
+                       response->removeEvents = fRemoveEventsPercentage;
+                       response->eventsInChunk = fNumberOfEventsInFile;
 
                        eventManager->Send(response,socket);
                        break;
                case REQUEST_SET_PARAMS:
-                       clientInstance->SetStorageParams(request->maxStorageSize,
-                                                        request->maxOccupation,
-                                                        request->removeEvents,
-                                                        request->eventsInChunk);
+                       SetStorageParams(request->maxStorageSize,
+                                        request->maxOccupation,
+                                        request->removeEvents,
+                                        request->eventsInChunk);
 
-                       clientInstance->fMaximumStorageSize = request->maxStorageSize;
-                       clientInstance->fStorageOccupationLevel = request->maxOccupation;
-                       clientInstance->fRemoveEventsPercentage = request->removeEvents;
-                       clientInstance->fNumberOfEventsInFile = request->eventsInChunk;
+                       fMaximumStorageSize = request->maxStorageSize;
+                       fStorageOccupationLevel = request->maxOccupation;
+                       fRemoveEventsPercentage = request->removeEvents;
+                       fNumberOfEventsInFile = request->eventsInChunk;
 
                        eventManager->Send(true,socket);
                        break;
                default:break;
                }
+               delete request;
        }
-       if(context){delete context;}
-       if(socket){delete socket;}
-       if(eventManager){delete eventManager;}
-       return nullptr;
 }
 
 void AliStorageClientThread::SetStorageParams(int maxStorageSize,int maxOccupation,int removeEvents,int eventsInChunk)
@@ -191,8 +170,7 @@ void AliStorageClientThread::SetStorageParams(int maxStorageSize,int maxOccupati
 
 
        TThread::Lock();
-       ifstream configFile (Form("%s/STORAGE/setupStorageDatabase.sh",
-                                 gSystem->Getenv("ALICE_ROOT")));
+       ifstream configFile (GetConfigFilePath());
        ofstream tmpFile("tmpFile.bla");
        
        if (configFile.is_open())
@@ -231,8 +209,7 @@ void AliStorageClientThread::SetStorageParams(int maxStorageSize,int maxOccupati
                }
                configFile.close();
                tmpFile.close();
-               rename("tmpFile.bla",Form("%s/STORAGE/setupStorageDatabase.sh",
-                                         gSystem->Getenv("ALICE_ROOT")));
+               rename("tmpFile.bla",GetConfigFilePath());
        }
        else
        {
@@ -277,10 +254,12 @@ Long64_t AliStorageClientThread::GetSizeOfAllChunks()
                                        if(!chunk->IsDirectory() && chunkFileName.find("chunk")==0)
                                        {
                                                TFile *tmpFile = new TFile(Form("%s/%s/%s",fStoragePath.c_str(),directoryName.c_str(),chunkFileName.c_str()),"read");
-
-                                               totalStorageSize+=tmpFile->GetSize();
-                                               tmpFile->Close();
-                                               if(tmpFile){delete tmpFile;}
+                                               if(tmpFile)
+                                               {
+                                                       totalStorageSize+=tmpFile->GetSize();
+                                                       tmpFile->Close();
+                                                       delete tmpFile;
+                                               }
                                        }
                                }
                                if(chunk){delete chunk;}
@@ -300,34 +279,26 @@ Long64_t AliStorageClientThread::GetSizeOfAllChunks()
 
 void AliStorageClientThread::CollectData()
 {
-       //connect with events' sockets
-       context_t *context = new context_t(1);
-       socket_t *socket = new socket_t(*context,ZMQ_SUB);
-       socket->setsockopt(ZMQ_SUBSCRIBE,"",0);
-       socket->connect(Form("tcp://%s:%d",fEventServer.c_str(),gEventsSubscriberPort));
-
-       if(socket)
+       AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
+       if(eventManager->CreateSocket(EVENTS_SERVER_SUB))
        {
-               cout<<"CLIENT -- Successfully connected to events' server"<<endl;
-               fConnectionStatus = STATUS_OK;
+               fConnectionStatus=STATUS_OK;
        }
-               else
+       else
        {
-               cout<<"CLIENT -- ERROR - could not connect to events' server"<<endl;
-               fConnectionStatus = STATUS_ERROR;
+               fConnectionStatus=STATUS_ERROR;
        }
-
-       AliStorageEventManager *eventManager = new AliStorageEventManager();
        
        int chunkNumber=0;
        int previousChunkNumber=-1;
        int eventsInChunk=0;
        int previousRunNumber=-1;
        AliESDEvent *event = NULL;
-
+//        TTree *tree = NULL;
+        
        while(!gClientQuit)
        {               
-               event = eventManager->GetEvent(socket);
+          event = eventManager->GetEvent(EVENTS_SERVER_SUB);
 
                if(event)
                {
@@ -414,6 +385,7 @@ void AliStorageClientThread::CollectData()
                                fSavingStatus=STATUS_ERROR;
                        }
                        delete event;event=0;
+                        //delete tree;
                }
                else if(fReceivingStatus!=STATUS_ERROR)
                {
similarity index 85%
rename from STORAGE/AliStorageClientThread.h
rename to MONITOR/alistoragemanager/AliStorageClientThread.h
index 4c4b70e..e042a20 100644 (file)
@@ -20,11 +20,9 @@ private:
        Int_t fReceivingStatus;
        Int_t fSavingStatus;
        
-       //zmq - receive events
-       std::string fEventServer;
-       
-       //zmq - communication with admin panel
-       static void* CommunicationHandler(void *arg);
+       //communication with admin panel
+    static void* Dispatch(void *arg){static_cast<AliStorageClientThread*>(arg)->CommunicationHandle();}
+       void CommunicationHandle();
        TThread *fCommunicationThread;
        
        //storage file system
similarity index 76%
rename from STORAGE/AliStorageDatabase.cxx
rename to MONITOR/alistoragemanager/AliStorageDatabase.cxx
index c6a339f..5f75106 100644 (file)
@@ -22,8 +22,7 @@ AliStorageDatabase::AliStorageDatabase() :
        fStoragePath("")
 {
        TThread::Lock();        
-       ifstream configFile (Form("%s/STORAGE/setupStorageDatabase.sh",
-                                 gSystem->Getenv("ALICE_ROOT")));
+       ifstream configFile (GetConfigFilePath());
 
        
        if (configFile.is_open())
@@ -162,75 +161,6 @@ AliESDEvent* AliStorageDatabase::GetEvent(struct eventStruct event)
        tmpFile->GetObject(Form("event%d;1",event.eventNumber),data);
 
        return data;
-       /*
-       //deserialize file??
-       TTree* tree= new TTree("esdTree", "esdTree");
-       data->WriteToTree(tree);
-       tree-> Fill();
-       AliESDEvent* requestedEvent= new AliESDEvent(); 
-       requestedEvent->ReadFromTree(tree);
-       tree->GetEntry(0);
-       delete data;
-       delete tree;
-       
-       
-       if(requestedEvent->GetRunNumber()<0)//if file is not in temp storage, check if it is in perm storage
-       {
-               cout<<"DATABASE -- could not find file in temp storage -- searching in perm"<<endl;
-               TFile *permFile = new TFile(Form("%s/permEvents.root",fStoragePath.c_str()),"update");//open/create perm file
-       
-               if(!permFile)
-               {
-                       cout<<"DATABASE -- Couldn't open perm file"<<endl;
-                       tmpFile->Close();
-                       if(tmpFile){delete tmpFile;}
-                       if(requestedEvent){delete requestedEvent;}
-                       return NULL;
-               }
-               TDirectory *runDirectory = permFile->GetDirectory(Form("run%d",event.runNumber));
-
-               if(!runDirectory)
-               {
-                       cout<<"DATABASE -- Couldn't open run directory"<<endl;
-                       
-                       if(tmpFile)
-                       {
-                               tmpFile->Close();
-                               delete tmpFile;
-                       }
-                       if(permFile)
-                       {
-                               permFile->Close();
-                               delete permFile;
-                       }
-                       if(requestedEvent){delete requestedEvent;}
-                       return NULL;
-               }
-               
-               //if(requestedEvent){delete requestedEvent;}
-               AliESDEvent *requestedEventPerm = (AliESDEvent*)runDirectory->Get(Form("event%d",event.eventNumber));
-
-               if(requestedEventPerm->GetRunNumber()<0)
-               {
-                       cout<<"DATABASE -- could not find event in perm storage"<<endl;
-                       tmpFile->Close();
-                       permFile->Close();
-                       if(tmpFile){delete tmpFile;}
-                       if(permFile){delete permFile;}
-                       return NULL;
-               }
-               else
-               {
-                       return requestedEventPerm;
-               }
-       }
-       else
-       {
-               cout<<"DATABASE -- sending event:"<<requestedEvent->GetRunNumber()<<endl;
-               tmpFile->Close();
-               if(tmpFile){delete tmpFile;}
-               return requestedEvent;
-               }*/
 }
 
 struct eventStruct AliStorageDatabase::GetOldestEvent()
similarity index 98%
rename from STORAGE/AliStorageDatabase.h
rename to MONITOR/alistoragemanager/AliStorageDatabase.h
index 9565138..65e9094 100644 (file)
@@ -27,11 +27,9 @@ public:
        struct eventStruct GetOldestEvent();
        std::vector<serverListStruct> GetList(struct listRequestStruct listStruct);
 
-       //not tested:
        AliESDEvent* GetEvent(struct eventStruct event);
        AliESDEvent* GetNextEvent(struct eventStruct event);
        AliESDEvent* GetLastEvent();
-       //
 private:
        std::string fHost;
        std::string fPort;
diff --git a/MONITOR/alistoragemanager/AliStorageEventManager.cxx b/MONITOR/alistoragemanager/AliStorageEventManager.cxx
new file mode 100644 (file)
index 0000000..4b8e3d9
--- /dev/null
@@ -0,0 +1,477 @@
+#include "AliStorageEventManager.h"
+
+#include <iostream>
+#include <sstream>
+#include <fstream>
+
+#include <TList.h>
+#include <TStreamerInfo.h>
+#include <TThread.h>
+
+#include "zmq.hpp"
+
+#include "AliESDEvent.h"
+#include "AliESDtrack.h"
+#include "AliTrackPointArray.h"
+#include "AliESDfriendTrack.h"
+#include "AliExternalTrackParam.h"
+#include "AliTrackerBase.h"
+#include "AliTracker.h"
+
+using namespace zmq;
+using namespace std;
+
+AliStorageEventManager *AliStorageEventManager::fManagerInstance = 0;
+
+AliStorageEventManager::AliStorageEventManager()
+{
+       //read config file
+       TThread::Lock();
+       ifstream configFile (GetConfigFilePath());
+    
+       if (configFile.is_open())
+       {
+               string line;
+               int from,to;
+               while(configFile.good())
+               {
+                       getline(configFile,line);
+                       from = line.find("\"")+1;
+                       to = line.find_last_of("\"");
+                       if(line.find("STORAGE_SERVER=")==0)
+                       {
+                               fStorageServer=line.substr(from,to-from);
+                       }
+                       else if(line.find("EVENT_SERVER=")==0)
+                       {
+                               fEventServer=line.substr(from,to-from);
+                       }
+                       else if(line.find("STORAGE_SERVER_PORT=")==0)
+                       {
+                               fStorageServerPort=atoi(line.substr(from,to-from).c_str());
+                       }
+                       else if(line.find("EVENT_SERVER_PORT=")==0)
+                       {
+                               fEventServerPort=atoi(line.substr(from,to-from).c_str());
+                       }
+                       else if(line.find("STORAGE_CLIENT_PORT=")==0)
+                       {
+                               fStorageClientPort=atoi(line.substr(from,to-from).c_str());
+                       }
+                       else if(line.find("XML_SERVER_PORT=")==0)
+                       {
+                               fXmlServerPort=atoi(line.substr(from,to-from).c_str());
+                       }
+               }
+               if(configFile.eof())
+               {
+                       configFile.clear();
+               }
+               configFile.close();
+       }
+       else
+       {
+               cout<<"EVENT MANAGER -- Unable to open config file"<<endl;
+       }
+       TThread::UnLock();
+       
+       for(int i=0;i<NUMBER_OF_SOCKETS;i++)
+       {
+               fContexts[i] = new context_t();
+       }
+}
+AliStorageEventManager::~AliStorageEventManager()
+{
+       if(fManagerInstance){delete fManagerInstance;fManagerInstance=0;}
+}
+
+AliStorageEventManager* AliStorageEventManager::GetEventManagerInstance()
+{
+       TThread::Lock();
+       if(fManagerInstance==0)
+       {
+               fManagerInstance = new AliStorageEventManager();
+       }
+       TThread::UnLock();
+       return fManagerInstance;
+}
+
+
+void __freeBuff (void *data, void *hint)
+{
+    free(data);
+}
+
+bool AliStorageEventManager::CreateSocket(storageSockets socket)
+{
+       switch(socket)
+       {
+       case SERVER_COMMUNICATION_REQ:
+       {
+               fSockets[SERVER_COMMUNICATION_REQ] =
+                       new socket_t(*fContexts[SERVER_COMMUNICATION_REQ],ZMQ_REQ);
+               try
+               {
+                       fSockets[SERVER_COMMUNICATION_REQ]->connect(Form("tcp://%s:%d",fStorageServer.c_str(),fStorageServerPort));
+
+               }
+               catch (const zmq::error_t& e)
+               {
+                       cout<<"MANAGER -- "<<e.what()<<endl;
+                       return 0;
+               }
+       }
+       break;
+       case SERVER_COMMUNICATION_REP:
+       {
+               fSockets[SERVER_COMMUNICATION_REP] =
+                       new socket_t(*fContexts[SERVER_COMMUNICATION_REP],ZMQ_REP);
+               try
+               {
+                       fSockets[SERVER_COMMUNICATION_REP]->bind(Form("tcp://*:%d",fStorageServerPort));
+               }
+               catch (const zmq::error_t& e)
+               {
+                       cout<<"MANAGER -- "<<e.what()<<endl;
+                       return 0;
+               }
+       }
+       break;
+       case CLIENT_COMMUNICATION_REQ:
+       {
+               fSockets[CLIENT_COMMUNICATION_REQ] =
+                       new socket_t(*fContexts[CLIENT_COMMUNICATION_REQ],ZMQ_REQ);
+               try
+               {
+                       fSockets[CLIENT_COMMUNICATION_REQ]->connect(Form("tcp://%s:%d",fStorageServer.c_str(), fStorageClientPort));
+               }
+               catch (const zmq::error_t& e)
+               {
+                       cout<<"MANAGER -- "<<e.what()<<endl;
+                       return 0;
+               }
+       }
+       break;
+       case CLIENT_COMMUNICATION_REP:
+       {
+               fSockets[CLIENT_COMMUNICATION_REP] =
+                       new socket_t(*fContexts[CLIENT_COMMUNICATION_REP],ZMQ_REP);
+               try
+               {
+                       fSockets[CLIENT_COMMUNICATION_REP]->bind(Form("tcp://*:%d",fStorageClientPort));
+               }
+               catch (const zmq::error_t& e)
+               {
+                       cout<<"MANAGER -- "<<e.what()<<endl;
+                       return 0;
+               }
+       }
+       break;
+       case EVENTS_SERVER_PUB:
+       {
+               fSockets[EVENTS_SERVER_PUB] =
+                       new socket_t(*fContexts[EVENTS_SERVER_PUB],ZMQ_PUB);
+               try
+               {
+                       fSockets[EVENTS_SERVER_PUB]->bind(Form("tcp://*:%d",fEventServerPort));
+               }
+               catch (const zmq::error_t& e)
+               {
+                       cout<<"MANAGER -- "<<e.what()<<endl;
+                       return 0;
+               }
+       }
+       break;
+       case EVENTS_SERVER_SUB:
+       {
+               fSockets[EVENTS_SERVER_SUB] =
+                       new socket_t(*fContexts[EVENTS_SERVER_SUB],ZMQ_SUB);
+               fSockets[EVENTS_SERVER_SUB]->setsockopt(ZMQ_SUBSCRIBE,"",0);
+               try
+               {
+                       fSockets[EVENTS_SERVER_SUB]->connect(Form("tcp://%s:%d",fEventServer.c_str(),fEventServerPort));
+               }
+               catch (const zmq::error_t& e)
+               {
+                       cout<<"MANAGER -- "<<e.what()<<endl;
+                       return 0;
+
+               }
+       }
+       break;
+       case XML_PUB:
+       {
+               fSockets[XML_PUB] =
+                       new socket_t(*fContexts[XML_PUB],ZMQ_PUB);
+               try
+               {
+                       fSockets[XML_PUB]->bind(Form("tcp://*:%d",fXmlServerPort));
+               }
+               catch (const zmq::error_t& e)
+               {
+                       cout<<"MANAGER -- "<<e.what()<<endl;
+                       return 0;
+               }
+       }
+       break;
+       default:break;
+       }
+       return 1;
+}
+
+void AliStorageEventManager::Send(vector<serverListStruct> list,storageSockets socket)
+{
+       //send size of the struct first
+       int numberOfRecords = list.size();
+       message_t message(20);
+       snprintf ((char *)message.data(), 20 ,"%d",numberOfRecords);
+
+       fSockets[socket]->send(message);
+       if(numberOfRecords==0)return;
+       fSockets[socket]->recv((new message_t));//empty message just to keep req-rep order
+
+       //prepare message with event's list
+       char *buffer = reinterpret_cast<char*> (&list[0]);
+       message_t *reply = new message_t((void*)buffer,
+                             sizeof(serverListStruct)*numberOfRecords,0);
+       fSockets[socket]->send(*reply);
+
+       if(reply){delete reply;}
+}
+
+void AliStorageEventManager::Send(struct serverRequestStruct *request,storageSockets socket)
+{
+       char *buffer = (char*)(request);
+       message_t *requestMessage = new message_t((void*)buffer,
+                                          sizeof(struct serverRequestStruct)
+                                          +sizeof(struct listRequestStruct)
+                                          +sizeof(struct eventStruct),0);      
+       fSockets[socket]->send(*requestMessage);
+}
+
+bool AliStorageEventManager::Send(struct clientRequestStruct *request,storageSockets socket,int timeout)
+{
+       pollitem_t items[1] =  {{*fSockets[socket],0,ZMQ_POLLIN,0}} ;
+       
+       
+       char *buffer = (char*)(request);
+       message_t *requestMessage = new message_t((void*)buffer,
+                                                 sizeof(struct clientRequestStruct),0);
+
+       try
+       {
+               fSockets[socket]->send(*requestMessage);
+       }
+       catch (const zmq::error_t& e)
+       {
+               cout<<"MANAGER -- "<<e.what()<<endl;
+               cout<<e.num()<<endl;
+               if(fSockets[socket]){delete fSockets[socket];fSockets[socket]=0;}
+
+               CreateSocket(socket);
+               return 0;
+               
+       }       
+       if(timeout>=0)
+       {
+               if(poll (&items[0], 1, timeout)==0)
+               {
+                       return 0;
+               }
+       }
+
+       return 1;
+}
+
+void AliStorageEventManager::Send(long message,storageSockets socket)
+{
+       stringstream streamBuffer;
+       streamBuffer << message;
+       string stringBuffer = streamBuffer.str();
+       char *buffer = (char*)stringBuffer.c_str();
+       message_t *replyMessage = new message_t((void*)buffer,sizeof(long),0);
+       fSockets[socket]->send(*replyMessage);
+       delete replyMessage;
+       streamBuffer.str(string());
+       streamBuffer.clear();
+}
+
+void AliStorageEventManager::Send(bool message,storageSockets socket)
+{
+       char *buffer;
+       if(message==true)
+       {
+               buffer = (char*)("true");
+       }
+       else
+       {
+               buffer = (char*)("false");
+       }
+       message_t *replyMessage = new message_t((void*)buffer,sizeof(char*),0);
+       fSockets[socket]->send(*replyMessage);
+       delete replyMessage;
+}
+
+void AliStorageEventManager::Send(AliESDEvent *event, storageSockets socket)
+{
+       TMessage tmess(kMESS_OBJECT);
+       tmess.Reset();
+       tmess.WriteObject(event);
+       TMessage::EnableSchemaEvolutionForAll(kTRUE);
+
+       int bufsize = tmess.Length();
+       char* buf = (char*) malloc(bufsize * sizeof(char));
+       memcpy(buf, tmess.Buffer(), bufsize);
+       
+       zmq::message_t message((void*)buf, bufsize, 0, 0);
+       fSockets[socket]->send(message);
+}
+
+void AliStorageEventManager::SendAsXml(AliESDEvent *event,storageSockets socket)
+{
+       cout<<"SENDING AS XML"<<endl;
+       stringstream bufferStream;
+       bufferStream << "<?xml version=\"1.0\" encoding=\"utf-8\"?>"<<endl;
+       bufferStream << "<ESD xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" << endl;
+       
+       for(int i=0;i<event->GetNumberOfTracks();i++)
+       {
+               AliESDtrack *track = event->GetTrack(i);
+               //double hgfhgf[size];
+               //track->GetESDpid(pid);
+               bufferStream << "\t<track mass=\""<<track->GetMass()<<"\">" <<endl;
+               const AliTrackPointArray *array = track->GetTrackPointArray();
+
+               if(array)
+               {
+                       const float *x = array->GetX();
+                       const float *y = array->GetY();
+                       const float *z = array->GetZ();
+                       int n = array->GetNPoints();
+
+                       for(int j=0;j<n;j++)
+                       {
+                               bufferStream <<"\t\t<point>"<<endl;
+                               bufferStream <<"\t\t\t<x>"<< x[j] <<"</x>"<<endl;
+                               bufferStream <<"\t\t\t<y>"<< y[j] <<"</y>"<<endl;
+                               bufferStream <<"\t\t\t<z>"<< z[j] <<"</z>"<<endl;
+                               bufferStream <<"\t\t</point>"<<endl;
+                       }
+               }
+               else cout<<"no array"<<endl;
+
+               bufferStream << "\t</track>"<<endl;
+       }
+
+       bufferStream << "</ESD>"<<endl;
+
+       string bufferString = bufferStream.str();
+       message_t message(bufferString.size());
+       memcpy (message.data(), bufferString.data(), bufferString.size());      
+       
+       fSockets[socket]->send(message);
+       cout<<"xml sent"<<endl;
+}
+
+vector<serverListStruct> AliStorageEventManager::GetServerListVector(storageSockets socket)
+{
+       //get size of the incomming message
+       message_t sizeMessage;
+       fSockets[socket]->recv(&sizeMessage);
+       int numberOfRecords;
+       istringstream iss(static_cast<char*>(sizeMessage.data()));
+       iss >> numberOfRecords;
+
+       if(numberOfRecords==0){cout<<"MANAGER -- list is empty"<<endl;}
+       
+       fSockets[socket]->send(*(new message_t()));//receive empty message just to keep req-rep order
+       
+//get list of events
+       message_t *response = new message_t(sizeof(serverListStruct)*numberOfRecords);
+       fSockets[socket]->recv(response);
+       
+       vector<serverListStruct> receivedList(static_cast<serverListStruct*>(response->data()), static_cast<serverListStruct*>(response->data()) + numberOfRecords);
+
+       return receivedList;
+}
+
+AliESDEvent* AliStorageEventManager::GetEvent(storageSockets socket,int timeout,TTree **tmpTree)
+{
+  message_t* message = new message_t();
+
+  try
+  {
+    fSockets[socket]->recv(message);
+  }
+  catch (const zmq::error_t& e)
+  {
+    cout<<"MANAGER -- "<<e.what()<<endl;
+    return NULL;
+  }
+       
+  TBufferFile *mess = new TBufferFile(TBuffer::kRead,
+                                      message->size()+sizeof(UInt_t),
+                                      message->data());
+  mess->InitMap();
+  mess->ReadClass();// get first the class stored in message
+  mess->SetBufferOffset(sizeof(UInt_t) + sizeof(kMESS_OBJECT));
+  mess->ResetMap();
+       
+  AliESDEvent* data = (AliESDEvent*)(mess->ReadObjectAny(AliESDEvent::Class()));
+       
+  if (data)
+  {
+    TTree* tree= new TTree("esdTree", "esdTree");
+    data->WriteToTree(tree);
+    tree->Fill();
+    AliESDEvent* event= new AliESDEvent();
+    event->ReadFromTree(tree);
+    tree->GetEntry(0);
+    if(data){delete data;}
+    //if(tree){delete tree;}
+    if(message){delete message;}
+    if(tmpTree){*tmpTree = tree;}
+    return event;              
+  }
+  else
+  {
+    if(message){delete message;}
+    return NULL;
+  }
+}
+
+struct serverRequestStruct* AliStorageEventManager::GetServerStruct(storageSockets socket)
+{
+       struct serverRequestStruct *request = new struct serverRequestStruct;
+       message_t *requestMessage = new message_t();
+       fSockets[socket]->recv(requestMessage);
+       request = static_cast<struct serverRequestStruct*>(requestMessage->data());
+       return request;
+}
+
+struct clientRequestStruct* AliStorageEventManager::GetClientStruct(storageSockets socket)
+{
+       struct clientRequestStruct *request = new struct clientRequestStruct;
+       message_t *requestMessage = new message_t();
+       fSockets[socket]->recv(requestMessage);
+       request = static_cast<struct clientRequestStruct*>(requestMessage->data());
+       return request;
+}
+
+bool AliStorageEventManager::GetBool(storageSockets socket)
+{
+       message_t *response = new message_t();
+       fSockets[socket]->recv(response);
+       char *result = (char*)response->data();
+       
+       if(!strcmp("true",result)){return true;}
+       else{return false;}
+}
+
+long AliStorageEventManager::GetLong(storageSockets socket)
+{
+       message_t *responseMessage = new message_t;
+       fSockets[socket]->recv(responseMessage);
+       return (long)atoi(static_cast<char*>(responseMessage->data()));
+}
+
diff --git a/MONITOR/alistoragemanager/AliStorageEventManager.h b/MONITOR/alistoragemanager/AliStorageEventManager.h
new file mode 100644 (file)
index 0000000..4884201
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef AliStorageEventManager_H
+#define AliStorageEventManager_H
+
+#include "AliESDEvent.h"
+#include "AliStorageTypes.h"
+
+#include <vector>
+#include <string>
+#include <sstream>
+
+#include <TMessage.h>
+
+namespace zmq
+{
+       class context_t;
+       class socket_t;
+}
+
+class AliStorageEventManager
+{
+public:
+       static AliStorageEventManager* GetEventManagerInstance();
+
+       void Send(std::vector<serverListStruct> list,storageSockets socket);
+       void Send(struct serverRequestStruct *request,storageSockets socket);
+       bool Send(struct clientRequestStruct *request,storageSockets socket,int timeout = -1);
+       void Send(AliESDEvent *event,storageSockets socket);
+       void Send(long message,storageSockets socket);
+       void Send(bool message,storageSockets socket);
+       void SendAsXml(AliESDEvent *event,storageSockets socket);
+       
+       std::vector<serverListStruct> GetServerListVector(storageSockets socket);
+       AliESDEvent* GetEvent(storageSockets socket,int timeout=-1,TTree **tmpTree=0);
+       struct serverRequestStruct* GetServerStruct(storageSockets socket);
+       struct clientRequestStruct* GetClientStruct(storageSockets socket);
+       long GetLong(storageSockets socket);
+       bool GetBool(storageSockets socket);
+
+
+       bool CreateSocket(storageSockets socket);
+private:
+       AliStorageEventManager();
+       ~AliStorageEventManager();
+
+       static AliStorageEventManager *fManagerInstance;
+
+       std::string fStorageServer;
+       std::string fEventServer;
+       int fStorageServerPort;
+       int fStorageClientPort;
+       int fEventServerPort;
+       int fXmlServerPort;
+       
+       zmq::context_t *fContexts[7];
+       zmq::socket_t *fSockets[7];
+
+       AliStorageEventManager(const AliStorageEventManager&);
+       AliStorageEventManager& operator=(const AliStorageEventManager&);
+};
+
+#endif
similarity index 70%
rename from STORAGE/AliStorageServerThread.cxx
rename to MONITOR/alistoragemanager/AliStorageServerThread.cxx
index 180a008..bd8fd3d 100644 (file)
@@ -2,7 +2,6 @@
 #include "AliStorageTypes.h"
 #include "AliESDEvent.h"
 
-#include "zmq.hpp"
 #include <iostream>
 #include <fstream>
 
 #include <TThread.h>
 
 using namespace std;
-using namespace zmq;
 
 AliStorageServerThread::AliStorageServerThread() :
-       fEventManager(0),
        fDatabase(0),
        fStoragePath("")
 {
        TThread::Lock();
        fDatabase = new AliStorageDatabase();
        //load parameters from config file
-       ifstream configFile (Form("%s/STORAGE/setupStorageDatabase.sh",
-                                 gSystem->Getenv("ALICE_ROOT")));
+       ifstream configFile (GetConfigFilePath());
 
        
        if (configFile.is_open())
@@ -51,74 +47,64 @@ AliStorageServerThread::AliStorageServerThread() :
        TThread::UnLock();
 
        //start communication on socket
-       fEventManager = new AliStorageEventManager();
        StartCommunication();
 }
 
 AliStorageServerThread::~AliStorageServerThread()
 {
-       cout<<"SERVER -- AliStorageServerThread destructor called";
-       
+       cout<<"SERVER -- AliStorageServerThread destructor called";     
        cout<<" --- OK"<<endl;
 }
 
 void AliStorageServerThread::StartCommunication()
 {
-       //create two-way communication socket
-       context_t *context = new context_t(1);
-       socket_t *socket = new socket_t(*context,ZMQ_REP);
-       socket->bind(Form("tcp://*:%d",gServerCommunicationPort));      
-       
-       message_t *request = new message_t;
-       message_t *reply;
-       struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
-       char *buffer;
+       AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
+       storageSockets socket = SERVER_COMMUNICATION_REP;
+       eventManager->CreateSocket(socket);
+
+       struct serverRequestStruct *request;
        
        while(1)
        {
-               socket->recv(request);
-               requestMessage = static_cast<struct serverRequestStruct*>(request->data());
+               request = eventManager->GetServerStruct(socket);
                
-               switch(requestMessage->messageType)
+               switch(request->messageType)
                {
                case REQUEST_LIST_EVENTS:
                {
-                       vector<serverListStruct> result = fDatabase->GetList(requestMessage->list);
-                       fEventManager->Send(result,socket);
+                       vector<serverListStruct> result = fDatabase->GetList(request->list);
+                       eventManager->Send(result,socket);
                        break;
                }
                case REQUEST_GET_EVENT:
                {
-                       AliESDEvent *event = fDatabase->GetEvent(requestMessage->event);
-                       fEventManager->Send(event,socket);
+                       AliESDEvent *event = fDatabase->GetEvent(request->event);
+                       eventManager->Send(event,socket);
                        delete event;
                        break;
                }
                case REQUEST_GET_NEXT_EVENT:
                {
-                       AliESDEvent *event = fDatabase->GetNextEvent(requestMessage->event);
-                       fEventManager->Send(event,socket);
+                       AliESDEvent *event = fDatabase->GetNextEvent(request->event);
+                       eventManager->Send(event,socket);
                        delete event;
                        break;
                }
                case REQUEST_GET_LAST_EVENT:
                {
                        AliESDEvent *event = fDatabase->GetLastEvent();
-                       fEventManager->Send(event,socket);
+                       eventManager->Send(event,socket);
                        delete event;
                        break;
                }
                case REQUEST_MARK_EVENT:
                {
-                       struct eventStruct *markData  = &(requestMessage->event);
-                       buffer =(char*)(MarkEvent(*markData) ? "true" : "false");
-                       reply = new message_t((void*)buffer,sizeof(char*),0);
-                       socket->send(*reply);
+                       struct eventStruct *markData  = &(request->event);
+                       eventManager->Send(MarkEvent(*markData),socket);
                        break;
                }
                default:break;
                }
-               
        }
 }
 
similarity index 68%
rename from STORAGE/AliStorageServerThread.h
rename to MONITOR/alistoragemanager/AliStorageServerThread.h
index eeff18d..9c4f7bd 100644 (file)
@@ -10,14 +10,7 @@ public:
        AliStorageServerThread();
        ~AliStorageServerThread();
 private:
-       //communication via socket
        void StartCommunication();
-       AliStorageEventManager *fEventManager;
-       
-       //handling different requests
-       AliESDEvent* GetEvent(struct eventStruct eventStruct);
-       AliESDEvent* GetNextEvent(struct eventStruct eventStruct);
-       AliESDEvent* GetLastEvent();
        bool MarkEvent(struct eventStruct event);
 
        //connection to database and storage
similarity index 71%
rename from STORAGE/AliStorageTypes.h
rename to MONITOR/alistoragemanager/AliStorageTypes.h
index 1738a0d..b4cc90a 100644 (file)
@@ -1,12 +1,25 @@
 #ifndef AliStorageTypes_H
 #define AliStorageTypes_H
 
-//sockets
-const int gServerCommunicationPort = 5066;
-const int gEventsSubscriberPort = 5024;
-const int gClientCommunicationPort = 5088;
-const int gClientPublisherPort = 5077;
+#include <TSystem.h>
 
+inline const char* GetConfigFilePath()
+{
+       return Form("%s/MONITOR/alistoragemanager/setupStorageDatabase.sh",
+                   gSystem->Getenv("ALICE_ROOT"));
+}
+
+enum storageSockets{
+       SERVER_COMMUNICATION_REQ=0,
+       SERVER_COMMUNICATION_REP,
+       CLIENT_COMMUNICATION_REQ,
+       CLIENT_COMMUNICATION_REP,
+       EVENTS_SERVER_PUB,
+       EVENTS_SERVER_SUB,
+       XML_PUB,
+       NUMBER_OF_SOCKETS
+};
+       
 enum statusType{
        STATUS_WAITING=1,
        STATUS_OK,
diff --git a/MONITOR/alistoragemanager/CMakebinalifakedisplay.pkg b/MONITOR/alistoragemanager/CMakebinalifakedisplay.pkg
new file mode 100644 (file)
index 0000000..c1444a7
--- /dev/null
@@ -0,0 +1,37 @@
+set ( SRCS  alistoragemanager/alifakedisplay.cxx)
+
+set ( EINCLUDE )
+set ( ELIBSDIR )
+
+set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
+
+if(PYTHIA6)
+  list (APPEND ELIBS EVGEN HepMC HepMCParser)
+endif(PYTHIA6)
+
+set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+
+set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lMONITOR ${SYSLIBS} )
+
+if( ALICE_TARGET STREQUAL "macosx")
+                       
+       set ( ELIBS ${ELIBS} GL)
+       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
+       
+  set ( ELIBSCPP ${ELIBS})
+       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
+
+  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
+
+       if( MACOSX_MINOR STREQUAL "5")
+                                               
+               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
+
+  endif( MACOSX_MINOR STREQUAL "5")
+       
+  set ( ELIBS ${ELIBS} GLU)
+       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
+       
+endif( ALICE_TARGET STREQUAL "macosx")
+
+set ( ELIBS ${ELIBS} MONITOR )
\ No newline at end of file
diff --git a/MONITOR/alistoragemanager/CMakebinalistorage.pkg b/MONITOR/alistoragemanager/CMakebinalistorage.pkg
new file mode 100644 (file)
index 0000000..05ed2ef
--- /dev/null
@@ -0,0 +1,38 @@
+set ( SRCS  alistoragemanager/alistorage.cxx)
+
+set ( EINCLUDE )
+set ( ELIBSDIR )
+
+set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
+
+if(PYTHIA6)
+  list (APPEND ELIBS EVGEN HepMC HepMCParser)
+endif(PYTHIA6)
+
+set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+
+set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lMONITOR -lMONITORzmq ${SYSLIBS} )
+
+if( ALICE_TARGET STREQUAL "macosx")
+                       
+       set ( ELIBS ${ELIBS} GL)
+       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
+       
+  set ( ELIBSCPP ${ELIBS})
+       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
+
+  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
+
+       if( MACOSX_MINOR STREQUAL "5")
+                                               
+               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
+
+  endif( MACOSX_MINOR STREQUAL "5")
+       
+  set ( ELIBS ${ELIBS} GLU)
+       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
+       
+endif( ALICE_TARGET STREQUAL "macosx")
+
+set ( ELIBS ${ELIBS} MONITOR MONITORzmq )       
+
diff --git a/MONITOR/alistoragemanager/CMakebinalistorageadmin.pkg b/MONITOR/alistoragemanager/CMakebinalistorageadmin.pkg
new file mode 100644 (file)
index 0000000..1fd1f6d
--- /dev/null
@@ -0,0 +1,37 @@
+set ( SRCS  alistoragemanager/alistorageadmin.cxx)
+
+set ( EINCLUDE )
+set ( ELIBSDIR )
+
+set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
+
+if(PYTHIA6)
+  list (APPEND ELIBS EVGEN HepMC HepMCParser)
+endif(PYTHIA6)
+
+set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+
+set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lMONITOR -lMONITORzmq ${SYSLIBS} )
+
+if( ALICE_TARGET STREQUAL "macosx")
+                       
+       set ( ELIBS ${ELIBS} GL)
+       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
+       
+  set ( ELIBSCPP ${ELIBS})
+       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
+
+  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
+
+       if( MACOSX_MINOR STREQUAL "5")
+                                               
+               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
+
+  endif( MACOSX_MINOR STREQUAL "5")
+       
+  set ( ELIBS ${ELIBS} GLU)
+       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
+       
+endif( ALICE_TARGET STREQUAL "macosx")
+
+set ( ELIBS ${ELIBS} MONITOR )
\ No newline at end of file
diff --git a/MONITOR/alistoragemanager/CMakebinalistoragegetpoints.pkg b/MONITOR/alistoragemanager/CMakebinalistoragegetpoints.pkg
new file mode 100644 (file)
index 0000000..574fef3
--- /dev/null
@@ -0,0 +1,37 @@
+set ( SRCS  alistoragemanager/alistoragegetpoints.cxx)
+
+set ( EINCLUDE )
+set ( ELIBSDIR )
+
+set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
+
+if(PYTHIA6)
+  list (APPEND ELIBS EVGEN HepMC HepMCParser)
+endif(PYTHIA6)
+
+set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+
+set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lMONITOR -lMONITORzmq ${SYSLIBS} )
+
+if( ALICE_TARGET STREQUAL "macosx")
+                       
+       set ( ELIBS ${ELIBS} GL)
+       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
+       
+  set ( ELIBSCPP ${ELIBS})
+       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
+
+  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
+
+       if( MACOSX_MINOR STREQUAL "5")
+                                               
+               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
+
+  endif( MACOSX_MINOR STREQUAL "5")
+       
+  set ( ELIBS ${ELIBS} GLU)
+       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
+       
+endif( ALICE_TARGET STREQUAL "macosx")
+
+set ( ELIBS ${ELIBS} MONITOR )
\ No newline at end of file
diff --git a/MONITOR/alistoragemanager/CMakebinalistorageminimalexample.pkg b/MONITOR/alistoragemanager/CMakebinalistorageminimalexample.pkg
new file mode 100644 (file)
index 0000000..fa04d35
--- /dev/null
@@ -0,0 +1,37 @@
+set ( SRCS  alistoragemanager/alistorageminimalexample.cxx)
+
+set ( EINCLUDE )
+set ( ELIBSDIR )
+
+set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
+
+if(PYTHIA6)
+  list (APPEND ELIBS EVGEN HepMC HepMCParser)
+endif(PYTHIA6)
+
+set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+
+set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lMONITOR -lMONITORzmq ${SYSLIBS} )
+
+if( ALICE_TARGET STREQUAL "macosx")
+                       
+       set ( ELIBS ${ELIBS} GL)
+       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
+       
+  set ( ELIBSCPP ${ELIBS})
+       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
+
+  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
+
+       if( MACOSX_MINOR STREQUAL "5")
+                                               
+               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
+
+  endif( MACOSX_MINOR STREQUAL "5")
+       
+  set ( ELIBS ${ELIBS} GLU)
+       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
+       
+endif( ALICE_TARGET STREQUAL "macosx")
+
+set ( ELIBS ${ELIBS} MONITOR )
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from STORAGE/StorageLinkDef.h
rename to MONITOR/alistoragemanager/StorageLinkDef.h
diff --git a/MONITOR/alistoragemanager/alifakedisplay.cxx b/MONITOR/alistoragemanager/alifakedisplay.cxx
new file mode 100644 (file)
index 0000000..7d556df
--- /dev/null
@@ -0,0 +1,173 @@
+#include "AliStorageEventManager.h"
+#include "AliStorageTypes.h"
+#include "AliESDEvent.h"
+#include "AliESDRun.h"
+
+#include <iostream>
+
+#include <TThread.h>
+
+using namespace std;
+
+/* parameters:
+
+0 - connect directly to reconstruction socket
+1 - connect to Storage Manager and ask for last event
+2 - connect to alieventserver, receive in thread and use in main thread
+
+*/
+
+// global variables:
+AliESDEvent *currentEvent[2];
+TTree *currentTree[2];
+TMutex mutex;
+int eventInUse=1;
+int writingToEventIndex=0;
+bool isNewEventAvaliable=false;
+//-----------------
+
+static void* GetNextEvent(void*);
+
+int main(int argc, char **argv)
+{
+       if(argc<2)
+       {
+               cout<<"Usage: alifakedisplay <mode>"<<endl;
+               cout<<"mode:"<<endl;
+               cout<<"0 - connect directly to reconstruction socket"<<endl;
+               cout<<"1 - connect to Storage Manager and ask for last event"<<endl;
+               return 0;
+       }
+
+       storageSockets socket; 
+       AliStorageEventManager *manager = AliStorageEventManager::GetEventManagerInstance();
+       AliESDEvent *event;
+       
+       if(atoi(argv[1])==0)
+       {
+               socket = EVENTS_SERVER_SUB;
+               manager->CreateSocket(socket);
+               while(1)
+               {
+                       event = manager->GetEvent(socket);
+                       if(event)
+                       {
+                               cout<<"Received event. Run:"<<event->GetRunNumber()<<"\t event:"<<event->GetEventNumberInFile()<<endl;
+
+                               cout<<event->GetPeriodNumber()<<endl;
+                               cout<<event->GetOrbitNumber()<<endl;
+                               cout<<event->GetBunchCrossNumber()<<endl;
+                               for(int i=0;i<100;i++)
+                               {
+                                       if(strcmp(event->GetESDRun()->GetTriggerClass(i),"")){
+                                               cout<<event->GetESDRun()->GetTriggerClass(i)<<endl;}
+                               }
+                               delete event;
+                       }
+                       else
+                       {
+                               cout<<"NO EVENT"<<endl;
+                       }
+               }
+       }
+       else if(atoi(argv[1])==1)
+       {
+               socket = SERVER_COMMUNICATION_REQ;
+               manager->CreateSocket(socket);
+               while(1)
+               {
+                       struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
+                       requestMessage->messageType = REQUEST_GET_LAST_EVENT;
+
+                       manager->Send(requestMessage,socket);                   
+                       event = manager->GetEvent(socket);
+                       if(event)
+                       {
+                               cout<<"Last event - Run:"<<event->GetRunNumber()<<"\t event:"<<event->GetEventNumberInFile()<<endl;
+               
+                               delete event;
+                       }
+                       else
+                       {
+                               cout<<"NO EVENT"<<endl;
+                       }
+                       sleep(1);
+               }
+       }
+        else if(atoi(argv[1])==2)
+       {
+          TThread *getEventThread = new TThread("getEventThread",GetNextEvent,nullptr);
+          getEventThread->Run();
+
+          int counter=0;
+          
+          while(1)
+          {
+            counter++;
+            if(isNewEventAvaliable)
+            {
+              cout<<"new event"<<endl;
+              mutex.Lock();
+              if(writingToEventIndex == 0) eventInUse = 0;
+              else if(writingToEventIndex == 1) eventInUse = 1;
+              cout<<"Using:"<<eventInUse<<endl;
+
+              if(currentEvent[eventInUse])
+              {
+                if(currentEvent[eventInUse]->GetRunNumber() >= 0)
+                {
+                  cout<<"CURRENT EVENT:"<<currentEvent[eventInUse]->GetEventNumberInFile()<<endl;
+                }
+              }
+              isNewEventAvaliable = false;
+              mutex.UnLock();
+            }
+            else{cout<<"No new event is avaliable."<<endl;}
+
+            sleep(2);
+          }
+       }
+
+       return 0;
+}
+
+void* GetNextEvent(void*)
+{
+  AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
+  eventManager->CreateSocket(EVENTS_SERVER_SUB);
+
+  currentEvent[0]=0;
+  currentEvent[1]=0;
+  currentTree[0]=0;
+  currentTree[1]=0;
+  AliESDEvent *tmpEvent;
+  TTree *tmpTree = NULL;
+  
+  while(1)
+  {
+    //if(tmpEvent){delete tmpEvent;tmpEvent=0;}
+    tmpEvent = eventManager->GetEvent(EVENTS_SERVER_SUB,-1,&tmpTree);
+
+    if(tmpEvent)
+    {
+      if(tmpEvent->GetRunNumber()>=0)
+      {
+        mutex.Lock();
+        if(eventInUse == 0){writingToEventIndex = 1;}
+        else if(eventInUse == 1){writingToEventIndex = 0;}
+        cout<<"Writing to:"<<writingToEventIndex<<endl;
+        if(currentEvent[writingToEventIndex])
+        {
+          cout<<"DELETING:"<<currentEvent[writingToEventIndex]<<endl;
+          delete currentEvent[writingToEventIndex];
+          currentEvent[writingToEventIndex]=0;
+          delete currentTree[writingToEventIndex];
+        }
+        currentEvent[writingToEventIndex] = tmpEvent;
+        currentTree[writingToEventIndex] = tmpTree;
+        isNewEventAvaliable = true;
+        mutex.UnLock();
+      }
+    }  
+  }
+}
similarity index 93%
rename from STORAGE/alistorage_main/alistorage_main.cxx
rename to MONITOR/alistoragemanager/alistorage.cxx
index 2b450f8..44f1e16 100644 (file)
@@ -26,6 +26,13 @@ void *ClientThreadHandle(void*)
 void *ServerThreadHandle(void*)
 {
        cout<<"\nALICE Storage Manager -- Starting server thread"<<endl;
+
+#ifdef ZMQ
+       cout<<"ZMQ found"<<endl;
+#else
+       cout<<"no ZMQ found"<<endl;
+#endif
+       
        AliStorageServerThread *server = new AliStorageServerThread();
 
        if(!server)
diff --git a/MONITOR/alistoragemanager/alistoragegetpoints.cxx b/MONITOR/alistoragemanager/alistoragegetpoints.cxx
new file mode 100644 (file)
index 0000000..43db369
--- /dev/null
@@ -0,0 +1,64 @@
+#include "AliStorageEventManager.h"
+#include "AliStorageTypes.h"
+#include <iostream>
+#include <sstream>
+#include <ostream>
+#include <AliTrackPointArray.h>
+#include <TXMLEngine.h>                                
+
+using namespace std;
+
+TXMLEngine* xml = new TXMLEngine;
+
+stringstream& getXml(AliESDEvent *event)
+{
+       // Create main node of document tree
+       XMLNodePointer_t mainnode = xml->NewChild(0, 0, "main");
+       
+       cout<<"tracks:"<<event->GetNumberOfTracks()<<endl;
+       XMLNodePointer_t tracks[event->GetNumberOfTracks()];
+       
+       for(int i=0;i<event->GetNumberOfTracks();i++)
+       {
+               AliESDtrack *track = event->GetTrack(i);
+               tracks[i] = xml->NewChild(mainnode, 0, Form("track%d",i));
+               const AliTrackPointArray *array = track->GetTrackPointArray();
+               if(array)
+               {
+                       const float *x = array->GetX();
+                       const float *y = array->GetY();
+                       const float *z = array->GetZ();
+                       int n = array->GetNPoints();
+
+                       for(int j=0;j<n;j++)
+                       {
+                               cout<<"3"<<endl;
+                               xml->NewChild(tracks[i], 0,Form("point%d",j),Form("%f\t%f\t%f\n",x[j],y[j],z[j]));
+                       }       
+               }
+               else cout<<"no array"<<endl;
+       }
+   
+       stringstream streamXml;
+       xml->SavePrimitive(streamXml);
+       delete xml;
+       return streamXml;
+}
+
+int main()
+{
+       AliStorageEventManager *manager = AliStorageEventManager::GetEventManagerInstance();
+       manager->CreateSocket(EVENTS_SERVER_SUB);
+       AliESDEvent *event;
+
+       while(1)
+       {
+               event = manager->GetEvent(EVENTS_SERVER_SUB);           
+               cout<<"sending xml"<<endl;
+               manager->Send(getXml(event),XML_PUB);
+               cout<<"xml sent"<<endl;
+       }
+       return 0;
+}
+
+
diff --git a/MONITOR/alistoragemanager/alistorageminimalexample.cxx b/MONITOR/alistoragemanager/alistorageminimalexample.cxx
new file mode 100644 (file)
index 0000000..b2a7943
--- /dev/null
@@ -0,0 +1,18 @@
+#ifdef ZMQ
+#include "AliStorageEventManager.h"
+#endif
+#include <iostream>
+#include <TFile.h>
+
+
+int main()
+{
+#ifdef ZMQ
+       AliStorageEventManager *manager = AliStorageEventManager::GetEventManagerInstance();
+       manager->CreateSocket(EVENTS_SERVER_SUB);
+       AliESDEvent *event  = manager->GetEvent(EVENTS_SERVER_SUB);
+               
+       std::cout<<"Received event:"<<event->GetEventNumberInFile()<<std::endl;
+#endif
+       return 0;
+}
old mode 100755 (executable)
new mode 100644 (file)
similarity index 77%
rename from STORAGE/clearAll.sh
rename to MONITOR/alistoragemanager/clearAll.sh
index d53f602..c86a83b
@@ -3,4 +3,4 @@ rm -fr /opt/reco/run197669/
 rm -fr /opt/reco/log/run197669.log
 rm -fr ~/storedFiles/
 mysql -u storage -pstorage123 -e "drop database storage"
-$ALICE_ROOT/STORAGE/setupStorageDatabase.sh
+./setupStorageDatabase.sh
old mode 100755 (executable)
new mode 100644 (file)
similarity index 71%
rename from STORAGE/setupStorageDatabase.sh
rename to MONITOR/alistoragemanager/setupStorageDatabase.sh
index 2bbf447..9930f3b
@@ -6,12 +6,16 @@ USER="storage"
 PASS="storage123"
 TABLE="events"
 STORAGE_PATH="/local/home/edis/storedFiles"
-MAX_SIZE="5000000"
+MAX_SIZE="10000000"
 MAX_OCCUPATION="80"
 REMOVE_PERCENT="60"
-EVENTS_IN_FILE="7"
-EVENT_SERVER="localhost"   # IP of machine running alieventserver
+EVENTS_IN_FILE="5"
+EVENT_SERVER="pcald39fix"   # IP of machine running alieventserver
+EVENT_SERVER_PORT="5024"
 STORAGE_SERVER="localhost"      # IP of machine running alistorage
+STORAGE_SERVER_PORT="5066"      # server thread communication port
+STORAGE_CLIENT_PORT="5088"      # client thread communication port
+XML_SERVER_PORT="5099"          # server of xml files
 mysql -u root -pdaq -e "create database if not exists $DATABASE;"
 mysql -u root -pdaq -e "grant ALL PRIVILEGES on $DATABASE.* to '$USER'@'$HOST' identified by '$PASS';"
 mysql -u root -pdaq -e "use $DATABASE;"
@@ -26,26 +30,4 @@ PRIMARY KEY(run_number,event_number));"
 
 echo "-----------------------------"
 echo "Databases successfuly created"
-echo "-----------------------------"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+echo "-----------------------------"
\ No newline at end of file
similarity index 97%
rename from MONITOR/CMakebinalitestproc.pkg
rename to MONITOR/alitestproc/CMakebinalitestproc.pkg
index 14ddcd6..2d48044 100644 (file)
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS  alitestproc.cxx)
+set ( SRCS  alitestproc/alitestproc.cxx)
 
 set ( EINCLUDE ${EINCLUDE}  TPC ITS RAW)
 
-set ( PACKBLIBS  ${ROOTCLIBS} ${SYSLIBS})
+set ( PACKBLIBS  ${ROOTCLIBS} -lMONITOR ${SYSLIBS})
 
 set ( ELIBS  MONITOR TPCbase TPCsim TPCrec HLTbase ITSbase ITSsim ITSrec MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw RAWDatasim MUONtrigger MUONcore STEER CDB AOD RAWDatarec ESD RAWDatabase STEERBase ANALYSIS)
 
similarity index 95%
rename from MONITOR/CMakebinderoot.pkg
rename to MONITOR/deroot/CMakebinderoot.pkg
index c82ed2c..2cd6ec6 100644 (file)
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS deroot.cxx)
+set ( SRCS deroot/deroot.cxx)
 
 set ( EINCLUDE ${EINCLUDE}  TPC ITS RAW)
 
-set ( PACKBLIBS  ${ROOTCLIBS} ${SYSLIBS})
+set ( PACKBLIBS  ${ROOTCLIBS} -lMONITOR ${SYSLIBS})
 
-set ( SRCS ${SRCS}  root2date.cxx)
+set ( SRCS ${SRCS}  deroot/root2date.cxx)
 
 set ( ELIBSDIR )
 
similarity index 100%
rename from MONITOR/deroot.cxx
rename to MONITOR/deroot/deroot.cxx
similarity index 100%
rename from MONITOR/deroot.h
rename to MONITOR/deroot/deroot.h
similarity index 89%
rename from MONITOR/CMakebinmonitorCheck.pkg
rename to MONITOR/monitorCheck/CMakebinmonitorCheck.pkg
index 0f382a7..e157cb2 100644 (file)
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS monitorCheck.cxx)
+set ( SRCS monitorCheck/monitorCheck.cxx)
 
 set ( EINCLUDE ${EINCLUDE}  TPC ITS RAW)
 
-set ( PACKBLIBS  ${ROOTCLIBS} ${SYSLIBS})
+set ( PACKBLIBS  ${ROOTCLIBS} -lMONITOR ${SYSLIBS})
 
-set ( ELIBS   MONITOR TPCbase TPCsim TPCrec HLTbase ITSbase ITSsim ITSrec MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw RAWDatasim MUONtrigger MUONcore STEER CDB AOD RAWDatarec ESD RAWDatabase STEERBase ANALYSIS)
+set ( ELIBS MONITOR TPCbase TPCsim TPCrec HLTbase ITSbase ITSsim ITSrec MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw RAWDatasim MUONtrigger MUONcore STEER CDB AOD RAWDatarec ESD RAWDatabase STEERBase ANALYSIS)
 
 set(DATE_ROOT $ENV{DATE_ROOT})
 set(ODIR $ENV{ODIR})
similarity index 88%
rename from MONITOR/CMakebinmonitorGDC.pkg
rename to MONITOR/monitorGDC/CMakebinmonitorGDC.pkg
index e595809..8def71c 100644 (file)
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS monitorGDC.cxx)
+set ( SRCS monitorGDC/monitorGDC.cxx)
 
 set ( EINCLUDE ${EINCLUDE}  TPC ITS RAW)
 
-set ( PACKBLIBS  ${ROOTCLIBS} ${SYSLIBS})
+set ( PACKBLIBS  ${ROOTCLIBS} -lMONITOR ${SYSLIBS})
 
-set ( ELIBS   MONITOR TPCbase TPCsim TPCrec HLTbase ITSbase ITSsim ITSrec MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw RAWDatasim MUONtrigger MUONcore STEER CDB AOD RAWDatarec ESD RAWDatabase STEERBase ANALYSIS)
+set ( ELIBS MONITOR TPCbase TPCsim TPCrec HLTbase ITSbase ITSsim ITSrec MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw RAWDatasim MUONtrigger MUONcore STEER CDB AOD RAWDatarec ESD RAWDatabase STEERBase ANALYSIS)
 
 set (DATE_ROOT $ENV{DATE_ROOT})
 set(ODIR $ENV{ODIR})
diff --git a/STORAGE/AliStorageEventManager.cxx b/STORAGE/AliStorageEventManager.cxx
deleted file mode 100644 (file)
index 26d95bd..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-#include "AliStorageEventManager.h"
-#include "AliNetMessage.h"
-
-#include <iostream>
-#include <sstream>
-
-#include <TList.h>
-#include <TStreamerInfo.h>
-
-#include "zmq.hpp"
-
-using namespace zmq;
-using namespace std;
-
-AliStorageEventManager::AliStorageEventManager(){}
-AliStorageEventManager::~AliStorageEventManager(){}
-
-void __freeBuffer (void *data, void *hint)
-{
-    free(data);
-}
-
-void AliStorageEventManager::Send(AliESDEvent *event, socket_t *socket)
-{
-       AliNetMessage tmess(kMESS_OBJECT);
-       tmess.Reset();
-       tmess.WriteObject(event);
-
-       int bufSize = tmess.BufferSize();
-       char* buf = new char[bufSize];
-       memcpy(buf, (char*)tmess.Buffer(), bufSize);
-
-       message_t message(buf, bufSize, __freeBuffer, NULL);
-       //fwrite(mess.Buffer(), sizeof(char), bufSize, stdout);
-       
-       socket->send(message);
-
-       
-       //publisher.Send(tmess);
-                       /*
-       TMessage tmess(kMESS_OBJECT);
-       tmess.Reset();
-       tmess.WriteObject(event);
-       TMessage::EnableSchemaEvolutionForAll(kTRUE);
-       SendStreamerInfos(&tmess, socket);
-       int bufsize = tmess.Length();
-       char* buf = (char*) malloc(bufsize * sizeof(char));
-       memcpy(buf, tmess.Buffer(), bufsize);
-       zmq::message_t message((void*)buf, bufsize, 0, 0);
-       socket->send(message);*/
-}
-
-void AliStorageEventManager::Send(vector<serverListStruct> list, socket_t *socket)
-{
-       //send size of the struct first
-       int numberOfRecords = list.size();
-       message_t message(20);
-       snprintf ((char *)message.data(), 20 ,"%d",numberOfRecords);
-
-       socket->send(message);
-       if(numberOfRecords==0)return;
-       socket->recv((new message_t));//empty message just to keep req-rep order
-
-       //prepare message with event's list
-       char *buffer = reinterpret_cast<char*> (&list[0]);
-       message_t *reply = new message_t((void*)buffer,
-                             sizeof(serverListStruct)*numberOfRecords,0);
-       socket->send(*reply);
-
-       if(reply){delete reply;}
-}
-
-void AliStorageEventManager::Send(struct serverRequestStruct *request,zmq::socket_t *socket)
-{
-       char *buffer = (char*)(request);
-       message_t *requestMessage = new message_t((void*)buffer,
-                                          sizeof(struct serverRequestStruct)
-                                          +sizeof(struct listRequestStruct)
-                                          +sizeof(struct eventStruct),0);      
-       socket->send(*requestMessage);
-}
-
-void AliStorageEventManager::Send(struct clientRequestStruct *request,zmq::socket_t *socket)
-{
-       char *buffer = (char*)(request);
-       message_t *requestMessage = new message_t((void*)buffer,
-                                          sizeof(struct clientRequestStruct),0);       
-       socket->send(*requestMessage);
-}
-
-void AliStorageEventManager::Send(long message,zmq::socket_t *socket)
-{
-       stringstream streamBuffer;
-       streamBuffer << message;
-       string stringBuffer = streamBuffer.str();
-       char *buffer = (char*)stringBuffer.c_str();
-       message_t *replyMessage = new message_t((void*)buffer,sizeof(long),0);
-       socket->send(*replyMessage);
-       delete replyMessage;
-       streamBuffer.str(string());
-       streamBuffer.clear();
-}
-
-void AliStorageEventManager::Send(bool message,zmq::socket_t *socket)
-{
-       char *buffer;
-       if(message==true)
-       {
-               buffer = (char*)("true");
-       }
-       else
-       {
-               buffer = (char*)("false");
-       }
-       message_t *replyMessage = new message_t((void*)buffer,sizeof(char*),0);
-       socket->send(*replyMessage);
-       delete replyMessage;
-}
-
-vector<serverListStruct> AliStorageEventManager::GetServerListVector(socket_t *socket)
-{
-       //get size of the incomming message
-       message_t sizeMessage;
-       socket->recv(&sizeMessage);
-       int numberOfRecords;
-       istringstream iss(static_cast<char*>(sizeMessage.data()));
-       iss >> numberOfRecords;
-
-       if(numberOfRecords==0){cout<<"MANAGER -- list is empty"<<endl;}
-       
-       socket->send(*(new message_t()));//receive empty message just to keep req-rep order
-       
-//get list of events
-       message_t *response = new message_t(sizeof(serverListStruct)*numberOfRecords);
-       socket->recv(response);
-       
-       vector<serverListStruct> receivedList(static_cast<serverListStruct*>(response->data()), static_cast<serverListStruct*>(response->data()) + numberOfRecords);
-
-       return receivedList;
-}
-
-AliESDEvent* AliStorageEventManager::GetEvent(socket_t *socket)
-{
-       message_t *message = new message_t();
-       
-       socket->recv(message);
-       int bufSize = (int)message->size();
-               
-       char* buf = new char[bufSize];
-       memcpy(buf, (char*)message->data(), bufSize);
-       
-       AliNetMessage *mess = new AliNetMessage(buf, bufSize);
-       
-       /*
-       message_t* message = RecvStreamerInfos(socket);
-       int64_t more;
-       size_t more_size = sizeof more;
-    
-       socket->getsockopt(ZMQ_RCVMORE, &more, &more_size );
-       socket->recv(message);
-       TBufferFile *mess = new TBufferFile(TBuffer::kRead,
-                                           message->size()+sizeof(UInt_t),
-                                           message->data());
-       mess->InitMap();
-       mess->ReadClass();// get first the class stored in message
-       mess->SetBufferOffset(sizeof(UInt_t) + sizeof(kMESS_OBJECT));
-       mess->ResetMap();
-       
-
-       //message_t *mess;
-       //socket->recv(message);
-       */
-       AliESDEvent* data = (AliESDEvent*)(mess->ReadObjectAny(AliESDEvent::Class()));
-       if (data)
-       {
-               TTree* tree= new TTree("esdTree", "esdTree");
-               data->WriteToTree(tree);
-               tree-> Fill();
-               AliESDEvent* event= new AliESDEvent();
-               event->ReadFromTree(tree);
-               tree->GetEntry(0);
-               delete data;
-               delete tree;
-               if(message){delete message;}
-               return event;                   
-       }
-       else
-       {
-               if(message){delete message;}
-               return NULL;
-       }
-}
-
-message_t* AliStorageEventManager::RecvStreamerInfos(socket_t *socket)
-{
-       message_t *message = new message_t;
-       socket->recv(message);
-       TBufferFile *mess = new TBufferFile(TBuffer::kRead,
-                                           message->size()+2*sizeof(UInt_t),
-                                           message->data());
-       if(!mess)
-       {
-               if(message){delete message;}
-               return NULL;
-       }
-       mess->InitMap();
-       mess->ReadClass();     // get first the class stored in message
-       mess->SetBufferOffset(sizeof(UInt_t) + sizeof(TMessage));
-       mess->ResetMap();
-       TList *list = (TList*)mess->ReadObjectAny(TList::Class());
-       if(list==0 || list->IsEmpty())
-       {
-               return message;
-       }
-       if(message){delete message;}
-       TIter next(list);
-       TStreamerInfo *info;
-       TObjLink *lnk = list->FirstLink();
-       // First call BuildCheck for regular class
-       while (lnk)
-       {
-               info = (TStreamerInfo*)lnk->GetObject();
-               TObject *element = info->GetElements()->UncheckedAt(0);
-               Bool_t isstl = element && strcmp("This",element->GetName())==0;
-               if (!isstl)
-               {
-                       info->BuildCheck();
-                       if (gDebug > 0)
-                       {
-                               Info("RecvStreamerInfos",
-                                    "importing TStreamerInfo: %s, version = %d",
-                                    info->GetName(),
-                                    info->GetClassVersion());
-                       }
-               }
-               lnk = lnk->Next();
-       }
-       lnk = list->FirstLink();
-       while (lnk)
-       {
-               info = (TStreamerInfo*)lnk->GetObject();
-               TObject *element = info->GetElements()->UncheckedAt(0);
-               Bool_t isstl = element && strcmp("This",element->GetName())==0;
-               if (isstl)
-               {
-                       info->BuildCheck();
-                       if (gDebug > 0)
-                       {
-                               Info("RecvStreamerInfos",
-                                    "importing TStreamerInfo: %s, version = %d",
-                                    info->GetName(),
-                                    info->GetClassVersion());
-                       }
-               }
-               lnk = lnk->Next();
-       }
-       if(list){delete list;}
-       if(mess){delete mess;}
-       if(lnk){delete lnk;}
-       return message;
-}
-
-void AliStorageEventManager::SendStreamerInfos(TMessage* mess, socket_t *socket)
-{
-       TList* infos = mess->GetStreamerInfos();
-   
-       TIter next(infos);
-       TStreamerInfo *info;
-       TList *minilist = 0;
-       while ((info = (TStreamerInfo*)next()))
-       {
-               //Int_t uid = info->GetNumber();
-               if (!minilist) minilist = new TList();
-         
-               minilist->Add(info);
-       }
-      
-       if (minilist)
-       {
-               TMessage messinfo(kMESS_STREAMERINFO);
-               messinfo.WriteObject(minilist);
-               delete minilist;
-               if (messinfo.GetStreamerInfos())
-                       messinfo.GetStreamerInfos()->Clear();
-          
-               int bufsize = messinfo.Length();
-               char* buf = (char*) malloc(bufsize * sizeof(char));
-               memcpy(buf, messinfo.Buffer(), bufsize);
-
-               // send!
-               zmq::message_t message((void*)buf, bufsize, 0, 0);
-                     
-               if (socket->send(message, ZMQ_SNDMORE))
-               {
-                       Warning("SendStreamerInfos", "problems sending TStreamerInfo's ...");
-               }
-       }
-
-       return;
-}
-
-
diff --git a/STORAGE/AliStorageEventManager.h b/STORAGE/AliStorageEventManager.h
deleted file mode 100644 (file)
index 2751f33..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef AliStorageEventManager_H
-#define AliStorageEventManager_H
-
-#include "AliESDEvent.h"
-#include "AliStorageTypes.h"
-
-#include <vector>
-
-#include <TMessage.h>
-
-namespace zmq
-{
-       class socket_t;
-       class message_t;
-}
-
-class AliStorageEventManager
-{
-public:
-       AliStorageEventManager();
-       ~AliStorageEventManager();
-
-       void Send(std::vector<serverListStruct> list,zmq::socket_t *socket);
-       void Send(struct serverRequestStruct *request,zmq::socket_t *socket);
-       void Send(struct clientRequestStruct *request,zmq::socket_t *socket);
-       void Send(AliESDEvent *event, zmq::socket_t *socket);
-       void Send(long message,zmq::socket_t *socket);
-       void Send(bool message,zmq::socket_t *socket);
-       
-       std::vector<serverListStruct> GetServerListVector(zmq::socket_t *socket);
-       AliESDEvent* GetEvent(zmq::socket_t *socket);
-       
-private:
-       void SendStreamerInfos(TMessage *mess, zmq::socket_t *socket);
-       zmq::message_t* RecvStreamerInfos(zmq::socket_t *socket);
-};
-
-#endif
diff --git a/STORAGE/CMakeLists.txt b/STORAGE/CMakeLists.txt
deleted file mode 100755 (executable)
index b6a97be..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# AliRoot Build System CMakeLists for EVE
-#
-# Author: Johny Jose m(johny.jose@cern.ch)
-#         Port of previous Makefile build to cmake
-
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
-
-if(ZEROMQ_FOUND)
-set(PACKAGES "${PACKAGES}"
-    CMakebinalifakedisplay.pkg
-    CMakebinalistorageadmin.pkg
-    CMakebinalistorage.pkg
-    CMakelibStorage.pkg
-)
-ENDIF(ZEROMQ_FOUND)
-
-ALICE_BuildModule()
diff --git a/STORAGE/CMakebinalifakedisplay.pkg b/STORAGE/CMakebinalifakedisplay.pkg
deleted file mode 100755 (executable)
index a019396..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- mode: CMake -*- 
-#-----------------------------------------------------------------------#
-# Package File for alieve                                                        #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#-----------------------------------------------------------------------#
-
-set ( SRCS  alifakedisplay.cxx)
-
-set ( EINCLUDE )
-set ( ELIBSDIR )
-
-set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
-
-if(PYTHIA6)
-  list (APPEND ELIBS EVGEN HepMC HepMCParser)
-endif(PYTHIA6)
-
-set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
-
-set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lStorage ${SYSLIBS} )
-
-if( ALICE_TARGET STREQUAL "macosx")
-                       
-       set ( ELIBS ${ELIBS} GL)
-       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
-       
-  set ( ELIBSCPP ${ELIBS})
-       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
-
-  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
-
-       if( MACOSX_MINOR STREQUAL "5")
-                                               
-               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
-
-  endif( MACOSX_MINOR STREQUAL "5")
-       
-  set ( ELIBS ${ELIBS} GLU)
-       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
-       
-endif( ALICE_TARGET STREQUAL "macosx")
-
-set ( ELIBS ${ELIBS} Storage )
\ No newline at end of file
diff --git a/STORAGE/CMakebinalistorage.pkg b/STORAGE/CMakebinalistorage.pkg
deleted file mode 100755 (executable)
index df29264..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- mode: CMake -*- 
-#-----------------------------------------------------------------------#
-# Package File for alieve                                                        #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#-----------------------------------------------------------------------#
-
-set ( SRCS  alistorage_main/alistorage_main.cxx)
-
-set ( EINCLUDE )
-set ( ELIBSDIR )
-
-set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
-
-if(PYTHIA6)
-  list (APPEND ELIBS EVGEN HepMC HepMCParser)
-endif(PYTHIA6)
-
-set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
-
-set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lStorage ${SYSLIBS} )
-
-if( ALICE_TARGET STREQUAL "macosx")
-                       
-       set ( ELIBS ${ELIBS} GL)
-       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
-       
-  set ( ELIBSCPP ${ELIBS})
-       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
-
-  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
-
-       if( MACOSX_MINOR STREQUAL "5")
-                                               
-               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
-
-  endif( MACOSX_MINOR STREQUAL "5")
-       
-  set ( ELIBS ${ELIBS} GLU)
-       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
-       
-endif( ALICE_TARGET STREQUAL "macosx")
-
-set ( ELIBS ${ELIBS} Storage )  
-
diff --git a/STORAGE/CMakebinalistorageadmin.pkg b/STORAGE/CMakebinalistorageadmin.pkg
deleted file mode 100755 (executable)
index 0cc383f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- mode: CMake -*- 
-#-----------------------------------------------------------------------#
-# Package File for alieve                                                        #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#-----------------------------------------------------------------------#
-
-set ( SRCS  alistorageadmin_main/alistorageadmin_main.cxx)
-
-set ( EINCLUDE )
-set ( ELIBSDIR )
-
-set ( ELIBS  EveBase EveDet MUONmapping MUONevaluation MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCsim TPCrec TPCbase TPCutil ITSbase ITSsim ITSrec ITSUpgradeBase ITSUpgradeSim PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec STEER CDB AOD ESD STEERBase ANALYSISalice ANALYSIS THijing hijing THbtp TEPEMGEN FASTSIM microcern RAWDatasim RAWDatarec RAWDatabase HLTbase XMLParser STAT OADB)
-
-if(PYTHIA6)
-  list (APPEND ELIBS EVGEN HepMC HepMCParser)
-endif(PYTHIA6)
-
-set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCfast STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
-
-set ( PACKBLIBS  ${ROOTCLIBS} ${ROOTPLIBS} -lTreePlayer -lGeomPainter -lGed -lRGL -lEve -lzmq -lStorage ${SYSLIBS} )
-
-if( ALICE_TARGET STREQUAL "macosx")
-                       
-       set ( ELIBS ${ELIBS} GL)
-       set ( ELIBSDIR ${ELIBSDIR} /usr/X11R6/lib/)
-       
-  set ( ELIBSCPP ${ELIBS})
-       list(REMOVE_ITEM ELIBSCPP microcern lhapdf herwig)
-
-  ALICE_Format(PACKLDFLAGS "-Wl,-u,_G__cpp_setupG__" "" ${LDFLAGS})
-
-       if( MACOSX_MINOR STREQUAL "5")
-                                               
-               set ( PACKLDFLAGS "${PACKLDFLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
-
-  endif( MACOSX_MINOR STREQUAL "5")
-       
-  set ( ELIBS ${ELIBS} GLU)
-       set ( ELIBSDIR ${ELIBSDIR} ${FINK_ROOT}/lib)
-       
-endif( ALICE_TARGET STREQUAL "macosx")
-
-set ( ELIBS ${ELIBS} Storage )
\ No newline at end of file
diff --git a/STORAGE/CMakelibStorage.pkg b/STORAGE/CMakelibStorage.pkg
deleted file mode 100755 (executable)
index 5b161df..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-# -*- mode: CMake -*- 
-#--------------------------------------------------------------------------------#
-# Package File for EveBase                                                       #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#--------------------------------------------------------------------------------#
-
-set ( SRCS
-   AliStorageClientThread.cxx
-   AliStorageServerThread.cxx
-   AliStorageAdministratorPanel.cxx
-   AliStorageAdministratorPanelMarkEvent.cxx
-   AliStorageAdministratorPanelListEvents.cxx
-   AliStorageAdministratorPanelSetStorageParams.cxx
-   AliStorageEventManager.cxx
-   AliStorageDatabase.cxx
-)
-
-string ( REPLACE ".cxx" ".h" CINTHDRS "${SRCS}" )
-string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
-
-set ( DHDR  StorageLinkDef.h)
-
-set ( EINCLUDE STORAGE MONITOR MONITORzmq STEER/STEER STEER/AOD STEER/ESD STEER/STEERBase EVE/EveBase )
-
-set ( ELIBS ${ELIBS} ${ZEROMQ_LIBRARIES})
-set ( ELIBSDIR ${ELIBSDIR}  /usr/lib64)
-
-set (EXPORT    
-    AliStorageClientThread.h
-    AliStorageServerThread.h
-    AliStorageAdministratorPanel.h
-    AliStorageAdministratorPanelMarkEvent.h
-    AliStorageAdministratorPanelListEvents.h
-    AliStorageAdministratorPanelSetStorageParams.h
-    AliStorageEventManager.h
-)
diff --git a/STORAGE/alifakedisplay.cxx b/STORAGE/alifakedisplay.cxx
deleted file mode 100644 (file)
index 6580de1..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "AliStorageEventManager.h"
-#include "AliStorageTypes.h"
-#include "AliESDEvent.h"
-
-#include "zmq.hpp"
-#include <iostream>
-
-using namespace std;
-using namespace zmq;
-
-/* parameters:
-
-0 - connect direct