]>
Commit | Line | Data |
---|---|---|
bf4d93eb | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // $Id$ | |
17 | ||
90037e4e | 18 | #include "AliMUONMchViewApplication.h" |
19 | ||
20 | #include "AliCDBManager.h" | |
21 | #include "AliCodeTimer.h" | |
22 | #include "AliLog.h" | |
fef32488 | 23 | #include "AliMUONChamberPainter.h" |
24 | #include "AliMUONDEPainter.h" | |
8f0acce4 | 25 | #include "AliMUONPainterDataRegistry.h" |
90037e4e | 26 | #include "AliMUONPainterDataSourceFrame.h" |
49419555 | 27 | #include "AliMUONPainterEnv.h" |
90037e4e | 28 | #include "AliMUONPainterHelper.h" |
29 | #include "AliMUONPainterMasterFrame.h" | |
30 | #include "AliMUONPainterRegistry.h" | |
49419555 | 31 | #include "AliMUONTrackerDataCompareDialog.h" |
32 | #include "AliMUONTrackerDataWrapper.h" | |
90037e4e | 33 | #include "AliMUONVTrackerData.h" |
49419555 | 34 | #include "AliMUONVTrackerDataMaker.h" |
90037e4e | 35 | #include <Riostream.h> |
36 | #include <TCanvas.h> | |
37 | #include <TEnv.h> | |
38 | #include <TFile.h> | |
39 | #include <TGClient.h> | |
40 | #include <TGFileDialog.h> | |
41 | #include <TGMenu.h> | |
42 | #include <TGTab.h> | |
49419555 | 43 | #include <TGTextView.h> |
44 | #include <TGrid.h> | |
90037e4e | 45 | #include <TKey.h> |
46 | #include <TList.h> | |
49419555 | 47 | #include <TRegexp.h> |
90037e4e | 48 | #include <TString.h> |
49 | #include <TSystem.h> | |
50 | ||
51 | /// \class AliMUONMchViewApplication | |
52 | /// | |
53 | /// Main class for the mchview program | |
54 | /// | |
55 | ///\author Laurent Aphecetche, Subatech | |
56 | ||
57 | /// \cond CLASSIMP | |
58 | ClassImp(AliMUONMchViewApplication) | |
59 | /// \endcond CLASSIMP | |
60 | ||
61 | const Int_t AliMUONMchViewApplication::fgkFILESAVEAS(1); | |
62 | const Int_t AliMUONMchViewApplication::fgkFILEOPEN(2); | |
63 | const Int_t AliMUONMchViewApplication::fgkFILEEXIT(3); | |
10eb3d17 | 64 | const Int_t AliMUONMchViewApplication::fgkFILEPRINTAS(4); |
49419555 | 65 | const Int_t AliMUONMchViewApplication::fgkABOUT(5); |
66 | const Int_t AliMUONMchViewApplication::fgkCOMPAREDATA(6); | |
10eb3d17 | 67 | |
68 | const char* AliMUONMchViewApplication::fgkFileTypes[] = { | |
69 | "ROOT files", "*.root", | |
70 | "All files", "*", | |
71 | 0, 0 }; | |
90037e4e | 72 | |
73 | //______________________________________________________________________________ | |
74 | AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name, | |
75 | int* argc, char** argv, | |
1ffbeb9d | 76 | UInt_t w, UInt_t h, |
77 | UInt_t ox, UInt_t oy) | |
90037e4e | 78 | : TRint(name,argc,argv), |
10eb3d17 | 79 | fMainFrame(0x0), |
80 | fPainterMasterFrame(0x0) | |
90037e4e | 81 | { |
82 | ||
83 | /// ctor | |
1ffbeb9d | 84 | /// (w,h) is the size in pixel (if 0,0 it will be computed as 70%,90% of display size) |
85 | /// (ox,oy) is the offset from the top-left of the display | |
86 | ||
87 | if (!w | !h) | |
88 | { | |
89 | w = (UInt_t)(gClient->GetDisplayWidth()*0.7); | |
90 | h = (UInt_t)(gClient->GetDisplayHeight()*0.9); | |
91 | } | |
90037e4e | 92 | |
93 | fMainFrame = new TGMainFrame(gClient->GetRoot(),w,h); | |
fef32488 | 94 | |
95 | AliMUONPainterHelper::Instance()->GenerateDefaultMatrices(); | |
96 | ||
90037e4e | 97 | CreateMenuBar(w); |
98 | ||
99 | const Int_t kbs = 2; | |
100 | ||
101 | // h -= 60; // menubar | |
102 | ||
103 | TGTab* tabs = new TGTab(fMainFrame,w,h); | |
104 | ||
105 | TGCompositeFrame* t = tabs->AddTab("Painter Master Frame"); | |
106 | ||
10eb3d17 | 107 | fPainterMasterFrame = |
90037e4e | 108 | new AliMUONPainterMasterFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2); |
109 | ||
10eb3d17 | 110 | t->AddFrame(fPainterMasterFrame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs)); |
90037e4e | 111 | |
112 | t = tabs->AddTab("Data Sources"); | |
113 | ||
114 | AliMUONPainterDataSourceFrame* dsf = | |
115 | new AliMUONPainterDataSourceFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2); | |
116 | ||
117 | t->AddFrame(dsf,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs)); | |
118 | ||
119 | fMainFrame->AddFrame(tabs,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0)); | |
120 | ||
121 | fMainFrame->SetWindowName("mchview - Visualization of MUON Tracker detector"); | |
122 | ||
123 | fMainFrame->MapSubwindows(); | |
124 | fMainFrame->Resize(); | |
10eb3d17 | 125 | |
126 | fPainterMasterFrame->Update(); | |
127 | ||
90037e4e | 128 | fMainFrame->MapWindow(); |
129 | ||
130 | fMainFrame->Connect("CloseWindow()","AliMUONMchViewApplication",this,"Terminate()"); | |
1ffbeb9d | 131 | |
132 | fMainFrame->MoveResize(ox,oy, w, h); | |
133 | fMainFrame->SetWMPosition(ox, oy); | |
90037e4e | 134 | fMainFrame->SetWMSizeHints(w,h,w,h,0,0); |
10eb3d17 | 135 | |
136 | cout << "***************************************************" << endl; | |
137 | cout << " Welcome to mchview" << endl; | |
138 | cout << " " << FullVersion() << endl; | |
139 | cout << "***************************************************" << endl; | |
fef32488 | 140 | |
141 | // Trying to see if we're requested to draw something specific instead | |
142 | // of the global view of all the chambers | |
143 | ||
144 | AliMUONVPainter* painter(0x0); | |
145 | TObjArray args; | |
146 | args.SetOwner(kTRUE); | |
147 | ||
148 | for ( int i = 1; i < argc[0]; ++i ) | |
149 | { | |
150 | args.Add(new TObjString(argv[i])); | |
151 | } | |
152 | ||
153 | for ( Int_t i = 0; i <= args.GetLast(); ++i ) | |
154 | { | |
155 | TString a(static_cast<TObjString*>(args.At(i))->String()); | |
10eb3d17 | 156 | |
fef32488 | 157 | AliMUONAttPainter att; |
158 | ||
159 | att.SetPlane(kTRUE,kFALSE); | |
160 | att.SetCathode(kFALSE,kFALSE); | |
161 | att.SetViewPoint(kTRUE,kFALSE); | |
162 | ||
163 | if ( a == "--de" ) | |
164 | { | |
165 | Int_t detElemId = static_cast<TObjString*>(args.At(i+1))->String().Atoi(); | |
166 | ||
167 | painter = new AliMUONDEPainter(att,detElemId); | |
168 | ||
169 | painter->SetOutlined("*",kFALSE); | |
170 | painter->SetOutlined("BUSPATCH",kTRUE); | |
171 | ||
172 | painter->SetLine(1,4,3); | |
173 | ++i; | |
174 | } | |
175 | ||
176 | if ( a == "--chamber" ) | |
177 | { | |
178 | Int_t chamberId = static_cast<TObjString*>(args.At(i+1))->String().Atoi(); | |
179 | ||
180 | painter = new AliMUONChamberPainter(att,chamberId-1); | |
181 | ||
182 | painter->SetOutlined("*",kFALSE); | |
183 | painter->SetOutlined("DE",kTRUE); | |
184 | ||
185 | painter->SetLine(1,4,3); | |
186 | ++i; | |
187 | } | |
188 | ||
189 | } | |
190 | ||
191 | if ( painter ) | |
192 | { | |
193 | fPainterMasterFrame->ShiftClicked(painter,0x0); | |
194 | ||
195 | fPainterMasterFrame->Update(); | |
196 | } | |
197 | ||
90037e4e | 198 | } |
199 | ||
200 | //______________________________________________________________________________ | |
201 | AliMUONMchViewApplication::~AliMUONMchViewApplication() | |
202 | { | |
203 | /// dtor | |
204 | } | |
205 | ||
49419555 | 206 | //______________________________________________________________________________ |
207 | void | |
208 | AliMUONMchViewApplication::CompareData() | |
209 | { | |
210 | /// Launch compare data dialog | |
211 | TGTransientFrame* t = new AliMUONTrackerDataCompareDialog(gClient->GetRoot(), | |
212 | gClient->GetRoot(), | |
213 | 400,400); | |
214 | ||
215 | t->MapSubwindows(); | |
216 | t->Resize(); | |
217 | t->MapWindow(); | |
218 | t->CenterOnParent(); | |
219 | ||
220 | // set names | |
221 | ||
222 | t->SetWindowName("mchview compare data tool"); | |
223 | t->SetIconName("mchview compare data tool"); | |
224 | ||
225 | t->MapRaised(); | |
226 | ||
227 | } | |
228 | ||
90037e4e | 229 | //______________________________________________________________________________ |
230 | void | |
231 | AliMUONMchViewApplication::CreateMenuBar(UInt_t w) | |
232 | { | |
233 | /// Create the application menu bar | |
234 | ||
235 | TGPopupMenu* file = new TGPopupMenu(gClient->GetRoot()); | |
236 | ||
237 | file->AddEntry("&Open...",fgkFILEOPEN); | |
238 | file->AddEntry("&Save As...",fgkFILESAVEAS); | |
10eb3d17 | 239 | file->AddEntry("&Print As...",fgkFILEPRINTAS); |
90037e4e | 240 | file->AddEntry("&Exit",fgkFILEEXIT); |
241 | ||
90037e4e | 242 | TGMenuBar* bar = new TGMenuBar(fMainFrame,w); |
243 | ||
49419555 | 244 | TGPopupMenu* tools = new TGPopupMenu(gClient->GetRoot()); |
245 | tools->AddEntry("&Compare data",fgkCOMPAREDATA); | |
246 | ||
10eb3d17 | 247 | TGPopupMenu* about = new TGPopupMenu(gClient->GetRoot()); |
49419555 | 248 | about->AddEntry(FullVersion(),fgkABOUT); |
10eb3d17 | 249 | |
49419555 | 250 | file->Connect("Activated(Int_t)","AliMUONMchViewApplication",this,"HandleMenu(Int_t)"); |
251 | about->Connect("Activated(Int_t)","AliMUONMchViewApplication",this,"HandleMenu(Int_t)"); | |
252 | tools->Connect("Activated(Int_t)","AliMUONMchViewApplication",this,"HandleMenu(Int_t)"); | |
253 | ||
90037e4e | 254 | bar->AddPopup("&File",file,new TGLayoutHints(kLHintsLeft|kLHintsTop)); |
49419555 | 255 | bar->AddPopup("&Tools",tools,new TGLayoutHints(kLHintsLeft|kLHintsTop)); |
10eb3d17 | 256 | bar->AddPopup("&About",about,new TGLayoutHints(kLHintsRight|kLHintsTop)); |
90037e4e | 257 | |
258 | fMainFrame->AddFrame(bar,new TGLayoutHints(kLHintsLeft|kLHintsExpandX)); | |
259 | ||
260 | AliMUONPainterRegistry::Instance()->SetMenuBar(bar); | |
261 | } | |
262 | ||
263 | //______________________________________________________________________________ | |
264 | void | |
265 | AliMUONMchViewApplication::HandleMenu(Int_t i) | |
266 | { | |
267 | /// Handle the click of one menu item | |
268 | ||
269 | switch (i) | |
270 | { | |
271 | case fgkFILEEXIT: | |
272 | Terminate(1); | |
273 | break; | |
274 | case fgkFILEOPEN: | |
275 | Open(); | |
276 | break; | |
277 | case fgkFILESAVEAS: | |
278 | Save(); | |
279 | break; | |
10eb3d17 | 280 | case fgkFILEPRINTAS: |
281 | PrintAs(); | |
282 | break; | |
49419555 | 283 | case fgkABOUT: |
284 | ReleaseNotes(); | |
285 | break; | |
286 | case fgkCOMPAREDATA: | |
287 | CompareData(); | |
288 | break; | |
90037e4e | 289 | default: |
290 | break; | |
291 | } | |
292 | } | |
293 | ||
294 | //______________________________________________________________________________ | |
295 | void | |
296 | AliMUONMchViewApplication::Open() | |
297 | { | |
298 | /// Open file dialog | |
299 | ||
300 | TGFileInfo fileInfo; | |
301 | ||
10eb3d17 | 302 | fileInfo.fFileTypes = fgkFileTypes; |
303 | ||
49419555 | 304 | delete[] fileInfo.fIniDir; |
305 | ||
306 | AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env(); | |
307 | ||
308 | fileInfo.fIniDir = StrDup(env->String("LastOpenDir",".")); | |
309 | ||
90037e4e | 310 | new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(), |
311 | kFDOpen,&fileInfo); | |
49419555 | 312 | |
313 | env->Set("LastOpenDir",fileInfo.fIniDir); | |
314 | env->Save(); | |
315 | ||
90037e4e | 316 | Open(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename))); |
317 | } | |
318 | ||
319 | //______________________________________________________________________________ | |
320 | void | |
321 | AliMUONMchViewApplication::Open(const char* filename) | |
322 | { | |
49419555 | 323 | /// Open a given file containing saved VTrackerDataMaker objects |
90037e4e | 324 | |
49419555 | 325 | TString sfilename(gSystem->ExpandPathName(filename)); |
90037e4e | 326 | |
49419555 | 327 | if ( sfilename.Contains(TRegexp("^alien")) ) |
328 | { | |
329 | // insure we've initialized the grid... | |
330 | if (!gGrid) | |
331 | { | |
332 | TGrid::Connect("alien://"); | |
333 | } | |
334 | } | |
335 | ||
336 | TFile* f = TFile::Open(filename); | |
337 | ||
632a2059 | 338 | ReadDir(*f); |
339 | ||
340 | delete f; | |
341 | } | |
342 | ||
343 | //______________________________________________________________________________ | |
344 | void | |
345 | AliMUONMchViewApplication::ReadDir(TDirectory& dir) | |
346 | { | |
72dae9ff | 347 | /// Read the given directory and import VTrackerData objects found |
348 | ||
632a2059 | 349 | TList* keys = dir.GetListOfKeys(); |
90037e4e | 350 | TIter next(keys); |
351 | ||
352 | TKey* k; | |
353 | ||
354 | while ( ( k = static_cast<TKey*>(next()) ) ) | |
355 | { | |
356 | TObject* object = k->ReadObj(); | |
49419555 | 357 | |
632a2059 | 358 | if ( object->InheritsFrom("TDirectory") ) |
359 | { | |
360 | TDirectory* d = static_cast<TDirectory*>(object); | |
361 | ReadDir(*d); | |
362 | continue; | |
363 | } | |
364 | ||
49419555 | 365 | if ( object->InheritsFrom("AliMUONVTrackerDataMaker") ) |
366 | { | |
367 | AliMUONVTrackerDataMaker* maker = dynamic_cast<AliMUONVTrackerDataMaker*>(object); | |
368 | if ( maker ) | |
369 | { | |
8f0acce4 | 370 | AliMUONPainterDataRegistry::Instance()->Register(maker); |
49419555 | 371 | } |
372 | } | |
90037e4e | 373 | |
374 | if ( object->InheritsFrom("AliMUONVTrackerData") ) | |
375 | { | |
49419555 | 376 | // this is for backward compatibility. Early versions of mchview |
377 | // wrote VTrackerData objects, and not VTrackerDataMaker ones. | |
378 | ||
379 | AliMUONVTrackerData* data = dynamic_cast<AliMUONVTrackerData*>(object); | |
90037e4e | 380 | if ( data ) |
381 | { | |
49419555 | 382 | AliMUONVTrackerDataMaker* maker = new AliMUONTrackerDataWrapper(data); |
8f0acce4 | 383 | AliMUONPainterDataRegistry::Instance()->Register(maker); |
90037e4e | 384 | } |
385 | } | |
386 | } | |
49419555 | 387 | |
90037e4e | 388 | } |
389 | ||
10eb3d17 | 390 | //______________________________________________________________________________ |
391 | void | |
392 | AliMUONMchViewApplication::PrintAs() | |
393 | { | |
394 | /// Print as... | |
395 | ||
396 | TGFileInfo fileInfo; | |
397 | ||
398 | new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(), | |
399 | kFDSave,&fileInfo); | |
400 | ||
401 | fPainterMasterFrame->SaveAs(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename))); | |
402 | } | |
403 | ||
49419555 | 404 | //______________________________________________________________________________ |
405 | void | |
406 | AliMUONMchViewApplication::ReleaseNotes() | |
407 | { | |
408 | /// Display release notes | |
409 | ||
410 | UInt_t width = 600; | |
411 | UInt_t height = 400; | |
412 | ||
413 | TGTransientFrame* t = new TGTransientFrame(gClient->GetRoot(),gClient->GetRoot(),width,height); | |
414 | ||
415 | TGTextView* rn = new TGTextView(t); | |
1ffbeb9d | 416 | |
fef32488 | 417 | rn->AddLine("1.00"); |
418 | rn->AddLine(""); | |
419 | rn->AddLine("Added the Status and StatusMap as a possible OCDB data source"); | |
420 | rn->AddLine(""); | |
421 | rn->AddLine("Added one (computed) dimension to the Gains data source = 1/a1/0.2 (mV/fC)"); | |
422 | rn->AddLine(""); | |
423 | ||
424 | ||
425 | rn->AddLine("0.99a"); | |
426 | rn->AddLine(""); | |
427 | rn->AddLine("Added the --de and --chamber options"); | |
428 | rn->AddLine(""); | |
429 | ||
dc9bb08e | 430 | rn->AddLine("0.99"); |
431 | rn->AddLine(""); | |
432 | rn->AddLine("The chamberid in the label (top right of panel) is now starting at 1 as in common usage"); | |
433 | rn->AddLine(""); | |
434 | ||
3f979838 | 435 | rn->AddLine("0.98"); |
436 | rn->AddLine(""); | |
437 | rn->AddLine("Added --asciimapping option"); | |
438 | rn->AddLine(""); | |
439 | ||
66cdf5b3 | 440 | rn->AddLine("0.97"); |
441 | rn->AddLine(""); | |
442 | rn->AddLine("Adding calibration option with Emelec (aka injection) gain"); | |
443 | rn->AddLine(""); | |
444 | ||
8f0acce4 | 445 | rn->AddLine("0.96a"); |
446 | rn->AddLine(""); | |
447 | rn->AddLine("Internal reorganization of the contour computations, that lead to improved performance. "); | |
448 | rn->AddLine("Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours."); | |
449 | rn->AddLine(""); | |
450 | ||
b6f591ae | 451 | rn->AddLine("0.96"); |
452 | rn->AddLine(""); | |
453 | rn->AddLine("New features"); | |
454 | rn->AddLine(""); | |
455 | rn->AddLine("- Can now read raw data from memory (using the mem://@gdc: syntax)"); | |
456 | rn->AddLine("- Raw data decoder now automatically skips buspatches with parity errors"); | |
457 | rn->AddLine(""); | |
458 | ||
459 | rn->AddLine("0.95"); | |
1ffbeb9d | 460 | rn->AddLine(""); |
461 | rn->AddLine("New features"); | |
462 | rn->AddLine(""); | |
463 | rn->AddLine("- Can now read and display HV values from OCDB"); | |
464 | rn->AddLine("- New program option --geometry to force geometry of the window"); | |
465 | rn->AddLine("- Added possibility, in painters' context menu, to include or exclude part of the detector"); | |
466 | rn->AddLine(" (which will be used later on to communicate with LC2 which parts should be read out or not)"); | |
467 | rn->AddLine(""); | |
468 | rn->AddLine("Improvement"); | |
469 | rn->AddLine(""); | |
470 | rn->AddLine("- When displaying Gains, the quality information is now decoded"); | |
471 | rn->AddLine(""); | |
49419555 | 472 | |
1286237e | 473 | rn->AddLine("0.94"); |
474 | rn->AddLine(""); | |
475 | rn->AddLine("New features"); | |
476 | rn->AddLine(""); | |
477 | rn->AddLine("Can now read ASCII calibration files produced by the DA"); | |
478 | rn->AddLine(""); | |
479 | ||
49419555 | 480 | rn->AddLine("0.93"); |
481 | rn->AddLine(""); | |
482 | rn->AddLine("New features"); | |
483 | rn->AddLine(""); | |
484 | rn->AddLine("- Adding a Lock button under the color slider to lock the range shown"); | |
485 | rn->AddLine(" when switching between views"); | |
486 | rn->AddLine("- Default display now shows bending plane (instead of cathode 0 before)"); | |
487 | rn->AddLine("- If pad is responder and there's some histo for that pad, "); | |
488 | rn->AddLine(" clicking on it will display an histo"); | |
489 | rn->AddLine("- Right-click on a painter will now display several histogram options"); | |
490 | rn->AddLine(" (e.g. raw charge as before, but also simple distributions of mean"); | |
491 | rn->AddLine(" and sigma"); | |
492 | rn->AddLine("- In the Data Sources Tab, each data source can now be removed and saved"); | |
493 | rn->AddLine("- There's a new Tool menu which allow to produce a TrackerData from two others"); | |
494 | rn->AddLine(" in order to compare data."); | |
495 | rn->AddLine(" - The --use option can now reference alien files"); | |
496 | rn->AddLine(""); | |
497 | rn->AddLine("Bug fixes"); | |
498 | rn->AddLine(""); | |
499 | rn->AddLine("- Can now read Capacitances from OCDB"); | |
500 | ||
501 | rn->Resize(width,height); | |
502 | ||
503 | t->AddFrame(rn, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); | |
504 | ||
505 | t->MapSubwindows(); | |
506 | t->Resize(); | |
507 | t->MapWindow(); | |
508 | t->CenterOnParent(); | |
509 | ||
510 | // set names | |
511 | ||
512 | t->SetWindowName("mchview release notes"); | |
513 | t->SetIconName("mchview release notes"); | |
514 | ||
515 | // t->SetMWMHints(kMWMDecorAll | kMWMDecorResizeH | kMWMDecorMaximize | | |
516 | // kMWMDecorMinimize | kMWMDecorMenu, | |
517 | // kMWMFuncAll | kMWMFuncResize | kMWMFuncMaximize | | |
518 | // kMWMFuncMinimize, | |
519 | // kMWMInputModeless); | |
520 | ||
521 | t->MapRaised(); | |
522 | // gClient->WaitFor(t); | |
523 | } | |
524 | ||
90037e4e | 525 | //______________________________________________________________________________ |
526 | void | |
527 | AliMUONMchViewApplication::Save() | |
528 | { | |
529 | /// Open "Save VTrackerData objects to file" dialog | |
530 | ||
531 | TGFileInfo fileInfo; | |
532 | ||
533 | new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(), | |
534 | kFDSave,&fileInfo); | |
535 | ||
536 | Save(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename))); | |
537 | } | |
538 | ||
539 | //______________________________________________________________________________ | |
540 | void | |
541 | AliMUONMchViewApplication::Save(const char* filename) | |
542 | { | |
49419555 | 543 | /// Save VTrackerDataMaker objects into file of given name |
90037e4e | 544 | |
8f0acce4 | 545 | AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance(); |
90037e4e | 546 | |
547 | TFile f(filename,"RECREATE"); | |
548 | ||
49419555 | 549 | for ( Int_t i = 0; i < reg->NumberOfDataMakers(); ++i ) |
90037e4e | 550 | { |
49419555 | 551 | AliMUONVTrackerDataMaker* maker = reg->DataMaker(i); |
552 | maker->Write(); | |
90037e4e | 553 | } |
554 | ||
555 | f.Close(); | |
556 | } |