Fixes in online reconstruction, Event Display and Storage Manager
authorjniedzie <jeremi.niedziela@cern.ch>
Mon, 9 Feb 2015 14:05:29 +0000 (15:05 +0100)
committerjniedzie <jeremi.niedziela@cern.ch>
Tue, 10 Feb 2015 07:50:12 +0000 (08:50 +0100)
12 files changed:
EVE/EveBase/AliEveEventManager.cxx
EVE/EveBase/AliEveEventManager.h
EVE/macros/alieve_online_new.C
MONITOR/MONITORzmq/AliEventsCollectorThread.cxx
MONITOR/MONITORzmq/AliOnlineReconstruction.cxx
MONITOR/MONITORzmq/AliStorageAdministratorPanelListEvents.cxx
MONITOR/MONITORzmq/AliStorageAdministratorPanelListEvents.h
MONITOR/MONITORzmq/AliStorageDatabase.cxx
MONITOR/MONITORzmq/AliStorageEventManager.cxx
MONITOR/MONITORzmq/AliStorageEventManager.h
MONITOR/MONITORzmq/AliStorageServerThread.cxx
MONITOR/alionlinereco/AliOnlineReconstructionUtil.h

index 5546c1d..8ab3e3a 100644 (file)
@@ -112,6 +112,8 @@ TString  AliEveEventManager::fgAODFileName("AliAOD.root");
 TString  AliEveEventManager::fgGAliceFileName("galice.root");
 TString  AliEveEventManager::fgRawFileName("raw.root");
 TString  AliEveEventManager::fgCdbUri;
+TString  AliEveEventManager::fgSpecificCdbUriValue;
+TString  AliEveEventManager::fgSpecificCdbUriPath;
 
 TList*   AliEveEventManager::fgAODfriends = 0;
 
@@ -174,8 +176,8 @@ AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) :
     fEventListenerThread = new TThread("fEventListenerThread",DispatchEventListener,(void*)this);
     fEventListenerThread->Run();
     
-    fStorageManagerWatcherThread = new TThread("fStorageManagerWatcherThread",DispatchStorageManagerWatcher,(void*)this);
-    fStorageManagerWatcherThread->Run();
+    // fStorageManagerWatcherThread = new TThread("fStorageManagerWatcherThread",DispatchStorageManagerWatcher,(void*)this);
+    //fStorageManagerWatcherThread->Run();
       }
 #else
     cout<<"NO ZMQ FOUND. Online events not avaliable."<<endl;
@@ -459,6 +461,13 @@ void AliEveEventManager::SetCdbUri(const TString& cdb)
     if ( ! cdb.IsNull()) fgCdbUri = cdb;
 }
 
+void AliEveEventManager::SetSpecificCdbUri(const TString& path,const TString& value)
+{
+    // Set path to specific CDB object, there is no default.
+  if ( ! value.IsNull()) fgSpecificCdbUriValue = value;
+  if ( ! path.IsNull()) fgSpecificCdbUriPath = path;
+}
+
 void AliEveEventManager::SetGAliceFileName(const TString& galice)
 {
     // Set file-name for opening gAlice, default "galice.root".
@@ -795,17 +804,19 @@ void AliEveEventManager::InitOCDB(int runNo)
                 cdb->SetDefaultStorage("MC", "Residual");
             else if (fgCdbUri == "mcfull://")
                 cdb->SetDefaultStorage("MC", "Full");
-            else if (fgCdbUri == "local://") {
-                fgCdbUri = Form("local://%s/OCDB", gSystem->Getenv("ALICE_ROOT"));
+            else if (fgCdbUri == "local://"){
+               fgCdbUri = Form("local://%s/OCDB", gSystem->Getenv("ALICE_ROOT"));
                cdb->SetDefaultStorage(fgCdbUri);
-            } else
+             } 
+           else{
                 cdb->SetDefaultStorage(fgCdbUri);
-
+               cdb->SetSpecificStorage(fgSpecificCdbUriPath,fgSpecificCdbUriValue);
+             }
             cdb->SetRun(runNo);
 
             if (cdb->IsDefaultStorageSet() == kFALSE)
                 throw kEH + "CDB initialization failed for '" + fgCdbUri + "'.";
-        }
+        }/*
         if (fgCdbUri.BeginsWith("local://"))
         {
             TString curPath = gSystem->WorkingDirectory();
@@ -825,7 +836,7 @@ void AliEveEventManager::InitOCDB(int runNo)
                     cdb->SetSpecificStorage(grp, lpath);
                 }
             }
-       }
+           }*/
     }
 }
 
index e6b391a..62edb41 100644 (file)
@@ -62,6 +62,7 @@ public:
     static void AddAODfriend  (const TString& friendFileName);
     static void SetRawFileName(const TString& raw);
     static void SetCdbUri     (const TString& cdb);
