Increasing histo clu. lay.1 upper lim.
[u/mrichter/AliRoot.git] / RAW / AliRawDB.h
CommitLineData
a197a4ce 1#ifndef ALIRAWDB_H
2#define ALIRAWDB_H
60838f24 3// @(#)alimdc:$Name: $:$Id$
a197a4ce 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
6605cb7a 31#include "AliDAQ.h"
a197a4ce 32
33// Forward class declarations
33314186 34class AliRawEventV2;
35class AliRawDataArrayV2;
a197a4ce 36class TFile;
af885e0f 37class AliESDEvent;
a197a4ce 38
39class AliRawDB : public TObject {
40
41public:
33314186 42 AliRawDB(AliRawEventV2 *event,
af885e0f 43 AliESDEvent *esd,
e10815f1 44 Int_t compress,
a8b0468f 45 const char* fileName = NULL,
46 Int_t basketsize = 32000);
6605cb7a 47 virtual ~AliRawDB();
a197a4ce 48
49 virtual const char *GetOpenOption() const { return "RECREATE"; }
50 virtual Int_t GetNetopt() const { return 0; }
e10815f1 51 virtual Bool_t Create(const char* fileName = NULL);
d2450633 52 virtual Long64_t Close();
e10815f1 53 Int_t Fill();
60838f24 54 Long64_t GetTotalSize();
0cd3f979 55 Long64_t AutoSave();
a197a4ce 56
e10815f1 57 void SetMaxSize(Double_t maxSize) { fMaxSize = maxSize; }
58 void SetFS(const char* fs1, const char* fs2 = NULL);
59 void SetDeleteFiles(Bool_t deleteFiles = kTRUE) { fDeleteFiles = deleteFiles; }
60
61 Bool_t NextFile(const char* fileName = NULL);
a197a4ce 62
63 Double_t GetBytesWritten() const { return fRawDB->GetBytesWritten(); }
64 TFile *GetDB() const { return fRawDB; }
65 const char *GetDBName() const { return fRawDB->GetName(); }
33314186 66 Int_t GetEvents() const { return (fTree) ? (Int_t) fTree->GetEntries() : 0; }
67 AliRawEventV2 *GetEvent() const { return fEvent; }
a197a4ce 68 Float_t GetCompressionFactor() const;
69 Int_t GetCompressionMode() const { return fRawDB->GetCompressionLevel(); }
a8b0468f 70 Int_t GetBasketSize() const { return fBasketSize; }
e10815f1 71 void Stop() { fStop = kTRUE; }
ee8f2a6c 72 static const char *GetAliRootTag();
581835ab 73 Bool_t WriteGuidFile(TString &guidFileFolder);
33314186 74 void Reset();
75 AliRawDataArrayV2 *GetRawDataArray(UInt_t eqSize, UInt_t eqId) const;
a197a4ce 76
77protected:
78 TFile *fRawDB; // DB to store raw data
79 TTree *fTree; // tree used to store raw data
33314186 80 AliRawEventV2 *fEvent; // AliRawEvent via which data is stored
81 AliRawDataArrayV2 **fDetRawData[AliDAQ::kNDetectors+1]; // Detectors raw-data payload
a109e73e 82 TTree *fESDTree; // tree for storing HLT ESD information
af885e0f 83 AliESDEvent *fESD; // pointer to HLT ESD object
a197a4ce 84 Int_t fCompress; // compression mode (1 default)
a8b0468f 85 Int_t fBasketSize; // root i/o basket size (default = 32000)
a197a4ce 86 Double_t fMaxSize; // maximum size in bytes of the raw DB
e10815f1 87 TString fFS1; // first raw DB file system location
88 TString fFS2; // second raw DB file system location
89 Bool_t fDeleteFiles; // flag for deletion of files
90 Bool_t fStop; // stop execution (triggered by SIGUSR1)
ee8f2a6c 91 static const char *fgkAliRootTag; // string with the aliroot tag id
92
30d59ac8 93 static Int_t fgkDetBranches[AliDAQ::kNDetectors+1]; // Number of branches in each detector
94
a197a4ce 95 virtual const char *GetFileName() const;
96 virtual Bool_t FSHasSpace(const char *fs) const;
97 virtual void MakeTree();
98
99private:
100 AliRawDB(const AliRawDB& rawDB);
101 AliRawDB& operator = (const AliRawDB& rawDB);
102
33314186 103 ClassDef(AliRawDB,5) // Raw DB
a197a4ce 104};
105
106#endif