Changing form statements from LX to llu to prevent warnings
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveEventBufferOffline.cxx
index 2c935aa..f16682a 100644 (file)
@@ -5,6 +5,8 @@
 #include "AliEveEventBufferOffline.h"
 
 #include "AliESDEvent.h"
+#include "AliEveEventBufferOffline.h"
+#include "AliEveEventBuffer.h"
 
 #include "TTimer.h"
 #include "TFile.h"
@@ -44,10 +46,11 @@ AliEveEventBufferOffline::AliEveEventBufferOffline(TString filename)  :
   }
 
   fTree = dynamic_cast<TTree *>(fFile->Get("HLTesdTree"));
-  cout << "File has " << fNEntries << "events" << endl;
-  fNEntries = fTree->GetEntries();
-  fEvent->ReadFromTree(fTree);
-  
+  if(fTree) {
+    fNEntries = fTree->GetEntries();
+    cout << "File has " << fNEntries << "events" << endl;
+    fEvent->ReadFromTree(fTree);
+  }
 }
 
 
@@ -105,9 +108,9 @@ void AliEveEventBufferOffline::ConnectToSource() {
 
 
 ///_____________________________________________________________________
-void AliEveEventBufferOffline::WriteToFile(){
+void AliEveEventBufferOffline::WriteToFile(Int_t runnumber){
   //Inherited from AliEveEventBuffer
-  TFile * file = TFile::Open(Form("Event_%d_ITS.root", 100), "RECREATE"); 
-  fEventBuffer->At(fBIndex[kTop])->Write("blockList", TObject::kSingleKey);
+  TFile * file = TFile::Open(Form("%d_0x%016llu_ESD.root", runnumber, GetEventId()), "RECREATE"); 
+  fEventBuffer->At(fBIndex[kCurrent])->Write("blockList", TObject::kSingleKey);
   file->Close();
 }