CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
GlobalAlgorithm Class Reference

#include <GlobalAlgorithm.h>

Public Member Functions

std::string const & algoAlias () const
 get / set algorithm alias More...
 
int algoBitNumber () const
 get / set algorithm bit number More...
 
const int algoChipNumber () const
 get / set algorithm bit number More...
 
const int algoChipNumber (const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
 get the condition chip number the algorithm is located on More...
 
std::string const & algoLogicalExpression () const
 get / set the logical expression for the algorithm More...
 
const std::string algoName () const
 get / set algorithm name More...
 
const int algoOutputPin (const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
 get the output pin on the condition chip for the algorithm More...
 
const std::vector< GlobalLogicParser::TokenRPN > & algoRpnVector () const
 return the RPN vector More...
 
 GlobalAlgorithm ()
 
 GlobalAlgorithm (const std::string &algoNameValue)
 name only More...
 
 GlobalAlgorithm (const std::string &, const std::string &)
 name and logical expression More...
 
 GlobalAlgorithm (const std::string &, const std::string &, const int)
 name, logical expression and bit number More...
 
virtual void print (std::ostream &myCout) const
 print condition More...
 
void setAlgoAlias (const std::string &algoAliasValue)
 
void setAlgoBitNumber (const int algoBitNumberValue)
 
void setAlgoChipNumber (const int algoChipNumberValue)
 
void setAlgoLogicalExpresssion (const std::string &logicalExpression)
 
void setAlgoName (const std::string &algoNameValue)
 
virtual ~GlobalAlgorithm ()
 destructor More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::string m_algoAlias
 algorithm alias More...
 
int m_algoBitNumber
 
int m_algoChipNumber
 chip number (redundant with bit number) More...
 
std::string m_algoLogicalExpression
 algorithm logical expression More...
 
std::string m_algoName
 algorithm name More...
 
std::vector< GlobalLogicParser::TokenRPNm_algoRpnVector
 algorithm RPN vector More...
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 
std::ostream & operator<< (std::ostream &, const GlobalAlgorithm &)
 output stream operator More...
 

Detailed Description

Description: L1 GT algorithm.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 32 of file GlobalAlgorithm.h.

Constructor & Destructor Documentation

◆ GlobalAlgorithm() [1/4]

GlobalAlgorithm::GlobalAlgorithm ( )

constructor(s) empty

Definition at line 30 of file GlobalAlgorithm.cc.

References m_algoBitNumber, and m_algoChipNumber.

30  {
31  // default values for private members not set
32  // the other private members are C++ initialized
33  m_algoBitNumber = -1;
34  m_algoChipNumber = -1;
35 }
int m_algoChipNumber
chip number (redundant with bit number)

◆ GlobalAlgorithm() [2/4]

GlobalAlgorithm::GlobalAlgorithm ( const std::string &  algoNameValue)

name only

Definition at line 38 of file GlobalAlgorithm.cc.

References m_algoBitNumber, and m_algoChipNumber.

38  : m_algoName(algoNameValue) {
39  // default values for private members not set
40  // the other private members are C++ initialized
41  m_algoBitNumber = -1;
42  m_algoChipNumber = -1;
43 }
int m_algoChipNumber
chip number (redundant with bit number)
std::string m_algoName
algorithm name

◆ GlobalAlgorithm() [3/4]

GlobalAlgorithm::GlobalAlgorithm ( const std::string &  algoNameValue,
const std::string &  algoLogicalExpressionValue 
)

name and logical expression

Definition at line 46 of file GlobalAlgorithm.cc.

References m_algoBitNumber, m_algoChipNumber, m_algoLogicalExpression, m_algoRpnVector, and GlobalLogicParser::rpnVector().

47  : m_algoName(algoNameValue), m_algoLogicalExpression(algoLogicalExpressionValue) {
49  m_algoRpnVector = logicParser.rpnVector();
50 
51  // default values for private members not set
52  m_algoBitNumber = -1;
53  m_algoChipNumber = -1;
54 }
int m_algoChipNumber
chip number (redundant with bit number)
std::string m_algoLogicalExpression
algorithm logical expression
std::string m_algoName
algorithm name
std::vector< GlobalLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector

◆ GlobalAlgorithm() [4/4]

GlobalAlgorithm::GlobalAlgorithm ( const std::string &  algoNameValue,
const std::string &  algoLogicalExpressionValue,
const int  algoBitNumberValue 
)

name, logical expression and bit number

Definition at line 57 of file GlobalAlgorithm.cc.

References m_algoChipNumber, m_algoLogicalExpression, m_algoRpnVector, and GlobalLogicParser::rpnVector().

60  : m_algoName(algoNameValue),
61  m_algoLogicalExpression(algoLogicalExpressionValue),
62  m_algoBitNumber(algoBitNumberValue)
63 
64 {
66  m_algoRpnVector = logicParser.rpnVector();
67 
68  // default values for private members not set
69  m_algoChipNumber = -1;
70 }
int m_algoChipNumber
chip number (redundant with bit number)
std::string m_algoLogicalExpression
algorithm logical expression
std::string m_algoName
algorithm name
std::vector< GlobalLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector

◆ ~GlobalAlgorithm()

GlobalAlgorithm::~GlobalAlgorithm ( )
virtual

destructor

Definition at line 73 of file GlobalAlgorithm.cc.

73  {
74  // empty
75 }

Member Function Documentation

◆ algoAlias()

std::string const& GlobalAlgorithm::algoAlias ( ) const
inline

get / set algorithm alias

Definition at line 57 of file GlobalAlgorithm.h.

References m_algoAlias.

Referenced by l1t::TriggerMenuParser::insertAlgorithmIntoMap().

57 { return m_algoAlias; }
std::string m_algoAlias
algorithm alias

◆ algoBitNumber()

int GlobalAlgorithm::algoBitNumber ( ) const
inline

get / set algorithm bit number

Definition at line 72 of file GlobalAlgorithm.h.

References m_algoBitNumber.

Referenced by l1t::TriggerMenuParser::insertAlgorithmIntoMap().

72 { return m_algoBitNumber; }

◆ algoChipNumber() [1/2]

const int GlobalAlgorithm::algoChipNumber ( ) const
inline

get / set algorithm bit number

Definition at line 77 of file GlobalAlgorithm.h.

References m_algoChipNumber.

Referenced by algoOutputPin(), and l1t::TriggerMenuParser::insertAlgorithmIntoMap().

77 { return m_algoChipNumber; }
int m_algoChipNumber
chip number (redundant with bit number)

◆ algoChipNumber() [2/2]

const int GlobalAlgorithm::algoChipNumber ( const int  numberConditionChips,
const int  pinsOnConditionChip,
const std::vector< int > &  orderConditionChip 
) const

get the condition chip number the algorithm is located on

Definition at line 80 of file GlobalAlgorithm.cc.

References m_algoBitNumber.

82  {
83  int posChip = (m_algoBitNumber / pinsOnConditionChip) + 1;
84  for (int iChip = 0; iChip < numberConditionChips; ++iChip) {
85  if (posChip == orderConditionChip[iChip]) {
86  return iChip;
87  }
88  }
89 
90  // chip number not found
91  return -1;
92 }

◆ algoLogicalExpression()

std::string const& GlobalAlgorithm::algoLogicalExpression ( ) const
inline

get / set the logical expression for the algorithm

Definition at line 62 of file GlobalAlgorithm.h.

References m_algoLogicalExpression.

62 { return m_algoLogicalExpression; }
std::string m_algoLogicalExpression
algorithm logical expression

◆ algoName()

const std::string GlobalAlgorithm::algoName ( ) const
inline

get / set algorithm name

Definition at line 52 of file GlobalAlgorithm.h.

References m_algoName.

Referenced by l1t::TriggerMenuParser::insertAlgorithmIntoMap().

52 { return m_algoName; }
std::string m_algoName
algorithm name

◆ algoOutputPin()

const int GlobalAlgorithm::algoOutputPin ( const int  numberConditionChips,
const int  pinsOnConditionChip,
const std::vector< int > &  orderConditionChip 
) const

get the output pin on the condition chip for the algorithm

Definition at line 95 of file GlobalAlgorithm.cc.

References algoChipNumber(), and m_algoBitNumber.

Referenced by l1t::TriggerMenuParser::insertAlgorithmIntoMap().

97  {
98  int iChip = algoChipNumber(numberConditionChips, pinsOnConditionChip, orderConditionChip);
99 
100  int outputPin = m_algoBitNumber - (orderConditionChip[iChip] - 1) * pinsOnConditionChip + 1;
101 
102  return outputPin;
103 }
const int algoChipNumber() const
get / set algorithm bit number

◆ algoRpnVector()

const std::vector<GlobalLogicParser::TokenRPN>& GlobalAlgorithm::algoRpnVector ( ) const
inline

return the RPN vector

Definition at line 69 of file GlobalAlgorithm.h.

References m_algoRpnVector.

69 { return m_algoRpnVector; }
std::vector< GlobalLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector

◆ print()

void GlobalAlgorithm::print ( std::ostream &  myCout) const
virtual

print condition

Definition at line 106 of file GlobalAlgorithm.cc.

References mps_fire::i, m_algoAlias, m_algoBitNumber, m_algoChipNumber, m_algoLogicalExpression, m_algoName, and m_algoRpnVector.

Referenced by l1t::TriggerMenuParser::parseAlgorithm().

106  {
107  myCout << std::endl;
108 
109  myCout << " Algorithm name: " << m_algoName << std::endl;
110  myCout << " Algorithm alias: " << m_algoAlias << std::endl;
111 
112  myCout << " Bit number: " << m_algoBitNumber;
113  if (m_algoBitNumber < 0) {
114  myCout << " - not properly initialized! " << std::endl;
115  } else {
116  myCout << std::endl;
117  }
118 
119  myCout << " Located on chip number: " << m_algoChipNumber;
120  if (m_algoChipNumber < 0) {
121  myCout << " - not properly initialized! " << std::endl;
122  } else {
123  myCout << std::endl;
124  }
125 
126  myCout << " Logical expresssion: " << m_algoLogicalExpression << std::endl;
127 
128  int rpnVectorSize = m_algoRpnVector.size();
129 
130  myCout << " RPN vector size: " << rpnVectorSize;
131 
132  if (rpnVectorSize == 0) {
133  myCout << " - not properly initialized! " << std::endl;
134  } else {
135  myCout << std::endl;
136 
137  for (int i = 0; i < rpnVectorSize; ++i) {
138  myCout << " ( " << (m_algoRpnVector[i]).operation << ", " << (m_algoRpnVector[i]).operand << " )"
139  << std::endl;
140  }
141  }
142 
143  myCout << std::endl;
144 }
std::string m_algoAlias
algorithm alias
int m_algoChipNumber
chip number (redundant with bit number)
std::string m_algoLogicalExpression
algorithm logical expression
std::string m_algoName
algorithm name
std::vector< GlobalLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector

◆ serialize()

template<class Archive >
void GlobalAlgorithm::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setAlgoAlias()

void GlobalAlgorithm::setAlgoAlias ( const std::string &  algoAliasValue)
inline

Definition at line 59 of file GlobalAlgorithm.h.

References m_algoAlias.

Referenced by l1t::TriggerMenuParser::parseAlgorithm().

59 { m_algoAlias = algoAliasValue; }
std::string m_algoAlias
algorithm alias

◆ setAlgoBitNumber()

void GlobalAlgorithm::setAlgoBitNumber ( const int  algoBitNumberValue)
inline

Definition at line 74 of file GlobalAlgorithm.h.

References m_algoBitNumber.

74 { m_algoBitNumber = algoBitNumberValue; }

◆ setAlgoChipNumber()

void GlobalAlgorithm::setAlgoChipNumber ( const int  algoChipNumberValue)
inline

Definition at line 79 of file GlobalAlgorithm.h.

References m_algoChipNumber.

Referenced by l1t::TriggerMenuParser::parseAlgorithm().

79 { m_algoChipNumber = algoChipNumberValue; }
int m_algoChipNumber
chip number (redundant with bit number)

◆ setAlgoLogicalExpresssion()

void GlobalAlgorithm::setAlgoLogicalExpresssion ( const std::string &  logicalExpression)
inline

◆ setAlgoName()

void GlobalAlgorithm::setAlgoName ( const std::string &  algoNameValue)
inline

Definition at line 54 of file GlobalAlgorithm.h.

References m_algoName.

54 { m_algoName = algoNameValue; }
std::string m_algoName
algorithm name

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 119 of file GlobalAlgorithm.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 119 of file GlobalAlgorithm.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const GlobalAlgorithm result 
)
friend

output stream operator

Definition at line 147 of file GlobalAlgorithm.cc.

147  {
148  result.print(os);
149  return os;
150 }

Member Data Documentation

◆ m_algoAlias

std::string GlobalAlgorithm::m_algoAlias
private

algorithm alias

Definition at line 103 of file GlobalAlgorithm.h.

Referenced by algoAlias(), print(), and setAlgoAlias().

◆ m_algoBitNumber

int GlobalAlgorithm::m_algoBitNumber
private

bit number (determined by output pin, chip number, chip order) the result for the algorithm is found at m_algoBitNumber position in the decision word vector<bool>

Definition at line 114 of file GlobalAlgorithm.h.

Referenced by algoBitNumber(), algoChipNumber(), algoOutputPin(), GlobalAlgorithm(), print(), and setAlgoBitNumber().

◆ m_algoChipNumber

int GlobalAlgorithm::m_algoChipNumber
private

chip number (redundant with bit number)

Definition at line 117 of file GlobalAlgorithm.h.

Referenced by algoChipNumber(), GlobalAlgorithm(), print(), and setAlgoChipNumber().

◆ m_algoLogicalExpression

std::string GlobalAlgorithm::m_algoLogicalExpression
private

algorithm logical expression

Definition at line 106 of file GlobalAlgorithm.h.

Referenced by algoLogicalExpression(), GlobalAlgorithm(), print(), and setAlgoLogicalExpresssion().

◆ m_algoName

std::string GlobalAlgorithm::m_algoName
private

algorithm name

Definition at line 100 of file GlobalAlgorithm.h.

Referenced by algoName(), print(), and setAlgoName().

◆ m_algoRpnVector

std::vector<GlobalLogicParser::TokenRPN> GlobalAlgorithm::m_algoRpnVector
private

algorithm RPN vector

Definition at line 109 of file GlobalAlgorithm.h.

Referenced by algoRpnVector(), GlobalAlgorithm(), and print().