GRSISort
Created by P.C. Bender
Developement Team: P.C. Bender, R. Dunlop, V. Bildstein
An extension of the ROOT analysis Framework
TXMLOdb Class Reference

Class to access ODB info from an XML ODB dump at either the begining of a run or from a seperate file.

Definition at line 31 of file TXMLOdb.h.

Public Member Functions

 TXMLOdb (char *buffer, int size=0)
 
virtual ~TXMLOdb ()
 
TXMLNode * FindNode (const char *name, TXMLNode *node=nullptr)
 
TXMLNode * FindPath (const char *path, TXMLNode *node=nullptr)
 
const char * GetNodeName (TXMLNode *)
 
std::vector< double > ReadDoubleArray (TXMLNode *node)
 
int ReadInt (const char *path, int index=0, int defaultValue=0xffffffff)
 
std::vector< int > ReadIntArray (TXMLNode *node)
 
std::vector< std::string > ReadStringArray (TXMLNode *node)
 

Public Attributes

TXMLDocument * fDoc
 
TXMLNode * fOdb
 
TDOMParser * fParser
 

Static Private Attributes

static char fTextBuffer [256]
 

#include <TXMLOdb.h>

Constructor & Destructor Documentation

◆ TXMLOdb()

TXMLOdb::TXMLOdb ( char *  buffer,
int  size = 0 
)

Creator, tries to open buffer as input file and parse it, if that fails, parses size bytes of the buffer.

Definition at line 16 of file TXMLOdb.cxx.

References fDoc, fOdb, and fParser.

◆ ~TXMLOdb()

TXMLOdb::~TXMLOdb ( )
virtual

Default destructor, deletes the parser.

Definition at line 43 of file TXMLOdb.cxx.

References fParser.

Member Function Documentation

◆ FindNode()

TXMLNode * TXMLOdb::FindNode ( const char *  name,
TXMLNode *  node = nullptr 
)

Finds node with name "name". If a node is provided this node will be used as a starting point. If the provided node is a null pointer fOdb is used instead. Returns a null pointer if the search fails.

Definition at line 51 of file TXMLOdb.cxx.

References fOdb, and GetNodeName().

Referenced by FindPath().

◆ FindPath()

TXMLNode * TXMLOdb::FindPath ( const char *  path,
TXMLNode *  node = nullptr 
)

Find path "path" under the provided node. If the node is a null pointer, fOdb is used instead.

Definition at line 77 of file TXMLOdb.cxx.

References FindNode(), and fOdb.

Referenced by TGRSIDataParser::Process(), ReadInt(), TMidasFile::SetEPICSOdb(), TMidasFile::SetFileOdb(), TMidasFile::SetGRIFFOdb(), TMidasFile::SetRunInfo(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().

◆ GetNodeName()

const char * TXMLOdb::GetNodeName ( TXMLNode *  node)

Returns the name of a node.

Definition at line 115 of file TXMLOdb.cxx.

References fTextBuffer.

Referenced by FindNode(), TMidasFile::SetFileOdb(), and TMidasFile::SetTIGOdb().

◆ ReadDoubleArray()

std::vector< double > TXMLOdb::ReadDoubleArray ( TXMLNode *  node)

Reads and returns an array of doubles.

Definition at line 230 of file TXMLOdb.cxx.

Referenced by TMidasFile::SetGRIFFOdb(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().

◆ ReadInt()

int TXMLOdb::ReadInt ( const char *  path,
int  index = 0,
int  defaultValue = 0xffffffff 
)

tries to find the path "path", returns defaultValue if that fails, otherwise returns 0.

Definition at line 127 of file TXMLOdb.cxx.

References FindPath().

◆ ReadIntArray()

std::vector< int > TXMLOdb::ReadIntArray ( TXMLNode *  node)

Reads and returns an array of integers.

Definition at line 137 of file TXMLOdb.cxx.

Referenced by TMidasFile::SetGRIFFOdb(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().

◆ ReadStringArray()

std::vector< std::string > TXMLOdb::ReadStringArray ( TXMLNode *  node)

Reads and returns an array of strings.

Definition at line 179 of file TXMLOdb.cxx.

Referenced by TMidasFile::SetEPICSOdb(), TMidasFile::SetGRIFFOdb(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().

Member Data Documentation

◆ fDoc

TXMLDocument* TXMLOdb::fDoc

Definition at line 36 of file TXMLOdb.h.

Referenced by TXMLOdb().

◆ fOdb

TXMLNode* TXMLOdb::fOdb

Definition at line 38 of file TXMLOdb.h.

Referenced by FindNode(), FindPath(), and TXMLOdb().

◆ fParser

TDOMParser* TXMLOdb::fParser

Definition at line 37 of file TXMLOdb.h.

Referenced by TXMLOdb(), and ~TXMLOdb().

◆ fTextBuffer

char TXMLOdb::fTextBuffer
staticprivate

Definition at line 50 of file TXMLOdb.h.

Referenced by GetNodeName().