]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliMDC.h
Fix for #95494: Change AliLog message in AliAltroRawStreamV3.cxx
[u/mrichter/AliRoot.git] / RAW / AliMDC.h
index 2b86730b5af7f3b64b6e7942279a0e0e2139c5ac..d5f5fb9703273673004b3a56a70ee48450f062a0 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef ALIMDC_H
 #define ALIMDC_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 <TObject.h>
 #endif
 
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+
 #ifndef ROOT_TSysEvtHandler
 #include <TSysEvtHandler.h>
 #endif
 
 // Forward class declarations
-class AliRawEvent;
-class AliRawEventHeader;
+class AliRawEventHeaderBase;
 class AliRawEquipmentHeader;
 class AliRawData;
-#ifdef USE_HLT
-class AliESD;
-#endif
+class AliRawDB;
+class AliTagDB;
+class AliRawEventTag;
+class AliESDEvent;
+
+#include "AliRawEventV2.h"
+#include "AliESDEvent.h"
+#include "AliRawDB.h"
+#include "AliTagDB.h"
+#include "AliRawData.h"
+#include "AliRawEventTag.h"
 
 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,
+                    kErrTagFile = -11};
+
+   AliMDC(Int_t compress, Bool_t deleteFiles, 
+         EFilterMode filterMode = kFilterTransparent, 
+         Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL,
+         const char* guidFileFolder = NULL,
+         Int_t basketsize = 32000);
+   virtual ~AliMDC();
+
+   Int_t      Open(EWriteMode mode, const char* fileName,
+                  Double_t maxFileSize = 0,
+                  const char* fs1 = NULL, const char* fs2 = NULL);
+   Int_t      ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
+   Long64_t   GetTotalSize();
+   Long64_t   Close();
+   Long64_t   AutoSave();
+
+   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 {
@@ -67,62 +83,46 @@ private:
      AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
      Bool_t Notify() {
        Info("Notify", "received a SIGUSR1 signal");
-       fMDC->SetStopLoop();
+       fMDC->Stop();
        return kTRUE;
      }
    private:
      AliMDC *fMDC;   // alimdc to signal
 
-     AliMDCInterruptHandler(const AliMDCInterruptHandler& handler);
-     AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler);
+     AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented
+     AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented
    };
 
-   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
+   AliRawEventV2 *fEvent;       // produced AliRawEvent
+   AliESDEvent      *fESD;         // pointer to HLT ESD object
+   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
+   Int_t        fBasketSize;  // root i/o basket size (default = 32000)
+   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
+   TString      fFileNameTagDB;// tag DB file name
+   TString      fGuidFileFolder; // guid files folder
+
+   // 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(
-#ifdef USE_HLT
-                   AliRawEvent *event,AliESD *esd
-#endif
-                   );
+                                 Bool_t isSwapped, char*& data);
+   Int_t     ReadRawData(AliRawData &raw, Int_t size, char*& data);
 
-   ClassDef(AliMDC,0)  // MDC processor
+   ClassDef(AliMDC,3)  // MDC processor
 };
 
 #endif