SDD Run types updated. New macro to test the SDD preprocessor
[u/mrichter/AliRoot.git] / TPC / amoreTPC-QA / src / ui / UIQA.cxx
CommitLineData
e9d4890d 1/***************************************************************************
2 * Copyright (C) 2007 by Filimon Roukoutakis *
3 * Filimon.Roukoutakis@cern.ch *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20#include "UIQA.h"
45af6e68 21#include "AliTPCCalibCE.h"
22#include <AmoreDA.h>
e9d4890d 23
24ClassImp(amore::TPC::ui::UIQA)
25
26#include <iostream>
27#include <sstream>
28#include <TCanvas.h>
29
30namespace amore {
31
32namespace TPC {
33
34namespace ui {
35
36using amore::subscriber::Subscribe;
37
45af6e68 38
39
40
e9d4890d 41UIQA::UIQA() {
42
43 Construct(); // Temporary but important!!! Do not forget to put this call in the constructor for the time being!
44
45}
46
47
48UIQA::~UIQA()
49{
50}
51
52void UIQA::Construct() { // The custom GUI is constructed here. gRootFrame is the container of the custom widgets.
53
54 fTab=new TGTab(amore::ui::gRootFrame);
55 amore::ui::gRootFrame->AddFrame(fTab);
56 TGCompositeFrame* tempFrame=fTab->AddTab("My Tab 1");
57 fEC[0]=new TRootEmbeddedCanvas("fEC0", tempFrame, 800, 450);
58 tempFrame->AddFrame(fEC[0]);
59 fEC[0]->GetCanvas()->Divide(3, 3);
60 tempFrame=fTab->AddTab("My Tab 2");
61 amore::ui::gRootFrame->MapSubwindows();
62 amore::ui::gRootFrame->Resize();
63 amore::ui::gRootFrame->MapWindow();
64
65}
66
67void UIQA::SubscribeMonitorObjects() { // Before using any MonitorObject, a subscription should be made.
68
45af6e68 69 //std::ostringstream stringStream;
70 //amore::core::String_t sourceName="CEDA/", subscription; // The agent name acting as a source could be concatenated with all the objects it contains
71 //subscription=sourceName+"CE";
72 //Subscribe(subscription.c_str()); // Here you put a series of subscriptions where the string corresponds to the object name as published in the Publisher Module. As these names are internal to the QA framework, the recommended way of having consistency between AMORE and QA is to factor-out of QA the function that represents the histogram naming convention as a separate AliRoot class/function and use it from inside QA and AMORE.
e9d4890d 73 //...
74
75}
76
77void UIQA::Update() { // This is executed after getting the updated contents of the subscribed MonitorObjects. Notice that the output of moInt[i] and moString[i] varies with time for a specific i because on the dqmAgent the "quality" check fails or succeeds. This is the essence of automatic data quality checks in AMORE. Try to use the moString[i] on a text widget to alert the shifter, or -depending of the value of moInt[i], 0 or 1- make part of the screen change color...
78 std::ostringstream stringStream;
45af6e68 79 amore::da::AmoreDA amoreDA;
e9d4890d 80 // Example of accessing a normal TObject. The name is the name of the object in the QA framework
45af6e68 81 //amore::core::MonitorObjectTObject* ptr=gSubscriber->At<amore::core::MOTObj>("CEDA/CE");
82 //AliTPCCalibCE* hCalibCE=0;
83 //if(ptr) {
84 //hCalibCE=(AliTPCCalibCE*)ptr->Object();
85 //}
e9d4890d 86 // End of access example
45af6e68 87
88 // hCalibCE->Dump();
89 TObject *temp=0;
90 amoreDA.Receive("CEDA/CE",temp);
91 temp->Dump();
92
e9d4890d 93
94}
95
96void UIQA::Process() {
97
98}
99
100void UIQA::StartOfCycle() {
101
102}
103
104void UIQA::EndOfCycle() {
105
106}
107
108};
109
110};
111
112};