Updates, making buffer and managers aware of each others work
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Nov 2010 16:33:38 +0000 (16:33 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Nov 2010 16:33:38 +0000 (16:33 +0000)
EVE/EveHLT/AliEveEventBuffer.cxx
EVE/EveHLT/AliEveHLTEventManager.cxx
EVE/EveHLT/AliEveHLTEventManagerHomer.cxx

index eea002fa025b5a077a64440170af3634c9cb98df..53aabbc2b8164a235cea1bcc0df3656221095aec 100644 (file)
@@ -60,7 +60,7 @@ AliEveEventBuffer::~AliEveEventBuffer() {
 }
 
 void AliEveEventBuffer::CreateBufferThread() {
-  cout << "hereherehere"<<endl;
+  //  cout << "hereherehere"<<endl;
   TThread * fThread = new TThread(AliEveEventBuffer::BufferThread, (void*) this);
   fThread->Run();
 
@@ -85,23 +85,23 @@ void * AliEveEventBuffer::BufferThread(void * buffer) {
 ///_____________________________________________________________________________
 void AliEveEventBuffer::MonitorBuffer() {
   cout << "Monitorbuffer: " << endl;
-  if(fBusy) {
-    cout << "Already called FetchEvent()" << endl;
-    return;
-  } else {
-    cout << "fbusy = false"<<endl;
-    
-    if ( (CalculateDifference(fBIndex[kTop],fBIndex[kLast]) < fPreBuffer) ) {
+  if ( (CalculateDifference(fBIndex[kTop],fBIndex[kLast]) < fPreBuffer) ) {
+    if(GetBusy()) {
+      cout << "Already called FetchEvent()" << endl;
+      return;
+    } else {
       fBusy = kTRUE;
       FetchEvent();
       fBusy = kFALSE;
-    } else {
-      //StopBufferMonitor();
-      fBusy = kFALSE;
     }
+  } else {
+    //StopBufferMonitor();
+    
+    fBusy = kFALSE;
   }
 }
 
+
 ///_______________________________________________________________________________
 TObject * AliEveEventBuffer::NextEvent() {
   //See header file for documentation
@@ -243,8 +243,9 @@ Int_t AliEveEventBuffer::CalculateDifference(Int_t top, Int_t low) {
 void AliEveEventBuffer::StartBufferMonitor() {
   //cout << "NOT !!! starting buffer mon"<<endl;
   cout << "starting buffer mon"<<endl;
+  CreateBufferThread();
   SetBufferMonStarted(kTRUE);
-  fTimer->Start(5000);
+  fTimer->Start(10000);
 }
 ///___________________________________________________________________________________
 void AliEveEventBuffer::StopBufferMonitor() {
index 23645347712148beb15b9bb146f6c4686c4a3861..91c986b5589ced23aca02395ecd370906a7aeae5 100644 (file)
@@ -238,6 +238,12 @@ void AliEveHLTEventManager::ProcessBlock(AliHLTHOMERBlockDesc * block) {
     else if ( ! block->GetDetector().CompareTo("HLT") ) {
       if(!fHLTElement) CreateHLTElement();
       fHLTElement->ProcessBlock(block);
+
+      if(!fPhosElement) CreatePhosElement();
+      fPhosElement->ProcessBlock(block);
+
+      if(!fEmcalElement) CreateEmcalElement();
+      fEmcalElement->ProcessBlock(block);
     }
 
     else if ( ! block->GetDetector().CompareTo("ITS") ) {
@@ -343,8 +349,9 @@ void AliEveHLTEventManager::PrintScreens() {
 void AliEveHLTEventManager::StartLoop() {
   //See header file for documentation
   //fTimer->SetCommand("NextEvent()", "AliEveHLTEventManager", this);
+  NextEvent();
   SetEventLoopStarted(kTRUE);
-  fTimer->Start(10000);
+  fTimer->Start(15000);
 }
 
 void AliEveHLTEventManager::StopLoop() {
index 521b8030674736cffa8fbca315addd0a3c86860a..f8ed314ec0a00ad594f31224dee54d2b9cd30d60 100644 (file)
@@ -47,10 +47,18 @@ AliEveHLTEventManagerHomer::~AliEveHLTEventManagerHomer() {
 ///________________________________________________________________________________
 void AliEveHLTEventManagerHomer::NextEvent() {
   //See header file for documentation
+  if(fEventBuffer->GetBusy() ) {
+    cout << "event buffer already busy"<<endl;
+    return;
+  }else {
+    fEventBuffer->SetBusy(kTRUE);
+  }
+  
   TList * fEvent = static_cast<TList*>(fEventBuffer->NextEvent());
   if(fEvent) {
     cout << "Got the event " <<endl;
     ProcessEvent(fEvent);
+
   } else {
     cout << "could't get the sync event"<<endl;
   }