ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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 More...
 
 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 &, const TXC::L1TopoConfigAlg &)
 

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.

59 { NONE = 0, SORT = 1, DECISION = 2 };

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),
50  m_type(type)
51 {}

◆ 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  {
94 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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; }

◆ setAlgOutput()

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

Definition at line 99 of file L1TopoConfigAlg.h.

99 { m_output = output; }

◆ 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; }

Friends And Related Function Documentation

◆ 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 }

Member Data Documentation

◆ m_algoID

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

Definition at line 119 of file L1TopoConfigAlg.h.

◆ 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.

◆ m_name

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

Definition at line 116 of file L1TopoConfigAlg.h.

◆ m_output

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

Definition at line 118 of file L1TopoConfigAlg.h.

◆ 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.

◆ 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:
beamspotman.r
def r
Definition: beamspotman.py:676
TXC::L1TopoConfigAlg::m_outputElements
std::vector< TXC::OutputElement > m_outputElements
Definition: L1TopoConfigAlg.h:124
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TXC::FixedParameter::name
std::string name
Definition: L1TopoConfigAlg.h:41
TXC::L1TopoConfigAlg::m_type
std::string m_type
Definition: L1TopoConfigAlg.h:117
TXC::L1TopoConfigAlg::m_fixedParameters
std::vector< TXC::FixedParameter > m_fixedParameters
Definition: L1TopoConfigAlg.h:125
athena.value
value
Definition: athena.py:122
TXC::L1TopoConfigAlg::NONE
@ NONE
Definition: L1TopoConfigAlg.h:59
TXC::L1TopoConfigAlg::m_output
std::string m_output
Definition: L1TopoConfigAlg.h:118
x
#define x
LArG4AODNtuplePlotter.pe
pe
Definition: LArG4AODNtuplePlotter.py:116
TXC::L1TopoConfigAlg::algoID
unsigned int algoID() const
Definition: L1TopoConfigAlg.h:73
PlotCalibFromCool.ie
ie
Definition: PlotCalibFromCool.py:420
TXC::L1TopoConfigAlg::isSortAlg
bool isSortAlg() const
Definition: L1TopoConfigAlg.h:78
TXC::L1TopoConfigAlg::m_variableParameters
std::vector< TXC::RegisterParameter > m_variableParameters
Definition: L1TopoConfigAlg.h:126
lumiFormat.i
int i
Definition: lumiFormat.py:92
TXC::OutputElement::outname
std::string outname
Definition: L1TopoConfigAlg.h:34
TXC::L1TopoConfigAlg::type
const std::string & type() const
Definition: L1TopoConfigAlg.h:76
python.subdetectors.mmg.names
names
Definition: mmg.py:8
TXC::L1TopoConfigAlg::name
const std::string & name() const
Definition: L1TopoConfigAlg.h:72
TXC::L1TopoConfigAlg::DECISION
@ DECISION
Definition: L1TopoConfigAlg.h:59
TXC::L1TopoConfigAlg::m_kind
AlgKind m_kind
Definition: L1TopoConfigAlg.h:120
selection
std::string selection
Definition: fbtTestBasics.cxx:73
TXC::L1TopoConfigAlg::m_algoID
unsigned int m_algoID
Definition: L1TopoConfigAlg.h:119
TXC::L1TopoConfigAlg::output
const std::string & output() const
Definition: L1TopoConfigAlg.h:77
beamspotman.outname
outname
Definition: beamspotman.py:414
TXC::InputElement
Definition: L1TopoConfigAlg.h:20
TXC::RegisterParameter
Definition: L1TopoConfigAlg.h:45
python.changerun.o2
o2
Definition: changerun.py:45
TXC::OutputElement::position
unsigned int position
Definition: L1TopoConfigAlg.h:35
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
TXC::FixedParameter
Definition: L1TopoConfigAlg.h:38
TXC::L1TopoConfigAlg::SORT
@ SORT
Definition: L1TopoConfigAlg.h:59
TXC::FixedParameter::value
std::string value
Definition: L1TopoConfigAlg.h:42
TXC::L1TopoConfigAlg::m_inputElements
std::vector< TXC::InputElement > m_inputElements
Definition: L1TopoConfigAlg.h:123
TXC::L1TopoConfigAlg::m_name
std::string m_name
Definition: L1TopoConfigAlg.h:116
TXC::OutputElement
Definition: L1TopoConfigAlg.h:28