Updates to AddTask macro from Chris
[u/mrichter/AliRoot.git] / MUON / AliMUONMchViewApplication.cxx
CommitLineData
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"
301ca128 23#include "AliMUONAlignmentCompareDialog.h"
fef32488 24#include "AliMUONChamberPainter.h"
25#include "AliMUONDEPainter.h"
8f0acce4 26#include "AliMUONPainterDataRegistry.h"
90037e4e 27#include "AliMUONPainterDataSourceFrame.h"
49419555 28#include "AliMUONPainterEnv.h"
90037e4e 29#include "AliMUONPainterHelper.h"
fcabdc0c 30#include "AliMUONPainterGroup.h"
90037e4e 31#include "AliMUONPainterMasterFrame.h"
fcabdc0c 32#include "AliMUONPainterMatrix.h"
90037e4e 33#include "AliMUONPainterRegistry.h"
49419555 34#include "AliMUONTrackerDataCompareDialog.h"
35#include "AliMUONTrackerDataWrapper.h"
90037e4e 36#include "AliMUONVTrackerData.h"
49419555 37#include "AliMUONVTrackerDataMaker.h"
90037e4e 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>
49419555 46#include <TGTextView.h>
47#include <TGrid.h>
90037e4e 48#include <TKey.h>
49#include <TList.h>
49419555 50#include <TRegexp.h>
90037e4e 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
b80faac0 60using std::cout;
61using std::endl;
90037e4e 62/// \cond CLASSIMP
63ClassImp(AliMUONMchViewApplication)
64/// \endcond CLASSIMP
65
66const Int_t AliMUONMchViewApplication::fgkFILESAVEAS(1);
67const Int_t AliMUONMchViewApplication::fgkFILEOPEN(2);
68const Int_t AliMUONMchViewApplication::fgkFILEEXIT(3);
10eb3d17 69const Int_t AliMUONMchViewApplication::fgkFILEPRINTAS(4);
49419555 70const Int_t AliMUONMchViewApplication::fgkABOUT(5);
71const Int_t AliMUONMchViewApplication::fgkCOMPAREDATA(6);
301ca128 72const Int_t AliMUONMchViewApplication::fgkCOMPAREALIGNMENTS(7);
10eb3d17 73
74const char* AliMUONMchViewApplication::fgkFileTypes[] = {
75 "ROOT files", "*.root",
76 "All files", "*",
77 0, 0 };
90037e4e 78
79//______________________________________________________________________________
80AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name,
81 int* argc, char** argv,
1ffbeb9d 82 UInt_t w, UInt_t h,
83 UInt_t ox, UInt_t oy)
90037e4e 84: TRint(name,argc,argv),
10eb3d17 85 fMainFrame(0x0),
fcabdc0c 86 fPainterMasterFrameList(new TList),
87 fTabs(0x0)
90037e4e 88{
89
90 /// ctor
1ffbeb9d 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
d2b2e698 94 if (!w || !h)
1ffbeb9d 95 {
96 w = (UInt_t)(gClient->GetDisplayWidth()*0.7);
97 h = (UInt_t)(gClient->GetDisplayHeight()*0.9);
98 }
90037e4e 99
100 fMainFrame = new TGMainFrame(gClient->GetRoot(),w,h);
fef32488 101
90037e4e 102 CreateMenuBar(w);
103
104 const Int_t kbs = 2;
105
106// h -= 60; // menubar
107
fcabdc0c 108 fTabs = new TGTab(fMainFrame,w,h);
109
110 TGCompositeFrame* t = fTabs->AddTab("Painter Master Frame");
111
112 fPainterMasterFrameList->SetOwner(kTRUE);
113
90037e4e 114
fcabdc0c 115 AliMUONPainterMasterFrame* pmf = new AliMUONPainterMasterFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2,
116 GenerateStartupMatrix());
90037e4e 117
fcabdc0c 118 fPainterMasterFrameList->Add(pmf);
90037e4e 119
fcabdc0c 120 t->AddFrame(pmf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs));
90037e4e 121
fcabdc0c 122 t = fTabs->AddTab("Data Sources");
90037e4e 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
fcabdc0c 129 fMainFrame->AddFrame(fTabs,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0));
90037e4e 130
131 fMainFrame->SetWindowName("mchview - Visualization of MUON Tracker detector");
132
133 fMainFrame->MapSubwindows();
134 fMainFrame->Resize();
10eb3d17 135
fcabdc0c 136 pmf->Update();
10eb3d17 137
90037e4e 138 fMainFrame->MapWindow();
139
140 fMainFrame->Connect("CloseWindow()","AliMUONMchViewApplication",this,"Terminate()");
1ffbeb9d 141
9f4473f2 142// fMainFrame->MoveResize(ox,oy, w, h);
1ffbeb9d 143 fMainFrame->SetWMPosition(ox, oy);
9f4473f2 144// fMainFrame->SetWMSizeHints(w,h,w,h,0,0);
145// fMainFrame->SetWMSizeHints(w,h,w,h,10,10);
10eb3d17 146
147 cout << "***************************************************" << endl;
148 cout << " Welcome to mchview" << endl;
149 cout << " " << FullVersion() << endl;
150 cout << "***************************************************" << endl;
fef32488 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());
10eb3d17 167
fef32488 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 {
fcabdc0c 204 pmf->ShiftClicked(painter,0x0);
fef32488 205
fcabdc0c 206 pmf->Update();
fef32488 207 }
208
90037e4e 209}
210
211//______________________________________________________________________________
212AliMUONMchViewApplication::~AliMUONMchViewApplication()
213{
214 /// dtor
fcabdc0c 215 delete fPainterMasterFrameList;
216}
217
218//_____________________________________________________________________________
219AliMUONPainterMatrix*
220AliMUONMchViewApplication::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;
90037e4e 253}
254
255//______________________________________________________________________________
256void
301ca128 257AliMUONMchViewApplication::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//______________________________________________________________________________
278void
49419555 279AliMUONMchViewApplication::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
fcabdc0c 296 t->MapRaised();
49419555 297}
298
299//______________________________________________________________________________
300void
90037e4e 301AliMUONMchViewApplication::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);
10eb3d17 309 file->AddEntry("&Print As...",fgkFILEPRINTAS);
90037e4e 310 file->AddEntry("&Exit",fgkFILEEXIT);
311
90037e4e 312 TGMenuBar* bar = new TGMenuBar(fMainFrame,w);
313
49419555 314 TGPopupMenu* tools = new TGPopupMenu(gClient->GetRoot());
315 tools->AddEntry("&Compare data",fgkCOMPAREDATA);
301ca128 316 tools->AddEntry("&Compare alignments",fgkCOMPAREALIGNMENTS);
49419555 317
10eb3d17 318 TGPopupMenu* about = new TGPopupMenu(gClient->GetRoot());
49419555 319 about->AddEntry(FullVersion(),fgkABOUT);
10eb3d17 320
49419555 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
90037e4e 325 bar->AddPopup("&File",file,new TGLayoutHints(kLHintsLeft|kLHintsTop));
49419555 326 bar->AddPopup("&Tools",tools,new TGLayoutHints(kLHintsLeft|kLHintsTop));
10eb3d17 327 bar->AddPopup("&About",about,new TGLayoutHints(kLHintsRight|kLHintsTop));
90037e4e 328
329 fMainFrame->AddFrame(bar,new TGLayoutHints(kLHintsLeft|kLHintsExpandX));
330
331 AliMUONPainterRegistry::Instance()->SetMenuBar(bar);
332}
333
334//______________________________________________________________________________
335void
336AliMUONMchViewApplication::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;
10eb3d17 351 case fgkFILEPRINTAS:
352 PrintAs();
353 break;
49419555 354 case fgkABOUT:
355 ReleaseNotes();
356 break;
357 case fgkCOMPAREDATA:
358 CompareData();
359 break;
301ca128 360 case fgkCOMPAREALIGNMENTS:
361 CompareAlignments();
362 break;
363 default:
90037e4e 364 break;
365 }
366}
367
368//______________________________________________________________________________
369void
370AliMUONMchViewApplication::Open()
371{
372 /// Open file dialog
373
374 TGFileInfo fileInfo;
375
10eb3d17 376 fileInfo.fFileTypes = fgkFileTypes;
377
49419555 378 delete[] fileInfo.fIniDir;
379
380 AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
381
382 fileInfo.fIniDir = StrDup(env->String("LastOpenDir","."));
383
90037e4e 384 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
385 kFDOpen,&fileInfo);
49419555 386
387 env->Set("LastOpenDir",fileInfo.fIniDir);
388 env->Save();
389
90037e4e 390 Open(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)));
391}
392
393//______________________________________________________________________________
394void
395AliMUONMchViewApplication::Open(const char* filename)
396{
49419555 397 /// Open a given file containing saved VTrackerDataMaker objects
90037e4e 398
49419555 399 TString sfilename(gSystem->ExpandPathName(filename));
90037e4e 400
49419555 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
632a2059 412 ReadDir(*f);
413
414 delete f;
415}
416
417//______________________________________________________________________________
418void
419AliMUONMchViewApplication::ReadDir(TDirectory& dir)
420{
72dae9ff 421 /// Read the given directory and import VTrackerData objects found
422
632a2059 423 TList* keys = dir.GetListOfKeys();
90037e4e 424 TIter next(keys);
425
426 TKey* k;
427
428 while ( ( k = static_cast<TKey*>(next()) ) )
429 {
430 TObject* object = k->ReadObj();
49419555 431
632a2059 432 if ( object->InheritsFrom("TDirectory") )
433 {
434 TDirectory* d = static_cast<TDirectory*>(object);
435 ReadDir(*d);
436 continue;
437 }
438
49419555 439 if ( object->InheritsFrom("AliMUONVTrackerDataMaker") )
440 {
441 AliMUONVTrackerDataMaker* maker = dynamic_cast<AliMUONVTrackerDataMaker*>(object);
442 if ( maker )
443 {
8f0acce4 444 AliMUONPainterDataRegistry::Instance()->Register(maker);
49419555 445 }
446 }
90037e4e 447
448 if ( object->InheritsFrom("AliMUONVTrackerData") )
449 {
49419555 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);
90037e4e 454 if ( data )
455 {
49419555 456 AliMUONVTrackerDataMaker* maker = new AliMUONTrackerDataWrapper(data);
8f0acce4 457 AliMUONPainterDataRegistry::Instance()->Register(maker);
90037e4e 458 }
459 }
460 }
49419555 461
90037e4e 462}
463
90037e4e 464//______________________________________________________________________________
465void
10eb3d17 466AliMUONMchViewApplication::PrintAs()
467{
468 /// Print as...
469
470 TGFileInfo fileInfo;
471
472 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
473 kFDSave,&fileInfo);
474
fcabdc0c 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 }
10eb3d17 485}
486
487//______________________________________________________________________________
488void
49419555 489AliMUONMchViewApplication::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);
1ffbeb9d 499
fb43b48d 500 rn->AddLine("1.13");
501 rn->AddLine("");
502 rn->AddLine("Make default OCDB = 2013 one");
503 rn->AddLine("");
504
301ca128 505 rn->AddLine("1.11");
506 rn->AddLine("");
507 rn->AddLine("Adding [Compare alignments] in the Tools menu + make default OCDB be 2012's version");
508 rn->AddLine("");
509
9f4473f2 510 rn->AddLine("1.10");
511 rn->AddLine("");
512 rn->AddLine("Make the raw OCDB more obvious in the data source tab");
513 rn->AddLine("");
514
007e62b2 515 rn->AddLine("1.08");
516 rn->AddLine("");
517 rn->AddLine("Changed the default OCDB to 2011 version");
518 rn->AddLine("");
519
6ebcde15 520 rn->AddLine("1.07");
521 rn->AddLine("");
522 rn->AddLine("Added the RejectList as a possible OCDB data source");
523 rn->AddLine("");
524
991adcd3 525 rn->AddLine("1.06");
526 rn->AddLine("");
527 rn->AddLine("Changed a bit the HV display. Now a trip is indicated with a value of -1");
528 rn->AddLine("");
529
a679753e 530 rn->AddLine("1.05");
531 rn->AddLine("");
532 rn->AddLine("Added the possibility to select an event range when reading raw data");
533 rn->AddLine("Usefull e.g. to look at a single suspect event...");
534 rn->AddLine("");
535
f5a46139 536 rn->AddLine("1.04");
537 rn->AddLine("");
538 rn->AddLine("Changed the default OCDB to 2010 version");
539 rn->AddLine("");
540
fcabdc0c 541 rn->AddLine("1.03");
542 rn->AddLine("");
543 rn->AddLine("Add Print buttons");
544 rn->AddLine("Add the automatic creation of often used canvases when using pedestal source");
545 // Internal reorganization to allow several independent tabs to be created to
546 // show different master frames (not used yet). Important for the moment
547 // is the ability to create a PainterMatrix and pass it to the PainterMasterFrame
548 rn->AddLine("");
549
ca913045 550 rn->AddLine("1.02");
551 rn->AddLine("");
552 rn->AddLine("Internal change (merging of AliMUONTrackerACFDataMaker and AliMUONTrackerOCDBDataMaker into AliMUONTrackerConditionDataMaker)");
553 rn->AddLine("Added --ocdb option");
554 rn->AddLine("Corrected the display of the configuration");
555 rn->AddLine("Corrected the interpretation of the switches for the HV display");
556 rn->AddLine("");
557
6c870207 558 rn->AddLine("1.01");
559 rn->AddLine("");
560 rn->AddLine("Added the configuration as a possible OCDB data source");
561 rn->AddLine("");
562
fef32488 563 rn->AddLine("1.00");
564 rn->AddLine("");
565 rn->AddLine("Added the Status and StatusMap as a possible OCDB data source");
566 rn->AddLine("");
567 rn->AddLine("Added one (computed) dimension to the Gains data source = 1/a1/0.2 (mV/fC)");
568 rn->AddLine("");
6c870207 569
fef32488 570 rn->AddLine("0.99a");
571 rn->AddLine("");
572 rn->AddLine("Added the --de and --chamber options");
573 rn->AddLine("");
574
dc9bb08e 575 rn->AddLine("0.99");
576 rn->AddLine("");
577 rn->AddLine("The chamberid in the label (top right of panel) is now starting at 1 as in common usage");
578 rn->AddLine("");
579
3f979838 580 rn->AddLine("0.98");
581 rn->AddLine("");
582 rn->AddLine("Added --asciimapping option");
583 rn->AddLine("");
584
66cdf5b3 585 rn->AddLine("0.97");
586 rn->AddLine("");
587 rn->AddLine("Adding calibration option with Emelec (aka injection) gain");
588 rn->AddLine("");
589
8f0acce4 590 rn->AddLine("0.96a");
591 rn->AddLine("");
592 rn->AddLine("Internal reorganization of the contour computations, that lead to improved performance. ");
593 rn->AddLine("Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours.");
594 rn->AddLine("");
595
b6f591ae 596 rn->AddLine("0.96");
597 rn->AddLine("");
598 rn->AddLine("New features");
599 rn->AddLine("");
600 rn->AddLine("- Can now read raw data from memory (using the mem://@gdc: syntax)");
601 rn->AddLine("- Raw data decoder now automatically skips buspatches with parity errors");
602 rn->AddLine("");
603
604 rn->AddLine("0.95");
1ffbeb9d 605 rn->AddLine("");
606 rn->AddLine("New features");
607 rn->AddLine("");
608 rn->AddLine("- Can now read and display HV values from OCDB");
609 rn->AddLine("- New program option --geometry to force geometry of the window");
610 rn->AddLine("- Added possibility, in painters' context menu, to include or exclude part of the detector");
611 rn->AddLine(" (which will be used later on to communicate with LC2 which parts should be read out or not)");
612 rn->AddLine("");
613 rn->AddLine("Improvement");
614 rn->AddLine("");
615 rn->AddLine("- When displaying Gains, the quality information is now decoded");
616 rn->AddLine("");
49419555 617
1286237e 618 rn->AddLine("0.94");
619 rn->AddLine("");
620 rn->AddLine("New features");
621 rn->AddLine("");
622 rn->AddLine("Can now read ASCII calibration files produced by the DA");
623 rn->AddLine("");
624
49419555 625 rn->AddLine("0.93");
626 rn->AddLine("");
627 rn->AddLine("New features");
628 rn->AddLine("");
629 rn->AddLine("- Adding a Lock button under the color slider to lock the range shown");
630 rn->AddLine(" when switching between views");
631 rn->AddLine("- Default display now shows bending plane (instead of cathode 0 before)");
632 rn->AddLine("- If pad is responder and there's some histo for that pad, ");
633 rn->AddLine(" clicking on it will display an histo");
634 rn->AddLine("- Right-click on a painter will now display several histogram options");
635 rn->AddLine(" (e.g. raw charge as before, but also simple distributions of mean");
636 rn->AddLine(" and sigma");
637 rn->AddLine("- In the Data Sources Tab, each data source can now be removed and saved");
638 rn->AddLine("- There's a new Tool menu which allow to produce a TrackerData from two others");
639 rn->AddLine(" in order to compare data.");
640 rn->AddLine(" - The --use option can now reference alien files");
641 rn->AddLine("");
642 rn->AddLine("Bug fixes");
643 rn->AddLine("");
644 rn->AddLine("- Can now read Capacitances from OCDB");
645
646 rn->Resize(width,height);
647
648 t->AddFrame(rn, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
649
650 t->MapSubwindows();
651 t->Resize();
652 t->MapWindow();
653 t->CenterOnParent();
654
655 // set names
656
657 t->SetWindowName("mchview release notes");
658 t->SetIconName("mchview release notes");
659
660// t->SetMWMHints(kMWMDecorAll | kMWMDecorResizeH | kMWMDecorMaximize |
661// kMWMDecorMinimize | kMWMDecorMenu,
662// kMWMFuncAll | kMWMFuncResize | kMWMFuncMaximize |
663// kMWMFuncMinimize,
664// kMWMInputModeless);
665
666 t->MapRaised();
667// gClient->WaitFor(t);
668}
669
670//______________________________________________________________________________
671void
90037e4e 672AliMUONMchViewApplication::Save()
673{
674 /// Open "Save VTrackerData objects to file" dialog
675
676 TGFileInfo fileInfo;
677
678 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
679 kFDSave,&fileInfo);
680
681 Save(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)));
682}
683
684//______________________________________________________________________________
685void
686AliMUONMchViewApplication::Save(const char* filename)
687{
49419555 688 /// Save VTrackerDataMaker objects into file of given name
90037e4e 689
8f0acce4 690 AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
90037e4e 691
692 TFile f(filename,"RECREATE");
693
49419555 694 for ( Int_t i = 0; i < reg->NumberOfDataMakers(); ++i )
90037e4e 695 {
49419555 696 AliMUONVTrackerDataMaker* maker = reg->DataMaker(i);
697 maker->Write();
90037e4e 698 }
699
700 f.Close();
701}