adding first sketch of a DCS publisher component for global HLT data points
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERManager.h
1 //-*- Mode: C++ -*-
2
3 // $Id$
4 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
5
6 /**************************************************************************
7  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
8  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
9  * full copyright notice.                                                 *
10  **************************************************************************/
11
12 #ifndef ALIEVEHOMERMANAGER_H
13 #define ALIEVEHOMERMANAGER_H
14
15 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
16  * See cxx source for full Copyright notice                               */
17
18 /** @file   AliEveHOMERManager.h
19     @author Jochen Thaeder, Svein Lindal
20     @date
21     @brief  Manager for HOMER in HLT . Inherits some functionalitye
22     from AliHLTHOMERManager, mainly from TEveEventManager
23 */
24 #include "AliHLTHOMERManager.h"
25 #include <TEveEventManager.h>
26 #include <TGeoManager.h>
27
28 class AliEveHOMERSourceList;
29 class TString;
30 class TEveManager;
31 class TEveScene;
32 class TEveProjectionManager;
33 class TTimer;
34
35 class AliHLTEvePhos;
36 class AliHLTEveEmcal;
37 class AliHLTEveTPC;
38 class AliHLTEveHLT;
39 class AliHLTEveITS;
40 class AliHLTEveISSD;
41 class AliHLTEveISDD;
42 class AliHLTEveISPD;
43 class AliHLTEveTRD;
44 class AliHLTEveAny;
45 class AliHLTEveMuon;
46
47 class AliEveHOMERManager : public TEveElementList, public AliHLTHOMERManager {
48
49 public:
50
51   /*
52    * ---------------------------------------------------------------------------------
53    *                            Constructor / Destructor
54    * ---------------------------------------------------------------------------------
55    */
56
57   /** constructor */
58   AliEveHOMERManager();
59
60   /** destructor */
61   virtual ~AliEveHOMERManager();
62
63   /** Connect to avahi and get the list for sources */
64   Int_t CreateEveSourcesList();
65
66   /** Keep on looking for sources until some are found */
67   Int_t CreateEveSourcesListLoop();
68   
69   /** Connect to the sources found */
70   Int_t ConnectEVEtoHOMER(TString detector="ALL");
71
72   /** Delete current connections to sources and reconnect */
73   Int_t ReConnectHOMER( TString detector="" );
74
75   /** Set the retry count for source list loop */
76   void SetRetryCount(Int_t count, Int_t sleeptime) { fRetryCount = count; fRetrySleeptime = sleeptime; }
77   
78   /** Get next event and process it */
79   Int_t NextHOMEREvent();
80
81   /** Set flag for event loop */
82   void SetEventLoopStarted (Bool_t started) {fEventLoopStarted = started;}
83
84   /** Set flag for showing barrel */
85   void SetBarrelFlag(Bool_t flag) { fShowBarrel = flag;}
86   /** Set flag for showing muon arm */
87   void SetMuonFlag(Bool_t flag) { fShowMuon = flag;}
88
89   /**Set and get the global instance of the Eve manager */
90   void SetEveManager(TEveManager * manager) {fEveManager = manager;}
91   TEveManager * GetEveManager() const {return fEveManager;}
92
93   /**Set and get the global instance of TGeoManager */
94   void SetGeoManager(TGeoManager * manager) {fGeoManager = manager;}
95   TGeoManager * GetGeoManager() const {return fGeoManager;}
96
97   /** Set the projection scenes and their managers */
98   void SetRPhiManager (TEveProjectionManager * mgr) {fRPhiManager = mgr;}
99   void SetRPhiEventScene (TEveScene * scene ) {fRPhiEventScene = scene;}
100   void SetRhoZManager(TEveProjectionManager * mgr) {fRhoZManager = mgr;}
101   void SetRhoZEventScene(TEveScene * scene ) {fRhoZEventScene = scene;}
102   
103
104   /** Start and stop the automatic event loop */
105   void StartLoop();
106   void StopLoop();
107  
108 private:
109
110   /** copy constructor prohibited */
111   AliEveHOMERManager(const AliEveHOMERManager&);
112
113   /** assignment operator prohibited */
114   AliEveHOMERManager& operator=(const AliEveHOMERManager&);
115
116   void DestroyDetectorElements();
117   
118   /** Process block */
119   void ProcessBlock(AliHLTHOMERBlockDesc * block);  //Process block
120   /** Reset the elements in the display */
121   void ResetDisplay();  
122   /** Update the display  */
123   void UpdateDisplay(); 
124
125   // == sources ==
126   AliEveHOMERSourceList* fSrcList;        // List of Connected HOMER Sources
127
128   Int_t fRetryCount;                     //How many times to retry creating source list before giving up
129   Int_t fRetrySleeptime;                 //Sleep time between attempt at craeting source list
130
131   TGeoManager * fGeoManager;              //The global TGeoManager instance
132   TEveManager * fEveManager;              //The global TEveManager instance
133   TEveProjectionManager * fRPhiManager;   //The R - Phi projection scene manager
134   TEveProjectionManager * fRhoZManager;   //The Rho- Z projection sene manager
135   TEveScene * fRPhiEventScene;            //The R - Phi projection scene
136   TEveScene * fRhoZEventScene;            //The Rho - Z projection sene
137
138
139   TTimer * fTimer;                   //Timer for event loop
140   //TTimer * fSourceListTimer;       //Timer for source list loop
141  
142   AliHLTEvePhos  * fPhosElement;     //Phos eve processor
143   AliHLTEveEmcal * fEmcalElement;    //Emcal eve processor
144   AliHLTEveTPC   * fTPCElement;      //TPC eve processor
145   AliHLTEveHLT   * fHLTElement;      //HLT
146   AliHLTEveITS   * fITSElement;      //ITS
147   AliHLTEveISPD  * fISPDElement;     //ISPD
148   AliHLTEveISSD  * fISSDElement;     //ISSD
149   AliHLTEveISDD  * fISDDElement;     //ISDD
150   AliHLTEveTRD   * fTRDElement;      //TRD
151   AliHLTEveMuon  * fMuonElement;     //MUON
152   AliHLTEveAny   * fAnyElement;      //Catch all
153
154   Bool_t fEventLoopStarted;                    // Flag indicating whether the loop is running
155   Bool_t fCenterProjectionsAtPrimaryVertex;    // Flag indicating whether to center the projection scenes at primary vertex (as opposed to 0, 0, 0)
156   Bool_t fShowBarrel;                               // Display barrel detectors ?
157   Bool_t fShowMuon;                                 // Display Muon arm ?
158    
159   ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
160
161 };
162 #endif