ROOT-PVSS Connection
description
Transcript of ROOT-PVSS Connection
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
1
ATLASDCS
ROOT-PVSS ConnectionROOT-PVSS Connection
Current StatusCurrent Status
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
2
ATLASDCS
IntroductionIntroduction
Interface that allows PVSS data to be displayed Interface that allows PVSS data to be displayed using ROOT, permitting all analytical using ROOT, permitting all analytical functions that are available in ROOTfunctions that are available in ROOT
MotivationMotivation Features and implementation of the Features and implementation of the
interfaceinterface Examples – including demonstrationExamples – including demonstration Future plansFuture plans
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
3
ATLASDCS
MotivationMotivation
Limited PVSS functionalityLimited PVSS functionality Zoom impractical Histogramming difficult to use Exclusively data from PVSS No possibility to fit curve NOTE: This has been and is being improved
Physicists familiar with ROOTPhysicists familiar with ROOT ROOT is a very powerful analysis tool
Possibility for parallel data sourcesPossibility for parallel data sources Multiple PVSS systems Could include DAQ data, for example This is not implemented in the current version
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
4
ATLASDCS
Basic featuresBasic features
Based on TCP/IPBased on TCP/IP Any number of ROOT clients can connect to Any number of ROOT clients can connect to
one PVSS projectone PVSS project Trend Plots:Trend Plots:
From a specified time in the past to present (updating) From a time in past to another time in past (since--
until) HistogramsHistograms ROOT Macros can be usedROOT Macros can be used No configuration necessary on PVSS sideNo configuration necessary on PVSS side Windows and LinuxWindows and Linux
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
5
ATLASDCS
ROOT - PVSSROOT - PVSS Small API Manager (GetArc)Small API Manager (GetArc)
Only ~40 Kb
GetArc Manager
ROOT classes
PVSS
Viewer
Macros
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
6
ATLASDCS
PVSS TCP ManagerPVSS TCP Manager
Pass data point names or aliases using Pass data point names or aliases using pattern (dpNames)pattern (dpNames)
Take data for defined period and pass to a Take data for defined period and pass to a client (dpGetPeriod)client (dpGetPeriod)
Send data on change (dpConnect)Send data on change (dpConnect) Send single datapoint value (dpGet)Send single datapoint value (dpGet)
Currently limited to integer, float and boolean
Standard PVSS functionality usedStandard PVSS functionality used
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
7
ATLASDCS
Class StructureClass Structure
PVSSGraphPVSSNamePVSSValue
PVSSTrend
PVSSView
Pad
DrawTransaction()Refresh()
CTransaction
nameReady : Boolean
Start()Execute()Cancel()
1* 1*
PVSSGraphView
PVSSGraph2dView
PVSSHistViews
Retrieve single value
Retrieve DP names with
pattern
Display data from start time and
update
Display data from start time to end
time
Histograph‘Normal’ trend
Trend with 2-dimensional ‘surface’
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
8
ATLASDCS
Example: Two Graphs/CurvesExample: Two Graphs/Curves
{// This script explains how the PVSS-ROOT class set is usedgROOT->Reset();gSystem.Load(“PVSSAccess.dll”);gBenchmark->Start("hclient");
ct = new TCanvas("ct","Time on axis",10,10,700,500); // Define Main CanvasTDatime start("2005-04-13 14:35:00"),end("2005-04-13 14:45:00"); // Define Time Intervalchar *dp = "ELMB/LaR/ELMB_1/AI/NTC_40.value"; // Data point name 1char *dp1 = "ELMB/LaR/ELMB_1/AI/NTC_41.value"; // Data point name 2time_t t = start.Convert(); // Convert to time_t formattime_t e = end.Convert();TPVSSAccess *sock = new TPVSSAccess("pcatics4.cern.ch",4242); // Connect to PVSS
PVSSViews *pvss = new PVSSGraphViews(ct,"Test"); // Define View
// Define two Graphs/Curves on one view/trendPVSSGraph *gr = new PVSSGraph(sock,dp, t,e,pvss);PVSSGraph *gr1 = new PVSSGraph(sock,dp1, t,e,pvss);pvss->insertTransaction(gr);pvss->insertTransaction(gr1);int rlen = sock->GetTimePeriod(gr); // Obtain data for first data pointint rlen1 = sock->GetTimePeriod(gr1); // For the secondpvss->drawTransaction();gBenchmark->Show("hclient");
}
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
9
ATLASDCS
Example: 2D GraphsExample: 2D Graphs{
gROOT->Reset();gBenchmark->Start("hclient");gSystem.Load("PVSSAccess.dll");ct = new TCanvas("ct","Time on axis",10,10,700,500); // Main CanvasTDatime start("2005-04-12 9:00:00"),end("2005-04-12 11:00:00"); // Define Time Intervalchar **dpNames;char *dpw = "*Dubna_11?.Temperature.value"; // Data point using patternchar *dpt = ""; // Data point typeint len, rlen;time_t t = start.Convert(); // Convert to time_t formattime_t e = end.Convert();TPVSSAccess *sock = new TPVSSAccess("pcephc613.cern.ch",4242); // Connect to PVSSint tr = sock->GetDpNames(dpw,dpt,len,&dpNames); // Get DP name from PVSS
PVSSGraph2DViews *v = new PVSSGraph2DViews(ct,"Test"); // Open Viewv->SetOption("surf1");
for (int i = 0; i < len-3; i++) {// Open Trendscout << dpNames[i] << endl;PVSSGraph *gr = new PVSSGraph(sock,dpNames[i], t,e,v);rlen = sock->GetTimePeriod(gr); // Obtain data from data point
}v->drawTransaction();gBenchmark->Show("hclient");
}
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
10
ATLASDCS
2D Graph Display2D Graph Display
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
11
ATLASDCS
Example: TrendsExample: Trends{
// This is an example to open trendsgROOT->Reset();gSystem.Load("PVSSAccess.dll");gBenchmark->Start("hTrend");
ct = new TCanvas("ct","Time on axis",10,10,700,500); // Open canvas
char **dpNames;char *dpw = "@NTC*"; // Data point alias patternchar *dpt = "FwElmbAi"; // Data point typeint len;
TPVSSAccess *sock = new TPVSSAccess("pcatics4.cern.ch",4242); // Connect to PVSSint rr = sock->GetDpNames(dpw,dpt,len,&dpNames); // Take DP name from PVSSPVSSGraphViews *v = new PVSSGraphViews(ct,"Test"); // Open View
for (int i = 0; i < len; i++) {// Open Trendscout << dpNames[i] << endl;PVSSTrend *tr = new PVSSTrend(sock,dpNames[i],1800);v->insertTransaction(tr);sock->OpenTrend(tr);
}
v->startRefresh(5000);}
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
12
ATLASDCS
Example: HistogramExample: Histogram{
gROOT->Reset();gSystem.Load("PVSSAccess.dll");gBenchmark->Start("hclient");TDatime start("2004-07-26 20:00:00"),end("2004-07-26 22:00:00");
char *dp = "ELMB/LaR/ELMB_1/AI/ai_0.value"; // DP nametime_t t = start.Convert(); // Start interval
time_t e = end.Convert(); // End Intervaldouble *res,*dd;TPVSSAccess *sock = new TPVSSAccess("pcatics4.cern.ch",4242); // Connect to PVSSint len;int rlen = sock->GetTimePeriod(dp,t,e,len,res,dd); // Get Datactt1 = new TCanvas("ctt1","Time on axis",10,10,700,500); gt = new TH1F("elmb_counts","This is ELMB counts distribution",100,61900,61950);for (int i = 0; i < len; i++) { gt.Fill(res[i]); // Fill Histogram}gt->SetTitle("ELMB/LaR/ELMB_1/AI/ai_5");ctt1->SetFillColor(41);ctt1->SetFrameFillColor(33);gt->SetFillColor(19);gt->SetLineColor(5);gt->SetLineWidth(2);gt->Draw("AL");gPad->Modified();
gBenchmark->Show("hclient");}
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
13
ATLASDCS
PPPViewerPPPViewer
Menu to allow connection to be
set
Datapoint name and type selection (allowing
use of pattern)
Datapoint names displayed here
Time interval selection
Data display area
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
14
ATLASDCS
Practical RemarksPractical Remarks
Can be downloaded from:Can be downloaded from: http://atlas.web.cern.ch/Atlas/GROUPS/DAQTRIG/DCS/dcshome.html
Root installation – IMPORTANTRoot installation – IMPORTANT Developed with Version 4.03/02 For Windows Visual Studio version
Delete LibNew Install suitable .DLL (for Visual Studio version)
Full instructions on ROOT web site Read them!
PVSS00GetArc ConfigurationPVSS00GetArc Configuration[tcp]tcpServerSocket = 4242
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
15
ATLASDCS
Future PlansFuture Plans
ManagerManager Convert aliases to data point names and vice versa Extend data point types allowed when reading a single value
e.g. dyn_string ViewerViewer
Several pads in pppViewer Save and Load selected datapoint list Improve datapoint display and selection
Tree structure like Hardware or Logical View Active X componentActive X component
Can be displayed in PVSS panels Configuration of display on PVSS side
PVSSAccess libraryPVSSAccess library XY Graphs Signal/Slot event
Would allow for a ‘trigger’ Other data types (string, dyn_string,..) More than one connection
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
16
ATLASDCS
Relation plotsRelation plots(value vs. value)(value vs. value)
Only one pair of values can be plotted at a timeOnly one pair of values can be plotted at a time
14.04.2005 Slava Filimonov & Jim Cook, PVSS - ROOT Interface
17
ATLASDCS
Application ProtocolApplication Protocol
Request Header
Time
Start End
To PVSS
Answer Header
Data Timestamps
Data Point name
ROOT
Command
Request Header
Handler
Answer Header
Length Handler Length Data Type