AliMDC API: new method for auto-saving the raw-data tree. Requested by DAQ in order...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Apr 2008 11:40:45 +0000 (11:40 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Apr 2008 11:40:45 +0000 (11:40 +0000)
RAW/AliMDC.cxx
RAW/AliMDC.h
RAW/AliRawDB.cxx
RAW/AliRawDB.h
RAW/mdc.cxx
RAW/mdc.h

index 40de529..ac0e3a8 100644 (file)
@@ -446,6 +446,17 @@ Long64_t AliMDC::Close()
 }
 
 //______________________________________________________________________________
+Long64_t AliMDC::AutoSave()
+{
+  // Auto-save the raw-data
+  // and esd (if any) trees
+
+  if (!fRawDB) return -1;
+
+  return fRawDB->AutoSave();
+}
+
+//______________________________________________________________________________
 Int_t AliMDC::Run(const char* inputFile, Bool_t loop,
                  EWriteMode mode, Double_t maxFileSize, 
                  const char* fs1, const char* fs2)
index 00392b3..5a776a5 100644 (file)
@@ -73,6 +73,7 @@ public:
    Int_t      ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
    Long64_t   GetTotalSize();
    Long64_t   Close();
+   Long64_t   AutoSave();
 
    Int_t      Run(const char* inputFile, Bool_t loop,
                  EWriteMode mode, Double_t maxFileSize, 
index ebeae2e..4da8a7e 100644 (file)
@@ -413,6 +413,19 @@ Long64_t AliRawDB::GetTotalSize()
 }
 
 //______________________________________________________________________________
+Long64_t AliRawDB::AutoSave()
+{
+  // Auto-save the raw-data and
+  // esd (if any) trees
+
+  Long64_t nbytes = fTree->AutoSave();
+
+  if (fESDTree) nbytes += fESDTree->AutoSave();
+
+  return nbytes;
+}
+
+//______________________________________________________________________________
 void AliRawDB::WriteStats(AliStats* stats)
 {
    // Write stats to raw DB, local run DB and global MySQL DB.
index ceb7063..e4bf9ca 100644 (file)
@@ -52,6 +52,7 @@ public:
    virtual Long64_t    Close();
    Int_t               Fill();
    Long64_t            GetTotalSize();
+   Long64_t            AutoSave();
 
    void         WriteStats(AliStats* stats);
 
index 8c7237a..46aa4d1 100644 (file)
@@ -82,3 +82,11 @@ void  alimdcEnableDebug()
   AliLog::SetPrintRepetitions(kFALSE);
   AliLog::SetHandleRootMessages(kTRUE);
 }
+
+long long  alimdcAutoSave(void* alimdc)
+{
+  // Auto-save the raw-data tree
+
+  return ((AliMDC*)alimdc)->AutoSave();
+}
+  
index 5cee1ee..872fa49 100644 (file)
--- a/RAW/mdc.h
+++ b/RAW/mdc.h
@@ -24,6 +24,7 @@ long long  alimdcGetTotalFileSize(void* alimdc);
 long long  alimdcClose(void* alimdc);
 void  alimdcDelete(void* alimdc);
 void  alimdcEnableDebug();
+long long  alimdcAutoSave(void* alimdc);
 
 #ifdef __cplusplus
 }