]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/gui/src/AliHLTGUI.h
Adding document for performance study (marian)
[u/mrichter/AliRoot.git] / HLT / TPCLib / gui / src / AliHLTGUI.h
1
2 #ifndef _AliHLTGUI_H_
3 #define _AliHLTGUI_H_
4
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTGUI.h
9     @author Jochen Thaeder
10     @date   
11     @brief  Qt class for ALICE HLT online Display
12 */
13
14 #include "Rtypes.h"
15
16 #include "AliHLTLogging.h"
17 #include "AliHLTGUIMainForm.h"
18 #include <vector>
19 #include <qtimer.h>
20
21
22
23 /**
24  * @class AliHLTGUI
25  * The class handels the graphical user interface for the ALICE HLT online 
26  * display. The input made in the GUI is set in the main class @ref AliHLTTPCDisplayMain.
27  * In order to seperate the Qt code from the ROOT code, all functionality is 
28  * implemented in the class @ref AliHLTTPCDisplayMain. This class fuctions just as
29  * front-end for the GUI.<br>
30  * Several options can alredeay defined using the commandline:
31  *   -n-time-bins <mode>                Sets number of TimeBins for the TPC, can bei either a digit, 'sim' or 'tpc'.
32  *   -adc-threshold <mode>              Sets the ADC Threshold for the Zero-Suppression of raw data, should be ADC counts.
33  *   -occupancy-limit <mode>            Sets the Occupancy limits for pads, wherby <mode> is [0,1].
34  *   -b-field <mode>                    Sets the B-field.
35  *   -tcp-source <host:port> ...        Sets Host and Ports to a TCP port of a @ref TCPDumpSubscriber. Multiple Connections can be given.
36  *   -connect                           Connects already to given TCP-Sources.
37  *   --help                             Shows the Help Menu.
38  *   --version                          Prints version of AliHLTGUI.
39  * @ingroup alihlt_display
40  */
41
42 class AliHLTGUI : public AliHLTGUIMainForm , public AliHLTLogging {
43   Q_OBJECT
44
45  public:
46   /** standard constructor */
47   AliHLTGUI();
48
49   /**
50    * Constructor
51    * @param argc     Number of commandline arguments
52    * @param argv     Array of commandline arguments
53    */
54   AliHLTGUI( Int_t argc, Char_t **argv );
55
56   /** not a valid copy constructor, defined according to effective C++ style */
57   AliHLTGUI(const AliHLTGUI&);
58   /** not a valid assignment op, but defined according to effective C++ style */
59   AliHLTGUI& operator=(const AliHLTGUI&);
60
61   /** standard destructor */
62   virtual ~AliHLTGUI();
63     
64   public slots:
65
66   /** Qt slots for the GUI objects<br> */
67   /** ---------------------------------*/
68
69   /** Qt slot for connect button */
70   void connectDisplay();         
71   /** Qt slot for adding host to hostlist */
72   void addHost();            
73   /** Qt slot for removing host from hostlist */
74   void removeHost();
75   /** Qt slot for next event button */
76   void nextEvent();
77   /** Qt slot for event loop button */
78   void eventLoop();
79   /** Qt slot for update time of evemt loop */
80   void updateEventLoop();
81   /** Qt slot for redisplay  button */
82   void redisplayEvent(){ redisplay(kFALSE); }
83
84
85   /** Qt slots for the GUI objects and setter for @ref AliHLTTPCDisplayMain */
86   /** --------------------------------------------------------------------- */
87
88   /**
89    * Qt slot for objects, responsible for the selection<br>
90    * of the slices which should be displayed in the 3D view.<br>
91    * Selection is than set to @ref ALiHLTTPCDisplayMain.
92    */
93   void setSector();
94
95   /**
96    * Qt slot for zero suppression.<br>
97    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
98    * @ref redisplay() is called afterwards
99    */
100   void setZeroSuppression(); 
101
102   /**
103    * Qt slot for selection of new slice for raw data.<br>
104    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
105    * @ref redisplay(kTRUE) is called afterwards, on order to read
106    * the data for the new slice.
107    */
108   void setRawSlice();
109
110   /**
111    * Qt slot for selection of padrow for raw data.<br>
112    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
113    * @ref redisplay() is called afterwards
114    */
115   void setPadRow();
116
117   /**
118    * Qt slot for selection of pad for raw data.<br>
119    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
120    * @ref redisplay() is called afterwards
121    */
122   void setPad();
123
124   /** 
125    * Qt slot for selection of timebins (all timebins, 
126    * one timebin, range of timebin)  for raw data.<br>
127    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
128    * @ref redisplay() is called afterwards
129    */
130   void setTimeBin();
131
132   /**
133    * Qt slot for selection, how timebins should be displayed (sum, average, maximum).<br>
134    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
135    * @ref redisplay() is called afterwards
136    */
137   void selectTimeBinData();     
138   
139   /**
140    * Qt slot for splitting padrowCanvas and show padrow 
141    * and pad histograms in the same canvas.<br>
142    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
143    * @ref redisplay() is called afterwards
144    */
145   void setSplitPadRow();
146
147   /**
148    * Qt slot for splitting frontCanvas and show front 
149    * and pad histograms in the same canvas.<br>
150    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
151    * @ref redisplay() is called afterwards
152    */
153   void setSplitFront();
154
155   /**
156    * Qt slot for selection of what to display in 3D: raw data, cluster data, tracks data, geometry.<br>
157    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
158    * @ref redisplay() is called afterwards
159    */
160   void set3D();
161
162   /**
163    * Qt slot for selection if only one padrow or all padrow of selected 
164    * slice for raw data should be displayed.<br>
165    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
166    * @ref redisplay() is called afterwards
167    */
168   void set3DRaw();
169
170   /**
171    * Qt slot for selection of cuts for tracks.<br>
172    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
173    * @ref redisplay() is called afterwards
174    */
175   void setTrack(); 
176
177   /**
178    * Qt slot for selection of what clusters shold be displayed: 
179    * All clusters, used and unused clusters in terms of associated to found tracks.<br>
180    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
181    * @ref redisplay() is called afterwards
182    */
183   void setCluster();
184
185   /**
186    * Qt slot for inversion of the background in 3D canvas.<br>
187    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
188    * @ref redisplay() is called afterwards
189    */
190   void setInvert();
191
192   /**
193    * Qt slot for selection of single tracks or all tracks.
194    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
195    * @ref redisplay() is called afterwards
196    */
197   void setSelectTrack();
198
199   /**
200    * Qt slot for selection of slice for track and residual  objectes.<br>
201    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
202    * @ref redisplay() is called afterwards
203    */
204   void selectTrackSector();
205
206   /**
207    * Qt slot for selection of single track.<br>
208    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
209    * @ref redisplay() is called afterwards
210    */
211   void selectTrack();
212
213   /**
214    * Qt slot for selection, if angles should be kept when redisplaying
215    * Selection is than set to @ref ALiHLTTPCDisplayMain.<br>
216    * @ref redisplay() is called afterwards
217    */
218   void setKeepView();
219     
220   /** Functions<br> */
221   /** --------------*/
222
223   /** Shows Track parameter of current selected single Track */
224   void displayTrackParam();      
225
226   /**
227    * Redisplays event without reading new event, 
228    * after change of parameters in the GUI.
229    * @param newRawSlice        In the case of changed slice for raw data set
230    *                           to kTRUE, than data for new raw slice is read.
231    *                           Standard is kFALSE
232    */
233   void redisplay(Bool_t newRawSlice=kFALSE); // redisplay function
234
235   /** Qt slot for save histogram button, saves all canvases. */
236   void saveHistograms();
237   
238   /** 
239    * Enables connect-objects according to connection Status 
240    * @param connected          Connection status of the GUI to  
241    *                           the TCPDumpSubscriber.<br>
242    *                           Either kTRUE or kFALSE.
243    */
244   void enableDisplay(Bool_t connected);           
245
246   /** Enables data objects according to data availibility  */
247   void enableDataObjects();
248
249   /** Sets pad value in GUI out of @ref AliHLTTPCDisplayMain */
250   void setGUIPad(Int_t pad); 
251   
252   /** Callback function fot setGUIPad */
253   static void callback_setGUIPad(void* pt2Object, Int_t pad){
254     AliHLTGUI* myself = (AliHLTGUI*) pt2Object;
255     myself->setGUIPad(pad);
256   }
257
258  protected:
259   /** Pointer to AliHLTTPCDisplayMain */
260   void* fDisplay;
261   
262   /** Qt vector for hostnames */
263   vector<QString> fHostnames;
264   /** Qt vector for ports */
265   vector<QString> fPorts;
266   
267   /** QtWidget for ROOT padrow canvas */
268   TQtWidget *padrowWidget;
269   /** QtWidget for ROOT pad canvas */
270   TQtWidget *padWidget;
271   /** QtWidget for ROOT residuals canvas */
272   TQtWidget *residualsWidget;
273   /** QtWidget for ROOT charge canvas */
274   TQtWidget *chargeWidget;
275   /** QtWidget for ROOT threeD canvas */
276   TQtWidget *threeDWidget;
277   /** QtWidget for ROOT front canvas */
278   TQtWidget *frontWidget;
279   /** QtWidget for ROOT hist_s canvas */
280   TQtWidget *hits_sWidget;
281   /** QtWidget for ROOT q_track canvas */
282   TQtWidget *q_trackWidget;
283   /** QtWidget for ROOT q_s canvas */
284   TQtWidget *q_sWidget;
285   /** QtWidget for ROOT padrow_pad canvas */
286   TQtWidget *padrow_padWidget;
287
288   /** Qt Timer for event loop */
289   QTimer *fEventLoop;
290 };
291
292 #endif /*  _AliHLTGUI_H_ */