Switching between data sources added to alieventserver (local or GDSs active in curre...
authorjniedzie <jeremi.niedziela@cern.ch>
Mon, 15 Sep 2014 08:25:21 +0000 (10:25 +0200)
committerjniedzie <jeremi.niedziela@cern.ch>
Mon, 15 Sep 2014 08:25:50 +0000 (10:25 +0200)
MONITOR/alieventserver/AliEventServerPreferencesWindow.cxx
MONITOR/alieventserver/AliEventServerPreferencesWindow.h
MONITOR/alieventserver/AliEventServerUtil.h
MONITOR/alieventserver/AliEventServerWindow.cxx
MONITOR/alieventserver/AliEventServerWindow.h
MONITOR/alieventserver/alieventserver.rootrc

index 8da4573..7d4577c 100644 (file)
@@ -285,6 +285,11 @@ void AliEventServerPreferencesWindow::SetupLogbookTab(TGCompositeFrame* tab)
        fEntryLogbookPass = new TGTextEntry(cfLogbook, "dqm123");
        fEntryLogbookPass->SetEchoMode(TGTextEntry::kPassword);
        fEntryLogbookPass->Resize(150,0);
+    
+    // data source
+    TGLabel* lbDataSource = new TGLabel(cfLogbook, "Data source:");
+    fEntryDataSource = new TGTextEntry(cfLogbook, "local");
+    fEntryDataSource->Resize(150,0);
        
        cfLogbook->AddFrame(lbLogbookHost, new TGLayoutHints(kLHintsCenterY));
        cfLogbook->AddFrame(fEntryLogbookHost, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
@@ -296,6 +301,8 @@ void AliEventServerPreferencesWindow::SetupLogbookTab(TGCompositeFrame* tab)
        cfLogbook->AddFrame(fEntryLogbookUser, new TGLayoutHints(kLHintsNormal));
        cfLogbook->AddFrame(lbLogbookPass, new TGLayoutHints(kLHintsCenterY));
        cfLogbook->AddFrame(fEntryLogbookPass, new TGLayoutHints(kLHintsNormal));
+    cfLogbook->AddFrame(lbDataSource, new TGLayoutHints(kLHintsCenterY));
+    cfLogbook->AddFrame(fEntryDataSource, new TGLayoutHints(kLHintsNormal));
        
        tab->AddFrame(cfLogbook, new TGLayoutHints(kLHintsNormal));
 }
@@ -416,6 +423,7 @@ Int_t AliEventServerPreferencesWindow::ReadSettings()
        fEntryLogbookDB->SetText( settings.GetValue("logbook.db", DEFAULT_LOGBOOK_DB), kFALSE);
        fEntryLogbookUser->SetText( settings.GetValue("logbook.user", DEFAULT_LOGBOOK_USER), kFALSE);
        fEntryLogbookPass->SetText( settings.GetValue("logbook.pass", DEFAULT_LOGBOOK_PASS), kFALSE);
+    fEntryDataSource->SetText( settings.GetValue("data.source", DEFAULT_LOGBOOK_PASS), kFALSE);
 
        return readStatus;
 }
@@ -482,6 +490,7 @@ Int_t AliEventServerPreferencesWindow::WriteSettings()
        settings.SetValue("logbook.db", fEntryLogbookDB->GetText());
        settings.SetValue("logbook.user", fEntryLogbookUser->GetText());
        settings.SetValue("logbook.pass", fEntryLogbookPass->GetText());
+    settings.SetValue("data.source", fEntryDataSource->GetText());
        
        printf("Writting settings to file: %s\n", Form("%s/MONITOR/%s", gSystem->Getenv("ALICE_ROOT"), ALIEVENTSERVER_CONF) );
        
@@ -547,4 +556,5 @@ void AliEventServerPreferencesWindow::RestoreDefaults()
        fEntryLogbookDB->SetText( DEFAULT_LOGBOOK_DB, kFALSE);
        fEntryLogbookUser->SetText( DEFAULT_LOGBOOK_USER, kFALSE);
        fEntryLogbookPass->SetText( DEFAULT_LOGBOOK_PASS, kFALSE);
+    fEntryDataSource->SetText( DEFAULT_DATA_SOURCE, kFALSE);
 }
index a159e96..f7adab5 100644 (file)
@@ -66,6 +66,7 @@ protected:
        TGTextEntry* fEntryLogbookDB;
        TGTextEntry* fEntryLogbookUser;
        TGTextEntry* fEntryLogbookPass;
