Presentation is loading. Please wait.

Presentation is loading. Please wait.

ACCESS FROM C++ CODE TO DATA FROM VALIDATION DB Dmitri Konstantinov, CERN.

Similar presentations


Presentation on theme: "ACCESS FROM C++ CODE TO DATA FROM VALIDATION DB Dmitri Konstantinov, CERN."— Presentation transcript:

1 ACCESS FROM C++ CODE TO DATA FROM VALIDATION DB Dmitri Konstantinov, CERN

2 Motivation To ensure that we all use very same experimental data in Geant4/V tests, that we know origin of the data. How: To have direct access to experimental data(histograms) from Geant4/V C++/ROOT tests. (optional) python access to the DB

3 ACCESS TO DATA/HISTOS This can be done by several ways: 1) Direct access to DB using C/C++ API 2) Access to data base content(event) via http protocol using XML/JSON/etc format provided by DB WEB interface. db.fnal.gov/?datasetid=545&format=xml - request will generate output in specified format Access from C++ code using libCurl + tinyXML(for XML).

4 Direct access to DB using C API (Done) We use libpq library from postrgresql Using one query we access METATABLE and RESULTS tables and fill C++ class containing the following info: class Record { vector m_val; vector m_bin_min; vector m_bin_max; vector m_err_stat_plus; vector m_err_stat_minus; vector m_err_sys_plus; vector m_err_sys_minus; int m_npoints; vector m_nbins; } There is a method returning ROOT TGraphAsymmError filled with DB histogram content.

5 Access to XML/JSON via http protocol Access data in XML format provided by Web interface (this we already discussed as preferable way to access the DB) Using libCurl and Tiny XML libraries fill the very same c++ class with histo data Questions: By what means do we retrieve record from the DB? I use “ID” of RESULT table (former METADATA) What else can be used? What do we want to deliver with XML output – only histogram or full information related to this entry (which not necessary will be used for histogram comparison)

6 Plans Toy C++ reader for XML file provided by http Use this class in test with Franz data (as this dataset is available in the DB) Continue to work on C++ class: Consistency checks; Possibility to fill ROOT histograms (not only TGraphErrors) Possibility to use from ROOT macros Possibility to read in multidimensional data


Download ppt "ACCESS FROM C++ CODE TO DATA FROM VALIDATION DB Dmitri Konstantinov, CERN."

Similar presentations


Ads by Google