Adding possibility to use only local maximas
[u/mrichter/AliRoot.git] / HLT / rec / AliRawReaderHLT.h
CommitLineData
9c7b5023 1//-*- Mode: C++ -*-
7e914051 2// $Id$
9c7b5023 3
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 *
9
10/** @file AliRawReaderHLT.h
11 @author Matthias Richter
12 @date
13 @brief AliRawReader implementation which replaces original input of
14 detectors with the appropriate HLT output. */
15
16// see below for class documentation
17// or
18// refer to README to build package
19// or
20// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
21
13b78f4c 22#include "AliHLTDataTypes.h"
23#include "AliRawReader.h" // RAW, base class
a3ef3c1d 24#include "AliHLTReconstructorBase.h"
9c7b5023 25#include "TString.h"
13b78f4c 26#include <vector>
9c7b5023 27
13b78f4c 28class AliHLTOUT;
626bfcc1 29class AliHLTOUTHandler;
30
9c7b5023 31/**
32 * @class AliRawReaderHLT
33 * Handler of HLTOUT data for AliRawReader input.
34 */
a3ef3c1d 35class AliRawReaderHLT : public AliRawReader, public AliHLTReconstructorBase {
9c7b5023 36 public:
37 /** constructor */
38 AliRawReaderHLT(AliRawReader* pParentReader, const char* options=NULL);
39 /** destructor */
40 virtual ~AliRawReaderHLT();
41
42 // interface methods of AliRawReader
e3917543 43 void Select(Int_t detectorID,
44 Int_t minDDLID = -1, Int_t maxDDLID = -1);
45// void Select(const char *detectorName,
46// Int_t minDDLID = -1, Int_t maxDDLID = -1);
b0914d2e 47
48 using AliRawReader::Select;
49
e3917543 50 void SelectEquipment(Int_t equipmentType,
51 Int_t minEquipmentId = -1,
52 Int_t maxEquipmentId = -1);
53 void SkipInvalid(Bool_t skip = kTRUE);
54 void SelectEvents(Int_t type);
55
9c7b5023 56 UInt_t GetType() const;
57 UInt_t GetRunNumber() const;
58 const UInt_t* GetEventId() const;
59 const UInt_t* GetTriggerPattern() const;
60 const UInt_t* GetDetectorPattern() const;
61 const UInt_t* GetAttributes() const;
62 const UInt_t* GetSubEventAttributes() const;
63 UInt_t GetLDCId() const;
64 UInt_t GetGDCId() const;
65 UInt_t GetTimestamp() const;
66
67 const UInt_t* GetEquipmentAttributes() const;
68 Int_t GetEquipmentElementSize() const;
69 Int_t GetEquipmentHeaderSize() const;
70
71 Int_t GetEquipmentSize() const;
72 Int_t GetEquipmentType() const;
73 Int_t GetEquipmentId() const;
74 Bool_t ReadHeader();
75 Bool_t ReadNextData(UChar_t*& data);
76 Bool_t ReadNextInt(UInt_t& data);
77 Bool_t ReadNextShort(UShort_t& data);
78 Bool_t ReadNextChar(UChar_t& data);
79 Bool_t ReadNext(UChar_t* data, Int_t size);
80
81 Bool_t Reset();
82
83 Bool_t NextEvent();
84 Bool_t RewindEvents();
85
86 protected:
87
88 private:
89 /** standard constructor prohibited */
90 AliRawReaderHLT();
91 /** copy constructor prohibited */
92 AliRawReaderHLT(const AliRawReaderHLT&);
93 /** assignment operator prohibited */
94 AliRawReaderHLT& operator=(const AliRawReaderHLT&);
95
13b78f4c 96 /**
97 * Scan the options.
98 * Set the ids for the specified detectors in the detector
99 * list. Currently, no other options are available.
100 */
101 int ScanOptions(const char* options);
102
103 /**
104 * Read the next data block from the HLT stream
105 */
106 Bool_t ReadNextHLTData();
107
108 /**
109 * Check if a ddlid is part of the ones which are selected for
110 * input replacement.
111 */
112 Bool_t IsHLTInput(int ddlid);
113
9c7b5023 114 /** the rawreader */
115 AliRawReader* fpParentReader; //!transient
116
117 /** options */
118 TString fOptions; //!transient
13b78f4c 119
a3ef3c1d 120 /** system options = options w/o detector strings */
121 TString fSystemOptions; //!transient
122
13b78f4c 123 /** current data set, either extracted from the HLT stream or parent raw reader */
124 const AliHLTUInt8_t* fpData; // !transient
125
126 /** size of the current data set */
127 int fDataSize; // !transient
128
129 /** current stream offset in the data set */
130 int fOffset; // !transient
131
132 /** equipment id of the current data set, >0 indicates data set from HLT stream */
133 int fEquipmentId; // !transient
134
135 /** indicates the availibility of data from the HLT stream */
136 bool fbHaveHLTData; // !transient
137
138 /** list of detectors for which data will be taken from HLT stream */
139 vector<int> fDetectors; // !transient
140
141 /** instance of the HLTOUT handler */
142 AliHLTOUT* fpHLTOUT; // !transient
143
626bfcc1 144 /** instance of the data handler providing the current data buffer */
145 AliHLTOUTHandler* fpDataHandler; // !transient
146
a3ef3c1d 147 ClassDef(AliRawReaderHLT, 3)
9c7b5023 148};
149
150#define ALIHLTREC_LIBRARY "libHLTrec.so"
151#define ALIHLTREC_LIBRARY_VERSION 0
152#define ALIRAWREADERHLT_CREATE_INSTANCE "AliRawReaderHLTCreateInstance"
153
154#ifdef __cplusplus
155extern "C" {
156#endif
157 typedef AliRawReader* (*AliRawReaderHLTCreateInstance_t)(AliRawReader* pParentReader, const char* options);
158
159 /**
160 * Create an instance of the AliRawReader class
161 */
162 AliRawReader* AliRawReaderHLTCreateInstance(AliRawReader* pParentReader, const char* options);
163#ifdef __cplusplus
164}
165#endif
166#endif