X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliRawCastorDB.cxx;h=4f55c81dc1560f724c29a06614eea3ca9aa93ad9;hb=9fba36eae680c2075e713abfb85559d94191bce5;hp=f57921b0f8592d8d6486e37b9629e09771197578;hpb=efd255fef1645d017251fd214f583278d0751349;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliRawCastorDB.cxx b/RAW/AliRawCastorDB.cxx index f57921b0f85..4f55c81dc15 100644 --- a/RAW/AliRawCastorDB.cxx +++ b/RAW/AliRawCastorDB.cxx @@ -1,4 +1,4 @@ -// @(#)alimdc:$Name$:$Id$ +// @(#) $Id$ // Author: Fons Rademakers 26/11/99 /************************************************************************** @@ -32,11 +32,11 @@ ClassImp(AliRawCastorDB) //______________________________________________________________________________ -AliRawCastorDB::AliRawCastorDB(AliRawEvent *event, - AliESD *esd, +AliRawCastorDB::AliRawCastorDB(AliRawEventV2 *event, + AliESDEvent *esd, Int_t compress, - const char* fileName) - : AliRawDB(event, esd, compress, fileName) + const char* fileName,Int_t basketsize) + : AliRawDB(event, esd, compress, fileName, basketsize) { // Create a new raw DB that will be accessed via CASTOR and rootd. @@ -52,7 +52,9 @@ AliRawCastorDB::AliRawCastorDB(AliRawEvent *event, init = 1; } +#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0) if (fRawDB) fRawDB->UseCache(50, 0x200000); //0x100000 = 1MB) +#endif } //______________________________________________________________________________ @@ -103,21 +105,32 @@ const char *AliRawCastorDB::GetFileName() const } //______________________________________________________________________________ -void AliRawCastorDB::Close() +Long64_t AliRawCastorDB::Close() { // Close raw CASTOR/rootd DB. - if (!fRawDB) return; + if (!fRawDB) return 0; + + if (!fRawDB->IsOpen()) return 0; fRawDB->cd(); // Write the tree. - fTree->Write(); - if (fESDTree) fESDTree->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 (fDeleteFiles) { TUrl u(fRawDB->GetName()); gSystem->Exec(Form("rfrm %s", u.GetFile())); @@ -125,4 +138,9 @@ void AliRawCastorDB::Close() delete fRawDB; fRawDB = 0; + + if(!error) + return filesize; + else + return -1; }