X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONMchViewApplication.cxx;h=02620a689ccfa9c0e3fa7b89e9d09dad525a2d28;hb=dbeb013274a289e326d0b99b3fa481a23a0c4bb0;hp=9476c89f7e870fd0430eb5429ea2834f4267f5f3;hpb=ca91304529ab670ee6772a1406af5f0d8ce0545a;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONMchViewApplication.cxx b/MUON/AliMUONMchViewApplication.cxx index 9476c89f7e8..02620a689cc 100644 --- a/MUON/AliMUONMchViewApplication.cxx +++ b/MUON/AliMUONMchViewApplication.cxx @@ -20,13 +20,16 @@ #include "AliCDBManager.h" #include "AliCodeTimer.h" #include "AliLog.h" +#include "AliMUONAlignmentCompareDialog.h" #include "AliMUONChamberPainter.h" #include "AliMUONDEPainter.h" #include "AliMUONPainterDataRegistry.h" #include "AliMUONPainterDataSourceFrame.h" #include "AliMUONPainterEnv.h" #include "AliMUONPainterHelper.h" +#include "AliMUONPainterGroup.h" #include "AliMUONPainterMasterFrame.h" +#include "AliMUONPainterMatrix.h" #include "AliMUONPainterRegistry.h" #include "AliMUONTrackerDataCompareDialog.h" #include "AliMUONTrackerDataWrapper.h" @@ -54,6 +57,8 @@ /// ///\author Laurent Aphecetche, Subatech +using std::cout; +using std::endl; /// \cond CLASSIMP ClassImp(AliMUONMchViewApplication) /// \endcond CLASSIMP @@ -64,6 +69,7 @@ const Int_t AliMUONMchViewApplication::fgkFILEEXIT(3); const Int_t AliMUONMchViewApplication::fgkFILEPRINTAS(4); const Int_t AliMUONMchViewApplication::fgkABOUT(5); const Int_t AliMUONMchViewApplication::fgkCOMPAREDATA(6); +const Int_t AliMUONMchViewApplication::fgkCOMPAREALIGNMENTS(7); const char* AliMUONMchViewApplication::fgkFileTypes[] = { "ROOT files", "*.root", @@ -77,14 +83,15 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name, UInt_t ox, UInt_t oy) : TRint(name,argc,argv), fMainFrame(0x0), - fPainterMasterFrame(0x0) + fPainterMasterFrameList(new TList), + fTabs(0x0) { /// ctor /// (w,h) is the size in pixel (if 0,0 it will be computed as 70%,90% of display size) /// (ox,oy) is the offset from the top-left of the display - if (!w | !h) + if (!w || !h) { w = (UInt_t)(gClient->GetDisplayWidth()*0.7); h = (UInt_t)(gClient->GetDisplayHeight()*0.9); @@ -92,46 +99,50 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name, fMainFrame = new TGMainFrame(gClient->GetRoot(),w,h); - AliMUONPainterHelper::Instance()->GenerateDefaultMatrices(); - CreateMenuBar(w); const Int_t kbs = 2; // h -= 60; // menubar - TGTab* tabs = new TGTab(fMainFrame,w,h); + fTabs = new TGTab(fMainFrame,w,h); - TGCompositeFrame* t = tabs->AddTab("Painter Master Frame"); + TGCompositeFrame* t = fTabs->AddTab("Painter Master Frame"); - fPainterMasterFrame = - new AliMUONPainterMasterFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2); + fPainterMasterFrameList->SetOwner(kTRUE); + - t->AddFrame(fPainterMasterFrame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs)); + AliMUONPainterMasterFrame* pmf = new AliMUONPainterMasterFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2, + GenerateStartupMatrix()); - t = tabs->AddTab("Data Sources"); + fPainterMasterFrameList->Add(pmf); + + t->AddFrame(pmf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs)); + + t = fTabs->AddTab("Data Sources"); AliMUONPainterDataSourceFrame* dsf = new AliMUONPainterDataSourceFrame(t,t->GetWidth()-kbs*2,t->GetHeight()-kbs*2); t->AddFrame(dsf,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,kbs,kbs,kbs,kbs)); - fMainFrame->AddFrame(tabs,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0)); + fMainFrame->AddFrame(fTabs,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0)); fMainFrame->SetWindowName("mchview - Visualization of MUON Tracker detector"); fMainFrame->MapSubwindows(); fMainFrame->Resize(); - fPainterMasterFrame->Update(); + pmf->Update(); fMainFrame->MapWindow(); fMainFrame->Connect("CloseWindow()","AliMUONMchViewApplication",this,"Terminate()"); - fMainFrame->MoveResize(ox,oy, w, h); +// fMainFrame->MoveResize(ox,oy, w, h); fMainFrame->SetWMPosition(ox, oy); - fMainFrame->SetWMSizeHints(w,h,w,h,0,0); +// fMainFrame->SetWMSizeHints(w,h,w,h,0,0); +// fMainFrame->SetWMSizeHints(w,h,w,h,10,10); cout << "***************************************************" << endl; cout << " Welcome to mchview" << endl; @@ -190,9 +201,9 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name, if ( painter ) { - fPainterMasterFrame->ShiftClicked(painter,0x0); + pmf->ShiftClicked(painter,0x0); - fPainterMasterFrame->Update(); + pmf->Update(); } } @@ -201,6 +212,66 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name, AliMUONMchViewApplication::~AliMUONMchViewApplication() { /// dtor + delete fPainterMasterFrameList; +} + +//_____________________________________________________________________________ +AliMUONPainterMatrix* +AliMUONMchViewApplication::GenerateStartupMatrix() +{ + /// Kind of bootstrap method to trigger the generation of all contours + + AliCodeTimerAuto("",0); + + AliMUONAttPainter att; + + att.SetViewPoint(kTRUE,kFALSE); + att.SetCathode(kFALSE,kFALSE); + att.SetPlane(kTRUE,kFALSE); + + AliMUONPainterMatrix* matrix = new AliMUONPainterMatrix("Tracker",5,2); + + for ( Int_t i = 0; i < 10; ++i ) + { + AliMUONVPainter* painter = new AliMUONChamberPainter(att,i); + + painter->SetResponder("Chamber"); + + painter->SetOutlined("*",kFALSE); + + painter->SetOutlined("MANU",kTRUE); + + for ( Int_t j = 0; j < 3; ++j ) + { + painter->SetLine(j,1,4-j); + } + + matrix->Adopt(painter); + } + AliMUONPainterRegistry::Instance()->Register(matrix); + return matrix; +} + +//______________________________________________________________________________ +void +AliMUONMchViewApplication::CompareAlignments() +{ + /// Launch compare data dialog + TGTransientFrame* t = new AliMUONAlignmentCompareDialog(gClient->GetRoot(), + gClient->GetRoot(), + 400,400); + + t->MapSubwindows(); + t->Resize(); + t->MapWindow(); + t->CenterOnParent(); + + // set names + + t->SetWindowName("mchview compare alignments tool"); + t->SetIconName("mchview compare alignments tool"); + + t->MapRaised(); } //______________________________________________________________________________ @@ -222,8 +293,7 @@ AliMUONMchViewApplication::CompareData() t->SetWindowName("mchview compare data tool"); t->SetIconName("mchview compare data tool"); - t->MapRaised(); - + t->MapRaised(); } //______________________________________________________________________________ @@ -243,6 +313,7 @@ AliMUONMchViewApplication::CreateMenuBar(UInt_t w) TGPopupMenu* tools = new TGPopupMenu(gClient->GetRoot()); tools->AddEntry("&Compare data",fgkCOMPAREDATA); + tools->AddEntry("&Compare alignments",fgkCOMPAREALIGNMENTS); TGPopupMenu* about = new TGPopupMenu(gClient->GetRoot()); about->AddEntry(FullVersion(),fgkABOUT); @@ -286,7 +357,10 @@ AliMUONMchViewApplication::HandleMenu(Int_t i) case fgkCOMPAREDATA: CompareData(); break; - default: + case fgkCOMPAREALIGNMENTS: + CompareAlignments(); + break; + default: break; } } @@ -398,7 +472,16 @@ AliMUONMchViewApplication::PrintAs() new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(), kFDSave,&fileInfo); - fPainterMasterFrame->SaveAs(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename))); + TIter next(fPainterMasterFrameList); + AliMUONPainterMasterFrame* pmf; + Bool_t first(kTRUE); + + while ( ( pmf = static_cast(next()) ) ) + { + pmf->SaveAs(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)), + first ? "RECREATE" : "UPDATE"); + first = kFALSE; + } } //______________________________________________________________________________ @@ -414,6 +497,66 @@ AliMUONMchViewApplication::ReleaseNotes() TGTextView* rn = new TGTextView(t); + rn->AddLine("1.15"); + rn->AddLine(""); + rn->AddLine("Fixing display of data at pad level (pads were hollow)"); + rn->AddLine(""); + + rn->AddLine("1.14"); + rn->AddLine(""); + rn->AddLine("Fixing anti-aliasing problem on MacOSX"); + rn->AddLine(""); + + rn->AddLine("1.13"); + rn->AddLine(""); + rn->AddLine("Make default OCDB = 2013 one"); + rn->AddLine(""); + + rn->AddLine("1.11"); + rn->AddLine(""); + rn->AddLine("Adding [Compare alignments] in the Tools menu + make default OCDB be 2012's version"); + rn->AddLine(""); + + rn->AddLine("1.10"); + rn->AddLine(""); + rn->AddLine("Make the raw OCDB more obvious in the data source tab"); + rn->AddLine(""); + + rn->AddLine("1.08"); + rn->AddLine(""); + rn->AddLine("Changed the default OCDB to 2011 version"); + rn->AddLine(""); + + rn->AddLine("1.07"); + rn->AddLine(""); + rn->AddLine("Added the RejectList as a possible OCDB data source"); + rn->AddLine(""); + + rn->AddLine("1.06"); + rn->AddLine(""); + rn->AddLine("Changed a bit the HV display. Now a trip is indicated with a value of -1"); + rn->AddLine(""); + + rn->AddLine("1.05"); + rn->AddLine(""); + rn->AddLine("Added the possibility to select an event range when reading raw data"); + rn->AddLine("Usefull e.g. to look at a single suspect event..."); + rn->AddLine(""); + + rn->AddLine("1.04"); + rn->AddLine(""); + rn->AddLine("Changed the default OCDB to 2010 version"); + rn->AddLine(""); + + rn->AddLine("1.03"); + rn->AddLine(""); + rn->AddLine("Add Print buttons"); + rn->AddLine("Add the automatic creation of often used canvases when using pedestal source"); + // Internal reorganization to allow several independent tabs to be created to + // show different master frames (not used yet). Important for the moment + // is the ability to create a PainterMatrix and pass it to the PainterMasterFrame + rn->AddLine(""); + rn->AddLine("1.02"); rn->AddLine(""); rn->AddLine("Internal change (merging of AliMUONTrackerACFDataMaker and AliMUONTrackerOCDBDataMaker into AliMUONTrackerConditionDataMaker)");