#ifndef ALIRAWDB_H
#define ALIRAWDB_H
-// @(#)alimdc:$Name$:$Id$
+// @(#)alimdc:$Name: $:$Id$
// Author: Fons Rademakers 26/11/99
/* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
#include <TTree.h>
#endif
+#ifndef ROOT_TString
+#include <TString.h>
+#endif
+
+#include "AliDAQ.h"
// Forward class declarations
class AliRawEvent;
+class AliRawDataArray;
class AliStats;
class TFile;
-
-#ifdef USE_HLT
-class AliESD;
-#endif
+class AliESDEvent;
class AliRawDB : public TObject {
public:
AliRawDB(AliRawEvent *event,
-#ifdef USE_HLT
- AliESD *esd,
-#endif
- Double_t maxsize, Int_t compress,
- Bool_t create = kTRUE);
- virtual ~AliRawDB() { Close(); }
+ AliESDEvent *esd,
+ Int_t compress,
+ const char* fileName = NULL,
+ Int_t basketsize = 32000);
+ virtual ~AliRawDB();
virtual const char *GetOpenOption() const { return "RECREATE"; }
virtual Int_t GetNetopt() const { return 0; }
- virtual Bool_t Create();
- virtual void Close();
- void Fill() { fTree->Fill(); fESDTree->Fill(); }
- Bool_t FileFull() { return (fRawDB->GetBytesWritten() > fMaxSize) ?
- kTRUE : kFALSE; }
+ virtual Bool_t Create(const char* fileName = NULL);
+ virtual Long64_t Close();
+ Int_t Fill();
+ Long64_t GetTotalSize();
+ Long64_t AutoSave();
void WriteStats(AliStats* stats);
- Bool_t NextFile();
+ void SetMaxSize(Double_t maxSize) { fMaxSize = maxSize; }
+ void SetFS(const char* fs1, const char* fs2 = NULL);
+ void SetDeleteFiles(Bool_t deleteFiles = kTRUE) { fDeleteFiles = deleteFiles; }
+
+ Bool_t NextFile(const char* fileName = NULL);
Double_t GetBytesWritten() const { return fRawDB->GetBytesWritten(); }
TFile *GetDB() const { return fRawDB; }
AliRawEvent *GetEvent() const { return fEvent; }
Float_t GetCompressionFactor() const;
Int_t GetCompressionMode() const { return fRawDB->GetCompressionLevel(); }
+ Int_t GetBasketSize() const { return fBasketSize; }
+ void Stop() { fStop = kTRUE; }
+ static const char *GetAliRootTag();
+ Bool_t WriteGuidFile(TString &guidFileFolder);
protected:
TFile *fRawDB; // DB to store raw data
TTree *fTree; // tree used to store raw data
AliRawEvent *fEvent; // AliRawEvent via which data is stored
-#ifdef USE_HLT
+ AliRawDataArray **fDetRawData[AliDAQ::kNDetectors+1]; // Detectors raw-data payload
TTree *fESDTree; // tree for storing HLT ESD information
- AliESD *fESD; // pointer to HLT ESD object
-#endif
+ AliESDEvent *fESD; // pointer to HLT ESD object
Int_t fCompress; // compression mode (1 default)
+ Int_t fBasketSize; // root i/o basket size (default = 32000)
Double_t fMaxSize; // maximum size in bytes of the raw DB
+ TString fFS1; // first raw DB file system location
+ TString fFS2; // second raw DB file system location
+ Bool_t fDeleteFiles; // flag for deletion of files
+ Bool_t fStop; // stop execution (triggered by SIGUSR1)
+ static const char *fgkAliRootTag; // string with the aliroot tag id
+
+ static Int_t fgkDetBranches[AliDAQ::kNDetectors+1]; // Number of branches in each detector
virtual const char *GetFileName() const;
virtual Bool_t FSHasSpace(const char *fs) const;
AliRawDB(const AliRawDB& rawDB);
AliRawDB& operator = (const AliRawDB& rawDB);
- ClassDef(AliRawDB,0) // Raw DB
+ ClassDef(AliRawDB,4) // Raw DB
};
#endif