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 **************************************************************************/
11 #ifndef ALIEVEHOMERMANGER_H
12 #define ALIEVEHOMERMANGER_H
14 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
15 * See cxx source for full Copyright notice */
17 /** @file AliEveHOMERManager.h
18 @author Jochen Thaeder
20 @brief Manager for HOMER in offline
23 #include <TEveElement.h>
26 #include "TDOMParser.h"
30 #include "AliEveHOMERSourceList.h"
31 #include "AliHLTHOMERSourceDesc.h"
32 #include "AliHLTHOMERBlockDesc.h"
33 #include "AliHLTHOMERReader.h"
35 #include "AliTPCPreprocessorOnline.h"
38 class AliHLTHOMERLibManager;
40 class AliEveHOMERManager : public TEveElementList
45 * ---------------------------------------------------------------------------------
46 * Constructor / Destructor
47 * ---------------------------------------------------------------------------------
51 AliEveHOMERManager(TString xmlFile="" );
54 virtual ~AliEveHOMERManager();
57 * ---------------------------------------------------------------------------------
58 * Source Handling - public
59 * ---------------------------------------------------------------------------------
62 /** Create Sources List from HOMER-Proxy */
63 Int_t CreateHOMERSourcesList();
65 /** Set state of a source */
66 void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
68 /** Get pointer to source List */
69 TList* GetSourceList() { return fSourceList; } // Get pointer to source List
72 * ---------------------------------------------------------------------------------
73 * Connection Handling - public
74 * ---------------------------------------------------------------------------------
77 /** Connect to HOMER sources, out of Readout List, which gets created when state has changed */
80 /** Disconnect from HOMER sources */
81 void DisconnectHOMER();
83 /** Reconnect from HOMER sources */
84 Int_t ReconnectHOMER();
87 * ---------------------------------------------------------------------------------
88 * Event Handling - public
89 * ---------------------------------------------------------------------------------
92 /** Loads the next Event, after being connected */
96 ULong_t GetEventID() { return fEventID; } // Get event ID
98 /** Get pointer to block List */
99 TList* GetBlockList() { return fBlockList; } // Get pointer to block List
102 * ---------------------------------------------------------------------------------
104 * ---------------------------------------------------------------------------------
107 /** Still under testing ... */
108 void DumpTPCCalib(TString objectName, Bool_t dumpToFile);
110 ///////////////////////////////////////////////////////////////////////////////////
114 AliHLTHOMERLibManager* fLibManager; //! Dynamic loader manager for the HOMER library
116 ///////////////////////////////////////////////////////////////////////////////////
120 AliEveHOMERManager(const AliEveHOMERManager&); // Not implemented.
121 AliEveHOMERManager& operator=(const AliEveHOMERManager&); // Not implemented.
124 * ---------------------------------------------------------------------------------
125 * Source Handling - private
126 * ---------------------------------------------------------------------------------
129 /** Get Information out of a TDS process in XML file */
130 Int_t GetTDSAttributes( TXMLNode * xmlNode );
132 /** Resolve Information of hostname and port for source which has to be used by HOMER */
133 Int_t ResolveHostPortInformation( TString xmlHostname, TString xmlPort, TString &hostname, Int_t &port );
135 /** Resolve information of source */
136 Int_t ResolveSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc * source );
139 * ---------------------------------------------------------------------------------
140 * Connection Handling - private
141 * ---------------------------------------------------------------------------------
144 /** Create a readout list for Hostname and ports */
145 void CreateReadoutList( const char** socurceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount);
147 /** Checks if already connected to HOMER sources */
148 Bool_t IsConnected() { return fConnected; } // Checks if already connected to HOMER sources
150 /** Sets realm ( which can be ACR, GPN, HLT ) */
151 void SetRealm( TString s ) { fRealm = s; } // Sets realm ( which can be ACR, GPN, HLT
153 /* ---------------------------------------------------------------------------------
154 * Event Handling - private
155 * ---------------------------------------------------------------------------------
158 /** Create a TList of blocks, which have been readout */
159 Int_t CreateBlockList();
162 * ---------------------------------------------------------------------------------
163 * Block Handling - private
164 * ---------------------------------------------------------------------------------
167 /** Get Number of blocks in current event */
168 ULong_t GetNBlks() { return fNBlks; } // Get Number of blocks in current event
170 /** Get pointer to block ndx in current event */
171 void* GetBlk( Int_t ndx );
173 /** Get pointer to current block in current event */
174 void* GetBlk() { return GetBlk( fCurrentBlk ); } // Get pointer to current block in current event
176 /** Get first block in current event */
177 void* GetFirstBlk() { return GetBlk( 0 ); } // Get first block in current event
179 /** Get next block in current event */
180 void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); } // Get next block in current event
182 /** Get size of block ndx */
183 ULong_t GetBlkSize( Int_t ndx );
185 /** Get size of current block */
186 ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); } // Get size of current block
188 /** Get origin of block ndx */
189 TString GetBlkOrigin( Int_t ndx );
191 /** Get origin of current block */
192 TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); } // Get origin of current block
194 /** Get type of block ndx */
195 TString GetBlkType( Int_t ndx );
197 /** Get type of current block */
198 TString GetBlkType() { return GetBlkType( fCurrentBlk ); } // Get type of current block
200 /** Get specification of block ndx */
201 ULong_t GetBlkSpecification( Int_t ndx );
203 /** Get specification of current block */
204 ULong_t GetBlkSpecification() { return GetBlkSpecification( fCurrentBlk ); } // Get specification of current block
206 /** Checks if current Block should was requested */
207 Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
210 * ---------------------------------------------------------------------------------
212 * ---------------------------------------------------------------------------------
216 TString fXMLFile; // XML input file
217 TDOMParser* fXMLParser; //! XML parser into DOM model
218 TXMLNode * fRootNode; //! Root node of parsed config file
221 TList * fSourceList; //! List to HOMER sources
224 AliHLTHOMERReader* fReader; //! Pointer to HOMER reader
225 TString fRealm; // Indicates the realm where AliEve can connect to ( HLT, GPN, ACR );
228 TList * fBlockList; //! List to HOMER blocks
231 ULong_t fNBlks; // Number of blockes in current event
232 ULong64_t fEventID; // EventID of current event
233 ULong_t fCurrentBlk; // Current block in current event
236 Bool_t fConnected; // Shows connection status
237 Bool_t fStateHasChanged; // Indicates, if a sources have changes, so that one has to reconnect.
240 AliEveHOMERSourceList* fSrcList; // List of HOMER Sources
242 //-----------------------------------------------------------------------------------------
243 AliTPCPreprocessorOnline* fTPCPre; // Preprocessor for TPC calibration.
245 ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.