ATLAS Offline Software
Loading...
Searching...
No Matches
TXC::L1TopoConfigAlg Class Reference

#include <L1TopoConfigAlg.h>

Collaboration diagram for TXC::L1TopoConfigAlg:

Public Types

enum  AlgKind { NONE = 0 , SORT = 1 , DECISION = 2 }

Public Member Functions

 L1TopoConfigAlg (const std::string &name, const std::string &type)
 class L1TopoConfigAlg
 L1TopoConfigAlg (L1TopoConfigAlg &&) noexcept=default
L1TopoConfigAlgoperator= (L1TopoConfigAlg &&) noexcept=default
virtual ~L1TopoConfigAlg ()
const std::string & name () const
unsigned int algoID () const
std::string fullname () const
const std::string & type () const
const std::string & output () const
bool isSortAlg () const
bool isDecAlg () const
const std::vector< InputElement > & getInputs () const
std::vector< std::string > getInputNames () const
const std::vector< OutputElement > & getOutputs () const
std::vector< std::string > getOutputNames () const
const std::vector< FixedParameter > & getFixedParameters () const
const std::vector< RegisterParameter > & getParameters () const
void setAlgName (const std::string &name)
void setAlgType (const std::string &type)
void setAlgOutput (const std::string &output)
void setAlgoID (unsigned int algoID)
void setAlgKind (AlgKind kind)
void addInput (const std::string &name, const std::string &value, unsigned int position)
void addOutput (const std::string &name, const std::string &value, unsigned int bits, const std::string &outname, unsigned int position)
void addFixedParameter (const std::string &name, const std::string &value)
void addParameter (const std::string &name, const std::string &value, unsigned int position, unsigned int selection)

Private Member Functions

 L1TopoConfigAlg ()

Private Attributes

std::string m_name {""}
std::string m_type {""}
std::string m_output {""}
unsigned int m_algoID {0}
AlgKind m_kind { AlgKind::NONE }
std::vector< TXC::InputElementm_inputElements
std::vector< TXC::OutputElementm_outputElements
std::vector< TXC::FixedParameterm_fixedParameters
std::vector< TXC::RegisterParameterm_variableParameters

Friends

std::ostream & operator<< (std::ostream &o, const TXC::L1TopoConfigAlg &alg)

Detailed Description

Definition at line 56 of file L1TopoConfigAlg.h.

Member Enumeration Documentation

◆ AlgKind

Enumerator
NONE 
SORT 
DECISION 

Definition at line 59 of file L1TopoConfigAlg.h.

Constructor & Destructor Documentation

◆ L1TopoConfigAlg() [1/3]

TXC::L1TopoConfigAlg::L1TopoConfigAlg ( const std::string & name,
const std::string & type )

class L1TopoConfigAlg

Definition at line 48 of file L1TopoConfigAlg.cxx.

48 :
49 m_name(name),
51{}
const std::string & name() const
const std::string & type() const

◆ L1TopoConfigAlg() [2/3]

TXC::L1TopoConfigAlg::L1TopoConfigAlg ( L1TopoConfigAlg && )
defaultnoexcept

◆ ~L1TopoConfigAlg()

TXC::L1TopoConfigAlg::~L1TopoConfigAlg ( )
virtual

Definition at line 54 of file L1TopoConfigAlg.cxx.

54{}

◆ L1TopoConfigAlg() [3/3]

TXC::L1TopoConfigAlg::L1TopoConfigAlg ( )
inlineprivate

Definition at line 111 of file L1TopoConfigAlg.h.

111{};

Member Function Documentation

◆ addFixedParameter()

void TXC::L1TopoConfigAlg::addFixedParameter ( const std::string & name,
const std::string & value )

Definition at line 92 of file L1TopoConfigAlg.cxx.

92 {
93 m_fixedParameters.push_back(FixedParameter( name, value));
94}
std::vector< TXC::FixedParameter > m_fixedParameters

◆ addInput()

void TXC::L1TopoConfigAlg::addInput ( const std::string & name,
const std::string & value,
unsigned int position )

Definition at line 81 of file L1TopoConfigAlg.cxx.

81 {
82 m_inputElements.push_back( InputElement( name, value, position) );
83 std::sort( m_inputElements.begin(), m_inputElements.end(),[](const TXC::InputElement& i, const TXC::InputElement& i2){ return (i.position < i2.position);});
84}
std::vector< TXC::InputElement > m_inputElements
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ addOutput()

