Bugs corrected
[u/mrichter/AliRoot.git] / RAW / AliTagDB.h
CommitLineData
a197a4ce 1#ifndef ALITAGDB_H
2#define ALITAGDB_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// AliTagDB //
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 AliRawEventHeader;
30
31
32class AliTagDB : public TObject {
33
34public:
35 AliTagDB(AliRawEventHeader *header, Double_t maxsize, Bool_t create = kTRUE);
36 virtual ~AliTagDB() { Close(); }
37
38 Bool_t Create();
39 virtual void Close();
40 void Fill() { fTree->Fill(); }
41 Bool_t FileFull()
42 { return (fTagDB->GetBytesWritten() > fMaxSize) ? kTRUE : kFALSE; }
43
44 Bool_t NextFile();
45
46 Double_t GetBytesWritten() const { return fTagDB->GetBytesWritten(); }
47 TFile *GetDB() const { return fTagDB; }
48 const char *GetDBName() const { return fTagDB->GetName(); }
49 AliRawEventHeader *GetHeader() const { return fHeader; }
50 Int_t GetEvents() const { return (Int_t) fTree->GetEntries(); }
51 Float_t GetCompressionFactor() const;
52
53protected:
54 TFile *fTagDB; // DB to store header information only (tag)
55 TTree *fTree; // tree use to store header
56 AliRawEventHeader *fHeader; // header via which data is stored
57 Double_t fMaxSize; // maximum size in bytes of tag DB
58
59 virtual const char *GetFileName() const;
60
61private:
62 AliTagDB(const AliTagDB& tagDB);
63 AliTagDB& operator = (const AliTagDB& tagDB);
64
65 ClassDef(AliTagDB,0) // Tag DB
66};
67
68#endif