2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #ifndef ALIEVEHOMERMANGER_H
11 #define ALIEVEHOMERMANGER_H
13 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
14 * See cxx source for full Copyright notice */
16 /** @file AliEveHOMERManager.h
17 @author Jochen Thaeder
19 @brief Manager for HOMER in offline
22 #include <TEveElement.h>
25 #include "TDOMParser.h"
29 #include "AliHLTHOMERSourceDesc.h"
30 #include "AliHLTHOMERBlockDesc.h"
31 #include "AliHLTHOMERReader.h"
33 #include "AliTPCPreprocessorOnline.h"
36 class AliHLTHOMERLibManager;
39 * @class AliEveHOMERManager
41 * This class is the main class of the AliEveHOMERManager
44 * @ingroup alihlt_homer
47 class AliEveHOMERManager : public TEveElementList
52 * ---------------------------------------------------------------------------------
53 * Constructor / Destructor
54 * ---------------------------------------------------------------------------------
58 * @param argc Number of command line arguments.
59 * @param argv Array of command line arguments.
61 AliEveHOMERManager(TString xmlFile="" );
62 /** not a valid copy constructor, defined according to effective C++ style */
63 AliEveHOMERManager( const AliEveHOMERManager& );
64 /** not a valid assignment op, but defined according to effective C++ style */
65 AliEveHOMERManager& operator=( const AliEveHOMERManager& );
67 virtual ~AliEveHOMERManager();
70 * ---------------------------------------------------------------------------------
71 * Source Handling - public
72 * ---------------------------------------------------------------------------------
75 /** Create Sources List from HOMER-Proxy */
76 Int_t CreateHOMERSourcesList();
78 /** Set state of a source
79 * @param source Pointer to AliHLTHOMERSourceDesc object.
80 * @param state New (selected/not selected) state.
82 void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
84 /** Get pointer to source List
85 * @return returns pointer to TList of sources
87 TList* GetSourceList() { return fSourceList; }
90 * ---------------------------------------------------------------------------------
91 * Connection Handling - public
92 * ---------------------------------------------------------------------------------
95 /** Connect to HOMER sources, out of Readout List, which gets created when state has changed
96 * @return 0 on sucess, "HOMER" errors on error
100 /** Disconnect from HOMER sources */
101 void DisconnectHOMER();
103 /** Reconnect from HOMER sources
104 * @return 0 on sucess, "ConnectHOMER()" errors on error
106 Int_t ReconnectHOMER();
109 * ---------------------------------------------------------------------------------
110 * AliEveEventManager Handling - public
111 * ---------------------------------------------------------------------------------
114 /** Loads the next AliEveEventManager, after being connected
115 * @return 0 on sucess, "HOMER" errors on error
120 * @return Returns eventID
122 ULong_t GetEventID() { return fEventID; }
124 /** Get pointer to block List
125 * @return returns pointer to TList of blocks
127 TList* GetBlockList() { return fBlockList; }
130 ///////////////////////////////////////////////////////////////////////////////////
133 void SelectClusterTPC();
137 void TestSelectClass( TString objectName );
139 void DumpTPCCalib(TString objectName, Bool_t dumpToFile);
141 ///////////////////////////////////////////////////////////////////////////////////
145 /** Dynamic loader manager for the HOMER library */
146 AliHLTHOMERLibManager* fLibManager; //! transient
152 * ---------------------------------------------------------------------------------
153 * Source Handling - private
154 * ---------------------------------------------------------------------------------
157 /** Get Information out of a TDS process in XML file
158 * @param xmlNode Pointer to childs of TDS node
159 * @return 0 on sucess, > 0 on error
161 Int_t GetTDSAttributes( TXMLNode * xmlNode );
163 /** Resolve Information of hostname and port for source which has to be used by HOMER
164 * ( due to port mapping inside the HLT )
165 * @param xmlHostname Hostname out of the XML
166 * @param xmlPort Port out of the XML
167 * @param hostname Return of the hostname
168 * @param port Return of the port
169 * @return 0 on sucess, 1 if hostname couldn't be resolved, 2 if port couldn't be resolved,
171 Int_t ResolveHostPortInformation( TString xmlHostname, TString xmlPort, TString &hostname, Int_t &port );
173 /** Resolve information of source
174 * @param xmlParent ParentString out of the XML
175 * @param source Return the filled AliHLTHOMERSourceDesc object
176 * @return 0 on sucess, 1 on error
178 Int_t ResolveSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc * source );
181 * ---------------------------------------------------------------------------------
182 * Connection Handling - private
183 * ---------------------------------------------------------------------------------
186 /** Create a readout list for Hostname and ports
187 * @param socurceHostnames Array of selected hostnames
188 * @param socurcePorts Array of selected ports
189 * @param socurceCount Number of selected hostname:port
191 void CreateReadoutList( const char** socurceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount);
193 /** Checks if already connected to HOMER sources
194 * @return kTRUE or kFALSE, depending on connection state
196 Bool_t IsConnected() { return fConnected; }
198 /* ---------------------------------------------------------------------------------
199 * Eve AliEveHOMERManager::foo(nt Handling - private
200 * ---------------------------------------------------------------------------------
203 /** Create a TList of blocks, which have been readout */
204 Int_t CreateBlockList();
207 * ---------------------------------------------------------------------------------
208 * Block Handling - private
209 * ---------------------------------------------------------------------------------
212 /** Get Number of blocks in current event
213 * @return returns number of blocks in current event
215 ULong_t GetNBlks() { return fNBlks; }
217 /** Get pointer to block ndx in current event
218 * @param ndx Block index
219 * @return returns pointer to blk, NULL if no block present
221 void* GetBlk( Int_t ndx );
223 /** Get pointer to current block in current event
224 * @param ndx Block index
225 * @return returns pointer to blk, NULL if no block present
227 void* GetBlk() { return GetBlk( fCurrentBlk ); }
229 /** Get first block in current event
230 * @return returns pointer to blk, NULL if no block present
232 void* GetFirstBlk() { return GetBlk( 0 ); }
234 /** Get next block in current event
235 * @return returns pointer to blk, NULL if no block present
237 void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); }
239 /** Get size of block ndx
240 * @param ndx Block index
241 * @return returns pointer to blk, 0 if no block present
243 ULong_t GetBlkSize( Int_t ndx );
245 /** Get size of current block
246 * @param ndx Block index
247 * @return returns pointer to blk, 0 if no block present
249 ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); }
251 /** Get origin of block ndx
252 * @param ndx Block index
253 * @return origin of block
255 TString GetBlkOrigin( Int_t ndx );
257 /** Get origin of current block
258 * @param ndx Block index
259 * @return origin of block
261 TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); }
263 /** Get type of block ndx
264 * @param ndx Block index
265 * @return type of block
267 TString GetBlkType( Int_t ndx );
269 /** Get type of current block
270 * @param ndx Block index
271 * @return type of block
273 TString GetBlkType() { return GetBlkType( fCurrentBlk ); }
275 /** Get specification of block ndx
276 * @param ndx Block index
277 * @return specification of block
279 ULong_t GetBlkSpecification( Int_t ndx );
281 /** Get specification of current block
282 * @param ndx Block index
283 * @return specification of block
285 ULong_t GetBlkSpecification(){ return GetBlkSpecification( fCurrentBlk ); }
287 /** Checks if current Block should was requested
288 * @return returns kTRUE, if block should was requested
290 Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
293 * ---------------------------------------------------------------------------------
295 * ---------------------------------------------------------------------------------
300 /** XML input file */
301 TString fXMLFile; // see above
303 /** XML parser into DOM model */
304 TDOMParser* fXMLParser; //! transient
306 /** Root node of parsed config file */
307 TXMLNode * fRootNode; //! transient
311 /** List to HOMER sources */
312 TList * fSourceList; //! transient
317 /** Pointer to HOMER reader */
318 AliHLTHOMERReader* fReader; //! transient
322 /** List to HOMER blocks */
323 TList * fBlockList; //! transient
327 /** Number of blockes in current event */
328 ULong_t fNBlks; // see above
330 /** EventID of current event */
331 ULong64_t fEventID; // see above
333 /** Current block in current event */
334 ULong_t fCurrentBlk; // see above
338 /** Shows connection status */
339 Bool_t fConnected; // see above
341 /** Indicates, if a sources have changes,
342 * so that one has to reconnect .
344 Bool_t fStateHasChanged; // see above
349 AliTPCPreprocessorOnline* fTPCPre;
351 ClassDef( AliEveHOMERManager, 0 )