14 throw std::runtime_error(
"Algorithm category must be TOPO, R2TOPO, MUTOPO or MULTTOPO, but is '" + algoCategory +
"'");
22 return "L1TopoAlgorithm";
33 for(
auto & inp :
getList(
"input")) {
36 }
else if(
hasChild(
"fixedParameters.inputs") ) {
37 for(
auto & inp :
getList(
"fixedParameters.inputs")) {
41 for(
auto & o :
getList(
"output")) {
46 if(
auto & input =
getAttribute(
"input"); input!=
"null") {
56 }
else if(
hasChild(
"fixedParameters.input") ) {
57 auto inp =
getObject(
"fixedParameters.input");
58 for(
auto & k : inp.getKeys() ) {
67 for(
auto & p :
getList(
"variableParameters") ) {
68 if (p[
"name"] ==
"MaxMSqr") {
69 unsigned int val = p.getAttribute<
unsigned int>(
"value");
73 val = 1024*1024*10*10*10;
75 m_parameters.emplace_back(p[
"name"], val, p.getAttribute_optional<
unsigned int>(
"selection"));
78 m_parameters.emplace_back(p[
"name"], p.getAttribute<
int>(
"value"), p.getAttribute_optional<
unsigned int>(
"selection"));
106const std::vector<std::string> &
112const std::vector<std::string> &
118std::vector<std::string>
121 std::vector<std::string> out;
131 return operator[](
"fixedParameters.generics." + parName +
".value");
137 return getObject(
"fixedParameters.generics");
140const std::vector<TrigConf::L1TopoAlgorithm::VariableParameter> &
150 os <<
"Algorithm " <<
name() <<
" (class " <<
klass() <<
", category " <<
m_category <<
")" << std::endl;
151 os <<
" input:" << std::endl;
152 for(
auto & input :
inputs() ) {
153 os <<
" " << input << std::endl;
155 os <<
" output:" << std::endl;
156 for(
auto & output :
outputs() ) {
157 os <<
" " << output << std::endl;
159 os <<
" full output:" << std::endl;
161 os <<
" " << output << std::endl;
164 os <<
" threshold definition: " <<
getAttribute(
"threshold") << std::endl;
167 os <<
" generic parameters:" << std::endl;
169 for(
auto & k : genPars.getKeys() ) {
172 os <<
" parameters:" << std::endl;
175 for(
auto & p : pars ) {
176 os <<
" " << idx++ <<
" " << p.name() <<
"[" << p.selection() <<
"] ==> " << p.value() << std::endl;
static const Attributes_t empty
Base class for Trigger configuration data and wrapper around underlying representation.
virtual const std::string & name() const final
std::vector< DataStructure > getList(const std::string &pathToChild, bool ignoreIfMissing=false) const
Access to array structure.
bool isInitialized() const
const ptree & data() const
Access to the underlying data, if needed.
bool hasAttribute(const std::string &key) const
Check for attribute.
DataStructure()
Default constructor, leading to an uninitialized configuration object.
T getAttribute(const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
Access to simple attribute.
bool hasChild(const std::string &path) const
Check if child exists.
DataStructure getObject(const std::string &pathToChild, bool ignoreIfMissing=false) const
Access to configuration object.
std::string operator[](const std::string &key) const
Access to simple attribute.
virtual std::string className() const override
A string that is the name of the class.
L1TopoAlgorithm()=default
Constructor.
DataStructure generics() const
Accessors to generic parameters.
std::vector< std::string > fullOutputs() const
void print(std::ostream &os=std::cout) const override
print main info
std::string genericParameter(const std::string &parName) const
const std::vector< std::string > & inputs() const
Accessor to input collections Sorting and Multiplicity algorithms have only one input.
const std::vector< std::string > & outputs() const
Accessor to output collections Sorting and Multiplicity algorithms have only one output.
std::vector< VariableParameter > m_parameters
const std::vector< VariableParameter > & parameters() const
Accessor to register parameters which can change for each algorithm instance.
const std::string & category() const
void load()
Update the internal data after modification of the data object.
AlgorithmType type() const
std::vector< std::string > m_inputs
std::vector< std::string > m_outputs
const std::string & klass() const
Accessor to algorithm class type.
static unsigned int flavourStrToInt(const std::string &flavStr)