Line data Source code
1 : #ifndef ALITAGDB_H
2 : #define ALITAGDB_H
3 : // @(#) $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 : #ifndef ROOT_TString
28 : #include <TString.h>
29 : #endif
30 :
31 :
32 :
33 : // Forward class declarations
34 : class AliRawEventTag;
35 :
36 :
37 : class AliTagDB : public TObject {
38 :
39 : public:
40 : AliTagDB(AliRawEventTag *eventTag, const char* fileName = NULL);
41 7 : virtual ~AliTagDB() { Close(); }
42 :
43 : Bool_t Create(const char* fileName = NULL);
44 : virtual void Close();
45 8 : void Fill() { fTree->Fill(); }
46 : Bool_t FileFull()
47 16 : { return (fMaxSize >= 0) ? ((fTagDB->GetBytesWritten() > fMaxSize) ? kTRUE : kFALSE) : kFALSE; }
48 :
49 : Bool_t NextFile(const char* fileName = NULL);
50 :
51 2 : void SetMaxSize(Double_t maxSize) { fMaxSize = maxSize; }
52 : void SetFS(const char* fs);
53 :
54 0 : Double_t GetBytesWritten() const { return fTagDB->GetBytesWritten(); }
55 0 : TFile *GetDB() const { return fTagDB; }
56 0 : const char *GetDBName() const { return fTagDB->GetName(); }
57 0 : AliRawEventTag *GetEventTag() const { return fEventTag; }
58 0 : Int_t GetEvents() const { return (Int_t) fTree->GetEntries(); }
59 : Float_t GetCompressionFactor() const;
60 :
61 : protected:
62 : TFile *fTagDB; // DB to store header information only (tag)
63 : TTree *fTree; // tree use to store header
64 : AliRawEventTag *fEventTag; // pointer to event tag object via which data is stored
65 : Double_t fMaxSize; // maximum size in bytes of tag DB
66 : TString fFS; // tag DB file system location
67 : Bool_t fDeleteFiles; // flag for deletion of files
68 :
69 : virtual const char *GetFileName() const;
70 :
71 : private:
72 : AliTagDB(const AliTagDB& tagDB);
73 : AliTagDB& operator = (const AliTagDB& tagDB);
74 :
75 2 : ClassDef(AliTagDB,0) // Tag DB
76 : };
77 :
78 : #endif
|