]>
Commit | Line | Data |
---|---|---|
a197a4ce | 1 | #ifndef ALIMDC_H |
2 | #define ALIMDC_H | |
3 | // @(#)alimdc:$Name$:$Id$ | |
4 | // Author: Fons Rademakers 26/11/99 | |
5 | ||
6 | /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. * | |
7 | * See cxx source for full Copyright notice */ | |
8 | ||
9 | ////////////////////////////////////////////////////////////////////////// | |
10 | // // | |
11 | // AliMDC // | |
12 | // // | |
13 | ////////////////////////////////////////////////////////////////////////// | |
14 | ||
15 | #ifndef ROOT_TObject | |
16 | #include <TObject.h> | |
17 | #endif | |
18 | ||
e10815f1 | 19 | #ifndef ROOT_TObjArray |
20 | #include <TObjArray.h> | |
21 | #endif | |
22 | ||
a197a4ce | 23 | #ifndef ROOT_TSysEvtHandler |
24 | #include <TSysEvtHandler.h> | |
25 | #endif | |
26 | ||
27 | // Forward class declarations | |
a109e73e | 28 | class AliRawEvent; |
f2dc6b20 | 29 | class AliRawEventHeaderBase; |
a197a4ce | 30 | class AliRawEquipmentHeader; |
31 | class AliRawData; | |
e10815f1 | 32 | class AliRawDB; |
e10815f1 | 33 | class AliTagDB; |
34 | class AliStats; | |
a109e73e | 35 | class AliESD; |
a197a4ce | 36 | |
37 | class AliMDC : public TObject { | |
38 | ||
39 | public: | |
40 | enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL }; | |
e10815f1 | 41 | enum EFilterMode { kFilterOff, kFilterTransparent, kFilterOn }; |
f07ec911 | 42 | enum EErrorCode { kErrStartEndRun = -1, |
e10815f1 | 43 | kErrHeader = -2, |
44 | kErrHeaderSize = -3, | |
45 | kErrSubHeader = -4, | |
46 | kErrDataSize = -5, | |
47 | kErrEquipmentHeader = -6, | |
d21e9888 | 48 | kErrEquipment = -7, |
f07ec911 | 49 | kErrFileSize = -8, |
50 | kFilterReject = -9, | |
51 | kErrWriting = -10 }; | |
e10815f1 | 52 | |
53 | AliMDC(Int_t compress, Bool_t deleteFiles, | |
54 | EFilterMode filterMode = kFilterTransparent, | |
e10815f1 | 55 | Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL); |
56 | virtual ~AliMDC(); | |
57 | ||
58 | Int_t Open(EWriteMode mode, const char* fileName); | |
59 | Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE); | |
d21e9888 | 60 | Int_t GetTotalSize(); |
e10815f1 | 61 | Int_t Close(); |
62 | ||
63 | Int_t Run(const char* inputFile, Bool_t loop, | |
64 | EWriteMode mode, Double_t maxFileSize, | |
65 | const char* fs1 = NULL, const char* fs2 = NULL); | |
66 | void Stop(); | |
a197a4ce | 67 | |
68 | private: | |
69 | class AliMDCInterruptHandler : public TSignalHandler { | |
70 | public: | |
71 | AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { } | |
72 | Bool_t Notify() { | |
73 | Info("Notify", "received a SIGUSR1 signal"); | |
e10815f1 | 74 | fMDC->Stop(); |
a197a4ce | 75 | return kTRUE; |
76 | } | |
77 | private: | |
78 | AliMDC *fMDC; // alimdc to signal | |
79 | ||
d557984f | 80 | AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented |
81 | AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented | |
a197a4ce | 82 | }; |
83 | ||
e10815f1 | 84 | AliRawEvent *fEvent; // produced AliRawEvent |
85 | AliESD *fESD; // pointer to HLT ESD object | |
86 | AliStats *fStats; // statistics | |
87 | AliRawDB *fRawDB; // raw data DB | |
e10815f1 | 88 | AliTagDB *fTagDB; // tag DB |
89 | Int_t fCompress; // compression factor used for raw output DB | |
90 | Bool_t fDeleteFiles; // flag for deletion of files | |
91 | EFilterMode fFilterMode; // high level filter mode | |
92 | TObjArray fFilters; // filter algorithms | |
93 | Bool_t fStop; // stop execution (triggered by SIGUSR1) | |
f2dc6b20 | 94 | Bool_t fIsTagDBCreated; // is tag db already created |
95 | Double_t fMaxSizeTagDB;// max size of the tag DB | |
96 | const char* fFileNameTagDB;// tag DB file name | |
e10815f1 | 97 | |
98 | // Filter names | |
99 | enum {kNFilters = 1}; | |
100 | static const char* const fgkFilterName[kNFilters]; | |
a197a4ce | 101 | |
102 | AliMDC(const AliMDC& mdc); | |
103 | AliMDC& operator = (const AliMDC& mdc); | |
104 | ||
105 | Int_t Read(const char *name) { return TObject::Read(name); } | |
e10815f1 | 106 | Int_t Read(Int_t fd, void *buffer, Int_t length); |
a197a4ce | 107 | Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header, |
e10815f1 | 108 | Bool_t isSwapped, char*& data); |
109 | Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data); | |
a197a4ce | 110 | |
111 | ClassDef(AliMDC,0) // MDC processor | |
112 | }; | |
113 | ||
114 | #endif |