]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONMchViewApplication.cxx
Updated documentation about alignment to remove obsolete classes
[u/mrichter/AliRoot.git] / MUON / AliMUONMchViewApplication.cxx
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
18 #include "AliMUONMchViewApplication.h"
19
20 #include "AliCDBManager.h"
21 #include "AliCodeTimer.h"
22 #include "AliLog.h"
23 #include "AliMUONAlignmentCompareDialog.h"
24 #include "AliMUONChamberPainter.h"
25 #include "AliMUONDEPainter.h"
26 #include "AliMUONPainterDataRegistry.h"
27 #include "AliMUONPainterDataSourceFrame.h"
28 #include "AliMUONPainterEnv.h"
29 #include "AliMUONPainterHelper.h"
30 #include "AliMUONPainterGroup.h"
31 #include "AliMUONPainterMasterFrame.h"
32 #include "AliMUONPainterMatrix.h"
33 #include "AliMUONPainterRegistry.h"
34 #include "AliMUONTrackerDataCompareDialog.h"
35 #include "AliMUONTrackerDataWrapper.h"
36 #include "AliMUONVTrackerData.h"
37 #include "AliMUONVTrackerDataMaker.h"
38 #include <Riostream.h>
39 #include <TCanvas.h>
40 #include <TEnv.h>
41 #include <TFile.h>
42 #include <TGClient.h>
43 #include <TGFileDialog.h>
44 #include <TGMenu.h>
45 #include <TGTab.h>
46 #include <TGTextView.h>
47 #include <TGrid.h>
48 #include <TKey.h>
49 #include <TList.h>
50 #include <TRegexp.h>
51 #include <TString.h>
52 #include <TSystem.h>
53
54 /// \class AliMUONMchViewApplication
55 ///
56 /// Main class for the mchview program
57 ///
58 ///\author Laurent Aphecetche, Subatech
59
60 using std::cout;
61 using std::endl;
62 /// \cond CLASSIMP
63 ClassImp(AliMUONMchViewApplication)
64 /// \endcond CLASSIMP
65
66 const Int_t AliMUONMchViewApplication::fgkFILESAVEAS(1);
67 const Int_t AliMUONMchViewApplication::fgkFILEOPEN(2);
68 const Int_t AliMUONMchViewApplication::fgkFILEEXIT(3);
69 const Int_t AliMUONMchViewApplication::fgkFILEPRINTAS(4);
70 const Int_t AliMUONMchViewApplication::fgkABOUT(5);
71 const Int_t AliMUONMchViewApplication::fgkCOMPAREDATA(6);
72 const Int_t AliMUONMchViewApplication::fgkCOMPAREALIGNMENTS(7);
73
74 const char* AliMUONMchViewApplication::fgkFileTypes[] = { 
75   "ROOT files",    "*.root", 
76   "All files",     "*", 
77   0,               0 }; 
78
79 //______________________________________________________________________________
80 AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name,
81                                                      int* argc, char** argv,
82                                                      UInt_t w, UInt_t h,
83                                                      UInt_t ox, UInt_t oy) 
84 : TRint(name,argc,argv),
85   fMainFrame(0x0),
86   fPainterMasterFrameList(new TList),
87   fTabs(0x0)
88 {
89
90   /// ctor
91   /// (w,h) is the size in pixel (if 0,0 it will be computed as 70%,90% of display size)
92   /// (ox,oy) is the offset from the top-left of the display
93
94   if (!w || !h)
95   {
96     w = (UInt_t)(gClient->GetDisplayWidth()*0.7);
97     h = (UInt_t)(gClient->GetDisplayHeight()*0.9); 
98   }
99
100   fMainFrame = new TGMainFrame(gClient->GetRoot(),w,h);
101
102   CreateMenuBar(w);
103
104   const Int_t kbs = 2;
105   
106 //  h -= 60; // menubar
107   
108   fTabs = new TGTab(fMainFrame,w,h);
109   
110   TGCompositeFrame* t = fTabs->AddTab("Painter Master Frame");
111
112   fPainterMasterFrameList->SetOwner(kTRUE);
113   
114   
115   AliMUONPainterMasterFrame* pmf = new AliMUONPainterMasterFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2,
116                                                                  GenerateStartupMatrix());
117
118   fPainterMasterFrameList->Add(pmf);
119   
120   t->AddFrame(pmf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs));
121
122   t = fTabs->AddTab("Data Sources");
123   
124   AliMUONPainterDataSourceFrame* dsf = 
125     new AliMUONPainterDataSourceFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2);
126   
127   t->AddFrame(dsf,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs));
128   
129   fMainFrame->AddFrame(fTabs,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0));
130
131   fMainFrame->SetWindowName("mchview - Visualization of MUON Tracker detector");
132
133   fMainFrame->MapSubwindows();
134   fMainFrame->Resize();
135   
136   pmf->Update();
137   
138   fMainFrame->MapWindow();
139   
140   fMainFrame->Connect("CloseWindow()","AliMUONMchViewApplication",this,"Terminate()");
141
142 //  fMainFrame->MoveResize(ox,oy, w, h); 
143   fMainFrame->SetWMPosition(ox, oy);
144 //  fMainFrame->SetWMSizeHints(w,h,w,h,0,0);
145 //  fMainFrame->SetWMSizeHints(w,h,w,h,10,10);
146   
147   cout << "***************************************************" << endl;
148   cout << "   Welcome to mchview" << endl;
149   cout << "   " << FullVersion() << endl;
150   cout << "***************************************************" << endl;
151   
152   // Trying to see if we're requested to draw something specific instead
153   // of the global view of all the chambers
154   
155   AliMUONVPainter* painter(0x0);
156   TObjArray args;
157   args.SetOwner(kTRUE);
158   
159   for ( int i = 1; i < argc[0]; ++i ) 
160   {
161     args.Add(new TObjString(argv[i]));
162   }
163   
164   for ( Int_t i = 0; i <= args.GetLast(); ++i ) 
165   {
166     TString a(static_cast<TObjString*>(args.At(i))->String());
167
168     AliMUONAttPainter att;
169     
170     att.SetPlane(kTRUE,kFALSE);
171     att.SetCathode(kFALSE,kFALSE);
172     att.SetViewPoint(kTRUE,kFALSE);
173         
174     if ( a == "--de" )
175     {
176       Int_t detElemId = static_cast<TObjString*>(args.At(i+1))->String().Atoi();
177       
178       painter = new AliMUONDEPainter(att,detElemId);
179       
180       painter->SetOutlined("*",kFALSE);      
181       painter->SetOutlined("BUSPATCH",kTRUE);
182
183       painter->SetLine(1,4,3);      
184       ++i;
185     }
186
187     if ( a == "--chamber" )
188     {
189       Int_t chamberId = static_cast<TObjString*>(args.At(i+1))->String().Atoi();
190       
191       painter = new AliMUONChamberPainter(att,chamberId-1);
192       
193       painter->SetOutlined("*",kFALSE);      
194       painter->SetOutlined("DE",kTRUE);
195       
196       painter->SetLine(1,4,3);      
197       ++i;
198     }
199     
200   }
201   
202   if ( painter ) 
203   {
204     pmf->ShiftClicked(painter,0x0);
205     
206     pmf->Update();
207   }
208       
209 }
210
211 //______________________________________________________________________________
212 AliMUONMchViewApplication::~AliMUONMchViewApplication()
213 {
214   /// dtor
215   delete fPainterMasterFrameList;
216 }
217
218 //_____________________________________________________________________________
219 AliMUONPainterMatrix*
220 AliMUONMchViewApplication::GenerateStartupMatrix()
221 {
222   /// Kind of bootstrap method to trigger the generation of all contours
223   
224   AliCodeTimerAuto("",0);
225   
226   AliMUONAttPainter att;
227   
228   att.SetViewPoint(kTRUE,kFALSE);
229   att.SetCathode(kFALSE,kFALSE);
230   att.SetPlane(kTRUE,kFALSE);
231
232   AliMUONPainterMatrix* matrix = new AliMUONPainterMatrix("Tracker",5,2);
233     
234   for ( Int_t i = 0; i < 10; ++i )
235   {
236     AliMUONVPainter* painter = new AliMUONChamberPainter(att,i);
237     
238     painter->SetResponder("Chamber");
239     
240     painter->SetOutlined("*",kFALSE);
241     
242     painter->SetOutlined("MANU",kTRUE);
243     
244     for ( Int_t j = 0; j < 3; ++j ) 
245     {
246       painter->SetLine(j,1,4-j);
247     }
248     
249     matrix->Adopt(painter);    
250   }
251   AliMUONPainterRegistry::Instance()->Register(matrix);
252   return matrix;
253 }
254
255 //______________________________________________________________________________
256 void
257 AliMUONMchViewApplication::CompareAlignments()
258 {
259   /// Launch compare data dialog
260   TGTransientFrame* t = new AliMUONAlignmentCompareDialog(gClient->GetRoot(),
261                                                           gClient->GetRoot(),
262                                                           400,400);
263   
264   t->MapSubwindows();
265   t->Resize();
266   t->MapWindow();
267   t->CenterOnParent();
268   
269   // set names
270   
271   t->SetWindowName("mchview compare alignments tool");
272   t->SetIconName("mchview compare alignments tool");
273   
274   t->MapRaised();  
275 }
276
277 //______________________________________________________________________________
278 void
279 AliMUONMchViewApplication::CompareData()
280 {
281   /// Launch compare data dialog
282   TGTransientFrame* t = new AliMUONTrackerDataCompareDialog(gClient->GetRoot(),
283                                                             gClient->GetRoot(),
284                                                             400,400);
285
286   t->MapSubwindows();
287   t->Resize();
288   t->MapWindow();
289   t->CenterOnParent();
290   
291   // set names
292   
293   t->SetWindowName("mchview compare data tool");
294   t->SetIconName("mchview compare data tool");
295   
296   t->MapRaised();  
297 }
298
299 //______________________________________________________________________________
300 void
301 AliMUONMchViewApplication::CreateMenuBar(UInt_t w)
302 {
303   /// Create the application menu bar
304   
305   TGPopupMenu* file = new TGPopupMenu(gClient->GetRoot());
306   
307   file->AddEntry("&Open...",fgkFILEOPEN);
308   file->AddEntry("&Save As...",fgkFILESAVEAS);
309   file->AddEntry("&Print As...",fgkFILEPRINTAS);
310   file->AddEntry("&Exit",fgkFILEEXIT);
311   
312   TGMenuBar* bar = new TGMenuBar(fMainFrame,w);
313   
314   TGPopupMenu* tools = new TGPopupMenu(gClient->GetRoot());
315   tools->AddEntry("&Compare data",fgkCOMPAREDATA);
316   tools->AddEntry("&Compare alignments",fgkCOMPAREALIGNMENTS);
317   
318   TGPopupMenu* about = new TGPopupMenu(gClient->GetRoot());  
319   about->AddEntry(FullVersion(),fgkABOUT);
320
321   file->Connect("Activated(Int_t)","AliMUONMchViewApplication",this,"HandleMenu(Int_t)");
322   about->Connect("Activated(Int_t)","AliMUONMchViewApplication",this,"HandleMenu(Int_t)");
323   tools->Connect("Activated(Int_t)","AliMUONMchViewApplication",this,"HandleMenu(Int_t)");
324   
325   bar->AddPopup("&File",file,new TGLayoutHints(kLHintsLeft|kLHintsTop));
326   bar->AddPopup("&Tools",tools,new TGLayoutHints(kLHintsLeft|kLHintsTop));
327   bar->AddPopup("&About",about,new TGLayoutHints(kLHintsRight|kLHintsTop));
328   
329   fMainFrame->AddFrame(bar,new TGLayoutHints(kLHintsLeft|kLHintsExpandX));
330   
331   AliMUONPainterRegistry::Instance()->SetMenuBar(bar);
332 }
333
334 //______________________________________________________________________________
335 void
336 AliMUONMchViewApplication::HandleMenu(Int_t i)
337 {
338   /// Handle the click of one menu item
339
340   switch (i)
341     {
342     case fgkFILEEXIT:
343       Terminate(1);
344       break;
345     case fgkFILEOPEN:
346       Open();
347       break;
348     case fgkFILESAVEAS:
349       Save();
350       break;
351     case fgkFILEPRINTAS:
352       PrintAs();
353       break;
354     case fgkABOUT:
355       ReleaseNotes();
356       break;
357     case fgkCOMPAREDATA:
358       CompareData();
359       break;
360     case fgkCOMPAREALIGNMENTS:
361       CompareAlignments();
362       break;
363       default:
364       break;
365     }
366 }
367
368 //______________________________________________________________________________
369 void
370 AliMUONMchViewApplication::Open()
371 {
372   /// Open file dialog
373   
374   TGFileInfo fileInfo;
375   
376   fileInfo.fFileTypes = fgkFileTypes;
377   
378   delete[] fileInfo.fIniDir;
379   
380   AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
381   
382   fileInfo.fIniDir = StrDup(env->String("LastOpenDir","."));
383   
384   new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
385                    kFDOpen,&fileInfo);
386
387   env->Set("LastOpenDir",fileInfo.fIniDir);
388   env->Save();  
389     
390   Open(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)));
391 }  
392
393 //______________________________________________________________________________
394 void
395 AliMUONMchViewApplication::Open(const char* filename)
396 {
397   /// Open a given file containing saved VTrackerDataMaker objects
398   
399   TString sfilename(gSystem->ExpandPathName(filename));
400   
401   if ( sfilename.Contains(TRegexp("^alien")) )
402   {
403     // insure we've initialized the grid...
404     if (!gGrid)
405     {
406       TGrid::Connect("alien://");
407     }
408   }
409   
410   TFile* f = TFile::Open(filename);
411   
412         ReadDir(*f);
413         
414         delete f;
415 }
416
417 //______________________________________________________________________________
418 void
419 AliMUONMchViewApplication::ReadDir(TDirectory& dir)
420 {
421   /// Read the given directory and import VTrackerData objects found
422   
423   TList* keys = dir.GetListOfKeys();
424   TIter next(keys);
425   
426   TKey* k;
427   
428   while ( ( k = static_cast<TKey*>(next()) ) )
429   {
430     TObject* object = k->ReadObj();
431
432                 if ( object->InheritsFrom("TDirectory") )
433                 {
434                         TDirectory* d = static_cast<TDirectory*>(object);
435                         ReadDir(*d);
436                         continue;
437                 }
438                 
439     if ( object->InheritsFrom("AliMUONVTrackerDataMaker") )
440     {
441       AliMUONVTrackerDataMaker* maker = dynamic_cast<AliMUONVTrackerDataMaker*>(object);
442       if ( maker ) 
443       {
444         AliMUONPainterDataRegistry::Instance()->Register(maker);
445       }
446     }
447     
448     if ( object->InheritsFrom("AliMUONVTrackerData") )
449     {
450       // this is for backward compatibility. Early versions of mchview 
451       // wrote VTrackerData objects, and not VTrackerDataMaker ones.
452       
453       AliMUONVTrackerData* data = dynamic_cast<AliMUONVTrackerData*>(object);
454       if ( data ) 
455       {
456         AliMUONVTrackerDataMaker* maker = new AliMUONTrackerDataWrapper(data);
457         AliMUONPainterDataRegistry::Instance()->Register(maker);
458       }
459     }
460   }
461   
462
463
464 //______________________________________________________________________________
465 void
466 AliMUONMchViewApplication::PrintAs()
467 {
468   /// Print as...
469   
470   TGFileInfo fileInfo;
471   
472   new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
473                    kFDSave,&fileInfo);
474   
475   TIter next(fPainterMasterFrameList);
476   AliMUONPainterMasterFrame* pmf;
477   Bool_t first(kTRUE);
478   
479   while ( ( pmf = static_cast<AliMUONPainterMasterFrame*>(next()) ) )
480   {
481     pmf->SaveAs(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)),
482                 first ? "RECREATE" : "UPDATE");
483     first = kFALSE;
484   }
485 }
486
487 //______________________________________________________________________________
488 void
489 AliMUONMchViewApplication::ReleaseNotes()
490 {
491   /// Display release notes
492   
493   UInt_t width = 600;
494   UInt_t height = 400;
495   
496   TGTransientFrame* t = new TGTransientFrame(gClient->GetRoot(),gClient->GetRoot(),width,height);
497   
498   TGTextView* rn = new TGTextView(t);
499
500   rn->AddLine("1.14");
501   rn->AddLine("");
502   rn->AddLine("Fixing anti-aliasing problem on MacOSX");
503   rn->AddLine("");
504
505   rn->AddLine("1.13");
506   rn->AddLine("");
507   rn->AddLine("Make default OCDB = 2013 one");
508   rn->AddLine("");
509
510   rn->AddLine("1.11");
511   rn->AddLine("");
512   rn->AddLine("Adding [Compare alignments] in the Tools menu + make default OCDB be 2012's version");
513   rn->AddLine("");
514   
515   rn->AddLine("1.10");
516   rn->AddLine("");
517   rn->AddLine("Make the raw OCDB more obvious in the data source tab");
518   rn->AddLine("");
519   
520   rn->AddLine("1.08");
521   rn->AddLine("");
522   rn->AddLine("Changed the default OCDB to 2011 version");
523   rn->AddLine("");
524   
525   rn->AddLine("1.07");
526   rn->AddLine("");
527   rn->AddLine("Added the RejectList as a possible OCDB data source");
528   rn->AddLine("");
529   
530   rn->AddLine("1.06");
531   rn->AddLine("");
532   rn->AddLine("Changed a bit the HV display. Now a trip is indicated with a value of -1");
533   rn->AddLine("");
534   
535   rn->AddLine("1.05");
536   rn->AddLine("");
537   rn->AddLine("Added the possibility to select an event range when reading raw data");
538   rn->AddLine("Usefull e.g. to look at a single suspect event...");
539   rn->AddLine("");
540   
541   rn->AddLine("1.04");
542   rn->AddLine("");
543   rn->AddLine("Changed the default OCDB to 2010 version");
544   rn->AddLine("");
545   
546   rn->AddLine("1.03");
547   rn->AddLine("");
548   rn->AddLine("Add Print buttons");
549   rn->AddLine("Add the automatic creation of often used canvases when using pedestal source");
550   // Internal reorganization to allow several independent tabs to be created to 
551   // show different master frames (not used yet). Important for the moment
552   // is the ability to create a PainterMatrix and pass it to the PainterMasterFrame
553   rn->AddLine("");
554   
555   rn->AddLine("1.02");
556   rn->AddLine("");
557   rn->AddLine("Internal change (merging of AliMUONTrackerACFDataMaker and AliMUONTrackerOCDBDataMaker into AliMUONTrackerConditionDataMaker)");
558   rn->AddLine("Added --ocdb option");
559   rn->AddLine("Corrected the display of the configuration");
560   rn->AddLine("Corrected the interpretation of the switches for the HV display");
561   rn->AddLine("");
562   
563   rn->AddLine("1.01");
564   rn->AddLine("");
565   rn->AddLine("Added the configuration as a possible OCDB data source");
566   rn->AddLine("");
567   
568   rn->AddLine("1.00");
569   rn->AddLine("");
570   rn->AddLine("Added the Status and StatusMap as a possible OCDB data source");
571   rn->AddLine("");
572   rn->AddLine("Added one (computed) dimension to the Gains data source = 1/a1/0.2 (mV/fC)");
573   rn->AddLine("");
574     
575   rn->AddLine("0.99a");
576   rn->AddLine("");
577   rn->AddLine("Added the --de and --chamber options");
578   rn->AddLine("");
579   
580   rn->AddLine("0.99");
581   rn->AddLine("");
582   rn->AddLine("The chamberid in the label (top right of panel) is now starting at 1 as in common usage");  
583   rn->AddLine("");
584   
585   rn->AddLine("0.98");
586   rn->AddLine("");
587   rn->AddLine("Added --asciimapping option");
588   rn->AddLine("");
589   
590   rn->AddLine("0.97");
591   rn->AddLine("");
592   rn->AddLine("Adding calibration option with Emelec (aka injection) gain");
593   rn->AddLine("");
594   
595   rn->AddLine("0.96a");
596   rn->AddLine("");
597   rn->AddLine("Internal reorganization of the contour computations, that lead to improved performance. ");
598   rn->AddLine("Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours.");
599   rn->AddLine("");
600   
601   rn->AddLine("0.96");
602   rn->AddLine("");
603   rn->AddLine("New features");
604   rn->AddLine("");
605   rn->AddLine("- Can now read raw data from memory (using the mem://@gdc: syntax)");
606   rn->AddLine("- Raw data decoder now automatically skips buspatches with parity errors");
607   rn->AddLine("");
608   
609   rn->AddLine("0.95");
610   rn->AddLine("");
611   rn->AddLine("New features");
612   rn->AddLine("");
613   rn->AddLine("- Can now read and display HV values from OCDB");
614   rn->AddLine("- New program option --geometry to force geometry of the window");
615   rn->AddLine("- Added possibility, in painters' context menu, to include or exclude part of the detector");
616   rn->AddLine("  (which will be used later on to communicate with LC2 which parts should be read out or not)");
617   rn->AddLine("");
618   rn->AddLine("Improvement");
619   rn->AddLine("");
620   rn->AddLine("- When displaying Gains, the quality information is now decoded");
621   rn->AddLine("");
622   
623   rn->AddLine("0.94");
624   rn->AddLine("");
625   rn->AddLine("New features");
626   rn->AddLine("");
627   rn->AddLine("Can now read ASCII calibration files produced by the DA");
628   rn->AddLine("");
629   
630   rn->AddLine("0.93");
631   rn->AddLine("");
632   rn->AddLine("New features");
633   rn->AddLine("");
634   rn->AddLine("- Adding a Lock button under the color slider to lock the range shown");
635   rn->AddLine("  when switching between views");
636   rn->AddLine("- Default display now shows bending plane (instead of cathode 0 before)");
637   rn->AddLine("- If pad is responder and there's some histo for that pad, ");
638   rn->AddLine("  clicking on it will display an histo");
639   rn->AddLine("- Right-click on a painter will now display several histogram options");
640   rn->AddLine("  (e.g. raw charge as before, but also simple distributions of mean");
641   rn->AddLine("  and sigma");
642   rn->AddLine("- In the Data Sources Tab, each data source can now be removed and saved");
643   rn->AddLine("- There's a new Tool menu which allow to produce a TrackerData from two others");
644   rn->AddLine("  in order to compare data.");
645   rn->AddLine("  - The --use option can now reference alien files");
646   rn->AddLine("");    
647   rn->AddLine("Bug fixes");
648   rn->AddLine("");    
649   rn->AddLine("- Can now read Capacitances from OCDB");
650     
651   rn->Resize(width,height);
652   
653   t->AddFrame(rn, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
654   
655   t->MapSubwindows();
656   t->Resize();
657   t->MapWindow();
658   t->CenterOnParent();
659     
660   // set names
661   
662   t->SetWindowName("mchview release notes");
663   t->SetIconName("mchview release notes");
664   
665 //  t->SetMWMHints(kMWMDecorAll | kMWMDecorResizeH  | kMWMDecorMaximize |
666 //              kMWMDecorMinimize | kMWMDecorMenu,
667 //              kMWMFuncAll  | kMWMFuncResize    | kMWMFuncMaximize |
668 //              kMWMFuncMinimize,
669 //              kMWMInputModeless);
670   
671   t->MapRaised();
672 //  gClient->WaitFor(t);
673 }
674
675 //______________________________________________________________________________
676 void
677 AliMUONMchViewApplication::Save()
678 {
679   /// Open "Save VTrackerData objects to file" dialog
680   
681   TGFileInfo fileInfo;
682   
683   new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
684                    kFDSave,&fileInfo);
685   
686   Save(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)));
687 }  
688
689 //______________________________________________________________________________
690 void
691 AliMUONMchViewApplication::Save(const char* filename)
692 {
693   /// Save VTrackerDataMaker objects into file of given name
694   
695   AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
696
697   TFile f(filename,"RECREATE");
698   
699   for ( Int_t i = 0; i < reg->NumberOfDataMakers(); ++i )
700   {
701     AliMUONVTrackerDataMaker* maker = reg->DataMaker(i);
702     maker->Write();
703   }
704   
705   f.Close();
706 }