]>
Commit | Line | Data |
---|---|---|
a197a4ce | 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 | ||
a109e73e | 32 | #ifdef USE_HLT |
33 | class AliESD; | |
34 | #endif | |
a197a4ce | 35 | |
36 | class AliRawDB : public TObject { | |
37 | ||
38 | public: | |
a109e73e | 39 | AliRawDB(AliRawEvent *event, |
40 | #ifdef USE_HLT | |
41 | AliESD *esd, | |
42 | #endif | |
43 | Double_t maxsize, Int_t compress, | |
a197a4ce | 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(); | |
a109e73e | 51 | void Fill() { fTree->Fill(); fESDTree->Fill(); } |
a197a4ce | 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 | |
a109e73e | 69 | #ifdef USE_HLT |
70 | TTree *fESDTree; // tree for storing HLT ESD information | |
71 | AliESD *fESD; // pointer to HLT ESD object | |
72 | #endif | |
a197a4ce | 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 |