hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ParameterSet Class Reference

description More...

#include <ParameterSet.h>

Classes

struct  Element
 Backing data structure containing parameter values. More...
 

Public Types

enum  ElementType {
  et_NoType , et_Bool , et_Integer , et_Double ,
  et_String , et_VInteger , et_VDouble , et_VString ,
  et_ParameterSet
}
 

Public Member Functions

int getInteger (const std::string &name) const
 Get an integer by name or throw an exception if not available, or not the right type.
 
int getInteger (const std::string &name, int defaultValue) const
 Get an integer by name or use the given default if not available.
 
double getDouble (const std::string &name) const
 Get a double by name or throw an exception if not available, or not the right type.
 
double getDouble (const std::string &name, double defaultValue) const
 Get a double by name or use the given default if not available.
 
const std::string & getString (const std::string &name) const
 
const std::string & getString (const std::string &name, const std::string &defaultValue) const
 Get a string by name or use the given default if not available.
 
const std::vector< int > & getVInteger (const std::string &name) const
 Get a vector of integers by name or throw an exception if not available, or not the right type.
 
const std::vector< int > & getVInteger (const std::string &name, const std::vector< int > &defaultValue) const
 Get a vector of integers by name or use the given default if not available.
 
const std::vector< double > & getVDouble (const std::string &name) const
 Get a vector of doubles by name or throw an exception if not available, or not the right type.
 
const std::vector< double > & getVDouble (const std::string &name, const std::vector< double > &defaultValue) const
 Get a vector of doubles by name or use the given default if not available.
 
const std::vector< std::string > & getVString (const std::string &name) const
 Get a vector of strings by name or throw an exception if not available, or not the right type.
 
const std::vector< std::string > & getVString (const std::string &name, const std::vector< std::string > &defaultValue) const
 Get a vector of strings by name or use the given default if not available.
 
void insert (const std::string &name, int value)
 Add an integer to the ParameterSet.
 
void insert (const std::string &name, double value)
 Add a double to the ParameterSet.
 
void insert (const std::string &name, const std::string &value)
 Add a string to the ParameterSet.
 
void insert (const std::string &name, const std::vector< int > &values)
 Add a vector of integers to the ParameterSet.
 
void insert (const std::string &name, const std::vector< double > &values)
 Add a vector of doubles to the ParameterSet.
 
void insert (const std::string &name, const std::vector< std::string > &values)
 Add a vector of strings to the ParameterSet.
 

Public Attributes

std::map< std::string, Elementelements_
 

Detailed Description

description

Definition at line 22 of file ParameterSet.h.

Member Enumeration Documentation

◆ ElementType

Enumerator
et_NoType 
et_Bool 
et_Integer 
et_Double 
et_String 
et_VInteger 
et_VDouble 
et_VString 
et_ParameterSet 

Definition at line 178 of file ParameterSet.h.

Member Function Documentation

◆ getDouble() [1/2]

double getDouble ( const std::string &  name) const

Get a double by name or throw an exception if not available, or not the right type.

Parameters
nameName of the double parameter.

Definition at line 34 of file ParameterSet.cxx.

◆ getDouble() [2/2]

double getDouble ( const std::string &  name,
double  defaultValue 
) const

Get a double by name or use the given default if not available.

If the wrong type, throw an exception.

Parameters
nameName of the double parameter.
defaultValueDefault value to ue if the parameter was not provided.

Definition at line 45 of file ParameterSet.cxx.

◆ getInteger() [1/2]

int getInteger ( const std::string &  name) const

Get an integer by name or throw an exception if not available, or not the right type.

Parameters
nameName of the integer.

Definition at line 8 of file ParameterSet.cxx.

◆ getInteger() [2/2]

int getInteger ( const std::string &  name,
int  defaultValue 
) const

Get an integer by name or use the given default if not available.

If the wrong type, throw an exception.

Parameters
nameName of the integer.
defaultValueDefault value to use if the parameter was not provided.

Definition at line 19 of file ParameterSet.cxx.

◆ getString() [1/2]

const std::string & getString ( const std::string &  name) const

Get a string by name or throw an exception if not available, or not the right type.

Parameters
nameName of the string parameter.

