]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliTagDB.h
new digitization and reconstruction corresponded to new data format
[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
e10815f1 27#ifndef ROOT_TString
28#include <TString.h>
29#endif
30
31
a197a4ce 32
33// Forward class declarations
f2dc6b20 34class AliRawEventHeaderBase;
a197a4ce 35
36
37class AliTagDB : public TObject {
38
39public:
f2dc6b20 40 AliTagDB(AliRawEventHeaderBase *header, const char* fileName = NULL);
a197a4ce 41 virtual ~AliTagDB() { Close(); }
42
e10815f1 43 Bool_t Create(const char* fileName = NULL);
a197a4ce 44 virtual void Close();
45 void Fill() { fTree->Fill(); }
46 Bool_t FileFull()
e10815f1 47 { return (fMaxSize >= 0) ? ((fTagDB->GetBytesWritten() > fMaxSize) ? kTRUE : kFALSE) : kFALSE; }
48
49 Bool_t NextFile(const char* fileName = NULL);
a197a4ce 50
e10815f1 51 void SetMaxSize(Double_t maxSize) { fMaxSize = maxSize; }
52 void SetFS(const char* fs);
a197a4ce 53
54 Double_t GetBytesWritten() const { return fTagDB->GetBytesWritten(); }
55 TFile *GetDB() const { return fTagDB; }
56 const char *GetDBName() const { return fTagDB->GetName(); }
f2dc6b20 57 AliRawEventHeaderBase *GetHeader() const { return fHeader; }
a197a4ce 58 Int_t GetEvents() const { return (Int_t) fTree->GetEntries(); }
59 Float_t GetCompressionFactor() const;
60
61protected:
62 TFile *fTagDB; // DB to store header information only (tag)
63 TTree *fTree; // tree use to store header
f2dc6b20 64 AliRawEventHeaderBase *fHeader; // header via which data is stored
a197a4ce 65 Double_t fMaxSize; // maximum size in bytes of tag DB
e10815f1 66 TString fFS; // tag DB file system location
67 Bool_t fDeleteFiles; // flag for deletion of files
a197a4ce 68
69 virtual const char *GetFileName() const;
70
71private:
72 AliTagDB(const AliTagDB& tagDB);
73 AliTagDB& operator = (const AliTagDB& tagDB);
74
75 ClassDef(AliTagDB,0) // Tag DB
76};
77
78#endif