+    static void SetSpecificCdbUri(const TString& path,const TString& value);
     static void SetGAliceFileName(const TString& galice);
 
     // set Local Directory or URL where the files are located
@@ -203,6 +204,8 @@ protected:
     static TString  fgAODFileName;        // Name by which to open AOD.
     static TString  fgRawFileName;        // Name by which to open raw-data file.
     static TString  fgCdbUri;          // Global URI to CDB.
+    static TString  fgSpecificCdbUriValue;             // Global URI to specific CDB object.
+    static TString  fgSpecificCdbUriPath;              // Global URI to specific CDB object.
     static Bool_t   fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data.
     static Bool_t   fgAssertESD;               // Global flag specifying if ESDEvent must be asserted during opening of the event-data.
     static Bool_t   fgAssertAOD;               // Global flag specifying if AODEvent must be asserted during opening of the event-data.
index e222c26..de725c4 100644 (file)
@@ -22,8 +22,13 @@ void alieve_online_new()
         gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
     }
     
-    AliEveEventManager::SetCdbUri("local://$ALICE_ROOT/OCDB");
-    
+    //AliEveEventManager::SetCdbUri("local://$ALICE_ROOT/OCDB");
+    //AliEveEventManager::SetCdbUri("local:///local/OCDB/2013");
+    AliEveEventManager::SetCdbUri("local:///local/cdb");
+    AliEveEventManager::SetSpecificCdbUri("GRP/GRP/Data","local:///local/reco");
+
+    //AliEveEventManager::SetCdbUri("raw://");
     Info("alieve_init", "Adding standard macros.");
     TString  hack = gSystem->pwd(); // Problem with TGFileBrowser cding
     alieve_init_import_macros();
index d3ebcec..f79005c 100644 (file)
@@ -15,7 +15,7 @@ fCurrentFile(0),
 fDatabase(0),
 fFinished(false)
 {
-    fDatabase = new AliStorageDatabase();
+  fDatabase = new AliStorageDatabase();
     
     CheckCurrentStorageSize();
     
@@ -120,10 +120,12 @@ void AliEventsCollectorThread::CollectorHandle()
                 }
                 for(unsigned int i=0;i<eventsToUpdate.size();i++)
                 {
+                 TThread::Lock();
                     fDatabase->UpdateEventPath(eventsToUpdate[i],Form("%s/run%d/chunk%d.root",
                                                     fManager->fStoragePath.c_str(),
                                                     event->GetRunNumber(),
                                                     chunkNumber-1));
+                   TThread::UnLock();
                 }
                 eventsToUpdate.clear();
                 
@@ -185,6 +187,7 @@ void AliEventsCollectorThread::CollectorHandle()
             {
                 eventFile->Close();
                 delete eventFile;
+               TThread::Lock();
                 fDatabase->InsertEvent(event->GetRunNumber(),
                                        event->GetEventNumberInFile(),
                                        (char*)event->GetBeamType(),
@@ -192,7 +195,7 @@ void AliEventsCollectorThread::CollectorHandle()
                                        Form("%s/run%d/event%d.root",fManager->fStoragePath.c_str(),
                                             event->GetRunNumber(),
                                             eventsInChunk));
-                
+               TThread::UnLock();
                 currentEvent.runNumber = event->GetRunNumber();
                 currentEvent.eventNumber = event->GetEventNumberInFile();
                 eventsToUpdate.push_back(currentEvent);
@@ -274,13 +277,16 @@ void AliEventsCollectorThread::CheckCurrentStorageSize()
     {
         while(GetSizeOfAllChunks() > (float)fManager->fRemoveEventsPercentage/100. * fManager->fMaximumStorageSize)
         {
+         TThread::Lock();
             struct eventStruct oldestEvent = fDatabase->GetOldestEvent();
             string oldestEventPath = fDatabase->GetFilePath(oldestEvent);
-            
+           TThread::UnLock();
             //remove oldest event
             cout<<"CLIENT -- Removing old events:"<<oldestEventPath<<endl;
             gSystem->Exec(Form("rm -f %s",oldestEventPath.c_str()));
+           TThread::Lock();
             fDatabase->RemoveEventsWithPath(oldestEventPath);
+           TThread::UnLock();
         }
     }
 }
index 8c32c31..afea00d 100644 (file)
@@ -83,11 +83,11 @@ void AliOnlineReconstruction::StartOfRun()
       return;
     }
   gSystem->cd(recoBaseDir.Data());
-  // gSystem->cd("/");
+  
   cout<<"\n\nRetriving GRP\n\n"<<endl;
   TString gdcs;
   if (RetrieveGRP(gdcs) <= 0 || gdcs.IsNull()){return;}