Definition at line 60 of file ParameterSet.cxx.

◆ getString() [2/2]

const std::string & getString ( const std::string &  name,
const std::string &  defaultValue 
) const

Get a string by name or use the given default if not available.

If the wrong type, throw an exception.

Parameters
nameName of the string parameter.
defaultValueDefault value to ue if the parameter was not provided.

Definition at line 71 of file ParameterSet.cxx.

◆ getVDouble() [1/2]

const std::vector< double > & getVDouble ( const std::string &  name) const

Get a vector of doubles by name or throw an exception if not available, or not the right type.

Parameters
nameName of the vector of doubles.

Definition at line 122 of file ParameterSet.cxx.

◆ getVDouble() [2/2]

const std::vector< double > & getVDouble ( const std::string &  name,
const std::vector< double > &  defaultValue 
) const

Get a vector of doubles by name or use the given default if not available.

If the wrong type, throw an exception.

Parameters
nameName of the vector of doubles.
defaultValueDefault value to ue if the parameter was not provided.

Definition at line 133 of file ParameterSet.cxx.

◆ getVInteger() [1/2]

const std::vector< int > & getVInteger ( const std::string &  name) const

Get a vector of integers by name or throw an exception if not available, or not the right type.

Parameters
nameName of the vector of integers.

Definition at line 91 of file ParameterSet.cxx.

◆ getVInteger() [2/2]

const std::vector< int > & getVInteger ( const std::string &  name,
const std::vector< int > &  defaultValue 
) const

Get a vector of integers by name or use the given default if not available.

If the wrong type, throw an exception.

Parameters
nameName of the vector of integers.
defaultValueDefault value to ue if the parameter was not provided.

Definition at line 102 of file ParameterSet.cxx.

◆ getVString() [1/2]

const std::vector< std::string > & getVString ( const std::string &  name) const

Get a vector of strings by name or throw an exception if not available, or not the right type.

Parameters
nameName of the vector of strings.

Definition at line 153 of file ParameterSet.cxx.

◆ getVString() [2/2]

const std::vector< std::string > & getVString ( const std::string &  name,
const std::vector< std::string > &  defaultValue 
) const

Get a vector of strings by name or use the given default if not available.

If the wrong type, throw an exception.

Parameters
nameName of the vector of strings.
defaultValueDefault value to ue if the parameter was not provided.

Definition at line 164 of file ParameterSet.cxx.

◆ insert() [1/6]

void insert ( const std::string &  name,
const std::string &  value 
)

Add a string to the ParameterSet.

Parameters
nameName of the string parameter.
valueValue of the string parameter.

Definition at line 56 of file ParameterSet.cxx.

◆ insert() [2/6]

void insert ( const std::string &  name,
const std::vector< double > &  values 
)

Add a vector of doubles to the ParameterSet.

Parameters
nameName of the double vector parameter.
valuesValues of the double vector parameter.

Definition at line 118 of file ParameterSet.cxx.

◆ insert() [3/6]

void insert ( const std::string &  name,
const std::vector< int > &  values 
)

Add a vector of integers to the ParameterSet.

Parameters
nameName of the integer vector parameter.
valuesValues of the integer vector parameter.

Definition at line 87 of file ParameterSet.cxx.

◆ insert() [4/6]

void insert ( const std::string &  name,
const std::vector< std::string > &  values 
)

Add a vector of strings to the ParameterSet.

Parameters
nameName of the string vector parameter.
valuesValues of the string vector parameter.

Definition at line 149 of file ParameterSet.cxx.

◆ insert() [5/6]

void insert ( const std::string &  name,
double  value 
)

Add a double to the ParameterSet.

Parameters
nameName of the double parameter.
valueValue of the double parameter.

Definition at line 30 of file ParameterSet.cxx.

◆ insert() [6/6]

void insert ( const std::string &  name,
int  value 
)

Add an integer to the ParameterSet.

Parameters
nameName of the integer parameter.
valueValue of the integer parameter.

Definition at line 4 of file ParameterSet.cxx.

Member Data Documentation

◆ elements_

std::map<std::string, Element> elements_

Definition at line 225 of file ParameterSet.h.


The documentation for this class was generated from the following files: