]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawEvent.h
Fixed a memory leakage in the reading of digits for the HLT cluster fitter
[u/mrichter/AliRoot.git] / RAW / AliRawEvent.h
index e1f07849416c6b48a84e74d86d3c7ecd54b94acf..0e1bc72914136479d7712fb3fa6592098ffe35d0 100644 (file)
 #include <TTree.h>
 #endif
 
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+
 
 // Forward class declarations
-class TH1F;
 class AliRawDB;
 
 
@@ -188,6 +191,7 @@ public:
    AliRawData            *GetRawData();
    Int_t                  GetNSubEvents() const { return fNSubEvents; }
    AliRawEvent           *NextSubEvent();
+   AliRawEvent           *GetSubEvent(Int_t index) const;
    void                   Reset();
 
    ClassDef(AliRawEvent,1)  // ALICE raw event object
@@ -263,13 +267,14 @@ public:
             Bool_t create = kTRUE);
    ~AliRawDB() { Close(); }
 
-   virtual Bool_t Create();
-   virtual void   Close();
-   void           Fill() { fTree->Fill(); }
-   Bool_t         FileFull() { return (fRawDB->GetBytesWritten() > fMaxSize) ?
-                               kTRUE : kFALSE; }
+   virtual const char *GetOpenOption() const { return "RECREATE"; }
+   virtual Bool_t      Create();
+   virtual void        Close();
+   void                Fill() { fTree->Fill(); }
+   Bool_t              FileFull() { return (fRawDB->GetBytesWritten() > fMaxSize) ?
+                                    kTRUE : kFALSE; }
 
-   Bool_t      NextFile();
+   Bool_t       NextFile();
 
    Double_t     GetBytesWritten() const { return fRawDB->GetBytesWritten(); }
    TFile       *GetDB() const { return fRawDB; }
@@ -298,6 +303,22 @@ public:
 };
 
 
+class AliRawCastorDB : public AliRawDB {
+
+private:
+   const char *GetFileName();
+
+public:
+   AliRawCastorDB(AliRawEvent *event, Double_t maxsize, Int_t compress);
+   ~AliRawCastorDB() { Close(); }
+
+   const char *GetOpenOption() const { return "-RECREATE"; }
+   void        Close();
+
+   ClassDef(AliRawCastorDB,0)  // Raw DB via CASTOR and rootd
+};
+
+
 class AliRawRootdDB : public AliRawDB {
 
 private:
@@ -382,11 +403,12 @@ private:
    TFile  *fRunDB;     // run database
 
 public:
-   AliRunDB();
+   AliRunDB(Bool_t noLocalDB = kFALSE);
    ~AliRunDB() { Close(); }
 
    void Update(AliStats *stats);
    void UpdateRDBMS(AliStats *stats);
+   void UpdateAliEn(AliStats *stats);
    void Close();
 
    ClassDef(AliRunDB,0)  // Run (bookkeeping) DB
@@ -395,20 +417,21 @@ public:
 
 class AliMDC : public TObject {
 
+public:
+   enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL };
+
 private:
-   Int_t     fFd;          // DATE input stream
-   Int_t     fCompress;    // compression factor used for raw output DB
-   Int_t     fNumEvents;   // number of events processed
-   Int_t     fDebugLevel;  // controls debug print-out
-   Double_t  fMaxFileSize; // maximum size of raw output DB
-   Bool_t    fUseFifo;     // read from fifo, file otherwise
-   Bool_t    fUseEb;       // use event builder API instead of fifo
-   Bool_t    fUseFilter;   // use 3rd level trigger filter
-   Bool_t    fUseRFIO;     // write directly to RFIO file
-   Bool_t    fUseRootd;    // write directly to rootd file
-   Bool_t    fUseDevNull;  // write to /dev/null
-   Bool_t    fUseLoop;     // loop on input source (must be file)
-   Bool_t    fStopLoop;    // break from endless loop (triggered by SIGUSR1)
+   Int_t      fFd;          // DATE input stream
+   Int_t      fCompress;    // compression factor used for raw output DB
+   Int_t      fNumEvents;   // number of events processed
+   Int_t      fDebugLevel;  // controls debug print-out
+   Double_t   fMaxFileSize; // maximum size of raw output DB
+   EWriteMode fWriteMode;   // write mode (local, rfio, rootd, castor, /dev/null)
+   Bool_t     fUseFifo;     // read from fifo, file otherwise
+   Bool_t     fUseEb;       // use event builder API instead of fifo
+   Bool_t     fUseFilter;   // use 3rd level trigger filter
+   Bool_t     fUseLoop;     // loop on input source (must be file)
+   Bool_t     fStopLoop;    // break from endless loop (triggered by SIGUSR1)
 
    static Bool_t fgDeleteFiles;
 
@@ -423,8 +446,7 @@ private:
 
 public:
    AliMDC(Int_t fd, Int_t compress, Double_t maxFileSize, Bool_t useFilter,
-          Bool_t useRFIO, Bool_t useROOTD, Bool_t useDEVNULL,
-          Bool_t useLoop, Bool_t delFiles);
+          EWriteMode mode, Bool_t useLoop, Bool_t delFiles);
    ~AliMDC() { }
 
    Int_t  Run();
@@ -432,7 +454,7 @@ public:
    Bool_t StopLoop() const { return fStopLoop; }
 
    void   SetDebugLevel(Int_t level) { fDebugLevel = level; }
-   Bool_t GetDebugLevel() const { return fDebugLevel; }
+   Int_t  GetDebugLevel() const { return fDebugLevel; }
 
    static Bool_t DeleteFiles() { return fgDeleteFiles; }
 
@@ -442,6 +464,6 @@ public:
 R__EXTERN AliMDC *gAliMDC;
 
 #define ALIDEBUG(level) \
-   if (gAliMDC && gAliMDC->GetDebugLevel() >= (level))
+   if (gAliMDC && (gAliMDC->GetDebugLevel() >= (level)))
 
 #endif