DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
DD4hep::Parsers Namespace Reference

Namespace for the AIDA detector for utilities using boost::spirit parsers. More...

Functions

int parse (Property &result, const std::string &input)
 
int parse (std::vector< std::pair< double, double > > &result, const std::string &input)
 parse the bool value More...
 
int parse (std::vector< std::pair< int, int > > &result, const std::string &input)
 parse the std::vector<std::pair<int,int> > value More...
 
int parse (std::vector< std::vector< std::string > > &result, const std::string &input)
 parse the std::vector<std::vector<std::string> > value More...
 
int parse (std::vector< std::vector< double > > &result, const std::string &input)
 parse the std::vector<std::vector<double> > value More...
 
int parse (std::map< int, int > &result, const std::string &input)
 parse the std::map<int , int> value More...
 
int parse (std::map< int, double > &result, const std::string &input)
 parse the std::map<int , double> value More...
 
int parse (std::map< std::string, std::string > &result, const std::string &input)
 parse the std::map<std::string , std::string> value More...
 
int parse (std::map< std::string, int > &result, const std::string &input)
 parse the std::map<std::string , int> value More...
 
int parse (std::map< std::string, double > &result, const std::string &input)
 parse the std::map<std::string , double> value More...
 
int parse (std::map< std::string, std::vector< std::string > > &result, const std::string &input)
 parse the std::map<std::string , std::vector<std::string> > value More...
 
int parse (std::map< std::string, std::vector< int > > &result, const std::string &input)
 parse the std::map<std::string , std::vector<int> > value More...
 
int parse (std::map< std::string, std::vector< double > > &result, const std::string &input)
 parse the std::map<std::string , std::vector<double> > value More...
 
int parse (std::map< int, std::string > &result, const std::string &input)
 parse the std::map<int,std::string> > objects More...
 
int parse (std::string &name, std::string &value, const std::string &input)
 parse the std::map<unsigned int,std::string> > objects More...
 
int parse (std::map< std::string, std::pair< double, double > > &params, const std::string &input)
 helper function, needed for implementation of map of pairs More...
 
template<class T , unsigned int N>
int parse (T(&result)[N], const std::string &input)
 parser function for C-arrays More...
 
template<unsigned int N>
int parse (char(&result)[N], const std::string &input)
 parser function for C-strings More...
 
int parse (ROOT::Math::XYZPoint &result, const std::string &input)
 parse 3D-point More...
 
int parse (ROOT::Math::XYZVector &result, const std::string &input)
 parse 3D-vector More...
 
int parse (ROOT::Math::PxPyPzEVector &result, const std::string &input)
 parse PxPyPzEVector More...
 

Detailed Description

Namespace for the AIDA detector for utilities using boost::spirit parsers.

Function Documentation

int DD4hep::Parsers::parse ( Property result,
const std::string &  input 
)
int DD4hep::Parsers::parse ( std::vector< std::pair< double, double > > &  result,
const std::string &  input 
)

parse the bool value

See Also
DD4hep::Parsers::BoolGrammar
Parameters
result(output) boolean result
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12parse the char value
See Also
DD4hep::Parsers::CharGrammar
Parameters
result(output) boolean result
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12parse the int value
See Also
DD4hep::Parsers::IntGrammar
Parameters
result(output) integer result
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
See Also
DD4hep::Parsers::parser( int&, const std::string& ) parse the double value
DD4hep::Parsers::RealGrammar
Parameters
result(output) double result
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
See Also
DD4hep::Parsers::parser( double&, const std::string& ) parse the std::string value
DD4hep::Parsers::StringGrammar
Parameters
result(output) string result
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14parse the std::pair<double,double> value
See Also
DD4hep::Parsers::PairGrammar
DD4hep::Parsers::RealGrammar
Parameters
result(output) pair of doubles
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14parse the std::pair<int,int> value
See Also
DD4hep::Parsers::PairGrammar
DD4hep::Parsers::IntGrammar
Parameters
result(output) pair of integers
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14parse the std::vector<std::pair<double,double> > value
See Also
DD4hep::Parsers::VectorGrammar
DD4hep::Parsers::PairGrammar
DD4hep::Parsers::RealGrammar
Parameters
result(output) vector with pairs of doubles
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::vector< std::pair< int, int > > &  result,
const std::string &  input 
)