+    TGTextEntry* fEntryDataSource;
        
 private:
        void SetupServerTab(TGCompositeFrame* tab);
index ae71ff7..e026bcf 100644 (file)
@@ -28,6 +28,7 @@
 #define DEFAULT_LOGBOOK_DB "logbook"
 #define DEFAULT_LOGBOOK_USER "dqm"
 #define DEFAULT_LOGBOOK_PASS "dqm123"
+#define DEFAULT_DATA_SOURCE "local"
 
 #include <TSystem.h>
 #include <TString.h>
index 2b3d2bb..d9b822c 100644 (file)
@@ -158,11 +158,15 @@ void AliEventServerWindow::SetupToolbar()
        mToolBar->AddButton(this, new TGPictureButton(mToolBar, Form("%s/MONITOR/icons/stop.png", gSystem->Getenv("ALICE_ROOT")), TOOLBUTTON_STOP) );
        mToolBar->AddButton(this, new TGPictureButton(mToolBar, Form("%s/MONITOR/icons/preferences.png", gSystem->Getenv("ALICE_ROOT")), TOOLBUTTON_PREFERENCES) );
        mToolBar->AddButton(this, new TGPictureButton(mToolBar, Form("%s/MONITOR/icons/exit.png", gSystem->Getenv("ALICE_ROOT")), TOOLBUTTON_EXIT) );
+    
+    TGTextButton *fakeButton= new TGTextButton(this,"Fake",TOOLBUTTON_FAKE);
        
+    fakeButton->Connect("Clicked()", "AliEventServerWindow", this, "onFake()");
        mToolBar->Connect("Clicked(Int_t)", "AliEventServerWindow", this, "HandleToolBarAction(Int_t)");
        
        AddFrame(mToolBar, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
        AddFrame(new TGHorizontal3DLine(this), new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
+    AddFrame(fakeButton,new TGLayoutHints(kLHintsNormal));
 }
 
 void AliEventServerWindow::HandleToolBarAction(Int_t id)
@@ -231,10 +235,23 @@ Warning("FinishedReconstruction", "Run number %d not registered.", run);
 
 void AliEventServerWindow::StartReco(Int_t run)
 {
-       AliInfo(Form("Starting Reco for run %d", run));
-  
-       TString eventSource = Form("mem://%s/run%d", gSystem->Getenv("ONLINERECO_RAWFILES_DIR"), run);
-  
+    TEnv settings;
+    settings.ReadFile(AliEventServerUtil::GetPathToServerConf(), kEnvUser);
+    
+    TString dataSource = settings.GetValue("data.source", DEFAULT_DATA_SOURCE);
+    TString eventSource;
+    
+    if(dataSource=="local")
+    {
+        AliInfo(Form("Starting Reco for run %d", run));
+        eventSource = Form("mem://%s/run%d", gSystem->Getenv("ONLINERECO_RAWFILES_DIR"), run);
+    }
+    else if(dataSource=="run")
+    {
+        AliInfo("Starting Reco for GDCs active in current run");
+        eventSource = "mem://@*:";
+    }
+    
        if(!fRecoServer) LaunchRecoServer();
     
        fRecoServer->StartReconstruction(run, eventSource.Data());
@@ -310,6 +327,12 @@ void AliEventServerWindow::onExit()
        gSystem->ExitLoop();
 }
 
+void AliEventServerWindow::onFake()
+{
+    AliInfo("Faking Dim signal: starting reco for run 197669");
+    StartOfRun(197669);
+}
+
 void AliEventServerWindow::LaunchRecoServer()
 {
        fRecoServer = new AliEventServerReconstruction();               
index 8d92733..5eff9da 100644 (file)
@@ -32,7 +32,8 @@ public:
                TOOLBUTTON_START=1,
                TOOLBUTTON_STOP,
                TOOLBUTTON_PREFERENCES,
-               TOOLBUTTON_EXIT         
+               TOOLBUTTON_EXIT,
+        TOOLBUTTON_FAKE
        };
   
        AliEventServerWindow();
@@ -51,6 +52,7 @@ public:
        void onStartServer();
        void onStopServer();
        void onExit();
+    void onFake();
 
        void HandleToolBarAction(Int_t id=-1);
 
index 1c7dca4..753e5f7 100644 (file)
@@ -21,3 +21,6 @@ logbook.port:                            3306
 logbook.db:                              logbook
 logbook.user:                            dqm
 logbook.pass:                            dqm123
+
+//data source (local, run)
+data.source                              local