From Jochen - EveHLT development accumulated since the end of March.
[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"
7279ee15 34#include "AliEveHOMERXMLHandler.h"
6612c5b3 35
36#include "AliTPCPreprocessorOnline.h"
37
38
059c30e4 39class AliHLTHOMERLibManager;
40
d810d0de 41class AliEveHOMERManager : public TEveElementList
059c30e4 42{
43public:
44
45 /*
46 * ---------------------------------------------------------------------------------
51346b82 47 * Constructor / Destructor
48 * ---------------------------------------------------------------------------------
059c30e4 49 */
50
46eadbb4 51 /** constructor */
51346b82 52 AliEveHOMERManager(TString xmlFile="" );
46eadbb4 53
059c30e4 54 /** destructor */
d810d0de 55 virtual ~AliEveHOMERManager();
059c30e4 56
57 /*
58 * ---------------------------------------------------------------------------------
59 * Source Handling - public
51346b82 60 * ---------------------------------------------------------------------------------
059c30e4 61 */
51346b82 62
059c30e4 63 /** Create Sources List from HOMER-Proxy */
64 Int_t CreateHOMERSourcesList();
65
46eadbb4 66 /** Set state of a source */
51346b82 67 void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
059c30e4 68
46eadbb4 69 /** Get pointer to source List */
70 TList* GetSourceList() { return fSourceList; } // Get pointer to source List
059c30e4 71
72 /*
73 * ---------------------------------------------------------------------------------
74 * Connection Handling - public
51346b82 75 * ---------------------------------------------------------------------------------
059c30e4 76 */
51346b82 77
46eadbb4 78 /** Connect to HOMER sources, out of Readout List, which gets created when state has changed */
059c30e4 79 Int_t ConnectHOMER();
80
81 /** Disconnect from HOMER sources */
82 void DisconnectHOMER();
83
46eadbb4 84 /** Reconnect from HOMER sources */
059c30e4 85 Int_t ReconnectHOMER();
86
87 /*
88 * ---------------------------------------------------------------------------------
16718cdc 89 * Event Handling - public
51346b82 90 * ---------------------------------------------------------------------------------
059c30e4 91 */
92
46eadbb4 93 /** Loads the next Event, after being connected */
059c30e4 94 Int_t NextEvent();
51346b82 95
46eadbb4 96 /** Get event ID */
97 ULong_t GetEventID() { return fEventID; } // Get event ID
059c30e4 98
46eadbb4 99 /** Get pointer to block List */
100 TList* GetBlockList() { return fBlockList; } // Get pointer to block List
101
102 /*
103 * ---------------------------------------------------------------------------------
104 * Test Realm ....
105 * ---------------------------------------------------------------------------------
059c30e4 106 */
6612c5b3 107
46eadbb4 108 /** Still under testing ... */
6612c5b3 109 void DumpTPCCalib(TString objectName, Bool_t dumpToFile);
059c30e4 110
111 ///////////////////////////////////////////////////////////////////////////////////
112
113protected:
114
46eadbb4 115 AliHLTHOMERLibManager* fLibManager; //! Dynamic loader manager for the HOMER library
51346b82 116
46eadbb4 117 ///////////////////////////////////////////////////////////////////////////////////
059c30e4 118
119private:
120
46eadbb4 121 AliEveHOMERManager(const AliEveHOMERManager&); // Not implemented.
122 AliEveHOMERManager& operator=(const AliEveHOMERManager&); // Not implemented.
123
059c30e4 124 /*
125 * ---------------------------------------------------------------------------------
059c30e4 126 * Connection Handling - private
51346b82 127 * ---------------------------------------------------------------------------------
059c30e4 128 */
51346b82 129
46eadbb4 130 /** Create a readout list for Hostname and ports */
7279ee15 131 void CreateReadoutList( const char** sourceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount);
059c30e4 132
46eadbb4 133 /** Checks if already connected to HOMER sources */
134 Bool_t IsConnected() { return fConnected; } // Checks if already connected to HOMER sources
135
7279ee15 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 )
059c30e4 138
139 /* ---------------------------------------------------------------------------------
46eadbb4 140 * Event Handling - private
51346b82 141 * ---------------------------------------------------------------------------------
059c30e4 142 */
51346b82 143
059c30e4 144 /** Create a TList of blocks, which have been readout */
145 Int_t CreateBlockList();
146
147 /*
148 * ---------------------------------------------------------------------------------
149 * Block Handling - private
51346b82 150 * ---------------------------------------------------------------------------------
059c30e4 151 */
152
46eadbb4 153 /** Get Number of blocks in current event */
154 ULong_t GetNBlks() { return fNBlks; } // Get Number of blocks in current event
059c30e4 155
46eadbb4 156 /** Get pointer to block ndx in current event */
059c30e4 157 void* GetBlk( Int_t ndx );
158
46eadbb4 159 /** Get pointer to current block in current event */
160 void* GetBlk() { return GetBlk( fCurrentBlk ); } // Get pointer to current block in current event
059c30e4 161
46eadbb4 162 /** Get first block in current event */
163 void* GetFirstBlk() { return GetBlk( 0 ); } // Get first block in current event
059c30e4 164
46eadbb4 165 /** Get next block in current event */
166 void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); } // Get next block in current event
059c30e4 167
46eadbb4 168 /** Get size of block ndx */
059c30e4 169 ULong_t GetBlkSize( Int_t ndx );
170
46eadbb4 171 /** Get size of current block */
172 ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); } // Get size of current block
173
174 /** Get origin of block ndx */
51346b82 175 TString GetBlkOrigin( Int_t ndx );
176
46eadbb4 177 /** Get origin of current block */
178 TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); } // Get origin of current block
059c30e4 179
46eadbb4 180 /** Get type of block ndx */
181 TString GetBlkType( Int_t ndx );
059c30e4 182
46eadbb4 183 /** Get type of current block */
184 TString GetBlkType() { return GetBlkType( fCurrentBlk ); } // Get type of current block
059c30e4 185
46eadbb4 186 /** Get specification of block ndx */
059c30e4 187 ULong_t GetBlkSpecification( Int_t ndx );
188
46eadbb4 189 /** Get specification of current block */
190 ULong_t GetBlkSpecification() { return GetBlkSpecification( fCurrentBlk ); } // Get specification of current block
059c30e4 191
46eadbb4 192 /** Checks if current Block should was requested */
059c30e4 193 Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
194
195 /*
196 * ---------------------------------------------------------------------------------
197 * Members - private
51346b82 198 * ---------------------------------------------------------------------------------
059c30e4 199 */
200
7279ee15 201 // == XML handler ==
202 AliEveHOMERXMLHandler* fXMLHandler; //! Handles HLT XML Config Files
059c30e4 203
204 // == sources ==
a15e6d7d 205 TList * fSourceList; //! List to HOMER sources
059c30e4 206
207 // == connection ==
a15e6d7d 208 AliHLTHOMERReader* fReader; //! Pointer to HOMER reader
059c30e4 209
210 // == blocks ==
a15e6d7d 211 TList * fBlockList; //! List to HOMER blocks
059c30e4 212
213 // == events ==
46eadbb4 214 ULong_t fNBlks; // Number of blockes in current event
a15e6d7d 215 ULong64_t fEventID; // EventID of current event
46eadbb4 216 ULong_t fCurrentBlk; // Current block in current event
51346b82 217
059c30e4 218 // == states ==
a15e6d7d 219 Bool_t fConnected; // Shows connection status
a15e6d7d 220 Bool_t fStateHasChanged; // Indicates, if a sources have changes, so that one has to reconnect.
059c30e4 221
46eadbb4 222 // == sources ==
223 AliEveHOMERSourceList* fSrcList; // List of HOMER Sources
6612c5b3 224
46eadbb4 225 //-----------------------------------------------------------------------------------------
a15e6d7d 226 AliTPCPreprocessorOnline* fTPCPre; // Preprocessor for TPC calibration.
6612c5b3 227
a15e6d7d 228 ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
059c30e4 229};
230
231#endif