Put split level for the HLT ESD tree to zero.
[u/mrichter/AliRoot.git] / RAW / AliRawDB.cxx
index 5259a34447903bf96d9b31238461d9c82a60d587..1810a69b595f8ad38477951d1b7c8248a38f9b17 100644 (file)
@@ -25,6 +25,7 @@
 #include <errno.h>
 
 #include <TSystem.h>
 #include <errno.h>
 
 #include <TSystem.h>
+#include <TKey.h>
 
 #ifdef ALI_DATE
 #include "event.h"
 
 #ifdef ALI_DATE
 #include "event.h"
@@ -267,7 +268,7 @@ void AliRawDB::MakeTree()
    if (fESD) {
      fESDTree = new TTree("esdTree", Form("ALICE MDC%d HLT ESD tree", kMDC));
      fESDTree->SetAutoSave(2000000000);  // autosave when 2 Gbyte written
    if (fESD) {
      fESDTree = new TTree("esdTree", Form("ALICE MDC%d HLT ESD tree", kMDC));
      fESDTree->SetAutoSave(2000000000);  // autosave when 2 Gbyte written
-     split   = 99;
+     split   = 0;
      fESDTree->Branch("ESD", "AliESD", &fESD, bufsize, split);
    }
 
      fESDTree->Branch("ESD", "AliESD", &fESD, bufsize, split);
    }
 
@@ -315,6 +316,44 @@ Int_t AliRawDB::Fill()
    return Int_t(fRawDB->GetBytesWritten() - bytes);
 }
 
    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)
 {
 //______________________________________________________________________________
 void AliRawDB::WriteStats(AliStats* stats)
 {