// or, if isIovecArray is kTRUE, a pointer to an array of iovecs with one
// iovec per subevent (used by the event builder).
// The return value is the number of written bytes or an error code
+ const UInt_t kFileSizeWarningLevel = 1800000000;
+ const UInt_t kFileSizeErrorLevel = 1900000000;
+
+ UInt_t currentFileSize = GetTotalSize();
+ if(currentFileSize > kFileSizeErrorLevel) {
+ Error("ProcessEvent", "file size (%u) exceeds the limit "
+ , currentFileSize);
+ return kErrFileSize;
+ }
+ if(currentFileSize > kFileSizeWarningLevel)
+ Warning("ProcessEvent", "file size (%u) is close to the limit "
+ , currentFileSize);
Int_t status;
char* data = (char*) event;
return nBytes;
}
+//______________________________________________________________________________
+Int_t AliMDC::GetTotalSize()
+{
+// return the total current raw DB file size
+
+ if (!fRawDB) return -1;
+
+ return fRawDB->GetTotalSize();
+}
+
//______________________________________________________________________________
Int_t AliMDC::Close()
{
kErrSubHeader = -4,
kErrDataSize = -5,
kErrEquipmentHeader = -6,
- kErrEquipment = -7 };
+ kErrEquipment = -7,
+ kErrFileSize = -8 };
AliMDC(Int_t compress, Bool_t deleteFiles,
EFilterMode filterMode = kFilterTransparent,
Int_t Open(EWriteMode mode, const char* fileName);
Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
+ Int_t GetTotalSize();
Int_t Close();
Int_t Run(const char* inputFile, Bool_t loop,
#include <errno.h>
#include <TSystem.h>
+#include <TKey.h>
#ifdef ALI_DATE
#include "event.h"
return Int_t(fRawDB->GetBytesWritten() - bytes);
}
+//______________________________________________________________________________
+Int_t AliRawDB::GetTotalSize()
+{
+ // Return the total size of the trees
+ Int_t total = 0;
+
+ {
+ Int_t skey = 0;
+ TDirectory *dir = fTree->GetDirectory();
+ if (dir) {
+ TKey *key = dir->GetKey(fTree->GetName());
+ if (key) skey = key->GetKeylen();
+ }
+ total += skey;
+ if (fTree->GetZipBytes() > 0) total += fTree->GetTotBytes();
+ TBuffer b(TBuffer::kWrite,10000);
+ TTree::Class()->WriteBuffer(b,fTree);
+ total += b.Length();
+ }
+
+ if(fESDTree)
+ {
+ Int_t skey = 0;
+ TDirectory *dir = fESDTree->GetDirectory();
+ if (dir) {
+ TKey *key = dir->GetKey(fESDTree->GetName());
+ if (key) skey = key->GetKeylen();
+ }
+ total += skey;
+ if (fESDTree->GetZipBytes() > 0) total += fESDTree->GetTotBytes();
+ TBuffer b(TBuffer::kWrite,10000);
+ TTree::Class()->WriteBuffer(b,fESDTree);
+ total += b.Length();
+ }
+
+ return total;
+}
+
//______________________________________________________________________________
void AliRawDB::WriteStats(AliStats* stats)
{
virtual Bool_t Create(const char* fileName = NULL);
virtual void Close();
Int_t Fill();
+ Int_t GetTotalSize();
void WriteStats(AliStats* stats);
return ((AliMDC*)alimdc)->ProcessEvent(event, isIovecArray);
}
+int alimdcGetTotalFileSize(void* alimdc)
+{
+// return the total current file size
+
+ return ((AliMDC*)alimdc)->GetTotalSize();
+}
+
int alimdcClose(void* alimdc)
{
// close the raw DB
double maxSizeTagDB, const char* fileNameTagDB);
int alimdcOpen(void* alimdc, int mode, const char* fileName);
int alimdcProcessEvent(void* alimdc, void* event, int isIovecArray);
+int alimdcGetTotalFileSize(void* alimdc);
int alimdcClose(void* alimdc);
void alimdcDelete(void* alimdc);
void alimdcEnableDebug();