1 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
4 /////////////////////////////////////////////////////////////////////////
5 // ALICE EVENT DISPLAY CLASS //
6 // Author: Mayeul ROUSSELET //
7 // e-mail: Mayeul.Rousselet@cern.ch //
8 // Last update:26/08/2003 //
9 /////////////////////////////////////////////////////////////////////////
15 #include <RQ_OBJECT.h>
16 #include <TGStatusBar.h>
18 #include "AliDisplayFrame.h"
19 #include "AliSliderFrame.h"
26 class AliShutterFrame;
28 class AliDetectorFrame;
32 kIdsVIEW, //id of the view shutter
33 kIdbSIDEVIEW, //id of sideview button
98 kmCUTS, //tag for the update fucntion
103 //Constants to set the display mode
104 const Int_t kHits = BIT(0);
105 const Int_t kClusters = BIT(1);
106 const Int_t kHLT = BIT(2);
107 const Int_t kTracks = BIT(3);
110 class AliDisplay2 : public TObject{
111 //This classe is the main component of the new display.
112 //It aggregates all the subframes and manage the relationnships
113 //between the widgets and the internal representation
117 AliDisplay2(const TGWindow *p, UInt_t w, UInt_t h); //Constructor, load all the widgets
118 virtual ~AliDisplay2(void);
121 void CloseWindow();//
122 void DoView(Int_t pos){fDisplayFrame->DoView(pos);};//change the current view
124 void DoSaveSettings();//Save settings to the ressource file
125 void LoadSettings();//load the settings from the ressource file
128 Int_t GetCurrentView(void) const {return fCurrentView;};//return current view
129 TGMainFrame* GetMainFrame() const {return fMainFrame;};//
130 Float_t GetZoomStep() const {return fZoomStep;};//
131 Float_t GetZoomFactor() const {return fZoomFactor;};//
132 Float_t GetRapidityMin() const {return fSliderFrame->GetRapidityMin();};//
133 Float_t GetRapidityMax() const {return fSliderFrame->GetRapidityMax();};//
134 Float_t GetMomentumMin() const {return fSliderFrame->GetMomentumMin();};//
135 Float_t GetMomentumMax() const {return fSliderFrame->GetMomentumMax();};//
136 Int_t GetNbParticles() const {return fNbParticles;};//
137 Int_t GetEventNumber() const {return fEventNumber;};//
138 Int_t GetNbHits() const {return fNbHits;};//
139 Int_t GetNbClusters() const {return fDisplayFrame->GetNbClusters();};//
140 Float_t GetSliderStep() const {return fSliderStep;};//
141 Bool_t GetZoomMode() const {return fZoomMode;};//
142 Int_t GetMode() const {return fMode;};//
143 TObjArray* GetModules() const {return fModules;};//
144 Bool_t* GetEnabledModules() const {return fEnabledModules;};//
145 Int_t GetNbModules() const {return fNbModules;};//
146 char* GetIconsPath() const {return fIconsPath;};//
147 AliModuleInfo* GetModuleInfo() const {return fModuleInfo;};//
148 Bool_t GetSliderUpdate() const {return fSliderUpdate;};//
149 char* GetRawDataPath() const {return fRawDataPath;};
152 void SetSliderUpdate(Bool_t b){fSliderUpdate = b;};//
153 void SetMode(Int_t m){fMode=m;};//
154 void Enable(Int_t m);//Enable the given mode
155 Bool_t IsEnabled(Int_t m) const;//Return if the given mode is enabled
156 void Disable(Int_t m);//Disable the given mode
157 void SetZoomMode(Bool_t b=kTRUE){fZoomMode = b;};//
158 void SetCurrentView(Int_t id){fCurrentView = id;};//
159 void SetZoomStep(Float_t zs){fZoomStep=zs;};//
160 void SetZoomFactor(Float_t zf){fZoomFactor=zf;};//
161 void SetNbHits(Int_t hi){fNbHits = hi;};//
162 void SetNbParticles(Int_t nbp){fNbParticles = nbp;};//
163 void SetSliderStep(Float_t st){fSliderStep = st;};//
164 void SetEditable(Bool_t b){fDisplayFrame->SetEditable(b);};//
165 void SetStatusBar(const char *s,Int_t p){fStatusBar->SetText(s,p);};//Change text in the p part of the status bar
166 void SetRawDataPath(char *path){fRawDataPath=new char[strlen(path)];strcpy(fRawDataPath,path);};
168 void SavePadGIF(const char* file){fDisplayFrame->SavePadGIF(file);};//save current pad to gif file
169 void Draw(Option_t *options=0);//draw
170 void DrawDetector(const char *name){fDisplayFrame->DrawDetector(name);};//draw detector specific view (not implemented)
171 void DrawX3d();//Draw current pad in x3d view
172 void DrawGL();//Draw current pad in OpenGL view
173 void ShowNextEvent(Int_t delta);//Load and display the current+delta event, if it exists
174 void LoadClusters(Int_t nevent);//Load the clusters of the event
175 void LoadHits();//Load the hits
176 void LoadHLTClusters(Int_t nevent);//Load the hlt clusters
177 void LoadEnabledModules(){fDisplayFrame->LoadEnabledModules();};//Load enabled modules
178 void LoadEnabledHits(){fDisplayFrame->LoadHits();};//Load enabled hits
179 void ApplyCuts(){fDisplayFrame->ApplyCuts();}//Apply cuts from the slider frame
180 void EnableDetector(const char *name){fDisplayFrame->EnableDetector(name);};//Enable detector "name"
181 void DisableDetector(const char *name){fDisplayFrame->DisableDetector(name);};//Disable detector "name"
182 void Update(Int_t tag=-1);//Update the view, if loading only the modified data from the previous changes, the integer tag indicates the kind of modification
183 void HandleMouseWheel(Event_t *event);//Handle mouve event, not working yet
184 void HandleResize(Event_t *event);//Handle resize event
185 void FindModules();//Find the modules used for the simulation
189 void SaveToRC() const;
193 Float_t fZoomStep;//Step of the zoom, ie the factor by which the zoom factor will be multiplied(divided) when pressing the zoom in (out) button
194 Float_t fZoomFactor;//Zoom factor, ie 1=no zoom, >1 zoom in & <1 zoom out
195 Bool_t fZoomMode;//kTrue if zoom on zone is enabled
196 Int_t fCurrentView;//Current view, see the enum for value
197 Int_t fNbParticles;//Current number of displayed particles
198 Int_t fEventNumber;//Number of event
199 Int_t fNbHits;//Number of displayed hits
200 Float_t fSliderStep;//Step of the slider
201 Int_t fMode;//Display mode : each bit is associated to a mode : Hits=BIT(0), clusters=BIT(1)...
202 Int_t fNbModules;//Total number of modules
203 TObjArray *fModules;//Array of modules
204 Bool_t *fEnabledModules;//Array of bool for coding the enabled modules
205 char *fIconsPath;//Icon Path (by default $ALICE_ROOT/DISPLAY/icons/)
206 char *fRawDataPath;//Raw data path
207 Bool_t fHitsLoaded,fClustersLoaded,fHLTLoaded,fTracksLoaded;//Implement if the type of datas was loaded, to avoid uneeded load
208 Bool_t fSliderUpdate;//True if display frame update on slider move, for fast machine only (desactivated by default)
209 AliModuleInfo *fModuleInfo;//Pointer to the class which map module name and internal module ID, necessary because of the dynamic load of the available modules
211 TEnv *fAliDisplay2rc;//ressources file (.alidisplay.rc)
213 TGMainFrame *fMainFrame;//Main frame
214 TGCompositeFrame *fLeftFrame;//frame used for the layout
215 TGCompositeFrame *fRightFrame;//frame used for the layout
216 TGCompositeFrame *fSubFrame;//frame used for the layout
219 TGLayoutHints *fSliderFrameLayout; // Slider Frame Layout
220 AliSliderFrame *fSliderFrame;//Frame which contains the rapidity and momentum sliders
223 TGLayoutHints *fShutterFrameLayout; // Shutter Frame Layout
224 AliShutterFrame *fShutterFrame;// Shutter Frame
227 TGLayoutHints *fDisplayFrameLayout; // Display Frame Layout
228 AliDisplayFrame *fDisplayFrame;// Display Frame
231 TGLayoutHints *fInfoFrameLayout; // Info Frame Layout
232 AliInfoFrame *fInfoFrame; // Info Frame
234 //Detector Option Frame
235 TGLayoutHints *fDetectorFrameLayout;// Detector Frame Layout
236 AliDetectorFrame *fDetectorFrame; // Detector Frame
239 AliMenu *fMenu; // Menu
242 TGStatusBar *fStatusBar; // Status Bar
244 RQ_OBJECT("AliDisplay2")
246 ClassDef(AliDisplay2,0);
249 R__EXTERN AliDisplay2* gAliDisplay2;