X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliRawRootdDB.cxx;h=89c86e2d78c0fe20d3375ecab4477622c24d1291;hb=97005d5cb5e0021af0e311ae1a4e0afc978ff349;hp=7062e28f18b20d99c139f7838fadd1fa81593bf6;hpb=a197a4ce0bc124cc9b25d6e01bc5c42db6fe304f;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliRawRootdDB.cxx b/RAW/AliRawRootdDB.cxx index 7062e28f18b..89c86e2d78c 100644 --- a/RAW/AliRawRootdDB.cxx +++ b/RAW/AliRawRootdDB.cxx @@ -1,4 +1,4 @@ -// @(#)alimdc:$Name$:$Id$ +// @(#) $Id$ // Author: Fons Rademakers 26/11/99 /************************************************************************** @@ -24,8 +24,6 @@ #include -#include "AliMDC.h" - #include "AliRawRootdDB.h" @@ -33,15 +31,17 @@ ClassImp(AliRawRootdDB) //______________________________________________________________________________ -AliRawRootdDB::AliRawRootdDB(AliRawEvent *event, Double_t maxsize, Int_t compress) - : AliRawDB(event, maxsize, compress, kFALSE) +AliRawRootdDB::AliRawRootdDB(AliRawEventV2 *event, + AliESDEvent *esd, + Int_t compress, + const char* fileName,Int_t basketsize) + : AliRawDB(event, esd, compress, fileName, basketsize) { // Create a new raw DB that will be accessed via rootd daemon. - if (!Create()) - MakeZombie(); - else - fRawDB->UseCache(50, 0x200000); //0x100000 = 1MB) +#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0) + if (fRawDB) fRawDB->UseCache(50, 0x200000); //0x100000 = 1MB) +#endif } //______________________________________________________________________________ @@ -54,7 +54,7 @@ const char *AliRawRootdDB::GetFileName() const static TString fname; - TString fs = AliMDC::RootdFS(); + TString fs = fFS1; TDatime dt; #if 0 @@ -67,8 +67,8 @@ const char *AliRawRootdDB::GetFileName() const // directory does not exist, create it if (gSystem->mkdir(fs, kTRUE) == -1) { Error("GetFileName", "cannot create dir %s, using %s", fs.Data(), - AliMDC::RootdFS()); - fs = AliMDC::RootdFS(); + fFS1.Data()); + fs = fFS1; } } // FIXME: should check if fs is a directory @@ -89,26 +89,42 @@ const char *AliRawRootdDB::GetFileName() const } //______________________________________________________________________________ -void AliRawRootdDB::Close() +Long64_t AliRawRootdDB::Close() { // Close raw rootd 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) + if (fTree->Write() == 0) + error = kTRUE; + if (fESDTree) + if (fESDTree->Write() == 0) + error = kTRUE; // Close DB, this also deletes the fTree fRawDB->Close(); + fTree = NULL; + + Long64_t filesize = fRawDB->GetEND(); + #if 0 // can use services of TFTP - if (AliMDC::DeleteFiles()) + if (fDeleteFiles) gSystem->Exec(Form("rfrm %s", fRawDB->GetName())); #endif delete fRawDB; fRawDB = 0; + if(!error) + return filesize; + else + return -1; }