jana::JGeometry Class Reference

#include <JGeometry.h>

Inheritance diagram for jana::JGeometry:

Inheritance graph
[legend]
Collaboration diagram for jana::JGeometry:

Collaboration graph
[legend]
List of all members.

Detailed Description

JGeometry is a virtual base class used to define the interface by which geometry information can be obtained in JANA. Implementing this base class allows the JANA end user to be agnostic as to the details of how the geometry info is stored. The geometry can be stored in a database or any number of file formats. The files can be stored locally, or on the network somewhere.

The primary advantage here is that it allows one to work with local files, but then easily switch to a remote source method when appropriate without requiring modifications to the end user code.

On the user side they will call one of the Get(...) methods which all get translated into a call of one of the two vitural methods:

virtual bool Get(string namepath, string &sval, map<string, string> &where)=0; virtual bool Get(string namepath, map<string, string> &svals, map<string, string> &where)=0;

These two virtual methods along with one to get a list of the available namepaths are the only things that need to be implemented in a concrete subclass of JGeometry.

A geometry element is specified by its namepath and an optional set of qualifiers (the where argument). The namepath is a hierarchal list of elements separated by forward slashes(/) analogous to a path on a unix filesystem. This path is always assumed to be relative to the url specified in the constructor. So, for instance, suppose one kept the geometry in a set XML files on the local filesystem and wished to access information from the file

/home/joe/calib/geom_Oct10_2017.xml

One would specify the url as:

file:///home/joe/calib/geom_Oct10_2017.xml

and then the namepath could be specified as the string:

"TOF/bar/X_Y_Z"

which would indicate the attribute "X_Y_Z" of the subtag "bar" of the tag "TOF" in the file "/home/joe/calib/geom_Oct10_2017.xml"

Definition at line 70 of file JGeometry.h.

Public Types

enum  ATTR_LEVEL_t { attr_level_none = 0, attr_level_last = 1, attr_level_all = 2 }

Public Member Functions

virtual const char * className (void)
template<class T>
bool Get (string xpath, map< string, T > &vals)
template<class T>
bool Get (string xpath, vector< T > &vals, string delimiter=" ")
template<class T>
bool Get (string xpath, T &val)
virtual bool Get (string xpath, map< string, string > &svals)=0
virtual bool Get (string xpath, string &sval)=0
const string & GetContext (void) const
const int & GetRunFound (void) const
const int & GetRunMax (void) const
const int & GetRunMin (void) const
const int & GetRunRequested (void) const
const string & GetURL (void) const
virtual void GetXPaths (vector< string > &xpaths, ATTR_LEVEL_t level=attr_level_last, const string &filter="")=0
 JGeometry (string url, int run, string context="default")
virtual ~JGeometry ()

Static Public Member Functions

static const char * static_className (void)

Protected Attributes

int run_found
int run_max
int run_min

Private Member Functions

 JGeometry ()

Private Attributes

map< string, string > anywhere
string context
int run_requested
string url


Member Enumeration Documentation

enum jana::JGeometry::ATTR_LEVEL_t

Enumerator:
attr_level_none 
attr_level_last 
attr_level_all 

Definition at line 81 of file JGeometry.h.


Constructor & Destructor Documentation

jana::JGeometry::JGeometry ( string  url,
int  run,
string  context = "default" 
) [inline]

Definition at line 72 of file JGeometry.h.

References context, and run_requested.

virtual jana::JGeometry::~JGeometry (  )  [inline, virtual]

Definition at line 77 of file JGeometry.h.

jana::JGeometry::JGeometry (  )  [inline, private]

Definition at line 112 of file JGeometry.h.


Member Function Documentation

virtual const char* jana::JGeometry::className ( void   )  [inline, virtual]

Reimplemented in jana::JGeometryXML.

Definition at line 78 of file JGeometry.h.

References static_className().

Here is the call graph for this function:

template<class T>
bool jana::JGeometry::Get ( string  xpath,
map< string, T > &  vals 
)

Definition at line 202 of file JGeometry.h.

References Get().

Here is the call graph for this function:

template<class T>
bool jana::JGeometry::Get ( string  xpath,
vector< T > &  vals,
string  delimiter = " " 
)

Definition at line 158 of file JGeometry.h.

References Get().

Here is the call graph for this function:

template<class T>
bool jana::JGeometry::Get ( string  xpath,
T &  val 
)

Definition at line 126 of file JGeometry.h.

References Get().

Here is the call graph for this function:

virtual bool jana::JGeometry::Get ( string  xpath,
map< string, string > &  svals 
) [pure virtual]

virtual bool jana::JGeometry::Get ( string  xpath,
string &  sval 
) [pure virtual]

Referenced by Get(), jana::JEventLoop::GetGeom(), and main().

Here is the caller graph for this function:

const string& jana::JGeometry::GetContext ( void   )  const [inline]

Definition at line 103 of file JGeometry.h.

References context.

const int& jana::JGeometry::GetRunFound ( void   )  const [inline]

Definition at line 100 of file JGeometry.h.

References run_found.

const int& jana::JGeometry::GetRunMax ( void   )  const [inline]

Definition at line 102 of file JGeometry.h.

References run_max.

const int& jana::JGeometry::GetRunMin ( void   )  const [inline]

Definition at line 101 of file JGeometry.h.

References run_min.

const int& jana::JGeometry::GetRunRequested ( void   )  const [inline]

Definition at line 99 of file JGeometry.h.

References run_requested.

const string& jana::JGeometry::GetURL ( void   )  const [inline]

Definition at line 104 of file JGeometry.h.

References url.

Referenced by main().

Here is the caller graph for this function:

virtual void jana::JGeometry::GetXPaths ( vector< string > &  xpaths,
ATTR_LEVEL_t  level = attr_level_last,
const string &  filter = "" 
) [pure virtual]

Referenced by main().

Here is the caller graph for this function:

static const char* jana::JGeometry::static_className ( void   )  [inline, static]

Reimplemented in jana::JGeometryXML.

Definition at line 79 of file JGeometry.h.

Referenced by className().

Here is the caller graph for this function:


Member Data Documentation

map<string,string> jana::JGeometry::anywhere [private]

Definition at line 117 of file JGeometry.h.

string jana::JGeometry::context [private]

Definition at line 115 of file JGeometry.h.

Referenced by GetContext(), and JGeometry().

int jana::JGeometry::run_found [protected]

Definition at line 109 of file JGeometry.h.

Referenced by GetRunFound().

int jana::JGeometry::run_max [protected]

Definition at line 108 of file JGeometry.h.

Referenced by GetRunMax().

int jana::JGeometry::run_min [protected]

Definition at line 107 of file JGeometry.h.

Referenced by GetRunMin().

int jana::JGeometry::run_requested [private]

Definition at line 114 of file JGeometry.h.

Referenced by GetRunRequested(), and JGeometry().

string jana::JGeometry::url [private]

Definition at line 116 of file JGeometry.h.

Referenced by GetURL().


The documentation for this class was generated from the following file:
Generated on Wed Jun 10 22:44:48 2009 for JANA (JLab ANAlysis) by  doxygen 1.5.1