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"
34 #include "AliEveHOMERXMLHandler.h"
36 #include "AliTPCPreprocessorOnline.h"
39 class AliHLTHOMERLibManager;
41 class AliEveHOMERManager : public TEveElementList
46 * ---------------------------------------------------------------------------------
47 * Constructor / Destructor
48 * ---------------------------------------------------------------------------------
52 AliEveHOMERManager(TString xmlFile="" );
55 virtual ~AliEveHOMERManager();
58 * ---------------------------------------------------------------------------------
59 * Source Handling - public
60 * ---------------------------------------------------------------------------------
63 /** Create Sources List from HOMER-Proxy */
64 Int_t CreateHOMERSourcesList();
66 /** Set state of a source */
67 void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
69 /** Get pointer to source List */
70 TList* GetSourceList() { return fSourceList; } // Get pointer to source List
73 * ---------------------------------------------------------------------------------
74 * Connection Handling - public
75 * ---------------------------------------------------------------------------------
78 /** Connect to HOMER sources, out of Readout List, which gets created when state has changed */
81 /** Disconnect from HOMER sources */
82 void DisconnectHOMER();
84 /** Reconnect from HOMER sources */
85 Int_t ReconnectHOMER();
88 * ---------------------------------------------------------------------------------
89 * Event Handling - public
90 * ---------------------------------------------------------------------------------
93 /** Loads the next Event, after being connected */
97 ULong_t GetEventID() { return fEventID; } // Get event ID
99 /** Get pointer to block List */
100 TList* GetBlockList() { return fBlockList; } // Get pointer to block List
103 * ---------------------------------------------------------------------------------
105 * ---------------------------------------------------------------------------------
108 /** Still under testing ... */
109 void DumpTPCCalib(TString objectName, Bool_t dumpToFile);
111 ///////////////////////////////////////////////////////////////////////////////////
115 AliHLTHOMERLibManager* fLibManager; //! Dynamic loader manager for the HOMER library
117 ///////////////////////////////////////////////////////////////////////////////////
121 AliEveHOMERManager(const AliEveHOMERManager&); // Not implemented.
122 AliEveHOMERManager& operator=(const AliEveHOMERManager&); // Not implemented.
125 * ---------------------------------------------------------------------------------
126 * Connection Handling - private
127 * ---------------------------------------------------------------------------------
130 /** Create a readout list for Hostname and ports */
131 void CreateReadoutList( const char** sourceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount);
133 /** Checks if already connected to HOMER sources */
134 Bool_t IsConnected() { return fConnected; } // Checks if already connected to HOMER sources
136 /** Sets realm ( which can be ACR, GPN, HLT, KIP ) */
137 void SetRealm( TString s ) { fXMLHandler->SetRealm(s); } // Sets realm ( which can be ACR, GPN, HLT, KIP )
139 /* ---------------------------------------------------------------------------------
140 * Event Handling - private
141 * ---------------------------------------------------------------------------------
144 /** Create a TList of blocks, which have been readout */
145 Int_t CreateBlockList();
148 * ---------------------------------------------------------------------------------
149 * Block Handling - private
150 * ---------------------------------------------------------------------------------
153 /** Get Number of blocks in current event */
154 ULong_t GetNBlks() { return fNBlks; } // Get Number of blocks in current event
156 /** Get pointer to block ndx in current event */
157 void* GetBlk( Int_t ndx );
159 /** Get pointer to current block in current event */
160 void* GetBlk() { return GetBlk( fCurrentBlk ); } // Get pointer to current block in current event
162 /** Get first block in current event */
163 void* GetFirstBlk() { return GetBlk( 0 ); } // Get first block in current event
165 /** Get next block in current event */
166 void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); } // Get next block in current event
168 /** Get size of block ndx */
169 ULong_t GetBlkSize( Int_t ndx );
171 /** Get size of current block */
172 ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); } // Get size of current block
174 /** Get origin of block ndx */
175 TString GetBlkOrigin( Int_t ndx );
177 /** Get origin of current block */
178 TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); } // Get origin of current block
180 /** Get type of block ndx */
181 TString GetBlkType( Int_t ndx );
183 /** Get type of current block */
184 TString GetBlkType() { return GetBlkType( fCurrentBlk ); } // Get type of current block
186 /** Get specification of block ndx */
187 ULong_t GetBlkSpecification( Int_t ndx );
189 /** Get specification of current block */
190 ULong_t GetBlkSpecification() { return GetBlkSpecification( fCurrentBlk ); } // Get specification of current block
192 /** Checks if current Block should was requested */
193 Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
196 * ---------------------------------------------------------------------------------
198 * ---------------------------------------------------------------------------------
202 AliEveHOMERXMLHandler* fXMLHandler; //! Handles HLT XML Config Files
205 TList * fSourceList; //! List to HOMER sources
208 AliHLTHOMERReader* fReader; //! Pointer to HOMER reader
211 TList * fBlockList; //! List to HOMER blocks
214 ULong_t fNBlks; // Number of blockes in current event
215 ULong64_t fEventID; // EventID of current event
216 ULong_t fCurrentBlk; // Current block in current event
219 Bool_t fConnected; // Shows connection status
220 Bool_t fStateHasChanged; // Indicates, if a sources have changes, so that one has to reconnect.
223 AliEveHOMERSourceList* fSrcList; // List of HOMER Sources
225 //-----------------------------------------------------------------------------------------
226 AliTPCPreprocessorOnline* fTPCPre; // Preprocessor for TPC calibration.
228 ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.