]>
Commit | Line | Data |
---|---|---|
059c30e4 | 1 | //-*- Mode: C++ -*- |
2 | #ifndef ALIEVEHOMERMANGER_H | |
3 | #define ALIEVEHOMERMANGER_H | |
4 | ||
5 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
6 | * See cxx source for full Copyright notice */ | |
7 | ||
8 | /** @file AliEVEHOMERManager.h | |
9 | @author Jochen Thaeder | |
10 | @date | |
11 | @brief Manager for HOMER in offline | |
12 | */ | |
13 | ||
14 | #include <Reve/RenderElement.h> | |
15 | ||
16 | #include "TString.h" | |
17 | #include "TDOMParser.h" | |
18 | #include "TXMLNode.h" | |
19 | #include "TList.h" | |
20 | ||
21 | #include "AliHLTHOMERSourceDesc.h" | |
22 | #include "AliHLTHOMERBlockDesc.h" | |
23 | #include "AliHLTHOMERReader.h" | |
6612c5b3 | 24 | |
25 | #include "AliTPCPreprocessorOnline.h" | |
26 | ||
27 | ||
059c30e4 | 28 | class AliHLTHOMERLibManager; |
29 | ||
30 | /** | |
31 | * @class AliEVEHOMERManager | |
32 | * | |
33 | * This class is the main class of the AliEVEHOMERManager | |
34 | * ... more to come | |
35 | * | |
36 | * @ingroup alihlt_homer | |
37 | */ | |
38 | ||
39 | class AliEVEHOMERManager : public Reve::RenderElementList | |
40 | { | |
41 | public: | |
42 | ||
43 | /* | |
44 | * --------------------------------------------------------------------------------- | |
45 | * Constructor / Destructor | |
46 | * --------------------------------------------------------------------------------- | |
47 | */ | |
48 | ||
49 | /** constructor | |
50 | * @param argc Number of command line arguments. | |
51 | * @param argv Array of command line arguments. | |
52 | */ | |
53 | AliEVEHOMERManager(TString xmlFile="" ); | |
54 | /** not a valid copy constructor, defined according to effective C++ style */ | |
55 | AliEVEHOMERManager( const AliEVEHOMERManager& ); | |
56 | /** not a valid assignment op, but defined according to effective C++ style */ | |
57 | AliEVEHOMERManager& operator=( const AliEVEHOMERManager& ); | |
58 | /** destructor */ | |
59 | virtual ~AliEVEHOMERManager(); | |
60 | ||
61 | /* | |
62 | * --------------------------------------------------------------------------------- | |
63 | * Source Handling - public | |
64 | * --------------------------------------------------------------------------------- | |
65 | */ | |
66 | ||
67 | /** Create Sources List from HOMER-Proxy */ | |
68 | Int_t CreateHOMERSourcesList(); | |
69 | ||
70 | /** Set state of a source | |
71 | * @param source Pointer to AliHLTHOMERSourceDesc object. | |
72 | * @param state New (selected/not selected) state. | |
73 | */ | |
74 | void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state); | |
75 | ||
76 | /** Get pointer to source List | |
77 | * @return returns pointer to TList of sources | |
78 | */ | |
79 | TList* GetSourceList() { return fSourceList; } | |
80 | ||
81 | /* | |
82 | * --------------------------------------------------------------------------------- | |
83 | * Connection Handling - public | |
84 | * --------------------------------------------------------------------------------- | |
85 | */ | |
86 | ||
87 | /** Connect to HOMER sources, out of Readout List, which gets created when state has changed | |
88 | * @return 0 on sucess, "HOMER" errors on error | |
89 | */ | |
90 | Int_t ConnectHOMER(); | |
91 | ||
92 | /** Disconnect from HOMER sources */ | |
93 | void DisconnectHOMER(); | |
94 | ||
95 | /** Reconnect from HOMER sources | |
96 | * @return 0 on sucess, "ConnectHOMER()" errors on error | |
97 | */ | |
98 | Int_t ReconnectHOMER(); | |
99 | ||
100 | /* | |
101 | * --------------------------------------------------------------------------------- | |
102 | * Event Handling - public | |
103 | * --------------------------------------------------------------------------------- | |
104 | */ | |
105 | ||
106 | /** Loads the next Event, after being connected | |
107 | * @return 0 on sucess, "HOMER" errors on error | |
108 | */ | |
109 | Int_t NextEvent(); | |
110 | ||
111 | /** Get event ID | |
112 | * @return Returns eventID | |
113 | */ | |
114 | ULong_t GetEventID() { return fEventID; } | |
115 | ||
116 | /** Get pointer to block List | |
117 | * @return returns pointer to TList of blocks | |
118 | */ | |
119 | TList* GetBlockList() { return fBlockList; } | |
120 | ||
121 | ||
122 | /////////////////////////////////////////////////////////////////////////////////// | |
123 | ||
6612c5b3 | 124 | void SelectRawTPC(); |
125 | void SelectClusterTPC(); | |
126 | void SelectESDTPC(); | |
127 | ||
059c30e4 | 128 | void TestSelect(); |
6612c5b3 | 129 | void TestSelectClass( TString objectName ); |
130 | ||
131 | void DumpTPCCalib(TString objectName, Bool_t dumpToFile); | |
059c30e4 | 132 | |
133 | /////////////////////////////////////////////////////////////////////////////////// | |
134 | ||
135 | protected: | |
136 | ||
137 | /** Dynamic loader manager for the HOMER library */ | |
138 | AliHLTHOMERLibManager* fLibManager; //! transient | |
139 | ||
140 | ||
141 | private: | |
142 | ||
143 | /* | |
144 | * --------------------------------------------------------------------------------- | |
145 | * Source Handling - private | |
146 | * --------------------------------------------------------------------------------- | |
147 | */ | |
148 | ||
149 | /** Get Information out of a TDS process in XML file | |
150 | * @param xmlNode Pointer to childs of TDS node | |
151 | * @return 0 on sucess, > 0 on error | |
152 | */ | |
153 | Int_t GetTDSAttributes( TXMLNode * xmlNode ); | |
154 | ||
155 | /** Resolve Information of hostname and port for source which has to be used by HOMER | |
156 | * ( due to port mapping inside the HLT ) | |
157 | * @param xmlHostname Hostname out of the XML | |
158 | * @param xmlPort Port out of the XML | |
159 | * @param hostname Return of the hostname | |
160 | * @param port Return of the port | |
161 | * @return 0 on sucess, 1 if hostname couldn't be resolved, 2 if port couldn't be resolved, | |
162 | */ | |
163 | Int_t ResolveHostPortInformation( TString xmlHostname, TString xmlPort, TString &hostname, Int_t &port ); | |
164 | ||
165 | /** Resolve information of source | |
166 | * @param xmlParent ParentString out of the XML | |
167 | * @param source Return the filled AliHLTHOMERSourceDesc object | |
168 | * @return 0 on sucess, 1 on error | |
169 | */ | |
170 | Int_t ResolveSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc * source ); | |
171 | ||
172 | /* | |
173 | * --------------------------------------------------------------------------------- | |
174 | * Connection Handling - private | |
175 | * --------------------------------------------------------------------------------- | |
176 | */ | |
177 | ||
178 | /** Create a readout list for Hostname and ports | |
179 | * @param socurceHostnames Array of selected hostnames | |
180 | * @param socurcePorts Array of selected ports | |
181 | * @param socurceCount Number of selected hostname:port | |
182 | */ | |
183 | void CreateReadoutList( const char** socurceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount); | |
184 | ||
185 | /** Checks if already connected to HOMER sources | |
186 | * @return kTRUE or kFALSE, depending on connection state | |
187 | */ | |
188 | Bool_t IsConnected() { return fConnected; } | |
189 | ||
190 | /* --------------------------------------------------------------------------------- | |
6612c5b3 | 191 | * Eve AliEVEHOMERManager::foo(nt Handling - private |
059c30e4 | 192 | * --------------------------------------------------------------------------------- |
193 | */ | |
194 | ||
195 | /** Create a TList of blocks, which have been readout */ | |
196 | Int_t CreateBlockList(); | |
197 | ||
198 | /* | |
199 | * --------------------------------------------------------------------------------- | |
200 | * Block Handling - private | |
201 | * --------------------------------------------------------------------------------- | |
202 | */ | |
203 | ||
204 | /** Get Number of blocks in current event | |
205 | * @return returns number of blocks in current event | |
206 | */ | |
207 | ULong_t GetNBlks() { return fNBlks; } | |
208 | ||
209 | /** Get pointer to block ndx in current event | |
210 | * @param ndx Block index | |
211 | * @return returns pointer to blk, NULL if no block present | |
212 | */ | |
213 | void* GetBlk( Int_t ndx ); | |
214 | ||
215 | /** Get pointer to current block in current event | |
216 | * @param ndx Block index | |
217 | * @return returns pointer to blk, NULL if no block present | |
218 | */ | |
219 | void* GetBlk() { return GetBlk( fCurrentBlk ); } | |
220 | ||
221 | /** Get first block in current event | |
222 | * @return returns pointer to blk, NULL if no block present | |
223 | */ | |
224 | void* GetFirstBlk() { return GetBlk( 0 ); } | |
225 | ||
226 | /** Get next block in current event | |
227 | * @return returns pointer to blk, NULL if no block present | |
228 | */ | |
229 | void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); } | |
230 | ||
231 | /** Get size of block ndx | |
232 | * @param ndx Block index | |
233 | * @return returns pointer to blk, 0 if no block present | |
234 | */ | |
235 | ULong_t GetBlkSize( Int_t ndx ); | |
236 | ||
237 | /** Get size of current block | |
238 | * @param ndx Block index | |
239 | * @return returns pointer to blk, 0 if no block present | |
240 | */ | |
241 | ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); } | |
242 | ||
243 | /** Get origin of block ndx | |
244 | * @param ndx Block index | |
245 | * @return origin of block | |
246 | */ | |
247 | TString GetBlkOrigin( Int_t ndx ); | |
248 | ||
249 | /** Get origin of current block | |
250 | * @param ndx Block index | |
251 | * @return origin of block | |
252 | */ | |
253 | TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); } | |
254 | ||
255 | /** Get type of block ndx | |
256 | * @param ndx Block index | |
257 | * @return type of block | |
258 | */ | |
259 | TString GetBlkType( Int_t ndx ); | |
260 | ||
261 | /** Get type of current block | |
262 | * @param ndx Block index | |
263 | * @return type of block | |
264 | */ | |
265 | TString GetBlkType() { return GetBlkType( fCurrentBlk ); } | |
266 | ||
267 | /** Get specification of block ndx | |
268 | * @param ndx Block index | |
269 | * @return specification of block | |
270 | */ | |
271 | ULong_t GetBlkSpecification( Int_t ndx ); | |
272 | ||
273 | /** Get specification of current block | |
274 | * @param ndx Block index | |
275 | * @return specification of block | |
276 | */ | |
277 | ULong_t GetBlkSpecification(){ return GetBlkSpecification( fCurrentBlk ); } | |
278 | ||
279 | /** Checks if current Block should was requested | |
280 | * @return returns kTRUE, if block should was requested | |
281 | */ | |
282 | Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block ); | |
283 | ||
284 | /* | |
285 | * --------------------------------------------------------------------------------- | |
286 | * Members - private | |
287 | * --------------------------------------------------------------------------------- | |
288 | */ | |
289 | ||
290 | // == XML parser == | |
291 | ||
292 | /** XML input file */ | |
293 | TString fXMLFile; // see above | |
294 | ||
295 | /** XML parser into DOM model */ | |
296 | TDOMParser* fXMLParser; //! transient | |
297 | ||
298 | /** Root node of parsed config file */ | |
299 | TXMLNode * fRootNode; //! transient | |
300 | ||
301 | // == sources == | |
302 | ||
303 | /** List to HOMER sources */ | |
304 | TList * fSourceList; //! transient | |
305 | ||
306 | // == connection == | |
307 | ||
308 | ||
309 | /** Pointer to HOMER reader */ | |
310 | AliHLTHOMERReader* fReader; //! transient | |
311 | ||
312 | // == blocks == | |
313 | ||
314 | /** List to HOMER blocks */ | |
315 | TList * fBlockList; //! transient | |
316 | ||
317 | // == events == | |
318 | ||
319 | /** Number of blockes in current event */ | |
320 | ULong_t fNBlks; // see above | |
321 | ||
322 | /** EventID of current event */ | |
323 | ULong64_t fEventID; // see above | |
324 | ||
325 | /** Current block in current event */ | |
326 | ULong_t fCurrentBlk; // see above | |
327 | ||
328 | // == states == | |
329 | ||
330 | /** Shows connection status */ | |
331 | Bool_t fConnected; // see above | |
332 | ||
333 | /** Indicates, if a sources have changes, | |
334 | * so that one has to reconnect . | |
335 | */ | |
336 | Bool_t fStateHasChanged; // see above | |
337 | ||
6612c5b3 | 338 | |
339 | //---- | |
340 | ||
341 | AliTPCPreprocessorOnline* fTPCPre; | |
342 | ||
059c30e4 | 343 | ClassDef( AliEVEHOMERManager, 0 ) |
344 | }; | |
345 | ||
346 | #endif |