]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliMDC.h
Adding some extra information about the components usage.
[u/mrichter/AliRoot.git] / RAW / AliMDC.h
CommitLineData
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 28class AliRawEvent;
f2dc6b20 29class AliRawEventHeaderBase;
a197a4ce 30class AliRawEquipmentHeader;
31class AliRawData;
e10815f1 32class AliRawDB;
e10815f1 33class AliTagDB;
54dd2271 34class AliRawEventTag;
e10815f1 35class AliStats;
a109e73e 36class AliESD;
a197a4ce 37
38class AliMDC : public TObject {
39
40public:
41 enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL };
e10815f1 42 enum EFilterMode { kFilterOff, kFilterTransparent, kFilterOn };
f07ec911 43 enum EErrorCode { kErrStartEndRun = -1,
e10815f1 44 kErrHeader = -2,
45 kErrHeaderSize = -3,
46 kErrSubHeader = -4,
47 kErrDataSize = -5,
48 kErrEquipmentHeader = -6,
d21e9888 49 kErrEquipment = -7,
f07ec911 50 kErrFileSize = -8,
51 kFilterReject = -9,
19359f9c 52 kErrWriting = -10,
53 kErrTagFile = -11};
e10815f1 54
55 AliMDC(Int_t compress, Bool_t deleteFiles,
56 EFilterMode filterMode = kFilterTransparent,
5d315e4d 57 Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL,
58 const char* guidFileFolder = NULL);
e10815f1 59 virtual ~AliMDC();
60
4fbf7315 61 Int_t Open(EWriteMode mode, const char* fileName,
62 Double_t maxFileSize = 0,
63 const char* fs1 = NULL, const char* fs2 = NULL);
e10815f1 64 Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
d21e9888 65 Int_t GetTotalSize();
e10815f1 66 Int_t Close();
67
68 Int_t Run(const char* inputFile, Bool_t loop,
69 EWriteMode mode, Double_t maxFileSize,
70 const char* fs1 = NULL, const char* fs2 = NULL);
71 void Stop();
a197a4ce 72
73private:
74 class AliMDCInterruptHandler : public TSignalHandler {
75 public:
76 AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
77 Bool_t Notify() {
78 Info("Notify", "received a SIGUSR1 signal");
e10815f1 79 fMDC->Stop();
a197a4ce 80 return kTRUE;
81 }
82 private:
83 AliMDC *fMDC; // alimdc to signal
84
d557984f 85 AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented
86 AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented
a197a4ce 87 };
88
e10815f1 89 AliRawEvent *fEvent; // produced AliRawEvent
90 AliESD *fESD; // pointer to HLT ESD object
91 AliStats *fStats; // statistics
92 AliRawDB *fRawDB; // raw data DB
e10815f1 93 AliTagDB *fTagDB; // tag DB
54dd2271 94 AliRawEventTag *fEventTag; // raw-data event tag object
e10815f1 95 Int_t fCompress; // compression factor used for raw output DB
96 Bool_t fDeleteFiles; // flag for deletion of files
97 EFilterMode fFilterMode; // high level filter mode
98 TObjArray fFilters; // filter algorithms
99 Bool_t fStop; // stop execution (triggered by SIGUSR1)
f2dc6b20 100 Bool_t fIsTagDBCreated; // is tag db already created
101 Double_t fMaxSizeTagDB;// max size of the tag DB
102 const char* fFileNameTagDB;// tag DB file name
5d315e4d 103 const char* fGuidFileFolder; // guid files folder
e10815f1 104
105 // Filter names
106 enum {kNFilters = 1};
107 static const char* const fgkFilterName[kNFilters];
a197a4ce 108
109 AliMDC(const AliMDC& mdc);
110 AliMDC& operator = (const AliMDC& mdc);
111
112 Int_t Read(const char *name) { return TObject::Read(name); }
e10815f1 113 Int_t Read(Int_t fd, void *buffer, Int_t length);
a197a4ce 114 Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header,
e10815f1 115 Bool_t isSwapped, char*& data);
116 Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data);
a197a4ce 117
118 ClassDef(AliMDC,0) // MDC processor
119};
120
121#endif