4 #ifndef ALIRAWREADERHLT_H
5 #define ALIRAWREADERHLT_H
6 //* This file is property of and copyright by the ALICE HLT Project *
7 //* ALICE Experiment at CERN, All rights reserved. *
8 //* See cxx source for full Copyright notice *
10 /** @file AliRawReaderHLT.h
11 @author Matthias Richter
13 @brief AliRawReader implementation which replaces original input of
14 detectors with the appropriate HLT output. */
16 // see below for class documentation
18 // refer to README to build package
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22 #include "AliHLTDataTypes.h"
23 #include "AliRawReader.h" // RAW, base class
29 * @class AliRawReaderHLT
30 * Handler of HLTOUT data for AliRawReader input.
32 class AliRawReaderHLT : public AliRawReader {
35 AliRawReaderHLT(AliRawReader* pParentReader, const char* options=NULL);
37 virtual ~AliRawReaderHLT();
39 // interface methods of AliRawReader
40 void Select(Int_t detectorID,
41 Int_t minDDLID = -1, Int_t maxDDLID = -1);
42 // void Select(const char *detectorName,
43 // Int_t minDDLID = -1, Int_t maxDDLID = -1);
44 void SelectEquipment(Int_t equipmentType,
45 Int_t minEquipmentId = -1,
46 Int_t maxEquipmentId = -1);
47 void SkipInvalid(Bool_t skip = kTRUE);
48 void SelectEvents(Int_t type);
50 UInt_t GetType() const;
51 UInt_t GetRunNumber() const;
52 const UInt_t* GetEventId() const;
53 const UInt_t* GetTriggerPattern() const;
54 const UInt_t* GetDetectorPattern() const;
55 const UInt_t* GetAttributes() const;
56 const UInt_t* GetSubEventAttributes() const;
57 UInt_t GetLDCId() const;
58 UInt_t GetGDCId() const;
59 UInt_t GetTimestamp() const;
61 const UInt_t* GetEquipmentAttributes() const;
62 Int_t GetEquipmentElementSize() const;
63 Int_t GetEquipmentHeaderSize() const;
65 Int_t GetEquipmentSize() const;
66 Int_t GetEquipmentType() const;
67 Int_t GetEquipmentId() const;
69 Bool_t ReadNextData(UChar_t*& data);
70 Bool_t ReadNextInt(UInt_t& data);
71 Bool_t ReadNextShort(UShort_t& data);
72 Bool_t ReadNextChar(UChar_t& data);
73 Bool_t ReadNext(UChar_t* data, Int_t size);
78 Bool_t RewindEvents();
83 /** standard constructor prohibited */
85 /** copy constructor prohibited */
86 AliRawReaderHLT(const AliRawReaderHLT&);
87 /** assignment operator prohibited */
88 AliRawReaderHLT& operator=(const AliRawReaderHLT&);
92 * Set the ids for the specified detectors in the detector
93 * list. Currently, no other options are available.
95 int ScanOptions(const char* options);
98 * Read the next data block from the HLT stream
100 Bool_t ReadNextHLTData();
103 * Check if a ddlid is part of the ones which are selected for
106 Bool_t IsHLTInput(int ddlid);
109 AliRawReader* fpParentReader; //!transient
112 TString fOptions; //!transient
114 /** current data set, either extracted from the HLT stream or parent raw reader */
115 const AliHLTUInt8_t* fpData; // !transient
117 /** size of the current data set */
118 int fDataSize; // !transient
120 /** current stream offset in the data set */
121 int fOffset; // !transient
123 /** equipment id of the current data set, >0 indicates data set from HLT stream */
124 int fEquipmentId; // !transient
126 /** indicates the availibility of data from the HLT stream */
127 bool fbHaveHLTData; // !transient
129 /** list of detectors for which data will be taken from HLT stream */
130 vector<int> fDetectors; // !transient
132 /** instance of the HLTOUT handler */
133 AliHLTOUT* fpHLTOUT; // !transient
135 ClassDef(AliRawReaderHLT, 1)
138 #define ALIHLTREC_LIBRARY "libHLTrec.so"
139 #define ALIHLTREC_LIBRARY_VERSION 0
140 #define ALIRAWREADERHLT_CREATE_INSTANCE "AliRawReaderHLTCreateInstance"
145 typedef AliRawReader* (*AliRawReaderHLTCreateInstance_t)(AliRawReader* pParentReader, const char* options);
148 * Create an instance of the AliRawReader class
150 AliRawReader* AliRawReaderHLTCreateInstance(AliRawReader* pParentReader, const char* options);