// AliRawRFIODB or via rootd using AliRawRootdDB or to CASTOR via //
// rootd using AliRawCastorDB (and for performance testing there is //
// also AliRawNullDB). //
-// The AliRunDB class provides the interface to the run and file //
-// catalogues (AliEn or plain MySQL). //
// The AliStats class provides statics information that is added as //
// a single keyed object to each raw file. //
// The AliTagDB provides an interface to a TAG database. //
#include "AliRawRootdDB.h"
#include "AliRawNullDB.h"
#include "AliTagDB.h"
-#include "AliRunDB.h"
+#include "AliRawEventTag.h"
#include "AliFilter.h"
#include "AliMDC.h"
//______________________________________________________________________________
AliMDC::AliMDC(Int_t compress, Bool_t deleteFiles, EFilterMode filterMode,
- const char* localRunDB, Bool_t rdbmsRunDB,
- const char* alienHostRunDB, const char* alienDirRunDB,
Double_t maxSizeTagDB, const char* fileNameTagDB) :
fEvent(new AliRawEvent),
fESD(NULL),
fStats(NULL),
fRawDB(NULL),
- fRunDB(new AliRunDB(localRunDB, rdbmsRunDB, alienHostRunDB, alienDirRunDB)),
fTagDB(NULL),
+ fEventTag(new AliRawEventTag),
fCompress(compress),
fDeleteFiles(deleteFiles),
fFilterMode(filterMode),
// kFilterTransparent the algorthims will be run but no events will be
// rejected, if it is kFilterOn the filters will be run and the event will
// be rejected if all filters return kFALSE.
- // localRunDB is the file name of the local run DB; if NULL no local run DB
- // will be created.
- // The filling of a MySQL run DB can be switch on or off with rdbmsRunDB.
- // The host and directory name of the alien run DB can be specified by
- // alienHostRunDB and alienDirRunDB; if NULL no alien DB will be filled.
// If maxSizeTagDB is greater than 0 it determines the maximal size of the
// tag DB and then fileNameTagDB is the directory name for the tag DB.
// Otherwise fileNameTagDB is the file name of the tag DB. If it is NULL
fFilters.Delete();
if(fTagDB) delete fTagDB;
- delete fRunDB;
delete fRawDB;
delete fStats;
delete fESD;
delete fEvent;
+ delete fEventTag;
}
//______________________________________________________________________________
-AliMDC::AliMDC(const AliMDC& mdc): TObject(mdc)
-{
-// copy constructor
-
- Fatal("AliMDC", "copy constructor not implemented");
-}
-
-//______________________________________________________________________________
-AliMDC& AliMDC::operator = (const AliMDC& /*mdc*/)
-{
-// assignment operator
-
- Fatal("operator =", "assignment operator not implemented");
- return *this;
-}
-
-
-//______________________________________________________________________________
-Int_t AliMDC::Open(EWriteMode mode, const char* fileName)
+Int_t AliMDC::Open(EWriteMode mode, const char* fileName,
+ Double_t maxFileSize,
+ const char* fs1, const char* fs2)
{
// open a new raw DB file
fRawDB = new AliRawDB(fEvent, fESD, fCompress, fileName);
fRawDB->SetDeleteFiles(fDeleteFiles);
+ if (fileName == NULL) {
+ fRawDB->SetMaxSize(maxFileSize);
+ fRawDB->SetFS(fs1, fs2);
+ fRawDB->Create();
+ }
+
if (fRawDB->IsZombie()) {
delete fRawDB;
fRawDB = NULL;
// 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
if (!fRawDB) return -1;
fRawDB->WriteStats(fStats);
- fRunDB->Update(fStats);
Int_t filesize = fRawDB->Close();
delete fRawDB;
fRawDB = NULL;
// Create new raw DB.
if (fRawDB) Close();
- if (mode == kRFIO) {
- fRawDB = new AliRawRFIODB(fEvent, fESD, fCompress, NULL);
- } else if (mode == kROOTD) {
- fRawDB = new AliRawRootdDB(fEvent, fESD, fCompress, NULL);
- } else if (mode == kCASTOR) {
- fRawDB = new AliRawCastorDB(fEvent, fESD, fCompress, NULL);
- } else if (mode == kDEVNULL) {
- fRawDB = new AliRawNullDB(fEvent, fESD, fCompress, NULL);
- } else {
- fRawDB = new AliRawDB(fEvent, fESD, fCompress, NULL);
- }
- fRawDB->SetMaxSize(maxFileSize);
- fRawDB->SetFS(fs1, fs2);
- fRawDB->SetDeleteFiles(fDeleteFiles);
- fRawDB->Create();
-
- if (fRawDB->IsZombie()) {
- delete fRawDB;
- fRawDB = NULL;
- return 1;
- }
- printf("Filling raw DB %s\n", fRawDB->GetDBName());
- // Create AliStats object
- fStats = new AliStats(fRawDB->GetDBName(), fCompress,
- fFilterMode != kFilterOff);
+ if (Open(mode,NULL,maxFileSize,fs1,fs2) < 0) return 1;
// Process input stream
#ifdef USE_EB
// Write stats object to raw db, run db, MySQL and AliEn
fRawDB->WriteStats(fStats);
- if (fRunDB) fRunDB->Update(fStats);
delete fStats;
fStats = NULL;