Adding the AliAnalysisGUI class which is the main class that controls the GUI.
[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;
33class AliRunDB;
34class AliTagDB;
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,
52 kErrWriting = -10 };
e10815f1 53
54 AliMDC(Int_t compress, Bool_t deleteFiles,
55 EFilterMode filterMode = kFilterTransparent,
56 const char* localRunDB = NULL, Bool_t rdbmsRunDB = kFALSE,
57 const char* alienHostRunDB = NULL, const char* alienDirRunDB = NULL,
58 Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL);
59 virtual ~AliMDC();
60
61 Int_t Open(EWriteMode mode, const char* fileName);
62 Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
d21e9888 63 Int_t GetTotalSize();
e10815f1 64 Int_t Close();
65
66 Int_t Run(const char* inputFile, Bool_t loop,
67 EWriteMode mode, Double_t maxFileSize,
68 const char* fs1 = NULL, const char* fs2 = NULL);
69 void Stop();
a197a4ce 70
71private:
72 class AliMDCInterruptHandler : public TSignalHandler {
73 public:
74 AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
75 Bool_t Notify() {
76 Info("Notify", "received a SIGUSR1 signal");
e10815f1 77 fMDC->Stop();
a197a4ce 78 return kTRUE;
79 }
80 private:
81 AliMDC *fMDC; // alimdc to signal
82
d557984f 83 AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented
84 AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented
a197a4ce 85 };
86
e10815f1 87 AliRawEvent *fEvent; // produced AliRawEvent
88 AliESD *fESD; // pointer to HLT ESD object
89 AliStats *fStats; // statistics
90 AliRawDB *fRawDB; // raw data DB
91 AliRunDB *fRunDB; // run DB
92 AliTagDB *fTagDB; // tag DB
93 Int_t fCompress; // compression factor used for raw output DB
94 Bool_t fDeleteFiles; // flag for deletion of files
95 EFilterMode fFilterMode; // high level filter mode
96 TObjArray fFilters; // filter algorithms
97 Bool_t fStop; // stop execution (triggered by SIGUSR1)
f2dc6b20 98 Bool_t fIsTagDBCreated; // is tag db already created
99 Double_t fMaxSizeTagDB;// max size of the tag DB
100 const char* fFileNameTagDB;// tag DB file name
e10815f1 101
102 // Filter names
103 enum {kNFilters = 1};
104 static const char* const fgkFilterName[kNFilters];
a197a4ce 105
106 AliMDC(const AliMDC& mdc);
107 AliMDC& operator = (const AliMDC& mdc);
108
109 Int_t Read(const char *name) { return TObject::Read(name); }
e10815f1 110 Int_t Read(Int_t fd, void *buffer, Int_t length);
a197a4ce 111 Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header,
e10815f1 112 Bool_t isSwapped, char*& data);
113 Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data);
a197a4ce 114
115 ClassDef(AliMDC,0) // MDC processor
116};
117
118#endif