3 // @(#)alimdc:$Name: $:$Id$
4 // Author: Fons Rademakers 26/11/99
6 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 //////////////////////////////////////////////////////////////////////////
13 //////////////////////////////////////////////////////////////////////////
19 #ifndef ROOT_TObjArray
20 #include <TObjArray.h>
23 #ifndef ROOT_TSysEvtHandler
24 #include <TSysEvtHandler.h>
27 // Forward class declarations
29 class AliRawEventHeaderBase;
30 class AliRawEquipmentHeader;
38 #include "AliRawEvent.h"
39 #include "AliESDEvent.h"
43 #include "AliRawData.h"
44 #include "AliRawDataArray.h"
45 #include "AliRawEventTag.h"
47 class AliMDC : public TObject {
50 enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL };
51 enum EFilterMode { kFilterOff, kFilterTransparent, kFilterOn };
52 enum EErrorCode { kErrStartEndRun = -1,
57 kErrEquipmentHeader = -6,
64 AliMDC(Int_t compress, Bool_t deleteFiles,
65 EFilterMode filterMode = kFilterTransparent,
66 Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL,
67 const char* guidFileFolder = NULL,
68 Int_t basketsize = 32000);
71 Int_t Open(EWriteMode mode, const char* fileName,
72 Double_t maxFileSize = 0,
73 const char* fs1 = NULL, const char* fs2 = NULL);
74 Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
75 Long64_t GetTotalSize();
79 Int_t Run(const char* inputFile, Bool_t loop,
80 EWriteMode mode, Double_t maxFileSize,
81 const char* fs1 = NULL, const char* fs2 = NULL);
85 class AliMDCInterruptHandler : public TSignalHandler {
87 AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
89 Info("Notify", "received a SIGUSR1 signal");
94 AliMDC *fMDC; // alimdc to signal
96 AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented
97 AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented
100 AliRawEvent *fEvent; // produced AliRawEvent
101 AliESDEvent *fESD; // pointer to HLT ESD object
102 AliStats *fStats; // statistics
103 AliRawDB *fRawDB; // raw data DB
104 AliTagDB *fTagDB; // tag DB
105 AliRawEventTag *fEventTag; // raw-data event tag object
106 Int_t fCompress; // compression factor used for raw output DB
107 Int_t fBasketSize; // root i/o basket size (default = 32000)
108 Bool_t fDeleteFiles; // flag for deletion of files
109 EFilterMode fFilterMode; // high level filter mode
110 TObjArray fFilters; // filter algorithms
111 Bool_t fStop; // stop execution (triggered by SIGUSR1)
112 Bool_t fIsTagDBCreated; // is tag db already created
113 Double_t fMaxSizeTagDB;// max size of the tag DB
114 TString fFileNameTagDB;// tag DB file name
115 TString fGuidFileFolder; // guid files folder
118 enum {kNFilters = 1};
119 static const char* const fgkFilterName[kNFilters];
121 AliMDC(const AliMDC& mdc);
122 AliMDC& operator = (const AliMDC& mdc);
124 Int_t Read(const char *name) { return TObject::Read(name); }
125 Int_t Read(Int_t fd, void *buffer, Int_t length);
126 Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header,
127 Bool_t isSwapped, char*& data);
128 Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data);
130 ClassDef(AliMDC,3) // MDC processor