]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliRawDB.h
Removing not needed monitor and shift libs from binalimdc.pkg
[u/mrichter/AliRoot.git] / RAW / AliRawDB.h
1 #ifndef ALIRAWDB_H
2 #define ALIRAWDB_H
3 // @(#)alimdc:$Name$:$Id$
4 // Author: Fons Rademakers  26/11/99
5
6 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
7  * See cxx source for full Copyright notice                               */
8
9 //////////////////////////////////////////////////////////////////////////
10 //                                                                      //
11 // AliRawDB                                                             //
12 //                                                                      //
13 //////////////////////////////////////////////////////////////////////////
14
15 #ifndef ROOT_TObject
16 #include <TObject.h>
17 #endif
18
19 #ifndef ROOT_TFile
20 #include <TFile.h>
21 #endif
22
23 #ifndef ROOT_TTree
24 #include <TTree.h>
25 #endif
26
27
28 // Forward class declarations
29 class AliRawEvent;
30 class TFile;
31
32 #ifdef USE_HLT
33 class AliESD;
34 #endif
35
36 class AliRawDB : public TObject {
37
38 public:
39    AliRawDB(AliRawEvent *event,
40 #ifdef USE_HLT
41             AliESD *esd,
42 #endif
43             Double_t maxsize, Int_t compress,
44             Bool_t create = kTRUE);
45    virtual ~AliRawDB() { Close(); }
46
47    virtual const char *GetOpenOption() const { return "RECREATE"; }
48    virtual Int_t       GetNetopt() const { return 0; }
49    virtual Bool_t      Create();
50    virtual void        Close();
51    void                Fill() { fTree->Fill(); fESDTree->Fill(); }
52    Bool_t              FileFull() { return (fRawDB->GetBytesWritten() > fMaxSize) ?
53                                     kTRUE : kFALSE; }
54
55    Bool_t       NextFile();
56
57    Double_t     GetBytesWritten() const { return fRawDB->GetBytesWritten(); }
58    TFile       *GetDB() const { return fRawDB; }
59    const char  *GetDBName() const { return fRawDB->GetName(); }
60    Int_t        GetEvents() const { return (Int_t) fTree->GetEntries(); }
61    AliRawEvent *GetEvent() const { return fEvent; }
62    Float_t      GetCompressionFactor() const;
63    Int_t        GetCompressionMode() const { return fRawDB->GetCompressionLevel(); }
64
65 protected:
66    TFile         *fRawDB;         // DB to store raw data
67    TTree         *fTree;          // tree used to store raw data
68    AliRawEvent   *fEvent;         // AliRawEvent via which data is stored
69 #ifdef USE_HLT
70    TTree         *fESDTree;       // tree for storing HLT ESD information
71    AliESD        *fESD;           // pointer to HLT ESD object
72 #endif
73    Int_t          fCompress;      // compression mode (1 default)
74    Double_t       fMaxSize;       // maximum size in bytes of the raw DB
75
76    virtual const char *GetFileName() const;
77    virtual Bool_t      FSHasSpace(const char *fs) const;
78    virtual void        MakeTree();
79
80 private:
81    AliRawDB(const AliRawDB& rawDB);
82    AliRawDB& operator = (const AliRawDB& rawDB);
83
84    ClassDef(AliRawDB,0)  // Raw DB
85 };
86
87 #endif