parse the std::vector<std::pair<int,int> > value

See Also
DD4hep::Parsers::VectorGrammar
DD4hep::Parsers::PairGrammar
DD4hep::Parsers::IntGrammar
Parameters
result(output) vector with pairs of int
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::vector< std::vector< std::string > > &  result,
const std::string &  input 
)

parse the std::vector<std::vector<std::string> > value

See Also
DD4hep::Parsers::VectorGrammar
DD4hep::Parsers::StringGrammar
Parameters
result(output) vector with vectors of strings
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::vector< std::vector< double > > &  result,
const std::string &  input 
)

parse the std::vector<std::vector<double> > value

See Also
DD4hep::Parsers::VectorGrammar
DD4hep::Parsers::RealGrammar
Parameters
result(output) vector with vectors of doubles
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< int, int > &  result,
const std::string &  input 
)

parse the std::map<int , int> value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::IntGrammar
Parameters
result(output) map with integer key and double value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< int, double > &  result,
const std::string &  input 
)

parse the std::map<int , double> value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::IntGrammar
DD4hep::Parsers::RealGrammar
Parameters
result(output) map with integer key and double value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< std::string, std::string > &  result,
const std::string &  input 
)

parse the std::map<std::string , std::string> value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::StringGrammar
Parameters
result(output) map with string key and value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< std::string, int > &  result,
const std::string &  input 
)

parse the std::map<std::string , int> value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::StringGrammar
DD4hep::Parsers::IntGrammar
Parameters
result(output) map with string key and integer value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< std::string, double > &  result,
const std::string &  input 
)

parse the std::map<std::string , double> value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::StringGrammar
DD4hep::Parsers::RealGrammar
Parameters
result(output) map with string key and integer value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< std::string, std::vector< std::string > > &  result,
const std::string &  input 
)

parse the std::map<std::string , std::vector<std::string> > value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::StringGrammar
DD4hep::Parsers::VectorGrammar
Parameters
result(output) map with string value and vector of strings as value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< std::string, std::vector< int > > &  result,
const std::string &  input 
)

parse the std::map<std::string , std::vector<int> > value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::StringGrammar
DD4hep::Parsers::VectorGrammar
DD4hep::Parsers::IntGrammar
Parameters
result(output) map with string value and vector of integers as value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< std::string, std::vector< double > > &  result,
const std::string &  input 
)

parse the std::map<std::string , std::vector<double> > value

See Also
DD4hep::Parsers::MapGrammar
DD4hep::Parsers::StringGrammar
DD4hep::Parsers::VectorGrammar
DD4hep::Parsers::RealGrammar
Parameters
result(output) map with string value and vector of doubles as value
input(input) the string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14
int DD4hep::Parsers::parse ( std::map< int, std::string > &  result,
const std::string &  input 
)

parse the std::map<int,std::string> > objects

See Also
DD4hep::Parsers::MapGrammar
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Date
2007-12-06
int DD4hep::Parsers::parse ( std::string &  name,
std::string &  value,
const std::string &  input 
)

parse the std::map<unsigned int,std::string> > objects

See Also
DD4hep::Parsers::MapGrammar
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Date
2007-12-06parse the pair expression (map-component) " 'name' :value"
const std::string input = "'PackageName':DD4hepKernel" ;
std::string name ;
std::string value ;
int sc = DD4hep::Parsers::parse ( name , value , input ) ;
if ( sc.isFailure() ) { ... }
std::cout << "\tParsed name is " << name
<< "\tParsed value is " << value << std::endl
Parameters
name(output) the parsed name of the component, defined as 'name' or "name" before the column symbol ":", the leading and trailing blans are omitted
value(output) the parsed value of the component, defined as everything after the column symbol ":" till the end of the string
input(input) string to be parsed
Returns
status code
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12
int DD4hep::Parsers::parse ( std::map< std::string, std::pair< double, double > > &  params,
const std::string &  input 
)

helper function, needed for implementation of map of pairs

It is very useful construction for monitoring to represent the value and error or the allowed range for some parameter

Parameters
paramsthe map of pair
inputthe string to be parsed
Returns
status code
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Date
2009-05-19
template<class T , unsigned int N>
int DD4hep::Parsers::parse ( T(&)  result[N],
const std::string &  input 
)

parser function for C-arrays

Parameters
resultC-array
inputthe string to be parsed
Returns
status code
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-15