-  //gSystem->cd(recoBaseDir.Data());
+  
   gSystem->Exec(Form("rm -fr run%d;mkdir run%d",fRun,fRun));
   gSystem->cd(Form("run%d",fRun));
 
@@ -107,6 +107,8 @@ int AliOnlineReconstruction::RetrieveGRP(TString &gdc)
        TString cdbPath = fSettings.GetValue("cdb.defaultStorage", DEFAULT_CDB_STORAGE);
 
        cdbPath = Form("local://%s",gSystem->pwd());
+
+       gSystem->Exec(Form("rm -fr %s/GRP",cdbPath));
        cout<<"CDB path for GRP:"<<cdbPath<<endl;
 
        Int_t ret=AliGRPPreprocessor::ReceivePromptRecoParameters(fRun, dbHost.Data(),
@@ -127,23 +129,33 @@ void AliOnlineReconstruction::SetupReco()
 
        /* Settings CDB */
        cout<<"\n\nSetting CDB manager parameters\n\n"<<endl;
-       fCDBmanager->SetRun(fRun);
+       //fCDBmanager->SetRun(fRun);
        cout<<"Set default storage"<<endl;
 
-       fCDBmanager->SetDefaultStorage(fSettings.GetValue("cdb.defaultStorage", DEFAULT_CDB_STORAGE));
+               fCDBmanager->SetDefaultStorage(fSettings.GetValue("cdb.defaultStorage", DEFAULT_CDB_STORAGE));
 
        fCDBmanager->Print();
-       cout<<"Set specific storage 1"<<endl;
+               cout<<"Set specific storage 1"<<endl;
        fCDBmanager->SetSpecificStorage(fSettings.GetValue( "cdb.specificStoragePath1", DEFAULT_CDB_SPEC_STORAGE_PATH1),  
-                                   fSettings.GetValue( "cdb.specificStorageValue1", DEFAULT_CDB_SPEC_STORAGE_VALUE1));
+                                           fSettings.GetValue( "cdb.specificStorageValue1", DEFAULT_CDB_SPEC_STORAGE_VALUE1));
        fCDBmanager->Print();
-       cout<<"Set specific storage 2"<<endl;
+cout<<"Set specific storage 2"<<endl;
        fCDBmanager->SetSpecificStorage(fSettings.GetValue( "cdb.specificStoragePath2", DEFAULT_CDB_SPEC_STORAGE_PATH2),  
                                    fSettings.GetValue( "cdb.specificStorageValue2", DEFAULT_CDB_SPEC_STORAGE_VALUE2));
        fCDBmanager->Print();
-       cout<<"Set specific storage 3"<<endl;
-       fCDBmanager->SetSpecificStorage(fSettings.GetValue( "cdb.specificStoragePath3", DEFAULT_CDB_SPEC_STORAGE_PATH3),  
-                                   fSettings.GetValue( "cdb.specificStorageValue3", DEFAULT_CDB_SPEC_STORAGE_VALUE3));
+//     cout<<"Set specific storage 3"<<endl;
+//     fCDBmanager->SetSpecificStorage(fSettings.GetValue( "cdb.specificStoragePath3", DEFAULT_CDB_SPEC_STORAGE_PATH3),  
+//                                 fSettings.GetValue( "cdb.specificStorageValue3", DEFAULT_CDB_SPEC_STORAGE_VALUE3));
+
+
+       //fCDBmanager->SetSpecificStorage("TPC/Calib//PreprocStatus","local:///local/cdb");
+       //fCDBmanager->SetSpecificStorage("TPC/Calib//HighVoltage","local:///local/cdb");
+       //fCDBmanager->SetSpecificStorage("TPC/Calib//Goofie","local:///local/cdb");
+       //fCDBmanager->SetSpecificStorage("GRP/CTP/LTUConfig","local:///local/cdb");
+
+
+       //fCDBmanager->SetSpecificStorage("GRP/CTP/Scalers","local:///local/cdb");
+
        fCDBmanager->Print();
 
        /* Reconstruction settings */  
@@ -165,6 +177,7 @@ void AliOnlineReconstruction::SetupReco()
        fAliReco->SetCleanESD(fSettings.GetValue( "reco.cleanESD",DEFAULT_RECO_CLEAN_ESD));
        fCDBmanager->Print();
        // init reco for given run
+       //fAliReco->SetOption("TPC","useHLTorRAW");
        fAliReco->InitRun(fDataSource.Data());
 }
 
