bugfix
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHLTEventManagerHomer.cxx
index 521b8030674736cffa8fbca315addd0a3c86860a..b54d8f4a970859f8fe575ee89450ff8909068545 100644 (file)
@@ -47,24 +47,43 @@ AliEveHLTEventManagerHomer::~AliEveHLTEventManagerHomer() {
 ///________________________________________________________________________________
 void AliEveHLTEventManagerHomer::NextEvent() {
   //See header file for documentation
-  TList * fEvent = static_cast<TList*>(fEventBuffer->NextEvent());
-  if(fEvent) {
-    cout << "Got the event " <<endl;
-    ProcessEvent(fEvent);
+  if(fEventBuffer->GetBusy() ) {
+    cout << "event buffer already busy"<<endl;
+    return;
+  }else {
+    fEventBuffer->SetBusy(kTRUE);
+  }
+
+  TList * aSyncEvent = fEventBuffer->GetASyncEvent();
+  TList * event = static_cast<TList*>(fEventBuffer->NextEvent());
+  if(event) {
+    cout << "Got the event, reset the display " <<endl;
+    ResetDisplay();
+    cout << "Process event"<<endl;
+    ProcessEvent(event);
+    if(aSyncEvent) {
+      cout  << "Process asynchroneous event" << endl;
+      ProcessEvent(aSyncEvent);
+    }  else {
+      cout << "Could not get async event"<<endl;
+    }
+    
+    cout << "Upate the display"<<endl;
+    UpdateDisplay();
+  
   } else {
     cout << "could't get the sync event"<<endl;
   }
   
- //  cout  << "doint async block"<<endl;
- //  TList * async = static_cast<TList*>(fEventBuffer->GetAList());
- //  if(async) {
- //    ProcessEvent(async);
- //   }  else {
- //     cout << "No async bloc"<<endl;
- // }
-
-
-fEventBuffer->SetBusy(kFALSE);
+  //  cout  << "doint async block"<<endl;
+  //  TList * async = static_cast<TList*>(fEventBuffer->GetAList());
+  //  if(async) {
+  //   ProcessEvent(async);
+  //   }  else {
+  //    cout << "No async bloc"<<endl;
+  // }
+
+  fEventBuffer->SetBusy(kFALSE);
 }