From 252b0bbfd884cf81c089bfff905a9555c4162b49 Mon Sep 17 00:00:00 2001 From: marian Date: Thu, 21 Feb 2008 09:40:34 +0000 Subject: [PATCH] Updated GUI - use TPC calib viewer Adding manual in README file (Marian) --- TPC/amoreTPC-QA/README | 35 ++++++++--- TPC/amoreTPC-QA/src/ui/Makefile | 2 +- TPC/amoreTPC-QA/src/ui/UIQA.cxx | 102 +++++++++++++++++++++++++++++--- TPC/amoreTPC-QA/src/ui/UIQA.h | 11 +++- 4 files changed, 132 insertions(+), 18 deletions(-) diff --git a/TPC/amoreTPC-QA/README b/TPC/amoreTPC-QA/README index 079accd08a5..53155d17d0f 100644 --- a/TPC/amoreTPC-QA/README +++ b/TPC/amoreTPC-QA/README @@ -1,3 +1,31 @@ +How to use AMORE: + +login to the aldaqdqm04 +user: tpc +passwrod: ask responsible + + +1. Check if you have data at given GDC +eventDump :@aldaqpc030 + +2. Start agent + From GDC: + amoreAgent -aTPCQA -s :@aldaqpc030 + Or From file: + amoreAgent -aTPCQA -s data.raw + +3. start amore for TPC + amore -dTPC -mUIQA + + + + + + + + + + AMORE AGENT config: @@ -10,17 +38,10 @@ Please enter the default DATE datasource for this agent [:] : RAW Please enter the default AMORE PublisherModule for this agent [MyModule1] : AmoreTPCPublisher New amoreAgent was succesfully configured - - - mysql: mysql -udaq -p - use AMORE; show tables; select moname from CEDA; - - - publisher: diff --git a/TPC/amoreTPC-QA/src/ui/Makefile b/TPC/amoreTPC-QA/src/ui/Makefile index 37c9c73e54b..f825763ab1a 100644 --- a/TPC/amoreTPC-QA/src/ui/Makefile +++ b/TPC/amoreTPC-QA/src/ui/Makefile @@ -6,7 +6,7 @@ pkginclude_HEADERS = UIQA.h BUILT_SOURCES = TPCUIDict.h TPCUIDict.cxx bin_PROGRAMS = libAmoreTPCUI.$(DllSuf) -libAmoreTPCUI_CPPFLAGS = $(CPPFLAGS) -I../common -I$(ALICE_ROOT)/TPC +libAmoreTPCUI_CPPFLAGS = $(CPPFLAGS) -I../common -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/STEER libAmoreTPCUI_CXXFLAGS = $(CXXFLAGS) libAmoreTPCUI_LIBS = $(LIBS) $(AMORE)/lib/libAmoreDA.a -lAmoreTPCCommon -lEG -lVMC -lGeom -lMinuit -lRAWDatabase -lSTEERBase -lSTEER -lESD -lRAWDatarec -lCDB -lTPCbase -lTPCrec -lTPCsim libAmoreTPCUI_LDFLAGS = $(LDFLAGS) -L../common -L$(ALICE_ROOT)/lib/tgt_linux -L$(AMORE_SITE)/lib -shared -Wl,-soname,$(bin_PROGRAMS) -o $(bin_PROGRAMS) diff --git a/TPC/amoreTPC-QA/src/ui/UIQA.cxx b/TPC/amoreTPC-QA/src/ui/UIQA.cxx index 81496c5c0ac..04ac3e066af 100644 --- a/TPC/amoreTPC-QA/src/ui/UIQA.cxx +++ b/TPC/amoreTPC-QA/src/ui/UIQA.cxx @@ -18,13 +18,15 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "UIQA.h" -#include "AliTPCCalPad.h" -#include "AliTPCdataQA.h" -#include "AliTPCdataQA.h" #include #include #include - +#include "AliTPCCalPad.h" +#include "AliTPCdataQA.h" +#include "AliTPCCalibViewer.h" +#include "AliTPCCalibViewerGUI.h" +#include "AliTPCPreprocessorOnline.h" +#include "AliCDBEntry.h" ClassImp(amore::TPC::ui::UIQA) #include @@ -58,7 +60,13 @@ void UIQA::Construct() { // The custom GUI is constructed here. gRootFrame is th fTab=new TGTab(amore::ui::gRootFrame); amore::ui::gRootFrame->AddFrame(fTab); // - TGCompositeFrame* tempFrame=fTab->AddTab("OverThreshold"); + // + TGCompositeFrame* tabCont1 =fTab->AddTab("Expert"); + + fViewerGUI = new AliTPCCalibViewerGUI(tabCont1, 1000, 600, 0); + tabCont1->AddFrame(fViewerGUI , new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + // + TGCompositeFrame* tempFrame=fTab->AddTab("OverThreshold"); fEC[0]=new TRootEmbeddedCanvas("fEC0", tempFrame, 1000, 650); tempFrame->AddFrame(fEC[0]); fEC[0]->GetCanvas()->Divide(3,3); @@ -68,6 +76,10 @@ void UIQA::Construct() { // The custom GUI is constructed here. gRootFrame is th fEC[1]=new TRootEmbeddedCanvas("fEC1", tempFrame, 1000, 650); tempFrame->AddFrame(fEC[1]); fEC[1]->GetCanvas()->Divide(2,3); + // + // + + amore::ui::gRootFrame->MapSubwindows(); @@ -91,7 +103,7 @@ void UIQA::Construct() { // The custom GUI is constructed here. gRootFrame is th gStyle->SetFrameFillColor(10); gStyle->SetFrameBorderSize(1); gStyle->SetFrameBorderMode(-1); - gStyle->SetFrameLineWidth(1.2); + gStyle->SetFrameLineWidth(1.); } void UIQA::SubscribeMonitorObjects() { // Before using any MonitorObject, a subscription should be made. @@ -184,7 +196,7 @@ void UIQA::Update() { // This is executed after getting the updated contents of canvas->cd(6); tpcqa->GetMaxCharge()->MakeHisto2D(1)->Draw("colz"); } - + if (tpcqa) MakeTree(tpcqa); // End of access example @@ -209,6 +221,82 @@ void UIQA::EndOfCycle() { } + + void UIQA::MakeTree(AliTPCdataQA* ped){ + // + // + AliTPCPreprocessorOnline preprocesor; + if (ped->GetMaxCharge()) preprocesor.AddComponent(ped->GetMaxCharge()); + if (ped->GetMeanCharge()) preprocesor.AddComponent(ped->GetMeanCharge()); + if (ped->GetOverThreshold0()) preprocesor.AddComponent(ped->GetOverThreshold0()); + if (ped->GetOverThreshold5()) preprocesor.AddComponent(ped->GetOverThreshold5()); + if (ped->GetOverThreshold10()) preprocesor.AddComponent(ped->GetOverThreshold10()); + if (ped->GetOverThreshold20()) preprocesor.AddComponent(ped->GetOverThreshold20()); + if (ped->GetOverThreshold30()) preprocesor.AddComponent(ped->GetOverThreshold30()); + AliTPCCalPad * noise = GetNoise(); + if (noise) preprocesor.AddComponent(noise); + AliTPCCalPad * pedestal = GetPedestal(); + if (pedestal) preprocesor.AddComponent(pedestal); + preprocesor.DumpToFile("CalibTree2.root"); + delete noise; + delete pedestal; + // /*CalibTree + AliTPCCalibViewer *viewer = fViewerGUI->GetViewer(); + AliTPCCalibViewer *nviewer = new AliTPCCalibViewer("CalibTree2.root", "calPads"); + fViewerGUI->Initialize(nviewer); + //*/ + // + // + // + + } + + AliTPCCalPad * UIQA::GetNoise(){ + // + // GetNoise - if not in AmoreDB than from file + // + //amore::da::AmoreDA amoreDA; + // TObject *temp=0; + //amoreDA.Receive("PEDESTAL/NOISE",temp); + //temp->Dump(); + // if (temp) return (AliTPCCalPad*) temp; + TDirectory * dir = gDirectory; + TFile *f = new TFile("$AMORE_SITE/PadNoise.root"); + AliCDBEntry * entry = (AliCDBEntry*)f->Get("AliCDBEntry"); + if (entry){ + AliTPCCalPad * pad = ((AliTPCCalPad *)entry->GetObject()->Clone()); + if (pad) { + pad->SetName("Noise"); + pad->Print(); + return pad; + } + } + f->Close(); + dir->cd(); + return 0; + } + + AliTPCCalPad * UIQA::GetPedestal(){ + // + // + TFile f("$AMORE_SITE/Pedestal.root"); + AliCDBEntry * entry = (AliCDBEntry*)f.Get("AliCDBEntry"); + if (entry){ + AliTPCCalPad * pad = ((AliTPCCalPad *)entry->GetObject()->Clone()); + if (pad) { + pad->SetName("Pedestals"); + pad->Print(); + return pad; + } + } + return 0; + } + AliTPCCalPad * UIQA::GetTime0(){ + return 0; + } + + + }; }; diff --git a/TPC/amoreTPC-QA/src/ui/UIQA.h b/TPC/amoreTPC-QA/src/ui/UIQA.h index 0d945613530..eea58f14977 100644 --- a/TPC/amoreTPC-QA/src/ui/UIQA.h +++ b/TPC/amoreTPC-QA/src/ui/UIQA.h @@ -26,7 +26,9 @@ #include #include #include - +class AliTPCCalibViewerGUI; +class AliTPCdataQA; +class AliTPCCalPad; namespace amore { namespace TPC { @@ -56,12 +58,15 @@ class UIQA : public amore::ui::VisualModule, public amore::TPC::common::Common { virtual void EndOfSession() {}; protected: - + void MakeTree(AliTPCdataQA * qa); + AliTPCCalPad * GetNoise(); + AliTPCCalPad * GetPedestal(); + AliTPCCalPad * GetTime0(); TGTab* fTab; TRootEmbeddedCanvas* fEC[10]; TGNumberEntryField* fNEF[10]; TGTextView* fTextView[10]; - + AliTPCCalibViewerGUI *fViewerGUI; ClassDef(UIQA, 1); }; -- 2.43.0