@@ -209,7 +222,7 @@ void AliOnlineReconstruction::ReconstructionLoop()
              if (status){
                event = fAliReco->GetESDEvent();
                eventManager->Send(event,EVENTS_SERVER_PUB);
-               eventManager->SendAsXml(event,XML_PUB);
+               //eventManager->SendAsXml(event,XML_PUB);
 
                // sending RecPoints:
                /*
index 364e2d2..f9424dd 100644 (file)
@@ -87,9 +87,11 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
    // "Run" group frame
    TGGroupFrame *fRunGroupFrame = new TGGroupFrame(this,"Run");
    fRunGroupFrame->SetLayoutBroken(kTRUE);
-   fRunMinEntry = new TGNumberEntry(fRunGroupFrame, (Double_t) 0,9,ENTRY_RUN_MIN,(TGNumberFormat::EStyle) 5);
+   
+   fRunMinEntry = new TGNumberEntry(fRunGroupFrame,0,9,ENTRY_RUN_MIN,(TGNumberFormat::EStyle) 5);
    fRunGroupFrame->AddFrame(fRunMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fRunMinEntry->MoveResize(38,22,80,22);
+   
    TGLabel *fRunMinLabel = new TGLabel(fRunGroupFrame,"Min:");
    fRunMinLabel->SetTextJustify(36);
    fRunMinLabel->SetMargins(0,0,0,0);
@@ -103,21 +105,24 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
    fRunMaxLabel->SetWrapLength(-1);
    fRunGroupFrame->AddFrame(fRunMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fRunMaxLabel->MoveResize(120,22,30,24);
-   fRunMaxEntry = new TGNumberEntry(fRunGroupFrame, (Double_t) 0,8,ENTRY_RUN_MAX,(TGNumberFormat::EStyle) 5);
+   
+   fRunMaxEntry = new TGNumberEntry(fRunGroupFrame,999999,8,ENTRY_RUN_MAX,(TGNumberFormat::EStyle) 5);
    fRunGroupFrame->AddFrame(fRunMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fRunMaxEntry->MoveResize(150,22,72,22);
 
    fRunGroupFrame->SetLayoutManager(new TGVerticalLayout(fRunGroupFrame));
-   fRunGroupFrame->Resize(230,60);
+   //fRunGroupFrame->Resize(230,60);
    AddFrame(fRunGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fRunGroupFrame->MoveResize(8,8,230,60);
    
    // "Event" group frame
    TGGroupFrame *fEventGroupFrame = new TGGroupFrame(this,"Event");
    fEventGroupFrame->SetLayoutBroken(kTRUE);
-   fEventMinEntry = new TGNumberEntry(fEventGroupFrame, (Double_t) 0,9,ENTRY_EVENT_MIN,(TGNumberFormat::EStyle) 5);
+   
+   fEventMinEntry = new TGNumberEntry(fEventGroupFrame,0,9,ENTRY_EVENT_MIN,(TGNumberFormat::EStyle) 5);
    fEventGroupFrame->AddFrame(fEventMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fEventMinEntry->MoveResize(38,22,80,22);
+   
    TGLabel *fEventMinLabel = new TGLabel(fEventGroupFrame,"Min:");
    fEventMinLabel->SetTextJustify(36);
    fEventMinLabel->SetMargins(0,0,0,0);
@@ -131,50 +136,58 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
    fEventMaxLabel->SetWrapLength(-1);
    fEventGroupFrame->AddFrame(fEventMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fEventMaxLabel->MoveResize(120,22,30,24);
-   fEventMaxEntry = new TGNumberEntry(fEventGroupFrame, (Double_t) 0,8,ENTRY_EVENT_MAX,(TGNumberFormat::EStyle) 5);
+   
+   fEventMaxEntry = new TGNumberEntry(fEventGroupFrame,999999,8,ENTRY_EVENT_MAX,(TGNumberFormat::EStyle) 5);
    fEventGroupFrame->AddFrame(fEventMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fEventMaxEntry->MoveResize(150,22,72,22);
+   
    fEventGroupFrame->SetLayoutManager(new TGVerticalLayout(fEventGroupFrame));
-   fEventGroupFrame->Resize(230,60);
+   //fEventGroupFrame->Resize(230,60);
    AddFrame(fEventGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fEventGroupFrame->MoveResize(8,68,230,60);
    
    // "Multiplicity" group frame
    TGGroupFrame *fMultiplicityGroupFrame = new TGGroupFrame(this,"Multiplicity");
    fMultiplicityGroupFrame->SetLayoutBroken(kTRUE);
-   fMultiplicityMinEntry = new TGNumberEntry(fMultiplicityGroupFrame, (Double_t) 0,9,ENTRY_MULTIPLICITY_MIN,(TGNumberFormat::EStyle) 5);
+   
+   fMultiplicityMinEntry = new TGNumberEntry(fMultiplicityGroupFrame,0,9,ENTRY_MULTIPLICITY_MIN,(TGNumberFormat::EStyle) 5);
    fMultiplicityGroupFrame->AddFrame(fMultiplicityMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fMultiplicityMinEntry->MoveResize(38,22,80,22);
+   
    TGLabel *fMultiplicityMinLabel = new TGLabel(fMultiplicityGroupFrame,"Min:");
    fMultiplicityMinLabel->SetTextJustify(36);
    fMultiplicityMinLabel->SetMargins(0,0,0,0);
    fMultiplicityMinLabel->SetWrapLength(-1);
    fMultiplicityGroupFrame->AddFrame(fMultiplicityMinLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fMultiplicityMinLabel->MoveResize(8,22,30,18);
+   
    TGLabel *fMultiplicityMaxLabel = new TGLabel(fMultiplicityGroupFrame,"Max:");
    fMultiplicityMaxLabel->SetTextJustify(36);
    fMultiplicityMaxLabel->SetMargins(0,0,0,0);
    fMultiplicityMaxLabel->SetWrapLength(-1);
    fMultiplicityGroupFrame->AddFrame(fMultiplicityMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fMultiplicityMaxLabel->MoveResize(120,22,30,24);
-   fMultiplicityMaxEntry = new TGNumberEntry(fMultiplicityGroupFrame, (Double_t) 0,8,ENTRY_MULTIPLICITY_MAX,(TGNumberFormat::EStyle) 5);
+   
+   fMultiplicityMaxEntry = new TGNumberEntry(fMultiplicityGroupFrame,999999,8,ENTRY_MULTIPLICITY_MAX,(TGNumberFormat::EStyle) 5);
    fMultiplicityGroupFrame->AddFrame(fMultiplicityMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fMultiplicityMaxEntry->MoveResize(150,22,72,22);
 
    fMultiplicityGroupFrame->SetLayoutManager(new TGVerticalLayout(fMultiplicityGroupFrame));
-   fMultiplicityGroupFrame->Resize(230,60);
+   //fMultiplicityGroupFrame->Resize(230,60);
    AddFrame(fMultiplicityGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fMultiplicityGroupFrame->MoveResize(8,128,230,60);
 
    // "Beam" group frame
    TGGroupFrame *fBeamGroupFrame = new TGGroupFrame(this,"Beam");
    fBeamGroupFrame->SetLayoutBroken(kTRUE);
+   
    fPPcheckbox = new TGCheckButton(fBeamGroupFrame,"p-p",BUTTON_CHECK_PP);
    fPPcheckbox->SetTextJustify(36);
    fPPcheckbox->SetMargins(0,0,0,0);
    fPPcheckbox->SetWrapLength(-1);
    fBeamGroupFrame->AddFrame(fPPcheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fPPcheckbox->MoveResize(8,22,40,19);
+   
    fPbPbcheckbox = new TGCheckButton(fBeamGroupFrame,"Pb-Pb",BUTTON_CHECK_PBPB);
    fPbPbcheckbox->SetTextJustify(36);
    fPbPbcheckbox->SetMargins(0,0,0,0);
@@ -183,19 +196,21 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
    fPbPbcheckbox->MoveResize(60,22,55,19);
 
    fBeamGroupFrame->SetLayoutManager(new TGVerticalLayout(fBeamGroupFrame));
-   fBeamGroupFrame->Resize(230,60);
+   //fBeamGroupFrame->Resize(230,60);
    AddFrame(fBeamGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fBeamGroupFrame->MoveResize(8,188,230,60);
 
    // "Storage" group frame
    TGGroupFrame *fStorageGroupFrame = new TGGroupFrame(this,"Storage");
    fStorageGroupFrame->SetLayoutBroken(kTRUE);
+
    fPermanentCheckbox = new TGCheckButton(fStorageGroupFrame,"Permanent",BUTTON_CHECK_PERM);
    fPermanentCheckbox->SetTextJustify(36);
    fPermanentCheckbox->SetMargins(0,0,0,0);
    fPermanentCheckbox->SetWrapLength(-1);
    fStorageGroupFrame->AddFrame(fPermanentCheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fPermanentCheckbox->MoveResize(8,22,80,19);
+
    fTemporaryCheckbox = new TGCheckButton(fStorageGroupFrame,"Temporary",BUTTON_CHECK_TEMP);
    fTemporaryCheckbox->SetTextJustify(36);
    fTemporaryCheckbox->SetMargins(0,0,0,0);
@@ -204,7 +219,7 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
    fTemporaryCheckbox->MoveResize(120,22,80,19);
 
    fStorageGroupFrame->SetLayoutManager(new TGVerticalLayout(fStorageGroupFrame));
-   fStorageGroupFrame->Resize(230,60);
+   // fStorageGroupFrame->Resize(230,60);
    AddFrame(fStorageGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fStorageGroupFrame->MoveResize(8,248,230,60);
    
@@ -236,14 +251,13 @@ void AliStorageAdministratorPanelListEvents::InitWindow()
    // list box
    fListBox = new TGListBox(this);
    fListBox->SetName("fListBox");
-   fListBox->AddEntry("Entry 1",0);
-   fListBox->Resize(230,436);
+   fListBox->AddEntry(new TGString("Run   Event   System   Mult   Marked"),0);
+   //fListBox->Resize(230,436);
    AddFrame(fListBox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
    fListBox->MoveResize(8,360,230,436);
 
-   SetMWMHints(kMWMDecorAll,
-                        kMWMFuncAll,
-                        kMWMInputModeless);
+   //  SetMWMHints(kMWMDecorAll,kMWMFuncAll,kMWMInputModeless);
+
    MapSubwindows();
    Resize(GetDefaultSize());
    MapWindow();
@@ -259,64 +273,40 @@ void AliStorageAdministratorPanelListEvents::onGetListButton()
        struct serverRequestStruct *requestMessage = new struct serverRequestStruct;
        struct listRequestStruct list; 
 
-       //get listing parameters from somwhere
+       //build query
        list.runNumber[0]=fRunMinEntry->GetIntNumber();
        list.runNumber[1]=fRunMaxEntry->GetIntNumber();
        list.eventNumber[0]=fEventMinEntry->GetIntNumber();
        list.eventNumber[1]=fEventMaxEntry->GetIntNumber();
-       if(fTemporaryCheckbox->GetState()==1)
-       {
-               list.marked[0]=0;
-       }
-       else
-       {
-               list.marked[0]=-1;
-       }
-       if(fPermanentCheckbox->GetState()==1)
-       {
-               list.marked[1]=1;
-       }
-       else
-       {
-               list.marked[1]=-1;
-       }
+       if(fTemporaryCheckbox->GetState()==1){list.marked[0]=0;}
+       else{list.marked[0]=-1;}
+       if(fPermanentCheckbox->GetState()==1){list.marked[1]=1;}
+       else{list.marked[1]=-1;}
        list.multiplicity[0]=fMultiplicityMinEntry->GetIntNumber();
        list.multiplicity[1]=fMultiplicityMaxEntry->GetIntNumber();
-       if(fPPcheckbox->GetState()==1)
-       {
-               strcpy(list.system[0],"p-p");
-       }
-       else
-       {
-               strcpy(list.system[0],"");
-       }
-       if(fPbPbcheckbox->GetState()==1)
-       {
-               strcpy(list.system[1],"A-A");
-       }
-       else
-       {
-               strcpy(list.system[1],"");
-       }
+       if(fPPcheckbox->GetState()==1){strcpy(list.system[0],"p-p");}
+       else{strcpy(list.system[0],"");}
+       if(fPbPbcheckbox->GetState()==1){strcpy(list.system[1],"A-A");}
+       else{strcpy(list.system[1],"");}
        
        requestMessage->messageType = REQUEST_LIST_EVENTS;
        requestMessage->list = list;
 
-       fEventManager->Send(requestMessage,fServerSocket);
+       if(!fEventManager->Send(requestMessage,fServerSocket,1000)){return;}
 
        fListBox->RemoveAll();
        fListBox->AddEntry(new TGString("Run   Event   System   Mult   Marked"),0);
-       
+
        vector<serverListStruct> receivedList = fEventManager->GetServerListVector(fServerSocket);
-    
+       
        for(unsigned int i=0;i<receivedList.size();i++)
        {
-               fListBox->InsertEntry(Form("%d   %d   %s   %d   %d   ",
+         fListBox->AddEntry(new TGString(Form("%d   %d   %s   %d   %d   ",
                                              receivedList[i].runNumber,
                                              receivedList[i].eventNumber,
                                              receivedList[i].system,
                                              receivedList[i].multiplicity,
-                                             receivedList[i].marked),i+1,i);
+                                             receivedList[i].marked)),i+1);
        }
 
        fEventsListVector = receivedList;
@@ -397,7 +387,7 @@ void AliStorageAdministratorPanelListEvents::onLoadButton()
     SelectedEvent();
 }
 
-void AliStorageAdministratorPanelListEvents::onCloseButton(){onExit();}
+//void AliStorageAdministratorPanelListEvents::onCloseButton(){onExit();}
 void AliStorageAdministratorPanelListEvents::CloseWindow(){onExit();}
 
 void AliStorageAdministratorPanelListEvents::onExit()
@@ -417,7 +407,7 @@ Bool_t AliStorageAdministratorPanelListEvents::ProcessMessage(Long_t msg, Long_t
                case kCM_BUTTON:
                        switch(parm1)
                        {
-                       case BUTTON_CLOSE:onCloseButton();break;
+                         //    case BUTTON_CLOSE:onCloseButton();break;
                        case BUTTON_GET_LIST:onGetListButton();break;
                        case BUTTON_MARK_EVENT:onMarkButton();break;
             case BUTTON_LOAD_EVENT:onLoadButton();break;
index 524e561..0f86543 100644 (file)
@@ -25,8 +25,6 @@ private:
        
        static AliStorageAdministratorPanelListEvents *fInstance;
        
-    
-    
        //gui components and methods
        TGLabel *fStatusLabel;
        TGNumberEntry *fRunMinEntry;
@@ -41,7 +39,7 @@ private:
        TGCheckButton *fTemporaryCheckbox;
        TGCheckButton *fPermanentCheckbox;
        
-       TGTextButton *fCloseButton;
+       //      TGTextButton *fCloseButton;
        TGTextButton *fGetListButton;
        TGTextButton *fMarkButton;
        TGTextButton *fLoadButton;
index e101e5d..4d635bf 100644 (file)
@@ -140,7 +140,26 @@ bool AliStorageDatabase::UpdateEventPath(struct eventStruct event,const char *ne
 
 vector<serverListStruct> AliStorageDatabase::GetList(struct listRequestStruct list)
 {
-       TSQLResult *result = fServer->Query(Form("SELECT * FROM %s WHERE run_number >= %d AND run_number <= %d AND event_number >= %d AND event_number <= %d AND multiplicity >= %d AND multiplicity <= %d AND (permanent = %d OR permanent = %d) AND (system = '%s' OR system = '%s') ORDER BY run_number,event_number;",
+  cout<<"LIST:"<< list.runNumber[0]<<"\t"<<list.runNumber[1]<<"\t"<<list.eventNumber[0]<<"\t"<<list.eventNumber[1]<<"\t"<< list.multiplicity[0]<<"\t"<< list.multiplicity[1]<<"\t"<<list.marked[0]<<"\t"<< list.marked[1]<<"\t"<<list.system[0]<<"\t"<<list.system[1]<<endl;
+
+
+  cout<<"QUERY:"<<Form("SELECT * FROM %s WHERE run_number >= %d AND run_number <= %d AND event_number >= %d AND event_number <= %d AND multiplicity >= %d AND multiplicity <= %d AND (permanent = %d OR permanent = %d) AND (system = '%s' OR system = '%s') ORDER BY run_number,event_number;",
+                                                fTable.c_str(),
+                                                list.runNumber[0],
+                                                list.runNumber[1],
+                                                list.eventNumber[0],
+                                                list.eventNumber[1],
+                                                list.multiplicity[0],
+                                                list.multiplicity[1],
+                                                list.marked[0],
+                                                list.marked[1],
+                                                list.system[0],
+                      list.system[1])<<endl;
+
+  TThread::Lock();
+  TSQLResult *result = NULL;
+
+  result =  fServer->Query(Form("SELECT * FROM %s WHERE run_number >= %d AND run_number <= %d AND event_number >= %d AND event_number <= %d AND multiplicity >= %d AND multiplicity <= %d AND (permanent = %d OR permanent = %d) AND (system = '%s' OR system = '%s') ORDER BY run_number,event_number;",
                                                 fTable.c_str(),
                                                 list.runNumber[0],
                                                 list.runNumber[1],
@@ -153,7 +172,7 @@ vector<serverListStruct> AliStorageDatabase::GetList(struct listRequestStruct li
                                                 list.system[0],
                                                 list.system[1]));
 
-       
+       TThread::UnLock();
        TSQLRow *row;
        vector<serverListStruct> eventsVector;
        
index 2c5a360..82ad2e7 100644 (file)
@@ -291,8 +291,18 @@ void AliStorageEventManager::Send(vector<serverListStruct> list,storageSockets s
     if(tmpMessage){delete tmpMessage;}
 }
 
-void AliStorageEventManager::Send(struct serverRequestStruct *request,storageSockets socket)
+bool AliStorageEventManager::Send(struct serverRequestStruct *request,storageSockets socket,int timeout)
 {
+  
+  if(timeout>=0)
+    {
+      pollitem_t items[1] =  {{*fSockets[socket],0,ZMQ_POLLIN,0}};
+      if(poll (&items[0], 1, timeout)==0){
+       cout<<"Event Manager -- couldn't send serverRequestStruct -- timeout"<<endl;
+       return 0;
+      }
+    }
+
     char *buffer = (char*)(request);
     message_t *requestMessage = new message_t((void*)buffer,
                                               sizeof(struct serverRequestStruct)
@@ -304,17 +314,20 @@ void AliStorageEventManager::Send(struct serverRequestStruct *request,storageSoc
     catch(const zmq::error_t &e)
     {
         cout<<"MANAGER -- send serverRequestStruct -- "<<e.what()<<endl;
+       return 0;
     }
+    return 1;
 }
 
 bool AliStorageEventManager::Send(struct clientRequestStruct *request,storageSockets socket,int timeout)
 {
-    pollitem_t items[1] =  {{*fSockets[socket],0,ZMQ_POLLIN,0}} ;
-    
+    if(timeout>=0){
+      pollitem_t items[1] =  {{*fSockets[socket],0,ZMQ_POLLIN,0}};
+      if(poll (&items[0], 1, timeout)==0){return 0;}
+    }
     
     char *buffer = (char*)(request);
-    message_t *requestMessage = new message_t((void*)buffer,
-                                              sizeof(struct clientRequestStruct),freeBuff);
+    message_t *requestMessage = new message_t((void*)buffer,sizeof(struct clientRequestStruct),freeBuff);
     
     try{
         fSockets[socket]->send(*requestMessage);
@@ -330,14 +343,7 @@ bool AliStorageEventManager::Send(struct clientRequestStruct *request,storageSoc
         return 0;
         
     }
-    if(timeout>=0)
-    {
-        if(poll (&items[0], 1, timeout)==0)
-        {
-            delete requestMessage;
-            return 0;
-        }
-    }
+    
     delete requestMessage;
     return 1;
 }
@@ -391,7 +397,7 @@ void AliStorageEventManager::Send(AliESDEvent *event, storageSockets socket)
     TMessage tmess(kMESS_OBJECT);
     tmess.Reset();
     tmess.WriteObject(event);
-    //  TMessage::EnableSchemaEvolutionForAll(kTRUE);
+    //TMessage::EnableSchemaEvolutionForAll(kTRUE);
     
     int bufsize = tmess.Length();
     char* buf = (char*) malloc(bufsize * sizeof(char));
@@ -582,7 +588,7 @@ AliESDEvent* AliStorageEventManager::GetEvent(storageSockets socket,int timeout)
        try{(poll (&items[0], 1, timeout)==0);}
        catch(const zmq::error_t &e){
          cout<<"EVENT MANAGER -- GetEvent():"<<e.what()<<endl;
-           return NULL;
+         return NULL;
          }
     }
     message_t* message = new message_t();
index c3ebf13..46e4a84 100644 (file)
@@ -23,7 +23,7 @@ public:
        static AliStorageEventManager* GetEventManagerInstance();
 
        void Send(std::vector<serverListStruct> list,storageSockets socket);
-       void Send(struct serverRequestStruct *request,storageSockets socket);
+       bool Send(struct serverRequestStruct *request,storageSockets socket,int timeout = -1);
        bool Send(struct clientRequestStruct *request,storageSockets socket,int timeout = -1);
        void Send(AliESDEvent *event,storageSockets socket);
        void Send(TFile *file,storageSockets socket);
index a01ffb0..6be98dc 100644 (file)
@@ -76,6 +76,7 @@ void AliStorageServerThread::StartCommunication()
             }
             case REQUEST_GET_EVENT:
             {
+             cout<<"get event"<<endl;
                 TThread::Lock();
                 AliESDEvent *event = fDatabase->GetEvent(request->event);
                 TThread::UnLock();
@@ -93,6 +94,7 @@ void AliStorageServerThread::StartCommunication()
             }
             case REQUEST_GET_PREV_EVENT:
             {
+             cout<<"PREV request"<<endl;
                 AliESDEvent *event = fDatabase->GetPrevEvent(request->event);
                 eventManager->Send(event,socket);
                 delete event;
@@ -100,6 +102,7 @@ void AliStorageServerThread::StartCommunication()
             }
             case REQUEST_GET_LAST_EVENT:
             {
+             cout<<"LAST request"<<endl;
                 AliESDEvent *event = fDatabase->GetLastEvent();
                 eventManager->Send(event,socket);
                 delete event;
@@ -107,6 +110,7 @@ void AliStorageServerThread::StartCommunication()
             }
             case REQUEST_GET_FIRST_EVENT:
             {
+             cout<<"FIRST request"<<endl;
                 AliESDEvent *event = fDatabase->GetFirstEvent();
                 eventManager->Send(event,socket);
                 delete event;
@@ -114,13 +118,17 @@ void AliStorageServerThread::StartCommunication()
             }
             case REQUEST_MARK_EVENT:
             {
+             cout<<"MARK request"<<endl;
                 struct eventStruct *markData  = &(request->event);
                 eventManager->Send(MarkEvent(*markData),socket);
                 break;
             }
             default:
-                sleep(1);
+             {
+               cout<<"unknown request message"<<endl;
+               eventManager->Send(false,socket);
                 break;
+             }
         }
         
     }
index 76c7063..af0c4db 100644 (file)
@@ -39,8 +39,8 @@ namespace AliOnlineReconstructionUtil
 // return full path to the server configuration file
        inline const char* GetPathToServerConf()
        {
-               return Form("%s/MONITOR/alionlinereco/%s",
-                           gSystem->Getenv("ALICE_ROOT"),
+               return Form("%s/%s",
+                           gSystem->Getenv("HOME"),
                            ALIEVENTSERVER_CONF);
        }
 }