Project
Loading...
Searching...
No Matches
o2::tof::ParameterCollection Class Reference

Class container to hold different parameters meant to be stored on the CCDB. More...

#include <ParameterContainers.h>

Inherits TNamed.

Public Member Functions

 ParameterCollection (TString name="DefaultParameters")
 Default constructor.
 
 ~ParameterCollection () override=default
 Default destructor.
 
bool hasKey (const std::string &key) const
 Checks if the container has a particular key e.g. a pass.
 
template<typename ParType >
bool retrieveParameters (ParType &p, const std::string &key) const
 Function to load the parameters from the this container into the array based for the asked key, e.g. pass or version Parameters that are not found in storage are kept unchanged in the array.
 
bool addParameter (const std::string &pass, const std::string &parName, float value)
 Function to add a single parameter conatiner based on the asked key, e.g. pass or version.
 
int getSize (const std::string &pass) const
 
template<typename ParType >
bool storeParameters (const ParType &p, const std::string &key)
 Function to push the parameters from the sub container into the collection and store it under a given key.
 
const auto & getPars (const std::string &pass) const
 getter for the parameters stored in the container matching to a pass
 
void print (const std::string &pass) const
 printing function for the content of the pass
 
void print () const
 printing function for the full content of the container
 
const auto & getFullMap ()
 Getter of the full map of parameters stored in the container.
 
void loadParamFromFile (const TString FileName, const TString ParamName)
 

Detailed Description

Class container to hold different parameters meant to be stored on the CCDB.

Definition at line 143 of file ParameterContainers.h.

Constructor & Destructor Documentation

◆ ParameterCollection()

o2::tof::ParameterCollection::ParameterCollection ( TString  name = "DefaultParameters")
inline

Default constructor.

Definition at line 147 of file ParameterContainers.h.

◆ ~ParameterCollection()

o2::tof::ParameterCollection::~ParameterCollection ( )
overridedefault

Default destructor.

Member Function Documentation

◆ addParameter()

bool ParameterCollection::addParameter ( const std::string &  pass,
const std::string &  parName,
float  value 
)

Function to add a single parameter conatiner based on the asked key, e.g. pass or version.

Parameters
valueparameter to add to the stored information
passkey to look for in the stored information e.g. pass
Returns
true if found and configured false if not fully configured

Definition at line 23 of file ParameterContainers.cxx.

◆ getFullMap()

const auto & o2::tof::ParameterCollection::getFullMap ( )
inline

Getter of the full map of parameters stored in the container.

Returns
returns the full map of parameters

Definition at line 224 of file ParameterContainers.h.

◆ getPars()

const auto & o2::tof::ParameterCollection::getPars ( const std::string &  pass) const
inline

getter for the parameters stored in the container matching to a pass

Definition at line 213 of file ParameterContainers.h.

◆ getSize()

int ParameterCollection::getSize ( const std::string &  pass) const
Returns
the size of the container i.e. the number of stored keys (or passes)

Definition at line 36 of file ParameterContainers.cxx.

◆ hasKey()

bool o2::tof::ParameterCollection::hasKey ( const std::string &  key) const
inline

Checks if the container has a particular key e.g. a pass.

Returns
true if found, false if not

Definition at line 154 of file ParameterContainers.h.

◆ loadParamFromFile()

void o2::tof::ParameterCollection::loadParamFromFile ( const TString  FileName,
const TString  ParamName 
)
inline

Loader from file

Parameters
FileNamename of the input file
ParamNamename of the input object

Definition at line 229 of file ParameterContainers.h.

◆ print() [1/2]

void ParameterCollection::print ( ) const

printing function for the full content of the container

Definition at line 44 of file ParameterContainers.cxx.

◆ print() [2/2]

void ParameterCollection::print ( const std::string &  pass) const

printing function for the content of the pass

Parameters
passpass to print

Definition at line 51 of file ParameterContainers.cxx.

◆ retrieveParameters()

template<typename ParType >
bool o2::tof::ParameterCollection::retrieveParameters ( ParType &  p,
const std::string &  key 
) const
inline

Function to load the parameters from the this container into the array based for the asked key, e.g. pass or version Parameters that are not found in storage are kept unchanged in the array.

Template Parameters
ParTypetype of the parameter container
Parameters
pparameter list to configure from the stored information
keykey to look for in the stored information e.g. pass
Returns
true if found and configured false if not fully configured

Definition at line 163 of file ParameterContainers.h.

◆ storeParameters()

template<typename ParType >
bool o2::tof::ParameterCollection::storeParameters ( const ParType &  p,
const std::string &  key 
)
inline

Function to push the parameters from the sub container into the collection and store it under a given key.

Template Parameters
ParTypetype of the parameter container
Parameters
pparameter list to store
keystore key
Returns
true if modified and false if a new key is added

Definition at line 197 of file ParameterContainers.h.


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