#include <TObject.h>
#endif
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+
#ifndef ROOT_TSysEvtHandler
#include <TSysEvtHandler.h>
#endif
// Forward class declarations
-class AliRawEventHeader;
+class AliRawEvent;
+class AliRawEventHeaderBase;
class AliRawEquipmentHeader;
class AliRawData;
-
+class AliRawDB;
+class AliRunDB;
+class AliTagDB;
+class AliStats;
+class AliESD;
class AliMDC : public TObject {
public:
enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL };
-
- AliMDC(Int_t fd, Int_t compress, Double_t maxFileSize, Bool_t useFilter,
- EWriteMode mode, Bool_t useLoop, Bool_t delFiles);
- ~AliMDC() { fgInstance = NULL; }
-
- static AliMDC* Instance() {return fgInstance;}
-
- Int_t Run();
- void SetStopLoop() { fStopLoop = kTRUE; }
- Bool_t StopLoop() const { return fStopLoop; }
-
- void SetDebugLevel(Int_t level) { fDebugLevel = level; }
- Int_t GetDebugLevel() const { return fDebugLevel; }
-
- static Bool_t DeleteFiles() { return fgDeleteFiles; }
-
- enum {kMDC = 6}; // Which MDC is this...
-
- static const char* const Fifo() {return fgkFifo;}
- static const char* const RawDBFS(Int_t i) {return fgkRawDBFS[i];}
- static const char* const TagDBFS() {return fgkTagDBFS;}
- static const char* const RunDBFS() {return fgkRunDBFS;}
- static const char* const RFIOFS() {return fgkRFIOFS;}
- static const char* const CastorFS() {return fgkCastorFS;}
- static const char* const RootdFS() {return fgkRootdFS;}
- static const char* const AlienHost() {return fgkAlienHost;}
- static const char* const AlienDir() {return fgkAlienDir;}
+ enum EFilterMode { kFilterOff, kFilterTransparent, kFilterOn };
+ enum EErrorCode { kErrStartEndRun = -1,
+ kErrHeader = -2,
+ kErrHeaderSize = -3,
+ kErrSubHeader = -4,
+ kErrDataSize = -5,
+ kErrEquipmentHeader = -6,
+ kErrEquipment = -7,
+ kErrFileSize = -8,
+ kFilterReject = -9,
+ kErrWriting = -10 };
+
+ AliMDC(Int_t compress, Bool_t deleteFiles,
+ EFilterMode filterMode = kFilterTransparent,
+ const char* localRunDB = NULL, Bool_t rdbmsRunDB = kFALSE,
+ const char* alienHostRunDB = NULL, const char* alienDirRunDB = NULL,
+ Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL);
+ virtual ~AliMDC();
+
+ Int_t Open(EWriteMode mode, const char* fileName);
+ Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
+ Int_t GetTotalSize();
+ Int_t Close();
+
+ Int_t Run(const char* inputFile, Bool_t loop,
+ EWriteMode mode, Double_t maxFileSize,
+ const char* fs1 = NULL, const char* fs2 = NULL);
+ void Stop();
private:
class AliMDCInterruptHandler : public TSignalHandler {
AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
Bool_t Notify() {
Info("Notify", "received a SIGUSR1 signal");
- fMDC->SetStopLoop();
+ fMDC->Stop();
return kTRUE;
}
private:
AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler);
};
- static AliMDC* fgInstance; // singleton instance
-
- Int_t fFd; // DATE input stream
- Int_t fCompress; // compression factor used for raw output DB
- Int_t fNumEvents; // number of events processed
- Int_t fDebugLevel; // controls debug print-out
- Double_t fMaxFileSize; // maximum size of raw output DB
- EWriteMode fWriteMode; // write mode (local, rfio, rootd, castor, /dev/null)
- Bool_t fUseFifo; // read from fifo, file otherwise
- Bool_t fUseEb; // use event builder API instead of fifo
- Bool_t fUseFilter; // use 3rd level trigger filter
- Bool_t fUseLoop; // loop on input source (must be file)
- Bool_t fStopLoop; // break from endless loop (triggered by SIGUSR1)
-
- static Bool_t fgDeleteFiles; // flag for deletion of files
-
- static const Double_t fgkMaxTagFileSize; // maximal size of tag DB
-
- // Fixed file system locations for the different DB's
- static const char* const fgkFifo; // fifo
- static const char* const fgkRawDBFS[2]; // raw DB
- static const char* const fgkTagDBFS; // tag DB
- static const char* const fgkRunDBFS; // run DB
- static const char* const fgkRFIOFS; // rfio
- static const char* const fgkCastorFS; // castor
- static const char* const fgkRootdFS; // rootd
- static const char* const fgkAlienHost; // alien host name
- static const char* const fgkAlienDir; // alien directory
+ AliRawEvent *fEvent; // produced AliRawEvent
+ AliESD *fESD; // pointer to HLT ESD object
+ AliStats *fStats; // statistics
+ AliRawDB *fRawDB; // raw data DB
+ AliRunDB *fRunDB; // run DB
+ AliTagDB *fTagDB; // tag DB
+ Int_t fCompress; // compression factor used for raw output DB
+ Bool_t fDeleteFiles; // flag for deletion of files
+ EFilterMode fFilterMode; // high level filter mode
+ TObjArray fFilters; // filter algorithms
+ Bool_t fStop; // stop execution (triggered by SIGUSR1)
+ Bool_t fIsTagDBCreated; // is tag db already created
+ Double_t fMaxSizeTagDB;// max size of the tag DB
+ const char* fFileNameTagDB;// tag DB file name
+
+ // Filter names
+ enum {kNFilters = 1};
+ static const char* const fgkFilterName[kNFilters];
AliMDC(const AliMDC& mdc);
AliMDC& operator = (const AliMDC& mdc);
Int_t Read(const char *name) { return TObject::Read(name); }
- Int_t Read(void *buffer, Int_t length);
- Int_t ReadHeader(AliRawEventHeader &header, void *eb = 0);
+ Int_t Read(Int_t fd, void *buffer, Int_t length);
Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header,
- Bool_t isSwapped, void *eb = 0);
- Int_t ReadRawData(AliRawData &raw, Int_t size, void *eb = 0);
- Int_t DumpEvent(Int_t toRead);
- Int_t Filter(AliRawData &raw);
+ Bool_t isSwapped, char*& data);
+ Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data);
ClassDef(AliMDC,0) // MDC processor
};