]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawDB.h
Bugfix. Now NextBunch method should correctly in case of more than one bunches in...
[u/mrichter/AliRoot.git] / RAW / AliRawDB.h
index bfc182502a9a4dea4b36982de30f5f3e0d9054b4..cb400ed9843285d5b0399eb7caf26b0f9bc24713 100644 (file)
 #include <TTree.h>
 #endif
 
+#ifndef ROOT_TString
+#include <TString.h>
+#endif
+
+#include "AliDAQ.h"
 
 // Forward class declarations
 class AliRawEvent;
+class AliRawDataArray;
 class AliStats;
 class TFile;
-
-#ifdef USE_HLT
-class AliESD;
-#endif
+class AliESDEvent;
 
 class AliRawDB : public TObject {
 
 public:
    AliRawDB(AliRawEvent *event,
-#ifdef USE_HLT
-           AliESD *esd,
-#endif
-           Double_t maxsize, Int_t compress,
-            Bool_t create = kTRUE);
-   virtual ~AliRawDB() { Close(); }
+           AliESDEvent *esd,
+           Int_t compress,
+            const char* fileName = NULL);
+   virtual ~AliRawDB();
 
    virtual const char *GetOpenOption() const { return "RECREATE"; }
    virtual Int_t       GetNetopt() const { return 0; }
-   virtual Bool_t      Create();
-   virtual void        Close();
-   void                Fill() { fTree->Fill(); fESDTree->Fill(); }
-   Bool_t              FileFull() { return (fRawDB->GetBytesWritten() > fMaxSize) ?
-                                    kTRUE : kFALSE; }
+   virtual Bool_t      Create(const char* fileName = NULL);
+   virtual Int_t       Close();
+   Int_t               Fill();
+   Int_t               GetTotalSize();
 
    void         WriteStats(AliStats* stats);
 
-   Bool_t       NextFile();
+   void         SetMaxSize(Double_t maxSize) { fMaxSize = maxSize; }
+   void         SetFS(const char* fs1, const char* fs2 = NULL);
+   void         SetDeleteFiles(Bool_t deleteFiles = kTRUE) { fDeleteFiles = deleteFiles; }
+
+   Bool_t       NextFile(const char* fileName = NULL);
 
    Double_t     GetBytesWritten() const { return fRawDB->GetBytesWritten(); }
    TFile       *GetDB() const { return fRawDB; }
@@ -64,17 +68,24 @@ public:
    AliRawEvent *GetEvent() const { return fEvent; }
    Float_t      GetCompressionFactor() const;
    Int_t        GetCompressionMode() const { return fRawDB->GetCompressionLevel(); }
+   void         Stop() { fStop = kTRUE; }
+   static const char *GetAliRootTag();
+   Bool_t       WriteGuidFile(TString &guidFileFolder);
 
 protected:
    TFile         *fRawDB;         // DB to store raw data
    TTree         *fTree;          // tree used to store raw data
    AliRawEvent   *fEvent;         // AliRawEvent via which data is stored
-#ifdef USE_HLT
+   AliRawDataArray  *fDetRawData[AliDAQ::kNDetectors+1]; // Detectors raw-data payload
    TTree         *fESDTree;       // tree for storing HLT ESD information
-   AliESD        *fESD;           // pointer to HLT ESD object
-#endif
+   AliESDEvent        *fESD;           // pointer to HLT ESD object
    Int_t          fCompress;      // compression mode (1 default)
    Double_t       fMaxSize;       // maximum size in bytes of the raw DB
+   TString        fFS1;           // first raw DB file system location
+   TString        fFS2;           // second raw DB file system location
+   Bool_t         fDeleteFiles;   // flag for deletion of files
+   Bool_t         fStop;          // stop execution (triggered by SIGUSR1)
+   static const char  *fgkAliRootTag; // string with the aliroot tag id
 
    virtual const char *GetFileName() const;
    virtual Bool_t      FSHasSpace(const char *fs) const;
@@ -84,7 +95,7 @@ private:
    AliRawDB(const AliRawDB& rawDB);
    AliRawDB& operator = (const AliRawDB& rawDB);
 
-   ClassDef(AliRawDB,0)  // Raw DB
+   ClassDef(AliRawDB,2)  // Raw DB
 };
 
 #endif