20 #include "AliCDBManager.h"
21 #include "AliCodeTimer.h"
38 #include <Riostream.h>
43 #include <TGFileDialog.h>
46 #include <TGTextView.h>
75 "ROOT files",
"*.root",
81 int* argc,
char** argv,
84 : TRint(name,argc,argv),
86 fPainterMasterFrameList(new TList),
96 w = (UInt_t)(gClient->GetDisplayWidth()*0.7);
97 h = (UInt_t)(gClient->GetDisplayHeight()*0.9);
100 fMainFrame =
new TGMainFrame(gClient->GetRoot(),w,h);
110 TGCompositeFrame* t =
fTabs->AddTab(
"Painter Master Frame");
120 t->AddFrame(pmf,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs));
122 t =
fTabs->AddTab(
"Data Sources");
127 t->AddFrame(dsf,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs));
129 fMainFrame->AddFrame(
fTabs,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0));
131 fMainFrame->SetWindowName(
"mchview - Visualization of MUON Tracker detector");
140 fMainFrame->Connect(
"CloseWindow()",
"AliMUONMchViewApplication",
this,
"Terminate()");
147 cout <<
"***************************************************" << endl;
148 cout <<
" Welcome to mchview" << endl;
150 cout <<
"***************************************************" << endl;
157 args.SetOwner(kTRUE);
159 for (
int i = 1; i < argc[0]; ++i )
161 args.Add(
new TObjString(argv[i]));
164 for ( Int_t i = 0; i <= args.GetLast(); ++i )
166 TString a(static_cast<TObjString*>(args.At(i))->String());
171 att.SetCathode(kFALSE,kFALSE);
172 att.SetViewPoint(kTRUE,kFALSE);
176 Int_t detElemId =
static_cast<TObjString*
>(args.At(i+1))->String().Atoi();
187 if ( a ==
"--chamber" )
189 Int_t chamberId =
static_cast<TObjString*
>(args.At(i+1))->String().Atoi();
224 AliCodeTimerAuto(
"",0);
234 for ( Int_t i = 0; i < 10; ++i )
244 for ( Int_t j = 0; j < 3; ++j )
249 matrix->
Adopt(painter);
271 t->SetWindowName(
"mchview compare alignments tool");
272 t->SetIconName(
"mchview compare alignments tool");
293 t->SetWindowName(
"mchview compare data tool");
294 t->SetIconName(
"mchview compare data tool");
305 TGPopupMenu* file =
new TGPopupMenu(gClient->GetRoot());
314 TGPopupMenu* tools =
new TGPopupMenu(gClient->GetRoot());
318 TGPopupMenu* about =
new TGPopupMenu(gClient->GetRoot());
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)");
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));
329 fMainFrame->AddFrame(bar,
new TGLayoutHints(kLHintsLeft|kLHintsExpandX));
378 delete[] fileInfo.fIniDir;
382 fileInfo.fIniDir = StrDup(env->
String(
"LastOpenDir",
"."));
384 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
387 env->
Set(
"LastOpenDir",fileInfo.fIniDir);
390 Open(gSystem->ExpandPathName(Form(
"%s",fileInfo.fFilename)));
399 TString sfilename(gSystem->ExpandPathName(filename));
401 if ( sfilename.Contains(TRegexp(
"^alien")) )
406 TGrid::Connect(
"alien://");
410 TFile*
f = TFile::Open(filename);
423 TList* keys = dir.GetListOfKeys();
428 while ( ( k = static_cast<TKey*>(next()) ) )
430 TObject*
object = k->ReadObj();
432 if ( object->InheritsFrom(
"TDirectory") )
434 TDirectory* d =
static_cast<TDirectory*
>(object);
439 if ( object->InheritsFrom(
"AliMUONVTrackerDataMaker") )
448 if ( object->InheritsFrom(
"AliMUONVTrackerData") )
472 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
479 while ( ( pmf = static_cast<AliMUONPainterMasterFrame*>(next()) ) )
481 pmf->
SaveAs(gSystem->ExpandPathName(Form(
"%s",fileInfo.fFilename)),
482 first ?
"RECREATE" :
"UPDATE");
496 TGTransientFrame* t =
new TGTransientFrame(gClient->GetRoot(),gClient->GetRoot(),width,height);
498 TGTextView* rn =
new TGTextView(t);
502 rn->AddLine(
"- Get the data source range settings (for display) persistent, by adding them to the .mchviewrc resource file");
503 rn->AddLine(
"- Added two new buttons below the color palette to set default range values and return to them");
505 rn->AddLine(
"WARNING : resource file format changed. Please remove old one before launching this new version !");
510 rn->AddLine(
"- Do not connect to the Grid by default if OCDB is from cvmfs");
511 rn->AddLine(
"- Add disableAutoPedCanvas: 1|0 option to .mchviewrc to disable auto generation of pedestal canvases when opening a ped data source");
517 rn->AddLine(
"Default OCDB is now cvmfs (for the current year) if that mounting point exists");
522 rn->AddLine(
"Default OCDB is now raw:// (following the fact that 'code' OCDB is not longer installed");
523 rn->AddLine(
"If you want a purely local execution you'll need a local copy of the OCDB and use the --ocdb option to point mchview to it");
528 rn->AddLine(
"Fixing display of data at pad level (pads were hollow)");
533 rn->AddLine(
"Fixing anti-aliasing problem on MacOSX");
538 rn->AddLine(
"Make default OCDB = 2013 one");
543 rn->AddLine(
"Adding [Compare alignments] in the Tools menu + make default OCDB be 2012's version");
548 rn->AddLine(
"Make the raw OCDB more obvious in the data source tab");
553 rn->AddLine(
"Changed the default OCDB to 2011 version");
558 rn->AddLine(
"Added the RejectList as a possible OCDB data source");
563 rn->AddLine(
"Changed a bit the HV display. Now a trip is indicated with a value of -1");
568 rn->AddLine(
"Added the possibility to select an event range when reading raw data");
569 rn->AddLine(
"Usefull e.g. to look at a single suspect event...");
574 rn->AddLine(
"Changed the default OCDB to 2010 version");
579 rn->AddLine(
"Add Print buttons");
580 rn->AddLine(
"Add the automatic creation of often used canvases when using pedestal source");
588 rn->AddLine(
"Internal change (merging of AliMUONTrackerACFDataMaker and AliMUONTrackerOCDBDataMaker into AliMUONTrackerConditionDataMaker)");
589 rn->AddLine(
"Added --ocdb option");
590 rn->AddLine(
"Corrected the display of the configuration");
591 rn->AddLine(
"Corrected the interpretation of the switches for the HV display");
596 rn->AddLine(
"Added the configuration as a possible OCDB data source");
601 rn->AddLine(
"Added the Status and StatusMap as a possible OCDB data source");
603 rn->AddLine(
"Added one (computed) dimension to the Gains data source = 1/a1/0.2 (mV/fC)");
606 rn->AddLine(
"0.99a");
608 rn->AddLine(
"Added the --de and --chamber options");
613 rn->AddLine(
"The chamberid in the label (top right of panel) is now starting at 1 as in common usage");
618 rn->AddLine(
"Added --asciimapping option");
623 rn->AddLine(
"Adding calibration option with Emelec (aka injection) gain");
626 rn->AddLine(
"0.96a");
628 rn->AddLine(
"Internal reorganization of the contour computations, that lead to improved performance. ");
629 rn->AddLine(
"Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours.");
634 rn->AddLine(
"New features");
636 rn->AddLine(
"- Can now read raw data from memory (using the mem://@gdc: syntax)");
637 rn->AddLine(
"- Raw data decoder now automatically skips buspatches with parity errors");
642 rn->AddLine(
"New features");
644 rn->AddLine(
"- Can now read and display HV values from OCDB");
645 rn->AddLine(
"- New program option --geometry to force geometry of the window");
646 rn->AddLine(
"- Added possibility, in painters' context menu, to include or exclude part of the detector");
647 rn->AddLine(
" (which will be used later on to communicate with LC2 which parts should be read out or not)");
649 rn->AddLine(
"Improvement");
651 rn->AddLine(
"- When displaying Gains, the quality information is now decoded");
656 rn->AddLine(
"New features");
658 rn->AddLine(
"Can now read ASCII calibration files produced by the DA");
663 rn->AddLine(
"New features");
665 rn->AddLine(
"- Adding a Lock button under the color slider to lock the range shown");
666 rn->AddLine(
" when switching between views");
667 rn->AddLine(
"- Default display now shows bending plane (instead of cathode 0 before)");
668 rn->AddLine(
"- If pad is responder and there's some histo for that pad, ");
669 rn->AddLine(
" clicking on it will display an histo");
670 rn->AddLine(
"- Right-click on a painter will now display several histogram options");
671 rn->AddLine(
" (e.g. raw charge as before, but also simple distributions of mean");
672 rn->AddLine(
" and sigma");
673 rn->AddLine(
"- In the Data Sources Tab, each data source can now be removed and saved");
674 rn->AddLine(
"- There's a new Tool menu which allow to produce a TrackerData from two others");
675 rn->AddLine(
" in order to compare data.");
676 rn->AddLine(
" - The --use option can now reference alien files");
678 rn->AddLine(
"Bug fixes");
680 rn->AddLine(
"- Can now read Capacitances from OCDB");
682 rn->Resize(width,height);
684 t->AddFrame(rn,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
693 t->SetWindowName(
"mchview release notes");
694 t->SetIconName(
"mchview release notes");
714 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
717 Save(gSystem->ExpandPathName(Form(
"%s",fileInfo.fFilename)));
728 TFile
f(filename,
"RECREATE");
static AliMUONPainterHelper * Instance()
A painter for one detection element.
void SetOutlined(const char *pattern, Bool_t flag)
TList * fPainterMasterFrameList
list of painterMasterFrame objects
void SetLine(Int_t depth, Int_t lineColor, Int_t lineWidth)
Main class for the mchview program.
void ShiftClicked(AliMUONVPainter *painter, Double_t *values)
TFile f("CalibObjects.root")
Int_t NumberOfDataMakers() const
virtual void SetResponder(const char *pattern)
Producer of some AliMUONVTrackerData.
AliMUONMchViewApplication(const char *name, int *argc, char **argv, UInt_t w=0, UInt_t h=0, UInt_t ox=0, UInt_t oy=0)
Authors Philippe Pillot, Laurent Aphecetche, Subatech.
Author Laurent Aphecetche, Subatech.
void SetViewPoint(Bool_t front, Bool_t back)
Int_t Register(AliMUONPainterMatrix *group)
TString String(const char *resourceName, const char *defaultValue="") const
void SetCathode(Bool_t cath0, Bool_t cath1)
static const Int_t fgkCOMPAREDATA
Tools/Compare Data menu.
static AliMUONPainterRegistry * Instance()
void Register(AliMUONVTrackerDataMaker *reader)
static AliMUONPainterDataRegistry * Instance()
Base class for a graphical object representing some part of the MUON tracking system.
void SetMenuBar(TGMenuBar *bar)
Set the menu bar where to put the history menu.
void CreateMenuBar(UInt_t w)
Registry for painter data sources.
void ReadDir(TDirectory &dir)
static const Int_t fgkCOMPAREALIGNMENTS
Tools/Compare Alignments menu.
static const Int_t fgkFILESAVEAS
File/Save As... menu.
static const Int_t fgkABOUT
About menu.
The main window for the offline "a la mood" display.
AliMUONVTrackerDataMaker * DataMaker(Int_t i) const
static const Int_t fgkFILEOPEN
File/Open... menu.
Simple wrapper of AliMUONVTrackerData (for backward compatibility)
virtual ~AliMUONMchViewApplication()
void Adopt(AliMUONVPainter *painter)
Adopt a painter in this matrix.
static const char * fgkFileTypes[]
For the open menu.
static const Int_t fgkFILEEXIT
File/Exit menu.
AliMUONPainterEnv * Env()
Return the environment.
Basic attributes shared by all painters.
AliMUONPainterMatrix * GenerateStartupMatrix()
void SaveAs(const char *filename="", Option_t *option="") const
void SetPlane(Bool_t bending, Bool_t nonBending)
static const Int_t fgkFILEPRINTAS
File/Print As... menu.
Base class for MUON data that can be presented at different levels in the hierarchy of the MUON syste...
A matrix of AliMUONVPainter.
static const char * FullVersion()
Return the SVN revision and version number of the mchview application.
TGMainFrame * fMainFrame
pointer to our mainframe
void Set(const char *resourceName, Int_t value)
Frame to select input data source(s) to be displayed.
Painter for one (plane of one) chamber.