From 9f4473f278dfd538baa8ff3b36211dcc79d26581 Mon Sep 17 00:00:00 2001 From: laphecet Date: Tue, 25 Oct 2011 08:57:12 +0000 Subject: [PATCH] Make the raw OCDB more obvious in the data source tab --- MUON/AliMUONMchViewApplication.cxx | 10 ++++-- MUON/AliMUONMchViewApplication.h | 2 +- MUON/AliMUONPainterDataSourceFrame.cxx | 42 ++++++++++++++++++++++---- MUON/AliMUONPainterDataSourceFrame.h | 1 + MUON/AliMUONPainterMatrixFrame.cxx | 4 +-- 5 files changed, 48 insertions(+), 11 deletions(-) diff --git a/MUON/AliMUONMchViewApplication.cxx b/MUON/AliMUONMchViewApplication.cxx index 1471ebaf034..b5ffc608cf1 100644 --- a/MUON/AliMUONMchViewApplication.cxx +++ b/MUON/AliMUONMchViewApplication.cxx @@ -135,9 +135,10 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name, 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; @@ -466,6 +467,11 @@ AliMUONMchViewApplication::ReleaseNotes() TGTextView* rn = new TGTextView(t); + 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"); diff --git a/MUON/AliMUONMchViewApplication.h b/MUON/AliMUONMchViewApplication.h index f8542606916..695bdbdd44c 100644 --- a/MUON/AliMUONMchViewApplication.h +++ b/MUON/AliMUONMchViewApplication.h @@ -32,7 +32,7 @@ public: void HandleMenu(Int_t i); /// Return the version number of the mchview application - static const char* Version() { return "1.08"; } + static const char* Version() { return "1.10"; } /// Return the SVN revision and version number of the mchview application static const char* FullVersion() { return Form("mchview Version %s ($Id$)",Version()); } diff --git a/MUON/AliMUONPainterDataSourceFrame.cxx b/MUON/AliMUONPainterDataSourceFrame.cxx index c51fddb0f6e..930f66eca6e 100644 --- a/MUON/AliMUONPainterDataSourceFrame.cxx +++ b/MUON/AliMUONPainterDataSourceFrame.cxx @@ -19,6 +19,8 @@ #include "AliMUONPainterDataSourceFrame.h" #include "AliLog.h" +#include "AliCDBEntry.h" +#include "AliCDBManager.h" #include "AliMUONChamberPainter.h" #include "AliMUONMchViewApplication.h" #include "AliMUONPainterDataRegistry.h" @@ -68,6 +70,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p, fRawSelector2(new TGCompositeFrame(fRawSelector,w,h,kVerticalFrame)), fRawSelector21(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)), fRawSelector22(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)), + fRawSelector24(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)), fRawSelector23(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)), fCalibrateNoGain(new TGCheckButton(fRawSelector22,"Ped sub")), fCalibrateGainConstantCapa(new TGCheckButton(fRawSelector22,"Ped sub+gain (capa cste)")), @@ -79,7 +82,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p, fEventRangeButton(new TGCheckButton(fRawSelector23,"Event range")), fEventMin(new TGNumberEntry(fRawSelector23,-1,10)), fEventMax(new TGNumberEntry(fRawSelector23,-1,10)), - fRawOCDBPath(new TGTextEntry(fRawSelector22,"")), + fRawOCDBPath(new TGTextEntry(fRawSelector24,"alien://folder=/alice/data/2011/OCDB")), fOCDBSelector(new TGGroupFrame(this,"OCDB Path",kHorizontalFrame)), fDataReaders(new TGGroupFrame(this,"Data sources")), fFilePath(new TGTextEntry(fRawSelector21,"")), @@ -138,6 +141,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p, fRawSelector2->AddFrame(fRawSelector21, new TGLayoutHints(kLHintsExpandX,5,5,5,5)); fRawSelector2->AddFrame(fRawSelector22, new TGLayoutHints(kLHintsExpandX,5,5,5,5)); + fRawSelector2->AddFrame(fRawSelector24, new TGLayoutHints(kLHintsTop,5,5,5,5)); fRawSelector2->AddFrame(fRawSelector23, new TGLayoutHints(kLHintsExpandX,5,5,5,5)); fRawSelector21->AddFrame(openButton,new TGLayoutHints(kLHintsTop,5,5,5,5)); @@ -147,7 +151,8 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p, fRawSelector22->AddFrame(fCalibrateGainConstantCapa, new TGLayoutHints(kLHintsTop,5,5,5,5)); fRawSelector22->AddFrame(fCalibrateGain, new TGLayoutHints(kLHintsTop,5,5,5,5)); fRawSelector22->AddFrame(fCalibrateEmelecGain, new TGLayoutHints(kLHintsTop,5,5,5,5)); - fRawSelector22->AddFrame(fRawOCDBPath, new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5)); + + fRawSelector24->AddFrame(fRawOCDBPath, new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5)); fRawOCDBPath->SetEnabled(kFALSE); fRawSelector23->AddFrame(fHistogramButton,new TGLayoutHints(kLHintsTop,5,5,5,5)); @@ -705,14 +710,20 @@ AliMUONPainterDataSourceFrame::CreateRawDataSource(const TString& uri) } /// Basic test to see if the file is correct + /// and to get run numbre + Int_t runNumber(-1); Bool_t ok = rawReader->NextEvent(); if (!ok) { - AliError(Form("File %s does not seem to be a raw data file",filename.Data())); + AliError(Form("File %s does not seem to be a raw data file",filename.Data())); fFilePath->SetText(""); return kFALSE; } - + else + { + runNumber = rawReader->GetRunNumber(); + } + rawReader->RewindEvents(); AliMUONVTrackerDataMaker* reader(0x0); @@ -722,9 +733,28 @@ AliMUONPainterDataSourceFrame::CreateRawDataSource(const TString& uri) if ( ocdbPath.Length() > 0 ) { - AliMUONRecoParam* recoParam = AliMUONRecoParam::GetCosmicParam(); + + AliMUONRecoParam* recoParam(0x0); - // FIXME: where to get the reco params from in reality ? + AliCDBEntry* e = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam",runNumber); + if (e) + { + TObject* o = e->GetObject(); + if ( o->IsA() == TObjArray::Class() ) + { + TObjArray* a = static_cast(o); + TIter next(a); + AliMUONRecoParam* p; + while ( ( p = static_cast(next()) )) + { + if ( p->IsDefault()) recoParam = p; + } + } + else + { + recoParam = static_cast(o); + } + } reader = new AliMUONTrackerDataMaker(recoParam, rawReader, diff --git a/MUON/AliMUONPainterDataSourceFrame.h b/MUON/AliMUONPainterDataSourceFrame.h index 02c56ffcb88..24091ad8a8f 100644 --- a/MUON/AliMUONPainterDataSourceFrame.h +++ b/MUON/AliMUONPainterDataSourceFrame.h @@ -97,6 +97,7 @@ private: TGCompositeFrame* fRawSelector2; ///< idem TGCompositeFrame* fRawSelector21; ///< idem TGCompositeFrame* fRawSelector22; ///< idem + TGCompositeFrame* fRawSelector24; ///< idem TGCompositeFrame* fRawSelector23; ///< idem TGCheckButton* fCalibrateNoGain; ///< to trig calibration of raw data (only 0 suppression) TGCheckButton* fCalibrateGainConstantCapa; ///< to trig calibration of raw data (0-supp and gain w/ constant capacitance) diff --git a/MUON/AliMUONPainterMatrixFrame.cxx b/MUON/AliMUONPainterMatrixFrame.cxx index 597f1e32b5a..69757a1cfad 100644 --- a/MUON/AliMUONPainterMatrixFrame.cxx +++ b/MUON/AliMUONPainterMatrixFrame.cxx @@ -88,8 +88,8 @@ AliMUONPainterMatrixFrame::AliMUONPainterMatrixFrame(const TGWindow* window, fInterface = new TGHorizontalFrame(this,fCanvasWidth); - fMainFrame->AddFrame(fView, new TGLayoutHints(kLHintsLeft)); - fMainFrame->AddFrame(fColorSlider,new TGLayoutHints(kLHintsTop|kLHintsRight|kLHintsExpandX|kLHintsCenterY,kBorderSize/2)); + fMainFrame->AddFrame(fView, new TGLayoutHints(kLHintsExpandX)); + fMainFrame->AddFrame(fColorSlider,new TGLayoutHints(kLHintsTop|kLHintsRight|kLHintsCenterY,kBorderSize/2)); AliMUONPainterInterfaceHelper::SetBackgroundColor("MatrixFrame.ColorSlider",*fColorSlider); -- 2.43.0