]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - RAW/AliRawReader.h
possibility to select equipments
[u/mrichter/AliRoot.git] / RAW / AliRawReader.h
... / ...
CommitLineData
1#ifndef ALIRAWREADER_H
2#define ALIRAWREADER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6#include <TObject.h>
7#include "AliMiniHeader.h"
8
9
10class AliRawReader: public TObject {
11 public :
12 AliRawReader();
13 AliRawReader(const AliRawReader& rawReader);
14 AliRawReader& operator = (const AliRawReader& rawReader);
15 virtual ~AliRawReader() {};
16
17 void Select(Int_t detectorID,
18 Int_t minDDLID = -1, Int_t maxDDLID = -1);
19 void SelectEquipment(Int_t equipmentType,
20 Int_t minEquipmentId = -1,
21 Int_t maxEquipmentId = -1);
22
23 virtual UInt_t GetType() const = 0;
24 virtual UInt_t GetRunNumber() const = 0;
25 virtual const UInt_t* GetEventId() const = 0;
26 virtual const UInt_t* GetTriggerPattern() const = 0;
27 virtual const UInt_t* GetDetectorPattern() const = 0;
28 virtual const UInt_t* GetAttributes() const = 0;
29 virtual UInt_t GetLDCId() const = 0;
30 virtual UInt_t GetGDCId() const = 0;
31
32 virtual Int_t GetEquipmentSize() const = 0;
33 virtual Int_t GetEquipmentType() const = 0;
34 virtual Int_t GetEquipmentId() const = 0;
35 virtual const UInt_t* GetEquipmentAttributes() const = 0;
36 virtual Int_t GetEquipmentElementSize() const = 0;
37
38 Int_t GetDataSize() const
39 {if (fMiniHeader) return fMiniHeader->fSize;
40 else return GetEquipmentSize();};
41
42 Int_t GetDetectorID() const
43 {if (fMiniHeader) return fMiniHeader->fDetectorID; else return -1;};
44 Int_t GetDDLID() const
45 {if (fMiniHeader) return fMiniHeader->fDDLID; else return -1;};
46 Int_t GetVersion() const
47 {if (fMiniHeader) return fMiniHeader->fVersion; else return -1;};
48 Bool_t IsCompressed() const
49 {if (fMiniHeader) return fMiniHeader->fCompressionFlag != 0;
50 else return kFALSE;};
51
52 virtual Bool_t ReadHeader() = 0;
53 virtual Bool_t ReadNextData(UChar_t*& data) = 0;
54 virtual Bool_t ReadNextInt(UInt_t& data);
55 virtual Bool_t ReadNextShort(UShort_t& data);
56 virtual Bool_t ReadNextChar(UChar_t& data);
57
58 virtual Bool_t Reset() = 0;
59
60 enum {kErrMagic=1, kErrNoMiniHeader=2, kErrMiniMagic=4,
61 kErrSize=8, kErrOutOfBounds=16};
62 virtual Int_t CheckData() const;
63 Int_t GetErrorCode() {return fErrorCode;};
64
65 void DumpData(Int_t limit = -1);
66
67 protected :
68 Bool_t IsSelected() const;
69
70 Bool_t CheckMiniHeader(AliMiniHeader* miniHeader = NULL) const;
71 virtual Bool_t ReadNext(UChar_t* data, Int_t size) = 0;
72
73 AliMiniHeader* fMiniHeader; // current mini header
74 Int_t fCount; // counter of bytes to be read for current DDL
75
76 Int_t fSelectDetectorID; // id of selected detector (<0 = no selection)
77 Int_t fSelectMinDDLID; // minimal index of selected DDLs (<0 = no selection)
78 Int_t fSelectMaxDDLID; // maximal index of selected DDLs (<0 = no selection)
79 Int_t fSelectEquipmentType; // type of selected equipment (<0 = no selection)
80 Int_t fSelectMinEquipmentId; // minimal index of selected equipment (<0 = no selection)
81 Int_t fSelectMaxEquipmentId; // maximal index of selected equipment (<0 = no selection)
82
83 Int_t fErrorCode; // code of last error
84
85 ClassDef(AliRawReader, 0) // base class for reading raw digits
86};
87
88#endif