]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
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 8da4573aa7b3891780fa514c1e04eec6617a8646..7d4577cbab497ad75350e8354ecba34ef206d05a 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 a159e963c4f41f5fa6fa0c2dc81c052685cb4b8e..f7adab5428d459473980b622a6d786b785f65afc 100644 (file)
@@ -66,6 +66,7 @@ protected:
        TGTextEntry* fEntryLogbookDB;
        TGTextEntry* fEntryLogbookUser;
        TGTextEntry* fEntryLogbookPass;
+    TGTextEntry* fEntryDataSource;
        
 private:
        void SetupServerTab(TGCompositeFrame* tab);
index ae71ff78c463c82168438bcd5bbad9847ae0668d..e026bcf849c561dc54fa88bb2fd917f3a62e5bfc 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 2b3d2bbb6aded99cf596c52b4e2e1a2e0ff02021..d9b822c7f21b5e6730b34be20aa03f7510413d94 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 8d927338be68030b65f8a6dd6f88caea3efed4c8..5eff9daddbdfbc7822662653a7ba6560d2edc6ce 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 1c7dca48b04f7f5804f08446f4e5bf6bf3f88959..753e5f7fc3b4e3e6f9a6a522526e3f3623e12032 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