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
28 class AliRawEventHeaderBase;
29 class AliRawEquipmentHeader;
36 #include "AliRawEventV2.h"
37 #include "AliESDEvent.h"
40 #include "AliRawData.h"
41 #include "AliRawEventTag.h"
43 class AliMDC : public TObject {
46 enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL };
47 enum EFilterMode { kFilterOff, kFilterTransparent, kFilterOn };
48 enum EErrorCode { kErrStartEndRun = -1,
53 kErrEquipmentHeader = -6,
60 AliMDC(Int_t compress, Bool_t deleteFiles,
61 EFilterMode filterMode = kFilterTransparent,
62 Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL,
63 const char* guidFileFolder = NULL,
64 Int_t basketsize = 32000);
67 Int_t Open(EWriteMode mode, const char* fileName,
68 Double_t maxFileSize = 0,
69 const char* fs1 = NULL, const char* fs2 = NULL);
70 Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
71 Long64_t GetTotalSize();
75 Int_t Run(const char* inputFile, Bool_t loop,
76 EWriteMode mode, Double_t maxFileSize,
77 const char* fs1 = NULL, const char* fs2 = NULL);
81 class AliMDCInterruptHandler : public TSignalHandler {
83 AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
85 Info("Notify", "received a SIGUSR1 signal");
90 AliMDC *fMDC; // alimdc to signal
92 AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented
93 AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented
96 AliRawEventV2 *fEvent; // produced AliRawEvent
97 AliESDEvent *fESD; // pointer to HLT ESD object
98 AliRawDB *fRawDB; // raw data DB
99 AliTagDB *fTagDB; // tag DB
100 AliRawEventTag *fEventTag; // raw-data event tag object
101 Int_t fCompress; // compression factor used for raw output DB
102 Int_t fBasketSize; // root i/o basket size (default = 32000)
103 Bool_t fDeleteFiles; // flag for deletion of files
104 EFilterMode fFilterMode; // high level filter mode
105 TObjArray fFilters; // filter algorithms
106 Bool_t fStop; // stop execution (triggered by SIGUSR1)
107 Bool_t fIsTagDBCreated; // is tag db already created
108 Double_t fMaxSizeTagDB;// max size of the tag DB
109 TString fFileNameTagDB;// tag DB file name
110 TString fGuidFileFolder; // guid files folder
113 enum {kNFilters = 1};
114 static const char* const fgkFilterName[kNFilters];
116 AliMDC(const AliMDC& mdc);
117 AliMDC& operator = (const AliMDC& mdc);
119 Int_t Read(const char *name) { return TObject::Read(name); }
120 Int_t Read(Int_t fd, void *buffer, Int_t length);
121 Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header,
122 Bool_t isSwapped, char*& data);
123 Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data);
125 ClassDef(AliMDC,3) // MDC processor