Definition at line 510 of file Parsers.h.

References DD4hep::Alignments::AlignmentTools::copy(), and parse().

template<unsigned int N>
int DD4hep::Parsers::parse ( char(&)  result[N],
const std::string &  input 
)

parser function for C-strings

Parameters
resultC-string
inputthe string to be parsed
Returns
status code
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-15

Definition at line 535 of file Parsers.h.

References DD4hep::Alignments::AlignmentTools::copy(), and parse().

int DD4hep::Parsers::parse ( ROOT::Math::XYZPoint &  result,
const std::string &  input 
)

parse 3D-point

Valid representations of 3D-point:

- a'la python tuple with 3 elements ("canonical")
- a'la python list with 3 elements
- tuple or list with named ordered fields
" (1,2,3) "
" [1,2,3] "
" [ x : 1, 2, Z:3 ] "
" [ pX : 1 , PY : 2, 3] "

Valid keys for names fields:

"x", "X" , "pX" , "Px" , "PX "
"y", "Y" , "pY" , "Py" , "PY "
"z", "Z" , "pZ" , "Pz" , "PZ "
Attention
Named fields must be ordered (x,y,z)
Parameters
result(output) the parsed point
input(input) the input string
Returns
status code
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-05
int DD4hep::Parsers::parse ( ROOT::Math::XYZVector &  result,
const std::string &  input 
)

parse 3D-vector

Valid representations of 3D-vector:

- a'la python tuple with 3 elements ("canonical")
- a'la python list with 3 elements
- tuple or list with named ordered fields
" (1,2,3) "
" [1,2,3] "
" [ x : 1, 2, Z:3 ] "
" [ pX : 1 , PY : 2, 3] "

Valid keys for names fields:

"x", "X" , "pX" , "Px" , "PX "
"y", "Y" , "pY" , "Py" , "PY "
"z", "Z" , "pZ" , "Pz" , "PZ "
Attention
Named fields must be ordered (x,y,z)
Parameters
result(output) the parsed vector
input(input) the input string
Returns
status code
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-05
int DD4hep::Parsers::parse ( ROOT::Math::PxPyPzEVector &  result,
const std::string &  input 
)

parse PxPyPzEVector

Valid representations of Lorenzt vector

- a'la python tuple with 4 elements ("canonical")
- a'la python list with 4 elements
- python/list with inner representation of 3D-point/vector
- tuple or list with named ordered fields
" (1,2,3,4) "
" (1,2,3;4) "
" [1,2,3,4] "
" [1,2,3;4] "
" [ x:1 ,2,3; e= 4] "
" [ pX : 1 , PY : 2, 3 , T= 4] "
" [ ( pX : 1 , PY : 2, 3 ) , 4] "
" [ ( pX : 1 , PY : 2, 3 ) ; 4] "
" [ 4 , ( pX : 1 , PY : 2, 3 ) ] "
" [ 4 ; ( pX : 1 , PY : 2, 3 ) ] "
" [ [ pX : 1 , PY : 2, 3 ] , 4] "
" [ [ pX : 1 , PY : 2, 3 ] ; 4] "
" [ 4 , [ pX : 1 , PY : 2, 3 ] ] "
" [ 4 ; [ pX : 1 , PY : 2, 3 ] ] "
" ( ( pX : 1 , PY : 2, 3 ) , 4 )"
" ( ( pX : 1 , PY : 2, 3 ) ; 4 )"
" ( 4 , ( pX : 1 , PY : 2, 3 ) )"
" ( 4 ; ( pX : 1 , PY : 2, 3 ) )"
" ( [ pX : 1 , PY : 2, 3 ] , 4 )"
" ( [ pX : 1 , PY : 2, 3 ] ; 4 )"
" ( 4 , [ pX : 1 , PY : 2, 3 ] )"
" ( 4 ; [ pX : 1 , PY : 2, 3 ] )"

Note that "energy" element can be separated with semicolon.

Valid keys for names fields:

"x", "X" , "pX" , "Px" , "PX "
"y", "Y" , "pY" , "Py" , "PY "
"z", "Z" , "pZ" , "Pz" , "PZ "
"t", "T" , "e" , "E"
Attention
Named fields must be ordered (x,y,z)
Parameters
result(output) the parsed lorentz vector
input(input) the input string
Returns
status code
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-05