From Alexandru
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERManager.h
CommitLineData
d810d0de 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
a15e6d7d 9
059c30e4 10//-*- Mode: C++ -*-
11#ifndef ALIEVEHOMERMANGER_H
12#define ALIEVEHOMERMANGER_H
13
14/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
15 * See cxx source for full Copyright notice */
16
d810d0de 17/** @file AliEveHOMERManager.h
059c30e4 18 @author Jochen Thaeder
51346b82 19 @date
059c30e4 20 @brief Manager for HOMER in offline
21*/
22
84aff7a4 23#include <TEveElement.h>
059c30e4 24
25#include "TString.h"
26#include "TDOMParser.h"
27#include "TXMLNode.h"
28#include "TList.h"
29
46eadbb4 30#include "AliEveHOMERSourceList.h"
059c30e4 31#include "AliHLTHOMERSourceDesc.h"
32#include "AliHLTHOMERBlockDesc.h"
33#include "AliHLTHOMERReader.h"
6612c5b3 34
35#include "AliTPCPreprocessorOnline.h"
36
37
059c30e4 38class AliHLTHOMERLibManager;
39
d810d0de 40class AliEveHOMERManager : public TEveElementList
059c30e4 41{
42public:
43
44 /*
45 * ---------------------------------------------------------------------------------
51346b82 46 * Constructor / Destructor
47 * ---------------------------------------------------------------------------------
059c30e4 48 */
49
46eadbb4 50 /** constructor */
51346b82 51 AliEveHOMERManager(TString xmlFile="" );
46eadbb4 52
059c30e4 53 /** destructor */
d810d0de 54 virtual ~AliEveHOMERManager();
059c30e4 55
56 /*
57 * ---------------------------------------------------------------------------------
58 * Source Handling - public
51346b82 59 * ---------------------------------------------------------------------------------
059c30e4 60 */
51346b82 61
059c30e4 62 /** Create Sources List from HOMER-Proxy */
63 Int_t CreateHOMERSourcesList();
64
46eadbb4 65 /** Set state of a source */
51346b82 66 void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
059c30e4 67
46eadbb4 68 /** Get pointer to source List */
69 TList* GetSourceList() { return fSourceList; } // Get pointer to source List
059c30e4 70
71 /*
72 * ---------------------------------------------------------------------------------
73 * Connection Handling - public
51346b82 74 * ---------------------------------------------------------------------------------
059c30e4 75 */
51346b82 76
46eadbb4 77 /** Connect to HOMER sources, out of Readout List, which gets created when state has changed */
059c30e4 78 Int_t ConnectHOMER();
79
80 /** Disconnect from HOMER sources */
81 void DisconnectHOMER();
82
46eadbb4 83 /** Reconnect from HOMER sources */
059c30e4 84 Int_t ReconnectHOMER();
85
86 /*
87 * ---------------------------------------------------------------------------------
16718cdc 88 * Event Handling - public
51346b82 89 * ---------------------------------------------------------------------------------
059c30e4 90 */
91
46eadbb4 92 /** Loads the next Event, after being connected */
059c30e4 93 Int_t NextEvent();
51346b82 94
46eadbb4 95 /** Get event ID */
96 ULong_t GetEventID() { return fEventID; } // Get event ID
059c30e4 97
46eadbb4 98 /** Get pointer to block List */
99 TList* GetBlockList() { return fBlockList; } // Get pointer to block List
100
101 /*
102 * ---------------------------------------------------------------------------------
103 * Test Realm ....
104 * ---------------------------------------------------------------------------------
059c30e4 105 */
6612c5b3 106
46eadbb4 107 /** Still under testing ... */
6612c5b3 108 void DumpTPCCalib(TString objectName, Bool_t dumpToFile);
059c30e4 109
110 ///////////////////////////////////////////////////////////////////////////////////
111
112protected:
113
46eadbb4 114 AliHLTHOMERLibManager* fLibManager; //! Dynamic loader manager for the HOMER library
51346b82 115
46eadbb4 116 ///////////////////////////////////////////////////////////////////////////////////
059c30e4 117
118private:
119
46eadbb4 120 AliEveHOMERManager(const AliEveHOMERManager&); // Not implemented.
121 AliEveHOMERManager& operator=(const AliEveHOMERManager&); // Not implemented.
122
059c30e4 123 /*
124 * ---------------------------------------------------------------------------------
125 * Source Handling - private
51346b82 126 * ---------------------------------------------------------------------------------
059c30e4 127 */
51346b82 128
46eadbb4 129 /** Get Information out of a TDS process in XML file */
059c30e4 130 Int_t GetTDSAttributes( TXMLNode * xmlNode );
131
46eadbb4 132 /** Resolve Information of hostname and port for source which has to be used by HOMER */
059c30e4 133 Int_t ResolveHostPortInformation( TString xmlHostname, TString xmlPort, TString &hostname, Int_t &port );
134
46eadbb4 135 /** Resolve information of source */
059c30e4 136 Int_t ResolveSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc * source );
137
138 /*
139 * ---------------------------------------------------------------------------------
140 * Connection Handling - private
51346b82 141 * ---------------------------------------------------------------------------------
059c30e4 142 */
51346b82 143
46eadbb4 144 /** Create a readout list for Hostname and ports */
059c30e4 145 void CreateReadoutList( const char** socurceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount);
146
46eadbb4 147 /** Checks if already connected to HOMER sources */
148 Bool_t IsConnected() { return fConnected; } // Checks if already connected to HOMER sources
149
150 /** Sets realm ( which can be ACR, GPN, HLT ) */
151 void SetRealm( TString s ) { fRealm = s; } // Sets realm ( which can be ACR, GPN, HLT
059c30e4 152
153 /* ---------------------------------------------------------------------------------
46eadbb4 154 * Event Handling - private
51346b82 155 * ---------------------------------------------------------------------------------
059c30e4 156 */
51346b82 157
059c30e4 158 /** Create a TList of blocks, which have been readout */
159 Int_t CreateBlockList();
160
161 /*
162 * ---------------------------------------------------------------------------------
163 * Block Handling - private
51346b82 164 * ---------------------------------------------------------------------------------
059c30e4 165 */
166
46eadbb4 167 /** Get Number of blocks in current event */
168 ULong_t GetNBlks() { return fNBlks; } // Get Number of blocks in current event
059c30e4 169
46eadbb4 170 /** Get pointer to block ndx in current event */
059c30e4 171 void* GetBlk( Int_t ndx );
172
46eadbb4 173 /** Get pointer to current block in current event */
174 void* GetBlk() { return GetBlk( fCurrentBlk ); } // Get pointer to current block in current event
059c30e4 175
46eadbb4 176 /** Get first block in current event */
177 void* GetFirstBlk() { return GetBlk( 0 ); } // Get first block in current event
059c30e4 178
46eadbb4 179 /** Get next block in current event */
180 void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); } // Get next block in current event
059c30e4 181
46eadbb4 182 /** Get size of block ndx */
059c30e4 183 ULong_t GetBlkSize( Int_t ndx );
184
46eadbb4 185 /** Get size of current block */
186 ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); } // Get size of current block
187
188 /** Get origin of block ndx */
51346b82 189 TString GetBlkOrigin( Int_t ndx );
190
46eadbb4 191 /** Get origin of current block */
192 TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); } // Get origin of current block
059c30e4 193
46eadbb4 194 /** Get type of block ndx */
195 TString GetBlkType( Int_t ndx );
059c30e4 196
46eadbb4 197 /** Get type of current block */
198 TString GetBlkType() { return GetBlkType( fCurrentBlk ); } // Get type of current block
059c30e4 199
46eadbb4 200 /** Get specification of block ndx */
059c30e4 201 ULong_t GetBlkSpecification( Int_t ndx );
202
46eadbb4 203 /** Get specification of current block */
204 ULong_t GetBlkSpecification() { return GetBlkSpecification( fCurrentBlk ); } // Get specification of current block
059c30e4 205
46eadbb4 206 /** Checks if current Block should was requested */
059c30e4 207 Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
208
209 /*
210 * ---------------------------------------------------------------------------------
211 * Members - private
51346b82 212 * ---------------------------------------------------------------------------------
059c30e4 213 */
214
215 // == XML parser ==
46eadbb4 216 TString fXMLFile; // XML input file
a15e6d7d 217 TDOMParser* fXMLParser; //! XML parser into DOM model
46eadbb4 218 TXMLNode * fRootNode; //! Root node of parsed config file
059c30e4 219
220 // == sources ==
a15e6d7d 221 TList * fSourceList; //! List to HOMER sources
059c30e4 222
223 // == connection ==
a15e6d7d 224 AliHLTHOMERReader* fReader; //! Pointer to HOMER reader
46eadbb4 225 TString fRealm; // Indicates the realm where AliEve can connect to ( HLT, GPN, ACR );
059c30e4 226
227 // == blocks ==
a15e6d7d 228 TList * fBlockList; //! List to HOMER blocks
059c30e4 229
230 // == events ==
46eadbb4 231 ULong_t fNBlks; // Number of blockes in current event
a15e6d7d 232 ULong64_t fEventID; // EventID of current event
46eadbb4 233 ULong_t fCurrentBlk; // Current block in current event
51346b82 234
059c30e4 235 // == states ==
a15e6d7d 236 Bool_t fConnected; // Shows connection status
a15e6d7d 237 Bool_t fStateHasChanged; // Indicates, if a sources have changes, so that one has to reconnect.
059c30e4 238
46eadbb4 239 // == sources ==
240 AliEveHOMERSourceList* fSrcList; // List of HOMER Sources
6612c5b3 241
46eadbb4 242 //-----------------------------------------------------------------------------------------
a15e6d7d 243 AliTPCPreprocessorOnline* fTPCPre; // Preprocessor for TPC calibration.
6612c5b3 244
a15e6d7d 245 ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
059c30e4 246};
247
248#endif