void TXC::L1TopoConfigAlg::addOutput ( const std::string & name,
const std::string & value,
unsigned int bits,
const std::string & outname,
unsigned int position )

Definition at line 87 of file L1TopoConfigAlg.cxx.

87 {
88 m_outputElements.push_back(OutputElement( name, value, bits, outname, position));
89 std::sort( m_outputElements.begin(), m_outputElements.end(),[](const TXC::OutputElement& o, const TXC::OutputElement& o2){ return (o.position < o2.position);});
90}
std::vector< TXC::OutputElement > m_outputElements

◆ addParameter()

void TXC::L1TopoConfigAlg::addParameter ( const std::string & name,
const std::string & value,
unsigned int position,
unsigned int selection )

Definition at line 96 of file L1TopoConfigAlg.cxx.

96 {
97 m_variableParameters.push_back( RegisterParameter( name, value, position, selection));
98 std::sort(m_variableParameters.begin(),m_variableParameters.end(),[](const TXC::RegisterParameter& r, const TXC::RegisterParameter& r2){ return (r.position < r2.position);});
99}
std::vector< TXC::RegisterParameter > m_variableParameters
const std::string selection
int r
Definition globals.cxx:22

◆ algoID()

unsigned int TXC::L1TopoConfigAlg::algoID ( ) const
inline

Definition at line 73 of file L1TopoConfigAlg.h.

73{ return m_algoID; }

◆ fullname()

string TXC::L1TopoConfigAlg::fullname ( ) const

Definition at line 57 of file L1TopoConfigAlg.cxx.

57 {
58 return type() + "/" + name();
59}

◆ getFixedParameters()

const std::vector< FixedParameter > & TXC::L1TopoConfigAlg::getFixedParameters ( ) const
inline

Definition at line 90 of file L1TopoConfigAlg.h.

90{ return m_fixedParameters; }

◆ getInputNames()

vector< string > L1TopoConfigAlg::getInputNames ( ) const

Definition at line 63 of file L1TopoConfigAlg.cxx.

63 {
64 vector<string> names;
65 for(auto & x : m_inputElements)
66 names.push_back(x.value);
67 return names;
68}
#define x

◆ getInputs()

const std::vector< InputElement > & TXC::L1TopoConfigAlg::getInputs ( ) const
inline

Definition at line 82 of file L1TopoConfigAlg.h.

82{ return m_inputElements; }

◆ getOutputNames()

vector< string > L1TopoConfigAlg::getOutputNames ( ) const

Definition at line 71 of file L1TopoConfigAlg.cxx.

71 {
72 vector<string> names;
73 for(auto & x : m_outputElements)
74 names.push_back( isSortAlg() ? x.value : x.outname );
75 return names;
76}

◆ getOutputs()

const std::vector< OutputElement > & TXC::L1TopoConfigAlg::getOutputs ( ) const
inline

Definition at line 86 of file L1TopoConfigAlg.h.

86{ return m_outputElements; }

◆ getParameters()

const std::vector< RegisterParameter > & TXC::L1TopoConfigAlg::getParameters ( ) const
inline

Definition at line 93 of file L1TopoConfigAlg.h.

93{ return m_variableParameters; }

◆ isDecAlg()

bool TXC::L1TopoConfigAlg::isDecAlg ( ) const
inline

Definition at line 79 of file L1TopoConfigAlg.h.

79{ return m_kind == DECISION; }

◆ isSortAlg()

bool TXC::L1TopoConfigAlg::isSortAlg ( ) const
inline

Definition at line 78 of file L1TopoConfigAlg.h.

78{ return m_kind == SORT; }

◆ name()

const std::string & TXC::L1TopoConfigAlg::name ( ) const
inline

Definition at line 72 of file L1TopoConfigAlg.h.

72{ return m_name; }

◆ operator=()

L1TopoConfigAlg & TXC::L1TopoConfigAlg::operator= ( L1TopoConfigAlg && )
defaultnoexcept

◆ output()

const std::string & TXC::L1TopoConfigAlg::output ( ) const
inline

Definition at line 77 of file L1TopoConfigAlg.h.

77{ return m_output; }

◆ setAlgKind()

