]>
Commit | Line | Data |
---|---|---|
7b3eaa01 | 1 | // $Id$ |
2 | // Author: Matevz Tadel 2009 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2009, 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 | #include "AliEveConfigManager.h" | |
11 | ||
3aff0c2e | 12 | #include <AliEveMultiView.h> |
7b3eaa01 | 13 | #include <TEveManager.h> |
14 | #include <TEveBrowser.h> | |
a13d7c88 | 15 | #include <TEveWindow.h> |
3aff0c2e | 16 | #include <TGFileDialog.h> |
7b3eaa01 | 17 | #include <TGMenu.h> |
18 | ||
a13d7c88 | 19 | #include "AliEveEventManager.h" |
20 | #include "AliEveMacroExecutor.h" | |
21 | #include "AliEveMacroExecutorWindow.h" | |
22 | #include "AliEveMacro.h" | |
23 | ||
164d3d29 | 24 | //Storage Manager: |
9211a1f1 | 25 | #ifdef ZMQ |
164d3d29 | 26 | #include "AliStorageAdministratorPanelListEvents.h" |
27 | #include "AliStorageAdministratorPanelMarkEvent.h" | |
9211a1f1 | 28 | #endif |
164d3d29 | 29 | |
3aff0c2e | 30 | class AliEveMacroExecutor; |
31 | class TEveProjectionManager; | |
32 | class TEveGeoShape; | |
33 | class TEveUtil; | |
34 | ||
35 | #include <TSystem.h> | |
36 | #include <TPRegexp.h> | |
7b3eaa01 | 37 | #include <RVersion.h> |
38 | ||
39 | //______________________________________________________________________________ | |
40 | // Full description of AliEveConfigManager | |
41 | // | |
42 | ||
43 | ClassImp(AliEveConfigManager) | |
44 | ||
45 | AliEveConfigManager* AliEveConfigManager::fgMaster = 0; | |
46 | ||
47 | namespace | |
48 | { | |
49 | enum EAliEveMenu_e | |
50 | { | |
164d3d29 | 51 | kAEMDefault, kAEMScreen, kAEMProjector, kAEMNotransparency, kAEMTransparentDark, kAEMTransparentLight, kAEMTransparentMonoDark, kAEMTransparentMonoLight, kAEMGreen, kAEMBright, kAEMYellow, kAEMTpc, kAEMAll, kAEM3d, kAEMRphi, kAEMRhoz, kAEMAllhr, kAEM3dhr, kAEMRphihr, kAEMRhozhr, kAEMSavemacros, kAEMLoadmacros, kAEMSave, kAEMOpen, kAEMSetDefault, kAEMResiduals, kAEMCuts, kAEMVectors, kAEMGui, kStorageListEvents, kStorageMarkEvent |
7b3eaa01 | 52 | }; |
53 | } | |
54 | ||
55 | //______________________________________________________________________________ | |
56 | AliEveConfigManager* AliEveConfigManager::InitializeMaster() | |
57 | { | |
58 | // Get main instance. | |
59 | ||
60 | static const TEveException kEH("AliEveConfigManager::InitializeMaster "); | |
61 | ||
62 | if (fgMaster) | |
63 | throw kEH + "Master already initialized."; | |
64 | ||
65 | fgMaster = new AliEveConfigManager; | |
66 | return fgMaster; | |
67 | } | |
68 | ||
69 | //______________________________________________________________________________ | |
70 | AliEveConfigManager* AliEveConfigManager::GetMaster() | |
71 | { | |
72 | // Get main instance. | |
73 | ||
74 | static const TEveException kEH("AliEveConfigManager::GetMaster "); | |
75 | ||
76 | if (!fgMaster) | |
77 | throw kEH + "Master not initialized."; | |
78 | ||
79 | return fgMaster; | |
80 | } | |
81 | ||
82 | //______________________________________________________________________________ | |
83 | AliEveConfigManager::AliEveConfigManager() : | |
84 | TObject(), | |
6aafad45 | 85 | fAnalysisPopup(0), |
d52fea52 | 86 | fAliEvePopup(0), |
87 | fAliEveGeometries(0), | |
88 | fAliEvePictures(0), | |
89 | fAliEvePicturesHR(0), | |
90 | fAliEveDataSelection(0), | |
91 | fAliEveVizDBs(0), | |
92 | fLoadCheck(kFALSE) | |
7b3eaa01 | 93 | { |
94 | // Constructor. | |
95 | // Expected TEveManager is already initialized. | |
96 | ||
3aff0c2e | 97 | |
d4476392 | 98 | fAliEveGeometries = new TGPopupMenu(gClient->GetRoot()); |
99 | fAliEveGeometries->AddEntry("&Default", kAEMDefault); | |
100 | fAliEveGeometries->AddEntry("&Screen", kAEMScreen); | |
101 | fAliEveGeometries->AddEntry("&Projector", kAEMProjector); | |
3aff0c2e | 102 | |
d4476392 | 103 | fAliEveGeometries->AddSeparator(); |
3aff0c2e | 104 | |
d4476392 | 105 | fAliEveGeometries->AddEntry("&Low transparency", kAEMNotransparency); |
a13d7c88 | 106 | |
d4476392 | 107 | fAliEveGeometries->AddSeparator(); |
a13d7c88 | 108 | |
d4476392 | 109 | fAliEveGeometries->AddEntry("&Transparent screen", kAEMTransparentDark); |
110 | fAliEveGeometries->AddEntry("&Transparent projector", kAEMTransparentLight); | |
111 | fAliEveGeometries->AddEntry("&Transparent mono dark", kAEMTransparentMonoDark); | |
112 | fAliEveGeometries->AddEntry("&Transparent mono light", kAEMTransparentMonoLight); | |
3aff0c2e | 113 | |
d4476392 | 114 | fAliEveGeometries->AddSeparator(); |
3aff0c2e | 115 | |
d4476392 | 116 | fAliEveGeometries->AddEntry("&First collision setup", kAEMGreen); |
117 | fAliEveGeometries->AddEntry("&Bright", kAEMBright); | |
a13d7c88 | 118 | |
d4476392 | 119 | fAliEveGeometries->AddSeparator(); |
a13d7c88 | 120 | |
d4476392 | 121 | fAliEveGeometries->AddEntry("&TPC Yellow", kAEMYellow); |
122 | fAliEveGeometries->AddEntry("&TPC Blue", kAEMTpc); | |
a13d7c88 | 123 | |
d4476392 | 124 | fAliEveGeometries->AddSeparator(); |
a13d7c88 | 125 | |
d4476392 | 126 | fAliEvePictures = new TGPopupMenu(gClient->GetRoot()); |
a13d7c88 | 127 | |
d4476392 | 128 | fAliEvePictures->AddEntry("&Save all views", kAEMAll); |
129 | fAliEvePictures->AddEntry("&Save 3D View", kAEM3d); | |
130 | fAliEvePictures->AddEntry("&Save RPhi View", kAEMRphi); | |
131 | fAliEvePictures->AddEntry("&Save RhoZ View", kAEMRhoz); | |
a13d7c88 | 132 | |
d4476392 | 133 | fAliEvePictures->AddSeparator(); |
a13d7c88 | 134 | |
d4476392 | 135 | fAliEvePicturesHR = new TGPopupMenu(gClient->GetRoot()); |
136 | ||
137 | fAliEvePicturesHR->AddEntry("&Save all views HR", kAEMAllhr); | |
138 | fAliEvePicturesHR->AddEntry("&Save 3D View HR", kAEM3dhr); | |
139 | fAliEvePicturesHR->AddEntry("&Save RPhi View HR", kAEMRphihr); | |
140 | fAliEvePicturesHR->AddEntry("&Save RhoZ View HR", kAEMRhozhr); | |
141 | ||
142 | fAliEvePicturesHR->AddSeparator(); | |
a13d7c88 | 143 | |
d4476392 | 144 | fAliEveDataSelection = new TGPopupMenu(gClient->GetRoot()); |
a13d7c88 | 145 | |
d4476392 | 146 | fAliEveDataSelection->AddEntry("&Save Data Selection macros", kAEMSavemacros); |
147 | fAliEveDataSelection->AddEntry("&Load Data Selection macros", kAEMLoadmacros); | |
148 | ||
149 | fAliEveDataSelection->AddSeparator(); | |
150 | ||
151 | fAliEveVizDBs = new TGPopupMenu(gClient->GetRoot()); | |
152 | ||
153 | fAliEveVizDBs->AddEntry("&Save VizDB", kAEMSave); | |
154 | fAliEveVizDBs->AddEntry("&Load VizDB", kAEMOpen); | |
155 | ||
156 | fAliEveVizDBs->AddSeparator(); | |
157 | ||
158 | fAliEvePopup = new TGPopupMenu(gClient->GetRoot()); | |
159 | fAliEvePopup->AddEntry("&Set Default Settings", kAEMSetDefault); | |
a13d7c88 | 160 | fAliEvePopup->AddSeparator(); |
d4476392 | 161 | fAliEvePopup->AddPopup("&Geometries/VizDBs", fAliEveGeometries); |
a13d7c88 | 162 | fAliEvePopup->AddSeparator(); |
d4476392 | 163 | fAliEvePopup->AddPopup("&Pictures", fAliEvePictures); |
a13d7c88 | 164 | fAliEvePopup->AddSeparator(); |
d4476392 | 165 | fAliEvePopup->AddPopup("&PicturesHR", fAliEvePicturesHR); |
166 | fAliEvePopup->AddSeparator(); | |
167 | fAliEvePopup->AddPopup("&VizDBs", fAliEveVizDBs); | |
168 | fAliEvePopup->AddSeparator(); | |
169 | fAliEvePopup->AddPopup("&DataSelection", fAliEveDataSelection); | |
7b3eaa01 | 170 | fAliEvePopup->AddSeparator(); |
171 | ||
6aafad45 | 172 | fAnalysisPopup = new TGPopupMenu(gClient->GetRoot()); |
173 | // fAnalysisPopup->AddEntry("&Residuals", kAEMResiduals); | |
174 | // fAnalysisPopup->AddSeparator(); | |
175 | fAnalysisPopup->AddEntry("&Cuts", kAEMCuts); | |
176 | fAnalysisPopup->AddSeparator(); | |
177 | fAnalysisPopup->AddEntry("&Momentum vectors", kAEMVectors); | |
178 | fAnalysisPopup->AddSeparator(); | |
179 | // fAnalysisPopup->AddEntry("&Gui Mode", kAEMGui); | |
180 | // fAnalysisPopup->AddSeparator(); | |
181 | ||
7b3eaa01 | 182 | fAliEvePopup->Connect("Activated(Int_t)", "AliEveConfigManager", |
183 | this, "AliEvePopupHandler(Int_t)"); | |
6aafad45 | 184 | |
185 | fAnalysisPopup->Connect("Activated(Int_t)", "AliEveConfigManager", | |
186 | this, "AliEvePopupHandler(Int_t)"); | |
187 | ||
164d3d29 | 188 | //Storage Manager: |
189 | fStoragePopup = new TGPopupMenu(gClient->GetRoot()); | |
9211a1f1 | 190 | #ifdef ZMQ |
fae81379 | 191 | // fStoragePopup->AddEntry("&List events",kStorageListEvents); |
164d3d29 | 192 | fStoragePopup->AddEntry("&Mark event",kStorageMarkEvent); |
fae81379 | 193 | |
194 | gEve->GetBrowser()->StartEmbedding(0); | |
195 | fListEventsTab = AliStorageAdministratorPanelListEvents::GetInstance(); | |
196 | gEve->GetBrowser()->StopEmbedding("List"); | |
197 | ||
198 | fListEventsTab->Connect("SelectedEvent()","AliEveConfigManager",this,"SetEventInEventManager()"); | |
199 | ||
9211a1f1 | 200 | #endif |
164d3d29 | 201 | |
202 | fStoragePopup->Connect("Activated(Int_t)","AliEveConfigManager", | |
203 | this, "AliEvePopupHandler(Int_t)"); | |
204 | ||
a13d7c88 | 205 | fLoadCheck = kFALSE; |
7b3eaa01 | 206 | |
06219f85 | 207 | #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) |
208 | TGMenuBar *mBar = gEve->GetBrowser()->GetMenuBar(); | |
209 | mBar->AddPopup("&AliEve", fAliEvePopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0)); | |
6aafad45 | 210 | ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout(); |
211 | mBar->AddPopup("&Tools", fAnalysisPopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0)); | |
164d3d29 | 212 | ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout(); |
213 | mBar->AddPopup("&Storage Manager",fStoragePopup,new TGLayoutHints(kLHintsTop | kLHintsLeft,0,4,0,0)); | |
214 | ||
06219f85 | 215 | gEve->GetBrowser()->GetTopMenuFrame()->Layout(); |
7b3eaa01 | 216 | #else |
217 | // Uber hack as TRootBrowser does not provede manu-bar getter. | |
218 | TGFrameElement *xxFE = (TGFrameElement*) gEve->GetBrowser()->GetList()->First(); | |
219 | TGCompositeFrame *xxCF = (TGCompositeFrame*) xxFE->fFrame; | |
220 | xxFE = (TGFrameElement*) xxCF->GetList()->First(); | |
221 | xxCF = (TGCompositeFrame*) xxFE->fFrame; | |
222 | xxFE = (TGFrameElement*) xxCF->GetList()->First(); | |
223 | xxCF = (TGCompositeFrame*) xxFE->fFrame; | |
224 | xxFE = (TGFrameElement*) xxCF->GetList()->First(); | |
06219f85 | 225 | TGMenuBar *mBar = (TGMenuBar*) xxFE->fFrame; |
7b3eaa01 | 226 | mBar->AddPopup("&AliEve", fAliEvePopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0)); |
227 | ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout(); | |
6aafad45 | 228 | mBar->AddPopup("&Tools", fAnalysisPopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0)); |
229 | ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout(); | |
164d3d29 | 230 | mBar->AddPopup("&Storage Manager",fStoragePopup,new TGLayoutHints(kLHintsTop | kLHintsLeft,0,4,0,0)); |
231 | ((TGCompositeFrame*)mBar->GetParent()->GetParent())->Layout(); | |
06219f85 | 232 | #endif |
7b3eaa01 | 233 | } |
234 | ||
235 | //============================================================================== | |
236 | ||
a13d7c88 | 237 | #include <iostream> |
238 | #include <fstream> | |
239 | #include <string> | |
240 | #include <sstream> | |
241 | ||
242 | using namespace std; | |
243 | ||
3aff0c2e | 244 | namespace |
245 | { | |
246 | const char *gMacroSaveAsTypes[] = {"CINT Macro", "*.C", | |
a13d7c88 | 247 | 0, 0}; //for saving/loading macros |
248 | ||
249 | const char *gPictureSaveAsTypes[] = {"PNG Image", "*.png", | |
250 | 0, 0}; //for saving pictures | |
251 | ||
3aff0c2e | 252 | } |
253 | ||
0790c3e6 | 254 | void AliEveConfigManager::ConnectEventManagerSignals() |
255 | { | |
256 | AliEveEventManager *manager = AliEveEventManager::GetCurrent(); | |
257 | manager->Connect("StorageManagerOk()","AliEveConfigManager",this,"StorageManagerChangedState(=1)"); | |
258 | manager->Connect("StorageManagerDown()","AliEveConfigManager",this,"StorageManagerChangedState(=0)"); | |
259 | } | |
260 | ||
7b3eaa01 | 261 | void AliEveConfigManager::AliEvePopupHandler(Int_t id) |
262 | { | |
263 | // Handle user selections from AliEve popup. | |
264 | ||
265 | static const TEveException kEH("AliEveConfigManager::AliEvePopupHandler "); | |
266 | ||
267 | switch (id) | |
268 | { | |
3aff0c2e | 269 | |
a13d7c88 | 270 | case kAEMDefault: //default geometry and VizDB |
271 | { | |
272 | AliEveMultiView *mv = AliEveMultiView::Instance(); | |
3aff0c2e | 273 | |
a13d7c88 | 274 | mv->DestroyAllGeometries(); //destroy RPhi and Rhoz geometries before putting new |
3aff0c2e | 275 | |
a13d7c88 | 276 | gEve->LoadVizDB("geom_gentle_default.C", kTRUE, kTRUE); //loading geometry |
3aff0c2e | 277 | |
a13d7c88 | 278 | gEve->LoadVizDB("VizDB_scan.C", kTRUE, kTRUE); //loading VizDB |
3aff0c2e | 279 | |
a13d7c88 | 280 | if(!gEve->GetViewers()->UseLightColorSet()) |
281 | gEve->GetViewers()->SwitchColorSet(); //white background | |
3aff0c2e | 282 | |
a13d7c88 | 283 | gEve->FullRedraw3D(); |
284 | ||
3aff0c2e | 285 | break; |
3aff0c2e | 286 | } |
287 | ||
a13d7c88 | 288 | case kAEMScreen: //default geometry with black background |
3aff0c2e | 289 | { |
a13d7c88 | 290 | AliEveMultiView *mv = AliEveMultiView::Instance(); |
3aff0c2e | 291 | |
a13d7c88 | 292 | mv->DestroyAllGeometries(); |
3aff0c2e | 293 | |
294 | gEve->LoadVizDB("geom_gentle_default.C", kTRUE, kTRUE); | |
295 | ||
a13d7c88 | 296 | gEve->LoadVizDB("VizDB_scan_screen.C", kTRUE, kTRUE); |
3aff0c2e | 297 | |
298 | if(gEve->GetViewers()->UseLightColorSet()) | |
299 | gEve->GetViewers()->SwitchColorSet(); | |
300 | ||
a13d7c88 | 301 | gEve->FullRedraw3D(); |
302 | ||
3aff0c2e | 303 | break; |
304 | } | |
305 | ||
a13d7c88 | 306 | case kAEMProjector: //default geometry with white background |
3aff0c2e | 307 | { |
a13d7c88 | 308 | AliEveMultiView *mv = AliEveMultiView::Instance(); |
3aff0c2e | 309 | |
a13d7c88 | 310 | mv->DestroyAllGeometries(); |
3aff0c2e | 311 | |
95fb6e56 | 312 | gEve->LoadVizDB("geom_gentle_projector.C", kTRUE, kTRUE); |
3aff0c2e | 313 | |
a13d7c88 | 314 | gEve->LoadVizDB("VizDB_scan_projector.C", kTRUE, kTRUE); |
3aff0c2e | 315 | |
a13d7c88 | 316 | if(!gEve->GetViewers()->UseLightColorSet()) |
3aff0c2e | 317 | gEve->GetViewers()->SwitchColorSet(); |
318 | ||
319 | gEve->FullRedraw3D(); | |
320 | ||
321 | break; | |
322 | } | |
323 | ||
a13d7c88 | 324 | case kAEMNotransparency: //default geometry with low transparency (5%) |
3aff0c2e | 325 | { |
a13d7c88 | 326 | AliEveMultiView *mv = AliEveMultiView::Instance(); |
3aff0c2e | 327 | |
a13d7c88 | 328 | mv->DestroyAllGeometries(); |
3aff0c2e | 329 | |
a13d7c88 | 330 | gEve->LoadVizDB("geom_gentle_notransparency.C", kTRUE, kTRUE); |
3aff0c2e | 331 | |
a13d7c88 | 332 | gEve->LoadVizDB("VizDB_scan.C", kTRUE, kTRUE); |
3aff0c2e | 333 | |
334 | if(!gEve->GetViewers()->UseLightColorSet()) | |
335 | gEve->GetViewers()->SwitchColorSet(); | |
336 | ||
337 | gEve->FullRedraw3D(); | |
338 | ||
339 | break; | |
340 | } | |
341 | ||
3aff0c2e | 342 | |
a13d7c88 | 343 | case kAEMTransparentDark: //default geometry with black background, high transparency (80%) |
344 | { | |
345 | AliEveMultiView *mv = AliEveMultiView::Instance(); | |
3aff0c2e | 346 | |
a13d7c88 | 347 | mv->DestroyAllGeometries(); |
3aff0c2e | 348 | |
349 | gEve->LoadVizDB("geom_gentle_transparent.C", kTRUE, kTRUE); | |
350 | ||
351 | gEve->LoadVizDB("VizDB_scan_transparentdark.C", kTRUE, kTRUE); | |
352 | ||
353 | if(gEve->GetViewers()->UseLightColorSet()) | |
354 | gEve->GetViewers()->SwitchColorSet(); | |
355 | ||
356 | gEve->FullRedraw3D(); | |
357 | ||
358 | break; | |
359 | } | |
360 | ||
a13d7c88 | 361 | case kAEMTransparentLight: //default geometry with white background, high transparency (80%) |
3aff0c2e | 362 | { |
a13d7c88 | 363 | AliEveMultiView *mv = AliEveMultiView::Instance(); |
3aff0c2e | 364 | |
a13d7c88 | 365 | mv->DestroyAllGeometries(); |
3aff0c2e | 366 | |
367 | gEve->LoadVizDB("geom_gentle_transparent.C", kTRUE, kTRUE); | |
368 | ||
369 | gEve->LoadVizDB("VizDB_scan_transparentlight.C", kTRUE, kTRUE); | |
370 | ||
371 | if(!gEve->GetViewers()->UseLightColorSet()) | |
372 | gEve->GetViewers()->SwitchColorSet(); | |
373 | ||
374 | gEve->FullRedraw3D(); | |
375 | ||
376 | break; | |
377 | } | |
378 | ||
379 | case kAEMTransparentMonoDark: | |
380 | { | |
a13d7c88 | 381 | AliEveMultiView *mv = AliEveMultiView::Instance(); |
3aff0c2e | 382 | |
a13d7c88 | 383 | mv->DestroyAllGeometries(); |
3aff0c2e | 384 | |
385 | gEve->LoadVizDB("geom_gentle_transparentdark.C", kTRUE, kTRUE); | |
386 | ||
387 | gEve->LoadVizDB("VizDB_scan_transparentdark.C", kTRUE, kTRUE); | |
388 | ||
389 | if(gEve->GetViewers()->UseLightColorSet()) | |
390 | gEve->GetViewers()->SwitchColorSet(); | |
391 | ||
392 | gEve->FullRedraw3D(); | |
393 | ||
394 | break; | |
395 | } | |
396 | ||
397 | case kAEMTransparentMonoLight: | |
398 | { | |
a13d7c88 | 399 | AliEveMultiView *mv = AliEveMultiView::Instance(); |
3aff0c2e | 400 | |
a13d7c88 | 401 | mv->DestroyAllGeometries(); |
3aff0c2e | 402 | |
403 | gEve->LoadVizDB("geom_gentle_transparentlight.C", kTRUE, kTRUE); | |
404 | ||
405 | gEve->LoadVizDB("VizDB_scan_transparentlight.C", kTRUE, kTRUE); | |
406 | ||
407 | if(!gEve->GetViewers()->UseLightColorSet()) | |
408 | gEve->GetViewers()->SwitchColorSet(); | |
409 | ||
410 | gEve->FullRedraw3D(); | |
411 | ||
412 | break; | |
413 | } | |
414 | ||
a13d7c88 | 415 | case kAEMGreen: |
416 | { | |
417 | AliEveMultiView *mv = AliEveMultiView::Instance(); | |
418 | ||
419 | mv->DestroyAllGeometries(); | |
420 | ||
421 | gEve->LoadVizDB("geom_gentle_green.C", kTRUE, kTRUE); | |
422 | ||
423 | gEve->LoadVizDB("VizDB_scan.C", kTRUE, kTRUE); | |
424 | ||
425 | if(!gEve->GetViewers()->UseLightColorSet()) | |
426 | gEve->GetViewers()->SwitchColorSet(); | |
427 | ||
428 | gEve->FullRedraw3D(); | |
429 | ||
430 | break; | |
431 | } | |
432 | ||
433 | case kAEMBright: | |
3aff0c2e | 434 | { |
a13d7c88 | 435 | AliEveMultiView *mv = AliEveMultiView::Instance(); |
3aff0c2e | 436 | |
a13d7c88 | 437 | mv->DestroyAllGeometries(); |
3aff0c2e | 438 | |
a13d7c88 | 439 | gEve->LoadVizDB("geom_gentle_bright.C", kTRUE, kTRUE); |
440 | ||
441 | gEve->LoadVizDB("VizDB_scan.C", kTRUE, kTRUE); | |
442 | ||
443 | if(gEve->GetViewers()->UseLightColorSet()) | |
444 | gEve->GetViewers()->SwitchColorSet(); | |
445 | ||
446 | gEve->FullRedraw3D(); | |
447 | ||
448 | break; | |
449 | } | |
450 | ||
451 | case kAEMYellow: | |
452 | { | |
453 | AliEveMultiView *mv = AliEveMultiView::Instance(); | |
3aff0c2e | 454 | |
a13d7c88 | 455 | mv->DestroyAllGeometries(); |
456 | ||
457 | gEve->LoadVizDB("geom_gentle_yellow.C", kTRUE, kTRUE); | |
458 | ||
459 | gEve->LoadVizDB("VizDB_scan_yellow.C", kTRUE, kTRUE); | |
460 | ||
461 | if(!gEve->GetViewers()->UseLightColorSet()) | |
462 | gEve->GetViewers()->SwitchColorSet(); | |
463 | ||
464 | gEve->FullRedraw3D(); | |
465 | ||
466 | break; | |
467 | } | |
468 | ||
469 | case kAEMTpc: | |
470 | { | |
471 | AliEveMultiView *mv = AliEveMultiView::Instance(); | |
472 | ||
473 | mv->DestroyAllGeometries(); | |
3aff0c2e | 474 | |
475 | gEve->LoadVizDB("geom_gentle_tpc.C", kTRUE, kTRUE); | |
476 | ||
477 | gEve->LoadVizDB("VizDB_scan_tpc.C", kTRUE, kTRUE); | |
478 | ||
479 | if(!gEve->GetViewers()->UseLightColorSet()) | |
480 | gEve->GetViewers()->SwitchColorSet(); | |
481 | ||
482 | gEve->FullRedraw3D(); | |
483 | ||
7b3eaa01 | 484 | break; |
485 | } | |
486 | ||
a13d7c88 | 487 | case kAEMAll: //saving pictures from all three viewers |
488 | { | |
489 | ||
490 | TGFileInfo fi; | |
491 | fi.fFileTypes = gPictureSaveAsTypes; | |
492 | fi.fIniDir = StrDup(""); // current directory | |
493 | fi.fFileTypeIdx = 0; | |
494 | fi.fOverwrite = kTRUE; | |
495 | new TGFileDialog(gClient->GetDefaultRoot(), | |
496 | gEve->GetMainWindow(), kFDSave, &fi); // dialog | |
497 | if (!fi.fFilename) return; | |
498 | ||
499 | TPMERegexp filere(".*/([^/]+$)"); | |
500 | if (filere.Match(fi.fFilename) != 2) | |
501 | { | |
502 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
503 | return; | |
504 | } | |
505 | ||
506 | TString file1(filere[1]); | |
507 | TString file2(filere[1]); | |
508 | TString file3(filere[1]); | |
509 | ||
510 | if (!file1.EndsWith(".png")) | |
511 | file1 += "_3D.png"; // adding extensions | |
512 | ||
513 | if (!file2.EndsWith(".png")) | |
514 | file2 += "_RPhi.png"; // adding extensions | |
515 | ||
516 | if (!file3.EndsWith(".png")) | |
517 | file3 += "_RhoZ.png"; // adding extensions | |
518 | ||
519 | gSystem->ChangeDirectory(fi.fIniDir); | |
520 | ||
521 | printf("Saving...\n"); | |
522 | ||
523 | TEveViewerList *viewers = gEve->GetViewers(); | |
524 | TEveElement::List_i i = viewers->BeginChildren(); | |
525 | i++; | |
526 | TEveViewer* view3d = ((TEveViewer*)*i); | |
527 | view3d->GetGLViewer()->SavePicture(file1); // saving pictures | |
528 | i++; | |
529 | TEveViewer* viewrphi = ((TEveViewer*)*i); | |
530 | viewrphi->GetGLViewer()->SavePicture(file2); // saving pictures | |
531 | i++; | |
532 | TEveViewer* viewrhoz = ((TEveViewer*)*i); | |
533 | viewrhoz->GetGLViewer()->SavePicture(file3); // saving pictures | |
534 | ||
535 | printf("Done.\n"); | |
536 | ||
537 | break; | |
538 | } | |
539 | ||
540 | case kAEM3d: // saving only 3d view | |
541 | { | |
542 | ||
543 | TGFileInfo fi; | |
544 | fi.fFileTypes = gPictureSaveAsTypes; | |
545 | fi.fIniDir = StrDup(""); // current directory | |
546 | fi.fFileTypeIdx = 0; | |
547 | fi.fOverwrite = kTRUE; | |
548 | new TGFileDialog(gClient->GetDefaultRoot(), | |
549 | gEve->GetMainWindow(), kFDSave, &fi); | |
550 | if (!fi.fFilename) return; | |
551 | ||
552 | TPMERegexp filere(".*/([^/]+$)"); | |
553 | if (filere.Match(fi.fFilename) != 2) | |
554 | { | |
555 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
556 | return; | |
557 | } | |
558 | ||
559 | TString file1(filere[1]); | |
560 | ||
561 | if (!file1.EndsWith(".png")) | |
562 | file1 += ".png"; | |
563 | ||
564 | gSystem->ChangeDirectory(fi.fIniDir); | |
565 | ||
566 | printf("Saving...\n"); | |
567 | ||
568 | TEveViewerList *viewers = gEve->GetViewers(); | |
569 | TEveElement::List_i i = viewers->BeginChildren(); | |
570 | i++; | |
571 | TEveViewer* view3d = ((TEveViewer*)*i); | |
572 | view3d->GetGLViewer()->SavePicture(file1); | |
573 | ||
574 | printf("Done.\n"); | |
575 | ||
576 | break; | |
577 | } | |
578 | ||
579 | case kAEMRphi: // saving only RPhi view | |
580 | { | |
581 | ||
582 | TGFileInfo fi; | |
583 | fi.fFileTypes = gPictureSaveAsTypes; | |
584 | fi.fIniDir = StrDup(""); // current directory | |
585 | fi.fFileTypeIdx = 0; | |
586 | fi.fOverwrite = kTRUE; | |
587 | new TGFileDialog(gClient->GetDefaultRoot(), | |
588 | gEve->GetMainWindow(), kFDSave, &fi); | |
589 | if (!fi.fFilename) return; | |
590 | ||
591 | TPMERegexp filere(".*/([^/]+$)"); | |
592 | if (filere.Match(fi.fFilename) != 2) | |
593 | { | |
594 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
595 | return; | |
596 | } | |
597 | ||
598 | TString file1(filere[1]); | |
599 | ||
600 | if (!file1.EndsWith(".png")) | |
601 | file1 += ".png"; | |
602 | ||
603 | gSystem->ChangeDirectory(fi.fIniDir); | |
604 | ||
605 | printf("Saving...\n"); | |
606 | ||
607 | TEveViewerList *viewers = gEve->GetViewers(); | |
608 | TEveElement::List_i i = viewers->BeginChildren(); | |
609 | i++; | |
610 | i++; | |
611 | TEveViewer* viewrphi = ((TEveViewer*)*i); | |
612 | viewrphi->GetGLViewer()->SavePicture(file1); | |
613 | ||
614 | printf("Done.\n"); | |
615 | ||
616 | break; | |
617 | } | |
618 | ||
619 | case kAEMRhoz: // saving only RhoZ view | |
620 | { | |
621 | ||
622 | TGFileInfo fi; | |
95fb6e56 | 623 | fi.fFileTypes = gPictureSaveAsTypes; |
a13d7c88 | 624 | fi.fIniDir = StrDup(""); // current directory |
625 | fi.fFileTypeIdx = 0; | |
626 | fi.fOverwrite = kTRUE; | |
627 | new TGFileDialog(gClient->GetDefaultRoot(), | |
628 | gEve->GetMainWindow(), kFDSave, &fi); | |
629 | if (!fi.fFilename) return; | |
630 | ||
631 | TPMERegexp filere(".*/([^/]+$)"); | |
632 | if (filere.Match(fi.fFilename) != 2) | |
633 | { | |
634 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
635 | return; | |
636 | } | |
637 | ||
638 | TString file1(filere[1]); | |
639 | ||
640 | if (!file1.EndsWith(".png")) | |
641 | file1 += ".png"; | |
642 | ||
643 | gSystem->ChangeDirectory(fi.fIniDir); | |
644 | ||
645 | printf("Saving...\n"); | |
646 | ||
647 | TEveViewerList *viewers = gEve->GetViewers(); | |
648 | TEveElement::List_i i = viewers->BeginChildren(); | |
649 | i++; | |
650 | i++; | |
651 | i++; | |
652 | TEveViewer* viewrhoz = ((TEveViewer*)*i); | |
653 | viewrhoz->GetGLViewer()->SavePicture(file1); | |
654 | ||
655 | printf("Done.\n"); | |
656 | ||
657 | break; | |
658 | } | |
659 | ||
660 | case kAEMAllhr: // saving all three views in high resolution | |
661 | { | |
662 | ||
663 | TGFileInfo fi; | |
664 | fi.fFileTypes = gPictureSaveAsTypes; | |
665 | fi.fIniDir = StrDup(""); // current directory | |
666 | fi.fFileTypeIdx = 0; | |
667 | fi.fOverwrite = kTRUE; | |
668 | new TGFileDialog(gClient->GetDefaultRoot(), | |
669 | gEve->GetMainWindow(), kFDSave, &fi); | |
670 | if (!fi.fFilename) return; | |
671 | ||
672 | TPMERegexp filere(".*/([^/]+$)"); | |
673 | if (filere.Match(fi.fFilename) != 2) | |
674 | { | |
675 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
676 | return; | |
677 | } | |
678 | ||
679 | TString file1(filere[1]); | |
680 | TString file2(filere[1]); | |
681 | TString file3(filere[1]); | |
682 | ||
683 | if (!file1.EndsWith(".png")) | |
684 | file1 += "_3D.png"; | |
685 | ||
686 | if (!file2.EndsWith(".png")) | |
687 | file2 += "_RPhi.png"; | |
688 | ||
689 | if (!file3.EndsWith(".png")) | |
690 | file3 += "_RhoZ.png"; | |
691 | ||
692 | gSystem->ChangeDirectory(fi.fIniDir); | |
693 | ||
694 | printf("Saving...\n"); | |
695 | ||
696 | TEveViewerList *viewers = gEve->GetViewers(); | |
697 | TEveElement::List_i i = viewers->BeginChildren(); | |
698 | i++; | |
699 | TEveViewer* view3d = ((TEveViewer*)*i); | |
6aafad45 | 700 | view3d->GetGLViewer()->SavePictureScale(file1,6.0); // getting high resolution |
a13d7c88 | 701 | i++; |
702 | TEveViewer* viewrphi = ((TEveViewer*)*i); | |
6aafad45 | 703 | viewrphi->GetGLViewer()->SavePictureScale(file2,6.0); |
a13d7c88 | 704 | i++; |
705 | TEveViewer* viewrhoz = ((TEveViewer*)*i); | |
6aafad45 | 706 | viewrhoz->GetGLViewer()->SavePictureScale(file3,6.0); |
a13d7c88 | 707 | |
708 | printf("Done.\n"); | |
709 | ||
710 | break; | |
711 | } | |
712 | ||
713 | case kAEM3dhr: // saving only 3d view in high resolution | |
714 | { | |
715 | ||
716 | TGFileInfo fi; | |
717 | fi.fFileTypes = gPictureSaveAsTypes; | |
718 | fi.fIniDir = StrDup(""); // current directory | |
719 | fi.fFileTypeIdx = 0; | |
720 | fi.fOverwrite = kTRUE; | |
721 | new TGFileDialog(gClient->GetDefaultRoot(), | |
722 | gEve->GetMainWindow(), kFDSave, &fi); | |
723 | if (!fi.fFilename) return; | |
724 | ||
725 | TPMERegexp filere(".*/([^/]+$)"); | |
726 | if (filere.Match(fi.fFilename) != 2) | |
727 | { | |
728 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
729 | return; | |
730 | } | |
731 | ||
732 | TString file1(filere[1]); | |
733 | ||
734 | if (!file1.EndsWith(".png")) | |
735 | file1 += ".png"; | |
736 | ||
737 | gSystem->ChangeDirectory(fi.fIniDir); | |
738 | ||
739 | printf("Saving...\n"); | |
740 | ||
741 | TEveViewerList *viewers = gEve->GetViewers(); | |
742 | TEveElement::List_i i = viewers->BeginChildren(); | |
743 | i++; | |
744 | TEveViewer* view3d = ((TEveViewer*)*i); | |
745 | view3d->GetGLViewer()->SavePictureScale(file1,4.0); | |
746 | ||
747 | printf("Done.\n"); | |
748 | ||
749 | break; | |
750 | } | |
751 | ||
752 | case kAEMRphihr: // saving only RPhi view in high resolution | |
753 | { | |
754 | ||
755 | TGFileInfo fi; | |
756 | fi.fFileTypes = gPictureSaveAsTypes; | |
757 | fi.fIniDir = StrDup(""); // current directory | |
758 | fi.fFileTypeIdx = 0; | |
759 | fi.fOverwrite = kTRUE; | |
760 | new TGFileDialog(gClient->GetDefaultRoot(), | |
761 | gEve->GetMainWindow(), kFDSave, &fi); | |
762 | if (!fi.fFilename) return; | |
763 | ||
764 | TPMERegexp filere(".*/([^/]+$)"); | |
765 | if (filere.Match(fi.fFilename) != 2) | |
766 | { | |
767 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
768 | return; | |
769 | } | |
770 | ||
771 | TString file1(filere[1]); | |
772 | ||
773 | if (!file1.EndsWith(".png")) | |
774 | file1 += ".png"; | |
775 | ||
776 | gSystem->ChangeDirectory(fi.fIniDir); | |
777 | ||
778 | printf("Saving...\n"); | |
779 | ||
780 | TEveViewerList *viewers = gEve->GetViewers(); | |
781 | TEveElement::List_i i = viewers->BeginChildren(); | |
782 | i++; | |
783 | i++; | |
784 | TEveViewer* viewrphi = ((TEveViewer*)*i); | |
785 | viewrphi->GetGLViewer()->SavePictureScale(file1,4.0); | |
786 | ||
787 | printf("Done.\n"); | |
788 | ||
789 | break; | |
790 | } | |
791 | ||
792 | case kAEMRhozhr: // saving only RhoZ view in high resolution | |
793 | { | |
794 | ||
795 | TGFileInfo fi; | |
95fb6e56 | 796 | fi.fFileTypes = gPictureSaveAsTypes; |
a13d7c88 | 797 | fi.fIniDir = StrDup(""); // current directory |
798 | fi.fFileTypeIdx = 0; | |
799 | fi.fOverwrite = kTRUE; | |
800 | new TGFileDialog(gClient->GetDefaultRoot(), | |
801 | gEve->GetMainWindow(), kFDSave, &fi); | |
802 | if (!fi.fFilename) return; | |
803 | ||
804 | TPMERegexp filere(".*/([^/]+$)"); | |
805 | if (filere.Match(fi.fFilename) != 2) | |
806 | { | |
807 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
808 | return; | |
809 | } | |
810 | ||
811 | TString file1(filere[1]); | |
812 | ||
813 | if (!file1.EndsWith(".png")) | |
814 | file1 += ".png"; | |
815 | ||
816 | gSystem->ChangeDirectory(fi.fIniDir); | |
817 | ||
818 | printf("Saving...\n"); | |
819 | ||
820 | TEveViewerList *viewers = gEve->GetViewers(); | |
821 | TEveElement::List_i i = viewers->BeginChildren(); | |
822 | i++; | |
823 | i++; | |
824 | i++; | |
825 | TEveViewer* viewrhoz = ((TEveViewer*)*i); | |
826 | viewrhoz->GetGLViewer()->SavePictureScale(file1,4.0); | |
827 | ||
828 | printf("Done.\n"); | |
829 | ||
830 | break; | |
831 | } | |
832 | ||
833 | case kAEMSavemacros:// Saving Data Selection macros | |
834 | { | |
835 | ||
836 | AliEveMacroExecutor *exec = AliEveEventManager::GetMaster()->GetExecutor(); | |
837 | ||
838 | exec->SaveAddedMacros(); | |
839 | ||
840 | break; | |
841 | } | |
842 | ||
843 | case kAEMLoadmacros://Loading Data Selection macros | |
844 | { | |
845 | ||
846 | TEveBrowser *browser = gEve->GetBrowser(); | |
847 | browser->ShowCloseTab(kFALSE); | |
848 | ||
849 | if(fLoadCheck) | |
850 | browser->RemoveTab(TRootBrowser::kRight, 5);//remove the tab with previous DataSelection window | |
851 | else | |
852 | browser->RemoveTab(TRootBrowser::kRight, 2); | |
853 | ||
854 | ||
855 | TGFileInfo fi; | |
856 | fi.fFileTypes = gMacroSaveAsTypes; | |
857 | fi.fIniDir = StrDup(""); // current directory | |
858 | fi.fFileTypeIdx = 0; | |
859 | fi.fOverwrite = kTRUE; | |
860 | new TGFileDialog(gClient->GetDefaultRoot(), gEve->GetMainWindow(), kFDOpen, &fi);//dialog | |
861 | if (!fi.fFilename) return; | |
862 | ||
863 | TPMERegexp filere(".*/([^/]+$)"); | |
864 | if (filere.Match(fi.fFilename) != 2) | |
865 | { | |
866 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
867 | return; | |
868 | } | |
869 | printf("Loading...\n"); | |
870 | ||
871 | TString file(filere[1]); | |
872 | gSystem->ChangeDirectory(fi.fIniDir); | |
873 | ||
874 | TEveUtil::Macro(file);//run macro | |
875 | ||
876 | AliEveEventManager *eman = AliEveEventManager::GetMaster();//reload event (gEve->Refresh() crashes) | |
877 | Int_t ev = eman->GetEventId(); | |
878 | eman->Close(); | |
879 | eman->Open(); | |
880 | eman->GotoEvent(ev); | |
881 | ||
882 | printf("Done.\n"); | |
883 | ||
884 | fLoadCheck = kTRUE; | |
885 | ||
886 | break; | |
887 | ||
888 | } | |
889 | ||
890 | case kAEMSave://saving VizDB | |
891 | { | |
892 | TGFileInfo fi; | |
893 | fi.fFileTypes = gMacroSaveAsTypes; | |
894 | fi.fIniDir = StrDup(""); // current directory | |
895 | fi.fFileTypeIdx = 0; | |
896 | fi.fOverwrite = kTRUE; | |
897 | new TGFileDialog(gClient->GetDefaultRoot(), gEve->GetMainWindow(), kFDSave, &fi); | |
898 | if (!fi.fFilename) return; | |
899 | ||
900 | TPMERegexp filere(".*/([^/]+$)"); | |
901 | if (filere.Match(fi.fFilename) != 2) | |
902 | { | |
903 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
904 | return; | |
905 | } | |
906 | printf("Saving...\n"); | |
907 | ||
908 | TString file(filere[1]); | |
909 | if (!file.EndsWith(".C")) | |
910 | file += ".C"; | |
911 | gSystem->ChangeDirectory(fi.fIniDir); | |
912 | gEve->SaveVizDB(file); | |
913 | ||
914 | //Last line "gEve->SaveVizDB(file);" gives macro with many unnecessary | |
915 | //lines like "x038->SetMinPt(0);" tahat are not interpreted properly later | |
916 | ||
917 | string text; | |
918 | string all; | |
919 | ||
920 | ifstream myfile1(file); | |
921 | if(myfile1.is_open()) | |
922 | { | |
923 | while(!myfile1.eof()) | |
924 | { | |
925 | getline(myfile1,text); | |
926 | TString check(text); | |
927 | if(!(check.EndsWith("MinPt(0);")||check.EndsWith("MaxPt(0);") | |
928 | ||check.EndsWith("LimPt(0);")||check.EndsWith("MinP(0);") | |
929 | ||check.EndsWith("MaxP(0);")||check.EndsWith("LimP(0);"))) | |
930 | { | |
931 | all += text; //Cut off unnecessary lines and bring everything together | |
932 | all += "\n"; | |
933 | } | |
934 | } | |
935 | myfile1.close(); | |
936 | } | |
937 | ||
938 | ofstream myfile2(file); //Replacing old file with the one without "bad" lines | |
939 | myfile2 << all; | |
940 | myfile2.close(); | |
941 | ||
942 | printf("Done.\n"); | |
943 | break; | |
944 | ||
945 | } | |
946 | ||
947 | case kAEMOpen://Opening VizDB | |
948 | { | |
949 | TGFileInfo fi; | |
950 | fi.fFileTypes = gMacroSaveAsTypes; | |
951 | fi.fIniDir = StrDup(""); // current directory | |
952 | fi.fFileTypeIdx = 0; | |
953 | fi.fOverwrite = kTRUE; | |
954 | new TGFileDialog(gClient->GetDefaultRoot(), gEve->GetMainWindow(), kFDOpen, &fi); | |
955 | if (!fi.fFilename) return; | |
956 | ||
957 | TPMERegexp filere(".*/([^/]+$)"); | |
958 | if (filere.Match(fi.fFilename) != 2) | |
959 | { | |
960 | Warning("AliEvePopupHandler", "file '%s' bad.", fi.fFilename); | |
961 | return; | |
962 | } | |
963 | printf("Opening...\n"); | |
964 | ||
965 | TString file(filere[1]); | |
966 | ||
967 | gSystem->ChangeDirectory(fi.fIniDir); | |
968 | ||
969 | gEve->LoadVizDB(file, kTRUE, kTRUE); | |
970 | ||
971 | gEve->Redraw3D(kTRUE); | |
972 | ||
973 | printf("Done.\n"); | |
974 | break; | |
975 | ||
976 | } | |
977 | ||
d4476392 | 978 | case kAEMSetDefault://Restore default settings |
979 | { | |
980 | ||
981 | printf("Setting...\n"); | |
982 | ||
983 | TEveBrowser *browser = gEve->GetBrowser(); | |
984 | browser->ShowCloseTab(kFALSE); | |
985 | ||
986 | if(fLoadCheck) | |
987 | browser->RemoveTab(TRootBrowser::kRight, 5);//remove the tab with previous DataSelection window | |
988 | else | |
989 | browser->RemoveTab(TRootBrowser::kRight, 2); | |
990 | ||
991 | TEveUtil::Macro("geom_gentle_default.C"); | |
992 | gEve->LoadVizDB("VizDB_scan.C", kTRUE, kTRUE); | |
993 | TEveUtil::Macro("DataSelection_init.C"); | |
994 | ||
995 | if(!gEve->GetViewers()->UseLightColorSet()) | |
996 | gEve->GetViewers()->SwitchColorSet(); //white background | |
997 | ||
998 | AliEveEventManager *eman = AliEveEventManager::GetMaster();//reload event (gEve->Refresh() crashes) | |
999 | Int_t ev = eman->GetEventId(); | |
1000 | eman->Close(); | |
1001 | eman->Open(); | |
1002 | eman->GotoEvent(ev); | |
1003 | ||
1004 | printf("Done.\n"); | |
1005 | ||
1006 | fLoadCheck = kTRUE; | |
1007 | ||
1008 | gEve->Redraw3D(kTRUE); | |
1009 | ||
1010 | ||
1011 | } | |
1012 | ||
6aafad45 | 1013 | /* |
1014 | case kAEMResiduals: | |
1015 | { | |
1016 | ||
1017 | TEveUtil::Macro("make_residuals.C"); | |
1018 | ||
1019 | break; | |
1020 | ||
1021 | } | |
1022 | */ | |
1023 | ||
1024 | case kAEMCuts: | |
1025 | { | |
1026 | ||
1027 | TEveUtil::Macro("alieve_set_cuts.C"); | |
1028 | ||
1029 | break; | |
1030 | ||
1031 | } | |
1032 | ||
1033 | case kAEMVectors: | |
1034 | { | |
1035 | ||
1036 | TEveUtil::Macro("set_momentum_vectors.C"); | |
1037 | ||
1038 | break; | |
1039 | ||
1040 | } | |
1041 | ||
1042 | /* | |
1043 | case kAEMGui: | |
1044 | { | |
1045 | ||
1046 | TEveUtil::Macro("alieve_gui_mode.C"); | |
1047 | ||
1048 | break; | |
1049 | ||
1050 | } | |
1051 | */ | |
fae81379 | 1052 | /* |
0790c3e6 | 1053 | case kStorageListEvents: |
1054 | { | |
9211a1f1 | 1055 | #ifdef ZMQ |
0790c3e6 | 1056 | fListEventsWindow = |
1057 | AliStorageAdministratorPanelListEvents::GetInstance(); | |
1058 | ||
1059 | fListEventsWindow->Connect("SelectedEvent()","AliEveConfigManager",this,"SetEventInEventManager()"); | |
1060 | #endif | |
1061 | break; | |
1062 | ||
1063 | } | |
fae81379 | 1064 | */ |
0790c3e6 | 1065 | case kStorageMarkEvent: |
1066 | { | |
9211a1f1 | 1067 | #ifdef ZMQ |
0790c3e6 | 1068 | AliStorageAdministratorPanelMarkEvent *markEventWindow = |
1069 | AliStorageAdministratorPanelMarkEvent::GetInstance(); | |
9211a1f1 | 1070 | #endif |
0790c3e6 | 1071 | break; |
1072 | } | |
1073 | ||
1074 | default: | |
1075 | { | |
1076 | Warning(kEH, "Unknown menu entry."); | |
1077 | break; | |
1078 | } | |
7b3eaa01 | 1079 | } |
1080 | } | |
164d3d29 | 1081 | |
1082 | void AliEveConfigManager::SetEventInEventManager() | |
1083 | { | |
1084 | AliEveEventManager *manager = AliEveEventManager::GetMaster(); | |
fae81379 | 1085 | AliESDEvent *event = fListEventsTab->GetSelectedEvent(); |
164d3d29 | 1086 | |
1087 | if(event) | |
1088 | { | |
1089 | cout<<"SETTING EVENT IN ED"<<endl; | |
1090 | //fListEventsWindow->onExit(); | |
1091 | manager->SetAutoLoad(kFALSE); | |
1092 | manager->PrepareForNewEvent(event); | |
1093 | } | |
0790c3e6 | 1094 | } |
1095 | ||
1096 | void AliEveConfigManager::StorageManagerChangedState(int state) | |
1097 | { | |
01ca7d6f | 1098 | AliEveEventManager *manager = AliEveEventManager::GetMaster(); |
1099 | AliStorageAdministratorPanelListEvents* listEventsTab = AliStorageAdministratorPanelListEvents::GetInstance(); | |
1100 | ||
1101 | if (manager->IsOnlineMode()) { | |
0790c3e6 | 1102 | if (state == 0)// storage manager is down |
01ca7d6f | 1103 | { |
0790c3e6 | 1104 | fStoragePopup->DisableEntry(kStorageMarkEvent); |
01ca7d6f | 1105 | listEventsTab->SetOfflineMode(kTRUE); |
1106 | ||
1107 | } | |
0790c3e6 | 1108 | else if(state == 1)// storage manager is alive |
01ca7d6f | 1109 | { |
0790c3e6 | 1110 | fStoragePopup->EnableEntry(kStorageMarkEvent); |
01ca7d6f | 1111 | listEventsTab->SetOfflineMode(kFALSE); |
1112 | ||
1113 | } | |
1114 | } | |
1115 | } | |
1116 | ||
1117 | void AliEveConfigManager::DisableStoragePopup(){ | |
1118 | fStoragePopup->DisableEntry(kStorageMarkEvent); | |
164d3d29 | 1119 | } |
1120 | ||
1121 |