]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliMDC.h
Modified file access mode
[u/mrichter/AliRoot.git] / RAW / AliMDC.h
CommitLineData
a197a4ce 1#ifndef ALIMDC_H
2#define ALIMDC_H
60838f24 3// @(#)alimdc:$Name: $:$Id$
a197a4ce 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;
af885e0f 36class AliESDEvent;
37
38#include "AliRawEvent.h"
39#include "AliESDEvent.h"
40#include "AliStats.h"
41#include "AliRawDB.h"
42#include "AliTagDB.h"
43#include "AliRawData.h"
44#include "AliRawDataArray.h"
45#include "AliRawEventTag.h"
a197a4ce 46
47class AliMDC : public TObject {
48
49public:
50 enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL };
e10815f1 51 enum EFilterMode { kFilterOff, kFilterTransparent, kFilterOn };
f07ec911 52 enum EErrorCode { kErrStartEndRun = -1,
e10815f1 53 kErrHeader = -2,
54 kErrHeaderSize = -3,
55 kErrSubHeader = -4,
56 kErrDataSize = -5,
57 kErrEquipmentHeader = -6,
d21e9888 58 kErrEquipment = -7,
f07ec911 59 kErrFileSize = -8,
60 kFilterReject = -9,
19359f9c 61 kErrWriting = -10,
62 kErrTagFile = -11};
e10815f1 63
64 AliMDC(Int_t compress, Bool_t deleteFiles,
65 EFilterMode filterMode = kFilterTransparent,
5d315e4d 66 Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL,
a8b0468f 67 const char* guidFileFolder = NULL,
68 Int_t basketsize = 32000);
e10815f1 69 virtual ~AliMDC();
70
4fbf7315 71 Int_t Open(EWriteMode mode, const char* fileName,
72 Double_t maxFileSize = 0,
73 const char* fs1 = NULL, const char* fs2 = NULL);
e10815f1 74 Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
60838f24 75 Long64_t GetTotalSize();
d2450633 76 Long64_t Close();
0cd3f979 77 Long64_t AutoSave();
e10815f1 78
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);
82 void Stop();
a197a4ce 83
84private:
85 class AliMDCInterruptHandler : public TSignalHandler {
86 public:
87 AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
88 Bool_t Notify() {
89 Info("Notify", "received a SIGUSR1 signal");
e10815f1 90 fMDC->Stop();
a197a4ce 91 return kTRUE;
92 }
93 private:
94 AliMDC *fMDC; // alimdc to signal
95
d557984f 96 AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented
97 AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented
a197a4ce 98 };
99
e10815f1 100 AliRawEvent *fEvent; // produced AliRawEvent
af885e0f 101 AliESDEvent *fESD; // pointer to HLT ESD object
e10815f1 102 AliStats *fStats; // statistics
103 AliRawDB *fRawDB; // raw data DB
e10815f1 104 AliTagDB *fTagDB; // tag DB
54dd2271 105 AliRawEventTag *fEventTag; // raw-data event tag object
e10815f1 106 Int_t fCompress; // compression factor used for raw output DB
a8b0468f 107 Int_t fBasketSize; // root i/o basket size (default = 32000)
e10815f1 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)
f2dc6b20 112 Bool_t fIsTagDBCreated; // is tag db already created
113 Double_t fMaxSizeTagDB;// max size of the tag DB
581835ab 114 TString fFileNameTagDB;// tag DB file name
115 TString fGuidFileFolder; // guid files folder
e10815f1 116
117 // Filter names
118 enum {kNFilters = 1};
119 static const char* const fgkFilterName[kNFilters];
a197a4ce 120
121 AliMDC(const AliMDC& mdc);
122 AliMDC& operator = (const AliMDC& mdc);
123
124 Int_t Read(const char *name) { return TObject::Read(name); }
e10815f1 125 Int_t Read(Int_t fd, void *buffer, Int_t length);
a197a4ce 126 Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header,
e10815f1 127 Bool_t isSwapped, char*& data);
128 Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data);
a197a4ce 129
a8b0468f 130 ClassDef(AliMDC,3) // MDC processor
a197a4ce 131};
132
133#endif