bugfix
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveEventBufferHomer.cxx
index 16d7d3c4003da77cae737e8328b24f85b5b2a0ed..462983047e35e2fa94e2e4584169a0addda52766 100644 (file)
@@ -47,7 +47,9 @@ TObject * AliEveEventBufferHomer::GetEventFromSource() {
   if(fHomer) {
     cout << "calling nexthomerevent"<<endl;
     TList * blockList = fHomer->NextHOMEREvent();
   if(fHomer) {
     cout << "calling nexthomerevent"<<endl;
     TList * blockList = fHomer->NextHOMEREvent();
-    
+    cout  << "getting async block list"<<endl;
+    TList * aList = fHomer->GetAsyncBlockList();
+    fAsyncList = aList;
     if(blockList)  return dynamic_cast<TObject*>(blockList);
     else return NULL;
   } 
     if(blockList)  return dynamic_cast<TObject*>(blockList);
     else return NULL;
   } 
@@ -68,18 +70,6 @@ void AliEveEventBufferHomer::AddToBuffer(TObject * event) {
   }
 }
 
   }
 }
 
-// ///___________________________________________________________________________
-// void AliEveEventBufferHomer::AddToBuffer(TObject * event, ULong64_t eventId ) {
-//   cout << "Add to buffer"<<endl;
-//   if(!event) return;
-//   fBIndex[kTop] = CalculateNext(fBIndex[kTop]);
-//   TList * list = dynamic_cast<TList*>(fEventBuffer->At(fBIndex[kTop]));
-//   if(list) {
-//     list->Clear();
-//     list->AddAll(dynamic_cast<TList*>(event));
-//     fEventId[fBIndex[kTop]] = eventId;  
-//   }
-// }
 
 
 ///______________________________________________________________________
 
 
 ///______________________________________________________________________
@@ -118,14 +108,14 @@ void AliEveEventBufferHomer::ConnectToSource () {
 }
 
 ///_____________________________________________________________________
 }
 
 ///_____________________________________________________________________
-void AliEveEventBufferHomer::WriteToFile(){
+void AliEveEventBufferHomer::WriteToFile(Int_t runnumber){
 
 
-  TFile * file = TFile::Open(Form("Event_0x%016X_ITS.root", 100), "RECREATE"); 
-  fEventBuffer->At(fBIndex[kTop])->Write("blockList", TObject::kSingleKey);
+  TFile * file = TFile::Open(Form("%d_0x%016X_ESD.root", runnumber, GetEventId()), "RECREATE"); 
+  fEventBuffer->At(fBIndex[kCurrent])->Write("blockList", TObject::kSingleKey);
   file->Close();
   
   if(fAsyncList) {
   file->Close();
   
   if(fAsyncList) {
-    TFile * afile = TFile::Open(Form("Event_0x%016X_Async.root", 100), "RECREATE"); 
+    TFile * afile = TFile::Open(Form("%d_0x%016X_Async.root",  runnumber, GetEventId()), "RECREATE"); 
     fAsyncList->Write("blockList", TObject::kSingleKey);
     afile->Close();
   }
     fAsyncList->Write("blockList", TObject::kSingleKey);
     afile->Close();
   }