]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - RAW/AliRawDB.h
Bugs corrected
[u/mrichter/AliRoot.git] / RAW / AliRawDB.h
... / ...
CommitLineData
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
29class AliRawEvent;
30class AliStats;
31class TFile;
32
33#ifdef USE_HLT
34class AliESD;
35#endif
36
37class AliRawDB : public TObject {
38
39public:
40 AliRawDB(AliRawEvent *event,
41#ifdef USE_HLT
42 AliESD *esd,
43#endif
44 Double_t maxsize, Int_t compress,
45 Bool_t create = kTRUE);
46 virtual ~AliRawDB() { Close(); }
47
48 virtual const char *GetOpenOption() const { return "RECREATE"; }
49 virtual Int_t GetNetopt() const { return 0; }
50 virtual Bool_t Create();
51 virtual void Close();
52 void Fill() { fTree->Fill();
53#ifdef USE_HLT
54 fESDTree->Fill();
55#endif
56 }
57 Bool_t FileFull() { return (fRawDB->GetBytesWritten() > fMaxSize) ?
58 kTRUE : kFALSE; }
59
60 void WriteStats(AliStats* stats);
61
62 Bool_t NextFile();
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(); }
71
72protected:
73 TFile *fRawDB; // DB to store raw data
74 TTree *fTree; // tree used to store raw data
75 AliRawEvent *fEvent; // AliRawEvent via which data is stored
76#ifdef USE_HLT
77 TTree *fESDTree; // tree for storing HLT ESD information
78 AliESD *fESD; // pointer to HLT ESD object
79#endif
80 Int_t fCompress; // compression mode (1 default)
81 Double_t fMaxSize; // maximum size in bytes of the raw DB
82
83 virtual const char *GetFileName() const;
84 virtual Bool_t FSHasSpace(const char *fs) const;
85 virtual void MakeTree();
86
87private:
88 AliRawDB(const AliRawDB& rawDB);
89 AliRawDB& operator = (const AliRawDB& rawDB);
90
91 ClassDef(AliRawDB,0) // Raw DB
92};
93
94#endif