void TXC::L1TopoConfigAlg::setAlgKind ( AlgKind kind)
inline

Definition at line 101 of file L1TopoConfigAlg.h.

101{ m_kind = kind; }

◆ setAlgName()

void TXC::L1TopoConfigAlg::setAlgName ( const std::string & name)
inline

Definition at line 97 of file L1TopoConfigAlg.h.

97{ m_name = name; }

◆ setAlgoID()

void TXC::L1TopoConfigAlg::setAlgoID ( unsigned int algoID)
inline

Definition at line 100 of file L1TopoConfigAlg.h.

100{ m_algoID = algoID; }
unsigned int algoID() const

◆ setAlgOutput()

void TXC::L1TopoConfigAlg::setAlgOutput ( const std::string & output)
inline

Definition at line 99 of file L1TopoConfigAlg.h.

99{ m_output = output; }
const std::string & output() const

◆ setAlgType()

void TXC::L1TopoConfigAlg::setAlgType ( const std::string & type)
inline

Definition at line 98 of file L1TopoConfigAlg.h.

98{ m_type = type; }

◆ type()

const std::string & TXC::L1TopoConfigAlg::type ( ) const
inline

Definition at line 76 of file L1TopoConfigAlg.h.

76{ return m_type; }

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const TXC::L1TopoConfigAlg & alg )
friend

Definition at line 104 of file L1TopoConfigAlg.cxx.

104 {
105
106 if(alg.isSortAlg()) {
107 o << "Sorting algorithm " << alg.algoID() << " : " << alg.type() << "/" << alg.name() << endl;
108 o << " Input : " << alg.m_inputElements[0].value << endl;
109 o << " Output : " << alg.m_outputElements[0].value << endl;
110 } else {
111 o << "Decision algorithm " << alg.algoID() << " : " << alg.type() << "/" << alg.name() << endl;
112 for(const TXC::InputElement& ie: alg.m_inputElements)
113 o << " Input " << ie.position << " : " << ie.value << endl;
114 for(const TXC::OutputElement& oe: alg.m_outputElements)
115 o << " Output " << oe.position << " : " << oe.outname << endl;
116 }
117 o << " Fixed paramters: " << alg.getFixedParameters().size() << endl;
118 for(const TXC::FixedParameter& ge: alg.m_fixedParameters)
119 o << " " << setw(15) << left << ge.name << " : " << ge.value << endl;
120 o << " Parameters: " << alg.getParameters().size() << endl;
121 for(const TXC::RegisterParameter& pe: alg.m_variableParameters)
122 o << " " << setw(15) << left << pe.name << " : " << pe.value << endl;
123 return o;
124}
unsigned int position

Member Data Documentation

◆ m_algoID

unsigned int TXC::L1TopoConfigAlg::m_algoID {0}
private

Definition at line 119 of file L1TopoConfigAlg.h.

119{0};

◆ m_fixedParameters

std::vector<TXC::FixedParameter> TXC::L1TopoConfigAlg::m_fixedParameters
private

Definition at line 125 of file L1TopoConfigAlg.h.

◆ m_inputElements

std::vector<TXC::InputElement> TXC::L1TopoConfigAlg::m_inputElements
private

Definition at line 123 of file L1TopoConfigAlg.h.

◆ m_kind

AlgKind TXC::L1TopoConfigAlg::m_kind { AlgKind::NONE }
private

Definition at line 120 of file L1TopoConfigAlg.h.

120{ AlgKind::NONE };

◆ m_name

std::string TXC::L1TopoConfigAlg::m_name {""}
private

Definition at line 116 of file L1TopoConfigAlg.h.

116{""};

◆ m_output

std::string TXC::L1TopoConfigAlg::m_output {""}
private

Definition at line 118 of file L1TopoConfigAlg.h.

118{""};

◆ m_outputElements

std::vector<TXC::OutputElement> TXC::L1TopoConfigAlg::m_outputElements
private

Definition at line 124 of file L1TopoConfigAlg.h.

◆ m_type

std::string TXC::L1TopoConfigAlg::m_type {""}
private

Definition at line 117 of file L1TopoConfigAlg.h.

117{""};

◆ m_variableParameters

std::vector<TXC::RegisterParameter> TXC::L1TopoConfigAlg::m_variableParameters
private

Definition at line 126 of file L1TopoConfigAlg.h.


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