]>
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 | ||
e10815f1 | 27 | #ifndef ROOT_TString |
28 | #include <TString.h> | |
29 | #endif | |
30 | ||
a197a4ce | 31 | |
32 | // Forward class declarations | |
33 | class AliRawEvent; | |
b7d09bb3 | 34 | class AliStats; |
a197a4ce | 35 | class TFile; |
a109e73e | 36 | class AliESD; |
a197a4ce | 37 | |
38 | class AliRawDB : public TObject { | |
39 | ||
40 | public: | |
a109e73e | 41 | AliRawDB(AliRawEvent *event, |
a109e73e | 42 | AliESD *esd, |
e10815f1 | 43 | Int_t compress, |
44 | const char* fileName = NULL); | |
f07ec911 | 45 | virtual ~AliRawDB() { if(Close()==-1) Error("~AliRawDB", "cannot close output file!"); } |
a197a4ce | 46 | |
47 | virtual const char *GetOpenOption() const { return "RECREATE"; } | |
48 | virtual Int_t GetNetopt() const { return 0; } | |
e10815f1 | 49 | virtual Bool_t Create(const char* fileName = NULL); |
f07ec911 | 50 | virtual Int_t Close(); |
e10815f1 | 51 | Int_t Fill(); |
d21e9888 | 52 | Int_t GetTotalSize(); |
a197a4ce | 53 | |
b7d09bb3 | 54 | void WriteStats(AliStats* stats); |
55 | ||
e10815f1 | 56 | void SetMaxSize(Double_t maxSize) { fMaxSize = maxSize; } |
57 | void SetFS(const char* fs1, const char* fs2 = NULL); | |
58 | void SetDeleteFiles(Bool_t deleteFiles = kTRUE) { fDeleteFiles = deleteFiles; } | |
5d315e4d | 59 | void SetGuidFileFolder(const char* guidFileFolder) |
60 | { fGuidFileFolder = guidFileFolder; } | |
e10815f1 | 61 | |
62 | Bool_t NextFile(const char* fileName = NULL); | |
a197a4ce | 63 | |
64 | Double_t GetBytesWritten() const { return fRawDB->GetBytesWritten(); } | |
65 | TFile *GetDB() const { return fRawDB; } | |
66 | const char *GetDBName() const { return fRawDB->GetName(); } | |
67 | Int_t GetEvents() const { return (Int_t) fTree->GetEntries(); } | |
68 | AliRawEvent *GetEvent() const { return fEvent; } | |
69 | Float_t GetCompressionFactor() const; | |
70 | Int_t GetCompressionMode() const { return fRawDB->GetCompressionLevel(); } | |
e10815f1 | 71 | void Stop() { fStop = kTRUE; } |
ee8f2a6c | 72 | static const char *GetAliRootTag(); |
a197a4ce | 73 | |
74 | protected: | |
75 | TFile *fRawDB; // DB to store raw data | |
76 | TTree *fTree; // tree used to store raw data | |
77 | AliRawEvent *fEvent; // AliRawEvent via which data is stored | |
a109e73e | 78 | TTree *fESDTree; // tree for storing HLT ESD information |
79 | AliESD *fESD; // pointer to HLT ESD object | |
a197a4ce | 80 | Int_t fCompress; // compression mode (1 default) |
81 | Double_t fMaxSize; // maximum size in bytes of the raw DB | |
e10815f1 | 82 | TString fFS1; // first raw DB file system location |
83 | TString fFS2; // second raw DB file system location | |
84 | Bool_t fDeleteFiles; // flag for deletion of files | |
85 | Bool_t fStop; // stop execution (triggered by SIGUSR1) | |
5d315e4d | 86 | const char *fGuidFileFolder; // folder which contains guid files |
ee8f2a6c | 87 | static const char *fgkAliRootTag; // string with the aliroot tag id |
88 | ||
a197a4ce | 89 | virtual const char *GetFileName() const; |
90 | virtual Bool_t FSHasSpace(const char *fs) const; | |
91 | virtual void MakeTree(); | |
92 | ||
5d315e4d | 93 | void WriteGuidFile(); |
94 | ||
a197a4ce | 95 | private: |
96 | AliRawDB(const AliRawDB& rawDB); | |
97 | AliRawDB& operator = (const AliRawDB& rawDB); | |
98 | ||
99 | ClassDef(AliRawDB,0) // Raw DB | |
100 | }; | |
101 | ||
102 | #endif |