]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONMchViewApplication.cxx
Adding include path to allow compilation of CleanGeom task
[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
301ca128 255//______________________________________________________________________________
256void
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
49419555 277//______________________________________________________________________________
278void
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
90037e4e 299//______________________________________________________________________________
300void
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
10eb3d17 464//______________________________________________________________________________
465void
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
49419555 487//______________________________________________________________________________
488void
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
a7dd81de 500 rn->AddLine("1.15");
501 rn->AddLine("");
502 rn->AddLine("Fixing display of data at pad level (pads were hollow)");
503 rn->AddLine("");
504
065e62e4 505 rn->AddLine("1.14");
506 rn->AddLine("");
507 rn->AddLine("Fixing anti-aliasing problem on MacOSX");
508 rn->AddLine("");
509
fb43b48d 510 rn->AddLine("1.13");
511 rn->AddLine("");
512 rn->AddLine("Make default OCDB = 2013 one");
513 rn->AddLine("");
514
301ca128 515 rn->AddLine("1.11");
516 rn->AddLine("");
517 rn->AddLine("Adding [Compare alignments] in the Tools menu + make default OCDB be 2012's version");
518 rn->AddLine("");
519
9f4473f2 520 rn->AddLine("1.10");
521 rn->AddLine("");
522 rn->AddLine("Make the raw OCDB more obvious in the data source tab");
523 rn->AddLine("");
524
007e62b2 525 rn->AddLine("1.08");
526 rn->AddLine("");
527 rn->AddLine("Changed the default OCDB to 2011 version");
528 rn->AddLine("");
529
6ebcde15 530 rn->AddLine("1.07");
531 rn->AddLine("");
532 rn->AddLine("Added the RejectList as a possible OCDB data source");
533 rn->AddLine("");
534
991adcd3 535 rn->AddLine("1.06");
536 rn->AddLine("");
537 rn->AddLine("Changed a bit the HV display. Now a trip is indicated with a value of -1");
538 rn->AddLine("");
539
a679753e 540 rn->AddLine("1.05");
541 rn->AddLine("");
542 rn->AddLine("Added the possibility to select an event range when reading raw data");
543 rn->AddLine("Usefull e.g. to look at a single suspect event...");
544 rn->AddLine("");
545
f5a46139 546 rn->AddLine("1.04");
547 rn->AddLine("");
548 rn->AddLine("Changed the default OCDB to 2010 version");
549 rn->AddLine("");
550
fcabdc0c 551 rn->AddLine("1.03");
552 rn->AddLine("");
553 rn->AddLine("Add Print buttons");
554 rn->AddLine("Add the automatic creation of often used canvases when using pedestal source");
555 // Internal reorganization to allow several independent tabs to be created to
556 // show different master frames (not used yet). Important for the moment
557 // is the ability to create a PainterMatrix and pass it to the PainterMasterFrame
558 rn->AddLine("");
559
ca913045 560 rn->AddLine("1.02");
561 rn->AddLine("");
562 rn->AddLine("Internal change (merging of AliMUONTrackerACFDataMaker and AliMUONTrackerOCDBDataMaker into AliMUONTrackerConditionDataMaker)");
563 rn->AddLine("Added --ocdb option");
564 rn->AddLine("Corrected the display of the configuration");
565 rn->AddLine("Corrected the interpretation of the switches for the HV display");
566 rn->AddLine("");
567
6c870207 568 rn->AddLine("1.01");
569 rn->AddLine("");
570 rn->AddLine("Added the configuration as a possible OCDB data source");
571 rn->AddLine("");
572
fef32488 573 rn->AddLine("1.00");
574 rn->AddLine("");
575 rn->AddLine("Added the Status and StatusMap as a possible OCDB data source");
576 rn->AddLine("");
577 rn->AddLine("Added one (computed) dimension to the Gains data source = 1/a1/0.2 (mV/fC)");
578 rn->AddLine("");
6c870207 579
fef32488 580 rn->AddLine("0.99a");
581 rn->AddLine("");
582 rn->AddLine("Added the --de and --chamber options");
583 rn->AddLine("");
584
dc9bb08e 585 rn->AddLine("0.99");
586 rn->AddLine("");
587 rn->AddLine("The chamberid in the label (top right of panel) is now starting at 1 as in common usage");
588 rn->AddLine("");
589
3f979838 590 rn->AddLine("0.98");
591 rn->AddLine("");
592 rn->AddLine("Added --asciimapping option");
593 rn->AddLine("");
594
66cdf5b3 595 rn->AddLine("0.97");
596 rn->AddLine("");
597 rn->AddLine("Adding calibration option with Emelec (aka injection) gain");
598 rn->AddLine("");
599
8f0acce4 600 rn->AddLine("0.96a");
601 rn->AddLine("");
602 rn->AddLine("Internal reorganization of the contour computations, that lead to improved performance. ");
603 rn->AddLine("Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours.");
604 rn->AddLine("");
605
b6f591ae 606 rn->AddLine("0.96");
607 rn->AddLine("");
608 rn->AddLine("New features");
609 rn->AddLine("");
610 rn->AddLine("- Can now read raw data from memory (using the mem://@gdc: syntax)");
611 rn->AddLine("- Raw data decoder now automatically skips buspatches with parity errors");
612 rn->AddLine("");
613
614 rn->AddLine("0.95");
1ffbeb9d 615 rn->AddLine("");
616 rn->AddLine("New features");
617 rn->AddLine("");
618 rn->AddLine("- Can now read and display HV values from OCDB");
619 rn->AddLine("- New program option --geometry to force geometry of the window");
620 rn->AddLine("- Added possibility, in painters' context menu, to include or exclude part of the detector");
621 rn->AddLine(" (which will be used later on to communicate with LC2 which parts should be read out or not)");
622 rn->AddLine("");
623 rn->AddLine("Improvement");
624 rn->AddLine("");
625 rn->AddLine("- When displaying Gains, the quality information is now decoded");
626 rn->AddLine("");
49419555 627
1286237e 628 rn->AddLine("0.94");
629 rn->AddLine("");
630 rn->AddLine("New features");
631 rn->AddLine("");
632 rn->AddLine("Can now read ASCII calibration files produced by the DA");
633 rn->AddLine("");
634
49419555 635 rn->AddLine("0.93");
636 rn->AddLine("");
637 rn->AddLine("New features");
638 rn->AddLine("");
639 rn->AddLine("- Adding a Lock button under the color slider to lock the range shown");
640 rn->AddLine(" when switching between views");
641 rn->AddLine("- Default display now shows bending plane (instead of cathode 0 before)");
642 rn->AddLine("- If pad is responder and there's some histo for that pad, ");
643 rn->AddLine(" clicking on it will display an histo");
644 rn->AddLine("- Right-click on a painter will now display several histogram options");
645 rn->AddLine(" (e.g. raw charge as before, but also simple distributions of mean");
646 rn->AddLine(" and sigma");
647 rn->AddLine("- In the Data Sources Tab, each data source can now be removed and saved");
648 rn->AddLine("- There's a new Tool menu which allow to produce a TrackerData from two others");
649 rn->AddLine(" in order to compare data.");
650 rn->AddLine(" - The --use option can now reference alien files");
651 rn->AddLine("");
652 rn->AddLine("Bug fixes");
653 rn->AddLine("");
654 rn->AddLine("- Can now read Capacitances from OCDB");
655
656 rn->Resize(width,height);
657
658 t->AddFrame(rn, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
659
660 t->MapSubwindows();
661 t->Resize();
662 t->MapWindow();
663 t->CenterOnParent();
664
665 // set names
666
667 t->SetWindowName("mchview release notes");
668 t->SetIconName("mchview release notes");
669
670// t->SetMWMHints(kMWMDecorAll | kMWMDecorResizeH | kMWMDecorMaximize |
671// kMWMDecorMinimize | kMWMDecorMenu,
672// kMWMFuncAll | kMWMFuncResize | kMWMFuncMaximize |
673// kMWMFuncMinimize,
674// kMWMInputModeless);
675
676 t->MapRaised();
677// gClient->WaitFor(t);
678}
679
90037e4e 680//______________________________________________________________________________
681void
682AliMUONMchViewApplication::Save()
683{
684 /// Open "Save VTrackerData objects to file" dialog
685
686 TGFileInfo fileInfo;
687
688 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
689 kFDSave,&fileInfo);
690
691 Save(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)));
692}
693
694//______________________________________________________________________________
695void
696AliMUONMchViewApplication::Save(const char* filename)
697{
49419555 698 /// Save VTrackerDataMaker objects into file of given name
90037e4e 699
8f0acce4 700 AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
90037e4e 701
702 TFile f(filename,"RECREATE");
703
49419555 704 for ( Int_t i = 0; i < reg->NumberOfDataMakers(); ++i )
90037e4e 705 {
49419555 706 AliMUONVTrackerDataMaker* maker = reg->DataMaker(i);
707 maker->Write();
90037e4e 708 }
709
710 f.Close();
711}