#include "AliRawRootdDB.h"
#include "AliRawNullDB.h"
#include "AliTagDB.h"
+#include "AliRawEventTag.h"
#include "AliFilter.h"
#include "AliMDC.h"
fStats(NULL),
fRawDB(NULL),
fTagDB(NULL),
+ fEventTag(new AliRawEventTag),
fCompress(compress),
fDeleteFiles(deleteFiles),
fFilterMode(filterMode),
delete fStats;
delete fESD;
delete fEvent;
+ delete fEventTag;
}
//______________________________________________________________________________
// Store raw event in tree
Int_t nBytes = fRawDB->Fill();
+ // Fill the event tag object
+ fEventTag->SetHeader(fEvent->GetHeader());
+ fEventTag->SetGUID(fRawDB->GetDB()->GetUUID().AsString());
+ fEventTag->SetEventNumber(fRawDB->GetEvents()-1);
+
// Create Tag DB here only after the raw data header
// version was already identified
if (!fIsTagDBCreated) {
if (fFileNameTagDB) {
if (fMaxSizeTagDB > 0) {
- fTagDB = new AliTagDB(fEvent->GetHeader(), NULL);
+ fTagDB = new AliTagDB(fEventTag, NULL);
fTagDB->SetMaxSize(fMaxSizeTagDB);
fTagDB->SetFS(fFileNameTagDB);
fTagDB->Create();
} else {
- fTagDB = new AliTagDB(fEvent->GetHeader(), fFileNameTagDB);
+ fTagDB = new AliTagDB(fEventTag, fFileNameTagDB);
}
}
fIsTagDBCreated = kTRUE;
}
- // Store header in tree
+ // Store event tag in tree
if (fTagDB) fTagDB->Fill();
// Make top event object ready for next event data
class AliRawData;
class AliRawDB;
class AliTagDB;
+class AliRawEventTag;
class AliStats;
class AliESD;
AliStats *fStats; // statistics
AliRawDB *fRawDB; // raw data DB
AliTagDB *fTagDB; // tag DB
+ AliRawEventTag *fEventTag; // raw-data event tag object
Int_t fCompress; // compression factor used for raw output DB
Bool_t fDeleteFiles; // flag for deletion of files
EFilterMode fFilterMode; // high level filter mode
#include <errno.h>
#include <TSystem.h>
+#include <TTimeStamp.h>
#include "AliESD.h"
#include "AliRawDB.h"
-#include "AliRawEventHeaderBase.h"
+#include "AliRawEventTag.h"
#include "AliTagDB.h"
+#include "AliRawEventHeaderBase.h"
ClassImp(AliTagDB)
//______________________________________________________________________________
-AliTagDB::AliTagDB(AliRawEventHeaderBase *header, const char* fileName) :
+AliTagDB::AliTagDB(AliRawEventTag *eventTag, const char* fileName) :
fTagDB(NULL),
fTree(NULL),
- fHeader(header),
+ fEventTag(eventTag),
fMaxSize(-1),
fFS(""),
fDeleteFiles(kFALSE)
}
// Create ROOT Tree object container
- fTree = new TTree("TAG", Form("ALICE header data tree (%s)", AliRawDB::GetAliRootTag()));
+ fTree = new TTree("T", Form("ALICE raw-data tag tree (%s)", AliRawDB::GetAliRootTag()));
fTree->SetAutoSave(100000000); // autosave when 100 Mbyte written
Int_t bufsize = 32000;
Int_t split = 1;
- const char *headername = fHeader->GetName();
- fTree->Branch("header", headername, &fHeader, bufsize, split);
+ const char *tagname = fEventTag->GetName();
+ fTree->Branch("TAG", tagname, &fEventTag, bufsize, split);
return kTRUE;
}
// check that fs exists (crude check fails if fs is a file)
gSystem->MakeDirectory(fs);
- char hostname[64];
+ // Get the run number
+ Int_t runNumber = -1;
+ if (fEventTag) {
+ AliRawEventHeaderBase *header = fEventTag->GetHeader();
+ if (header) runNumber = header->Get("RunNb");
+ }
+ char hostname[64];
strcpy(hostname, gSystem->HostName());
char *s;
if ((s = strchr(hostname, '.')))
- *s = 0;
+ *s = 0;
- TDatime dt;
+ TTimeStamp ts;
- sprintf(fname, "%s/%s_%d_%d.root", fs, hostname, dt.GetDate(), dt.GetTime());
+ sprintf(fname, "%s/Run%d.%s_%d_%d_%d.RAW.tag.root", fs, runNumber, hostname,
+ ts.GetDate(), ts.GetTime(), ts.GetNanoSec());
return fname;
}
// Forward class declarations
-class AliRawEventHeaderBase;
+class AliRawEventTag;
class AliTagDB : public TObject {
public:
- AliTagDB(AliRawEventHeaderBase *header, const char* fileName = NULL);
+ AliTagDB(AliRawEventTag *eventTag, const char* fileName = NULL);
virtual ~AliTagDB() { Close(); }
Bool_t Create(const char* fileName = NULL);
Double_t GetBytesWritten() const { return fTagDB->GetBytesWritten(); }
TFile *GetDB() const { return fTagDB; }
const char *GetDBName() const { return fTagDB->GetName(); }
- AliRawEventHeaderBase *GetHeader() const { return fHeader; }
+ AliRawEventTag *GetEventTag() const { return fEventTag; }
Int_t GetEvents() const { return (Int_t) fTree->GetEntries(); }
Float_t GetCompressionFactor() const;
protected:
TFile *fTagDB; // DB to store header information only (tag)
TTree *fTree; // tree use to store header
- AliRawEventHeaderBase *fHeader; // header via which data is stored
+ AliRawEventTag *fEventTag; // pointer to event tag object via which data is stored
Double_t fMaxSize; // maximum size in bytes of tag DB
TString fFS; // tag DB file system location
Bool_t fDeleteFiles; // flag for deletion of files
//______________________________________________________________________________
-AliTagNullDB::AliTagNullDB(AliRawEventHeaderBase *header) :
- AliTagDB(header, "/dev/null")
+AliTagNullDB::AliTagNullDB(AliRawEventTag *eventTag) :
+ AliTagDB(eventTag, "/dev/null")
{
// Create tag db writing to /dev/null.
class AliTagNullDB : public AliTagDB {
public:
- AliTagNullDB(AliRawEventHeaderBase *header);
+ AliTagNullDB(AliRawEventTag *eventTag);
~AliTagNullDB() { Close(); }
void Close();