]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveHLT/AliEveHOMERManager.h
- fixes to simulation macros
[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 class TEveViewer;
35
36 class AliHLTEvePhos;
37 class AliHLTEveEmcal;
38 class AliHLTEveTPC;
39 class AliHLTEveHLT;
40 class AliHLTEveITS;
41 class AliHLTEveISSD;
42 class AliHLTEveISDD;
43 class AliHLTEveISPD;
44 class AliHLTEveTRD;
45 class AliHLTEveAny;
46 class AliHLTEveMuon;
47
48 class AliEveHOMERManager : public TEveElementList, public AliHLTHOMERManager {
49
50 public:
51
52   /*
53    * ---------------------------------------------------------------------------------
54    *                            Constructor / Destructor
55    * ---------------------------------------------------------------------------------
56    */
57
58   /** constructor */
59   AliEveHOMERManager();
60
61   /** destructor */
62   virtual ~AliEveHOMERManager();
63
64   /** Connect to avahi and get the list for sources */
65   Int_t CreateEveSourcesList();
66
67   /** Keep on looking for sources until some are found */
68   Int_t CreateEveSourcesListLoop();
69   
70   /** Connect to the sources found */
71   Int_t ConnectEVEtoHOMER(TString detector="ALL");
72
73   /** Delete current connections to sources and reconnect */
74   Int_t ReConnectHOMER( TString detector="" );
75
76   /** Set the retry count for source list loop */
77   void SetRetryCount(Int_t count, Int_t sleeptime) { fRetryCount = count; fRetrySleeptime = sleeptime; }
78   
79   /** Get next event from the readers */
80   Int_t NextHOMEREvent();
81
82   /** Process the event data */
83   Int_t ProcessEvent();
84
85   /** Set flag for event loop */
86   void SetEventLoopStarted (Bool_t started) {fEventLoopStarted = started;}
87
88   /** Set flag for showing barrel */
89   void SetBarrelFlag(Bool_t flag) { fShowBarrel = flag;}
90   /** Set flag for showing muon arm */
91   void SetMuonFlag(Bool_t flag) { fShowMuon = flag;}
92
93   /**Set and get the global instance of the Eve manager */
94   void SetEveManager(TEveManager * manager) {fEveManager = manager;}
95   TEveManager * GetEveManager() const {return fEveManager;}
96
97   /**Set and get the global instance of TGeoManager */
98   void SetGeoManager(TGeoManager * manager) {fGeoManager = manager;}
99   TGeoManager * GetGeoManager() const {return fGeoManager;}
100
101   /** Set the projection scenes and their managers */
102   void SetRPhiManager (TEveProjectionManager * mgr) {fRPhiManager = mgr;}
103   void SetRPhiEventScene (TEveScene * scene ) {fRPhiEventScene = scene;}
104   void SetRPhiViewer(TEveViewer * viewer ) {fRPhiViewer = viewer;}
105   void SetRhoZManager(TEveProjectionManager * mgr) {fRhoZManager = mgr;}
106   void SetRhoZEventScene(TEveScene * scene ) {fRhoZEventScene = scene;}
107   void SetRhoZViewer(TEveViewer * viewer ) {fRhoZViewer = viewer;}
108
109   /** Start and stop the automatic event loop */
110   void StartLoop();
111   void StopLoop();
112
113   /** Print the screens to a file **/
114   void PrintScreens();
115
116  
117 private:
118
119   /** copy constructor prohibited */
120   AliEveHOMERManager(const AliEveHOMERManager&);
121
122   /** assignment operator prohibited */
123   AliEveHOMERManager& operator=(const AliEveHOMERManager&);
124
125   void DestroyDetectorElements();
126   
127   /** Process block */
128   void ProcessBlock(AliHLTHOMERBlockDesc * block);  //Process block
129   /** Reset the elements in the display */
130   void ResetDisplay();  
131   /** Update the display  */
132   void UpdateDisplay(); 
133
134   // == sources ==
135   AliEveHOMERSourceList* fSrcList;        // List of Connected HOMER Sources
136
137   Int_t fRetryCount;                     //How many times to retry creating source list before giving up
138   Int_t fRetrySleeptime;                 //Sleep time between attempt at craeting source list
139
140   TGeoManager * fGeoManager;              //The global TGeoManager instance
141   TEveManager * fEveManager;              //The global TEveManager instance
142   TEveProjectionManager * fRPhiManager;   //The R - Phi projection scene manager
143   TEveProjectionManager * fRhoZManager;   //The Rho- Z projection sene manager
144   TEveScene * fRPhiEventScene;            //The R - Phi projection scene
145   TEveScene * fRhoZEventScene;            //The Rho - Z projection sene
146   TEveViewer * fRhoZViewer;
147   TEveViewer * fRPhiViewer;
148   
149
150
151   TTimer * fTimer;                   //Timer for event loop
152   //TTimer * fSourceListTimer;       //Timer for source list loop
153  
154   AliHLTEvePhos  * fPhosElement;     //Phos eve processor
155   AliHLTEveEmcal * fEmcalElement;    //Emcal eve processor
156   AliHLTEveTPC   * fTPCElement;      //TPC eve processor
157   AliHLTEveHLT   * fHLTElement;      //HLT
158   AliHLTEveITS   * fITSElement;      //ITS
159   AliHLTEveISPD  * fISPDElement;     //ISPD
160   AliHLTEveISSD  * fISSDElement;     //ISSD
161   AliHLTEveISDD  * fISDDElement;     //ISDD
162   AliHLTEveTRD   * fTRDElement;      //TRD
163   AliHLTEveMuon  * fMuonElement;     //MUON
164   AliHLTEveAny   * fAnyElement;      //Catch all
165
166   Bool_t fEventLoopStarted;                    // Flag indicating whether the loop is running
167   Bool_t fCenterProjectionsAtPrimaryVertex;    // Flag indicating whether to center the projection scenes at primary vertex (as opposed to 0, 0, 0)
168   Bool_t fShowBarrel;                               // Display barrel detectors ?
169   Bool_t fShowMuon;                                 // Display Muon arm ?
170    
171   ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
172
173 };
174 #endif