]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawNullDB.cxx
Bugfix in raw data reader classes. The bug affected the determination of the raw...
[u/mrichter/AliRoot.git] / RAW / AliRawNullDB.cxx
index c1b0d9b2a9982f740d7f30bcd7c09414aca74603..eefde1cf9c45692675c39319cced5f6b8bc4d126 100644 (file)
@@ -29,13 +29,14 @@ ClassImp(AliRawNullDB)
 
 
 //______________________________________________________________________________
-AliRawNullDB::AliRawNullDB(AliRawEvent *event, Double_t maxsize, Int_t compress)
-   : AliRawDB(event, maxsize, compress, kFALSE)
+AliRawNullDB::AliRawNullDB(AliRawEvent *event,
+                          AliESD *esd,
+                          Int_t compress,
+                          const char* fileName)
+   : AliRawDB(event, esd, compress, fileName)
 {
    // Create a new raw DB that will wrtie to /dev/null.
 
-   if (!Create())
-      MakeZombie();
 }
 
 //______________________________________________________________________________
@@ -47,20 +48,33 @@ const char *AliRawNullDB::GetFileName() const
 }
 
 //______________________________________________________________________________
-void AliRawNullDB::Close()
+Int_t AliRawNullDB::Close()
 {
    // Close raw RFIO DB.
 
-   if (!fRawDB) return;
+   if (!fRawDB) return 0;
+
+   if (!fRawDB->IsOpen()) return 0;
 
    fRawDB->cd();
 
    // Write the tree.
-   fTree->Write();
+   Bool_t error = kFALSE;
+   if (fTree->Write() == 0)
+     error = kTRUE;
+   if (fESDTree)
+     if (fESDTree->Write() == 0)
+       error = kTRUE;
 
    // Close DB, this also deletes the fTree
    fRawDB->Close();
 
+   Int_t filesize = fRawDB->GetEND();
+
    delete fRawDB;
    fRawDB = 0;
+   if(!error)
+     return filesize;
+   else
+     return -1;
 }