ATLAS Offline Software
|
L1Topo algorithm configuration. More...
#include <L1TopoAlgorithm.h>
Classes | |
struct | VariableParameter |
Public Types | |
enum | AlgorithmType { AlgorithmType::SORTING, AlgorithmType::DECISION, AlgorithmType::MULTIPLICITY, AlgorithmType::UNKNOWN } |
using | ptree = boost::property_tree::ptree |
Public Member Functions | |
L1TopoAlgorithm ()=default | |
Constructor. More... | |
L1TopoAlgorithm (const L1TopoAlgorithm &)=delete | |
L1TopoAlgorithm & | operator= (const L1TopoAlgorithm &)=delete |
L1TopoAlgorithm (L1TopoAlgorithm &&)=default | |
L1TopoAlgorithm (const std::string &algoName, AlgorithmType algoType, const std::string &algoCategory, const ptree &data) | |
Constructor initialized with configuration data. More... | |
virtual | ~L1TopoAlgorithm () override=default |
Destructor. More... | |
virtual std::string | className () const override |
A string that is the name of the class. More... | |
AlgorithmType | type () const |
const std::string & | category () const |
const std::string & | klass () const |
Accessor to algorithm class type. More... | |
const std::vector< std::string > & | inputs () const |
Accessor to input collections Sorting and Multiplicity algorithms have only one input. More... | |
const std::vector< std::string > & | outputs () const |
Accessor to output collections Sorting and Multiplicity algorithms have only one output. More... | |
std::vector< std::string > | fullOutputs () const |
DataStructure | generics () const |
Accessors to generic parameters. More... | |
std::string | genericParameter (const std::string &parName) const |
template<class T > | |
T | genericParameter (const std::string &parName) const |
const std::vector< VariableParameter > & | parameters () const |
Accessor to register parameters which can change for each algorithm instance. More... | |
void | print (std::ostream &os=std::cout) const override |
print main info More... | |
void | setData (const ptree &data) |
Setting the configuration data. More... | |
void | setData (ptree &&data) |
void | setName (const std::string &n) |
Setting the configuration element name. More... | |
virtual const std::string & | name () const final |
virtual void | clear () |
Clearing the configuration data. More... | |
const ptree & | data () const |
Access to the underlying data, if needed. More... | |
bool | isValue () const |
Check for attribute. More... | |
std::string | getValue () const |
Access to simple content. More... | |
template<class T > | |
T | getValue () const |
template<class T > | |
std::optional< T > | getValue_optional () const |
access to content of the note Will return false if the value could not be converted into T More... | |
bool | hasAttribute (const std::string &key) const |
Check for attribute. More... | |
bool | isNull (const std::string &key) const |
Check if an attribute is null. More... | |
bool | hasChild (const std::string &path) const |
Check if child exists. More... | |
std::string | operator[] (const std::string &key) const |
Access to simple attribute. More... | |
template<class T > | |
T | getAttribute (const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const |
Access to simple attribute. More... | |
const std::string & | getAttribute (const std::string &key, bool ignoreIfMissing=false, const std::string &def="") const |
template<class T > | |
std::optional< T > | getAttribute_optional (const std::string &key) const |
std::vector< DataStructure > | getList (const std::string &pathToChild, bool ignoreIfMissing=false) const |
Access to array structure. More... | |
std::optional< std::vector< DataStructure > > | getList_optional (const std::string &pathToChild) const |
DataStructure | getObject (const std::string &pathToChild, bool ignoreIfMissing=false) const |
Access to configuration object. More... | |
std::optional< TrigConf::DataStructure > | getObject_optional (const std::string &pathToChild) const |
std::vector< std::string > | getKeys () const |
Access to the keys of an DataStructure which presents a dictionary. More... | |
operator bool () const | |
Access to initialized state. More... | |
bool | isValid () const |
bool | isInitialized () const |
bool | empty () const |
Check if children exist. More... | |
void | printRaw (std::ostream &os=std::cout) const |
bool | ownsData () const |
Static Public Member Functions | |
static void | printElement (const std::string &key, const ptree &data, uint level=0, std::ostream &os=std::cout) |
Static function to print a ptree object. More... | |
Protected Member Functions | |
virtual void | update () override |
Update the internal data after modification of the data object. More... | |
Protected Attributes | |
bool | m_initialized { false } |
if initialized, the underlying ptree is has been assigned to (can be empty) More... | |
std::shared_ptr< ptree > | m_dataSPtr { nullptr } |
const ptree * | m_dataPtr { nullptr } |
std::string | m_name {""} |
Private Member Functions | |
void | load () |
Update the internal data after modification of the data object. More... | |
Private Attributes | |
AlgorithmType | m_type { AlgorithmType::UNKNOWN } |
std::string | m_category {} |
std::vector< std::string > | m_inputs {} |
std::vector< std::string > | m_outputs {} |
std::vector< VariableParameter > | m_parameters |
L1Topo algorithm configuration.
Provides access to the L1Topo algorithm name and type and the selection parameters, input and output collections. Can hold sorting and decision algorithms
Definition at line 20 of file L1TopoAlgorithm.h.
|
inherited |
Definition at line 40 of file DataStructure.h.
|
strong |
|
default |
Constructor.
|
delete |
|
default |
TrigConf::L1TopoAlgorithm::L1TopoAlgorithm | ( | const std::string & | algoName, |
AlgorithmType | algoType, | ||
const std::string & | algoCategory, | ||
const ptree & | data | ||
) |
Constructor initialized with configuration data.
data | The data containing the L1Topo menu |
Definition at line 8 of file L1TopoAlgorithm.cxx.
|
overridevirtualdefault |
Destructor.
const std::string & TrigConf::L1TopoAlgorithm::category | ( | ) | const |
Definition at line 92 of file L1TopoAlgorithm.cxx.
|
overridevirtual |
A string that is the name of the class.
Reimplemented from TrigConf::DataStructure.
Definition at line 21 of file L1TopoAlgorithm.cxx.
|
virtualinherited |
Clearing the configuration data.
should be overloaded by derived object that have to clear data
leads to an uninitialized object
Reimplemented in TrigConf::L1Menu, TrigConf::L1BunchGroupSet, TrigConf::HLTMenu, TrigConf::HLTMonitoring, TrigConf::HLTPrescalesSet, TrigConf::L1CTP, and TrigConf::L1PrescalesSet.
Definition at line 65 of file DataStructure.cxx.
Access to the underlying data, if needed.
Definition at line 83 of file DataStructure.h.
|
inlineinherited |
std::vector< std::string > TrigConf::L1TopoAlgorithm::fullOutputs | ( | ) | const |
Definition at line 119 of file L1TopoAlgorithm.cxx.
std::string TrigConf::L1TopoAlgorithm::genericParameter | ( | const std::string & | parName | ) | const |
Definition at line 129 of file L1TopoAlgorithm.cxx.
|
inline |
Definition at line 80 of file L1TopoAlgorithm.h.
TrigConf::DataStructure TrigConf::L1TopoAlgorithm::generics | ( | ) | const |
Accessors to generic parameters.
Definition at line 135 of file L1TopoAlgorithm.cxx.
|
inherited |
Definition at line 136 of file DataStructure.cxx.
|
inlineinherited |
Access to simple attribute.
key | The path to the attribute name, relative to the current one in form "path.to.child" |
ignoreIfMissing | Controls the behavior in case of missing configuration child |
Definition at line 152 of file DataStructure.h.
|
inlineinherited |
|
inherited |
Access to the keys of an DataStructure which presents a dictionary.
In case the DataStructure is a list or a simple attribute, an empty vector is returned
Definition at line 250 of file DataStructure.cxx.
|
inherited |
Access to array structure.
pathToChild | The path to the configuration child, relative to the current one in form "path.to.child" |
ignoreIfMissing | Controls the behavior in case of missing configuration child |
In case the child is missing and ignoreIfMissing
is set to true
, and empty vector will be returned. Otherwise a runtime exception will be thrown.
Definition at line 158 of file DataStructure.cxx.
|
inherited |
|
inherited |
Access to configuration object.
pathToChild | The path to the configuration child, relative to the current one |
ignoreIfMissing | Controls the behavior in case of missing configuration child |
In case the child is missing and ignoreIfMissing
is set to true
, an uninitialized DataStructure
will be returned. Otherwise a runtime exception will be thrown.
Definition at line 207 of file DataStructure.cxx.
|
inherited |
Definition at line 230 of file DataStructure.cxx.
|
inherited |
Access to simple content.
For instance when the json structure contains an array of values (ptree only works with strings) which one retrieved via getList
, then the values in the vector<DataStructure>
can be accessed using getValue
Definition at line 80 of file DataStructure.cxx.
|
inlineinherited |
Definition at line 108 of file DataStructure.h.
|
inlineinherited |
|
inherited |
Check for attribute.
key | The path to the attribute name, relative to the current one in form "path.to.child" |
key
exists and is an attribute Definition at line 86 of file DataStructure.cxx.
|
inherited |
Check if child exists.
path | The path to the child, relative to the current one in form "path.to.child" |
Definition at line 114 of file DataStructure.cxx.
const std::vector< std::string > & TrigConf::L1TopoAlgorithm::inputs | ( | ) | const |
Accessor to input collections Sorting and Multiplicity algorithms have only one input.
Definition at line 107 of file L1TopoAlgorithm.cxx.
|
inlineinherited |
Definition at line 216 of file DataStructure.h.
|
inherited |
Check if an attribute is null.
key | The path to the attribute name, relative to the current one in form "path.to.child" |
key
exists and is nullIf the attribute doesn't exist, the function returns false. To check if an attribute exists and is null, use it together with hasAttribute
.
Definition at line 94 of file DataStructure.cxx.
|
inlineinherited |
Definition at line 215 of file DataStructure.h.
|
inherited |
Check for attribute.
Definition at line 74 of file DataStructure.cxx.
const std::string & TrigConf::L1TopoAlgorithm::klass | ( | ) | const |
|
private |
Update the internal data after modification of the data object.
Definition at line 26 of file L1TopoAlgorithm.cxx.
|
finalvirtualinherited |
Definition at line 109 of file DataStructure.cxx.
|
inlineexplicitinherited |
|
delete |
|
inherited |
Access to simple attribute.
key | The path to the attribute name, relative to the current one in form "path.to.child" |
Definition at line 121 of file DataStructure.cxx.
const std::vector< std::string > & TrigConf::L1TopoAlgorithm::outputs | ( | ) | const |
Accessor to output collections Sorting and Multiplicity algorithms have only one output.
Definition at line 113 of file L1TopoAlgorithm.cxx.
|
inlineinherited |
Definition at line 242 of file DataStructure.h.
const std::vector< TrigConf::L1TopoAlgorithm::VariableParameter > & TrigConf::L1TopoAlgorithm::parameters | ( | ) | const |
Accessor to register parameters which can change for each algorithm instance.
Definition at line 141 of file L1TopoAlgorithm.cxx.
|
overridevirtual |
print main info
Reimplemented from TrigConf::DataStructure.
Definition at line 148 of file L1TopoAlgorithm.cxx.
|
staticinherited |
Static function to print a ptree
object.
key | The key of this data as found in the parent structure |
data | The ptree to print |
level | The substruture level used to indent the output |
os | The output stream |
Definition at line 279 of file DataStructure.cxx.
|
inherited |
Definition at line 265 of file DataStructure.cxx.
|
inherited |
Definition at line 50 of file DataStructure.cxx.
|
inherited |
Setting the configuration element name.
Definition at line 59 of file DataStructure.cxx.
TrigConf::L1TopoAlgorithm::AlgorithmType TrigConf::L1TopoAlgorithm::type | ( | ) | const |
Definition at line 86 of file L1TopoAlgorithm.cxx.
|
inlineoverrideprotectedvirtual |
Update the internal data after modification of the data object.
to be implemented by the derived class
Reimplemented from TrigConf::DataStructure.
Definition at line 92 of file L1TopoAlgorithm.h.
|
private |
Definition at line 101 of file L1TopoAlgorithm.h.
Definition at line 257 of file DataStructure.h.
|
protectedinherited |
Definition at line 256 of file DataStructure.h.
|
protectedinherited |
if initialized, the underlying ptree is has been assigned to (can be empty)
Definition at line 254 of file DataStructure.h.
|
private |
Definition at line 103 of file L1TopoAlgorithm.h.
|
protectedinherited |
Definition at line 259 of file DataStructure.h.
|
private |
Definition at line 104 of file L1TopoAlgorithm.h.
|
private |
Definition at line 106 of file L1TopoAlgorithm.h.
|
private |
Definition at line 99 of file L1TopoAlgorithm.h.