]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveHLT/AliEveHOMERManager.h
* Added new Handler Classes for HOMER Proxy
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERManager.h
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          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
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
17 /** @file   AliEveHOMERManager.h
18     @author Jochen Thaeder
19     @date
20     @brief  Manager for HOMER in offline
21 */
22
23 #include <TEveElement.h>
24
25 #include "TString.h"
26 #include "TDOMParser.h"
27 #include "TXMLNode.h"
28 #include "TList.h"
29
30 #include "AliEveHOMERSourceList.h"
31 #include "AliHLTHOMERSourceDesc.h"
32 #include "AliHLTHOMERBlockDesc.h"
33 #include "AliHLTHOMERReader.h"
34 #include "AliEveHOMERXMLHandler.h"
35
36 #include "AliTPCPreprocessorOnline.h"
37
38
39 class AliHLTHOMERLibManager;
40
41 class AliEveHOMERManager : public TEveElementList
42 {
43 public:
44
45   /*
46    * ---------------------------------------------------------------------------------
47    *                            Constructor / Destructor
48    * ---------------------------------------------------------------------------------
49    */
50
51   /** constructor */
52   AliEveHOMERManager(TString xmlFile="" );
53
54   /** destructor */
55   virtual ~AliEveHOMERManager();
56
57   /*
58    * ---------------------------------------------------------------------------------
59    *                            Source Handling - public
60    * ---------------------------------------------------------------------------------
61    */
62
63   /** Create Sources List from HOMER-Proxy */
64   Int_t CreateHOMERSourcesList();
65
66   /** Set state of a source */
67   void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
68
69   /** Get pointer to source List */
70   TList* GetSourceList() { return fSourceList; } // Get pointer to source List
71
72   /*
73    * ---------------------------------------------------------------------------------
74    *                            Connection Handling - public
75    * ---------------------------------------------------------------------------------
76    */
77
78   /** Connect to HOMER sources, out of Readout List, which gets created when state has changed */
79   Int_t ConnectHOMER();
80
81   /** Disconnect from HOMER sources */
82   void DisconnectHOMER();
83
84   /** Reconnect from HOMER sources */
85   Int_t ReconnectHOMER();
86
87   /*
88    * ---------------------------------------------------------------------------------
89    *                            Event Handling - public
90    * ---------------------------------------------------------------------------------
91    */
92
93   /** Loads the next Event, after being connected */
94   Int_t NextEvent();
95
96   /** Get event ID */
97   ULong_t GetEventID() { return fEventID; }    // Get event ID
98
99   /** Get pointer to block List */
100   TList* GetBlockList() { return fBlockList; } // Get pointer to block List
101   
102   ///////////////////////////////////////////////////////////////////////////////////
103
104 protected:
105
106   AliHLTHOMERLibManager* fLibManager;             //! Dynamic loader manager for the HOMER library
107
108   ///////////////////////////////////////////////////////////////////////////////////
109
110 private:
111
112   AliEveHOMERManager(const AliEveHOMERManager&);            // Not implemented.
113   AliEveHOMERManager& operator=(const AliEveHOMERManager&); // Not implemented.
114
115   /*
116    * ---------------------------------------------------------------------------------
117    *                            Connection Handling - private
118    * ---------------------------------------------------------------------------------
119    */
120
121   /** Create a readout list for Hostname and ports */
122   void CreateReadoutList( const char** sourceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount);
123
124   /** Checks if already connected to HOMER sources */
125   Bool_t IsConnected() { return fConnected; }  // Checks if already connected to HOMER sources
126
127   /** Sets realm ( which can be ACR, GPN, HLT, KIP ) */ 
128   void SetRealm( TString s ) { fXMLHandler->SetRealm(s); } // Sets realm ( which can be ACR, GPN, HLT, KIP )
129
130   /* ---------------------------------------------------------------------------------
131    *                            Event Handling - private
132    * ---------------------------------------------------------------------------------
133    */
134
135   /** Create a TList of blocks, which have been readout */
136   Int_t CreateBlockList();
137
138   /*
139    * ---------------------------------------------------------------------------------
140    *                            Block Handling - private
141    * ---------------------------------------------------------------------------------
142    */
143
144   /** Get Number of blocks in current event */
145   ULong_t GetNBlks() { return fNBlks; }                                        // Get Number of blocks in current event
146
147   /** Get pointer to block ndx in current event */
148   void* GetBlk( Int_t ndx );
149
150   /** Get pointer to current block in current event */
151   void* GetBlk() { return GetBlk( fCurrentBlk ); }                             // Get pointer to current block in current event
152
153   /** Get first block in current event */
154   void* GetFirstBlk() { return GetBlk( 0 ); }                                  // Get first block in current event
155
156   /** Get next block in current event */
157   void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); }                       // Get next block in current event
158
159   /** Get size of block ndx */
160   ULong_t GetBlkSize( Int_t ndx );
161
162   /** Get size of current block */ 
163   ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); }                   // Get size of current block 
164  
165   /** Get origin of block ndx */
166   TString GetBlkOrigin( Int_t ndx );
167
168   /** Get origin of current block */
169   TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); }                // Get origin of current block
170
171   /** Get type of block ndx */
172   TString GetBlkType( Int_t ndx ); 
173
174   /** Get type of current block */
175   TString GetBlkType() { return GetBlkType( fCurrentBlk ); }                   // Get type of current block
176
177   /** Get specification of block ndx */
178   ULong_t GetBlkSpecification( Int_t ndx );
179
180   /** Get specification of current block */
181   ULong_t GetBlkSpecification() { return GetBlkSpecification( fCurrentBlk ); } // Get specification of current block
182
183   /** Checks if current Block should was requested */
184   Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
185
186   /*
187    * ---------------------------------------------------------------------------------
188    *                            Members - private
189    * ---------------------------------------------------------------------------------
190    */
191
192   // == XML handler ==
193   AliEveHOMERXMLHandler* fXMLHandler;             //! Handles HLT XML Config Files
194
195   // == sources ==
196   TList * fSourceList;                            //! List to HOMER sources
197
198   // == connection ==
199   AliHLTHOMERReader* fReader;                     //! Pointer to HOMER reader
200
201   // == blocks ==
202   TList * fBlockList;                             //! List to HOMER blocks
203
204   // == events ==
205   ULong_t   fNBlks;                               // Number of blockes in current event
206   ULong64_t fEventID;                             // EventID of current event
207   ULong_t   fCurrentBlk;                          // Current block in current event
208
209   // == states ==
210   Bool_t fConnected;                              // Shows connection status
211   Bool_t fStateHasChanged;                        // Indicates, if a sources have changes, so that one has to reconnect.
212
213   // == sources ==
214   AliEveHOMERSourceList* fSrcList;                // List of HOMER Sources
215
216   ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
217 };
218
219 #endif