CMS 3D CMS Logo

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

#include <L1GtAlgorithm.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< L1GtLogicParser::TokenRPN > & algoRpnVector () const
 return the RPN vector More...
 
 L1GtAlgorithm ()
 
 L1GtAlgorithm (const std::string &algoNameValue)
 name only More...
 
 L1GtAlgorithm (const std::string &, const std::string &)
 name and logical expression More...
 
 L1GtAlgorithm (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 ~L1GtAlgorithm ()
 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< L1GtLogicParser::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 L1GtAlgorithm &)
 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 L1GtAlgorithm.h.

Constructor & Destructor Documentation

L1GtAlgorithm::L1GtAlgorithm ( )

constructor(s) empty

Definition at line 30 of file L1GtAlgorithm.cc.

References m_algoBitNumber, and m_algoChipNumber.

31 {
32  // default values for private members not set
33  // the other private members are C++ initialized
34  m_algoBitNumber = -1;
35  m_algoChipNumber = -1;
36 
37 }
int m_algoChipNumber
chip number (redundant with bit number)
L1GtAlgorithm::L1GtAlgorithm ( const std::string &  algoNameValue)

name only

Definition at line 40 of file L1GtAlgorithm.cc.

References m_algoBitNumber, and m_algoChipNumber.

40  :
41  m_algoName(algoNameValue) {
42 
43  // default values for private members not set
44  // the other private members are C++ initialized
45  m_algoBitNumber = -1;
46  m_algoChipNumber = -1;
47 
48 }
std::string m_algoName
algorithm name
int m_algoChipNumber
chip number (redundant with bit number)
L1GtAlgorithm::L1GtAlgorithm ( const std::string &  algoNameValue,
const std::string &  algoLogicalExpressionValue 
)

name and logical expression

Definition at line 51 of file L1GtAlgorithm.cc.

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

52  :
53  m_algoName(algoNameValue), m_algoLogicalExpression(algoLogicalExpressionValue) {
54 
56  m_algoRpnVector = logicParser.rpnVector();
57 
58  // default values for private members not set
59  m_algoBitNumber = -1;
60  m_algoChipNumber = -1;
61 }
std::string m_algoLogicalExpression
algorithm logical expression
std::vector< L1GtLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector
std::string m_algoName
algorithm name
int m_algoChipNumber
chip number (redundant with bit number)
L1GtAlgorithm::L1GtAlgorithm ( const std::string &  algoNameValue,
const std::string &  algoLogicalExpressionValue,
const int  algoBitNumberValue 
)

name, logical expression and bit number

Definition at line 64 of file L1GtAlgorithm.cc.

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

66  :
67  m_algoName(algoNameValue), m_algoLogicalExpression(algoLogicalExpressionValue),
68  m_algoBitNumber(algoBitNumberValue)
69 
70 {
72  m_algoRpnVector = logicParser.rpnVector();
73 
74  // default values for private members not set
75  m_algoChipNumber = -1;
76 
77 }
std::string m_algoLogicalExpression
algorithm logical expression
std::vector< L1GtLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector
std::string m_algoName
algorithm name
int m_algoChipNumber
chip number (redundant with bit number)
L1GtAlgorithm::~L1GtAlgorithm ( )
virtual

destructor

Definition at line 80 of file L1GtAlgorithm.cc.

81 {
82  // empty
83 }

Member Function Documentation

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

get / set algorithm alias

Definition at line 67 of file L1GtAlgorithm.h.

References m_algoAlias.

Referenced by L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap().

68  {
69  return m_algoAlias;
70  }
std::string m_algoAlias
algorithm alias
int L1GtAlgorithm::algoBitNumber ( ) const
inline

get / set algorithm bit number

Definition at line 94 of file L1GtAlgorithm.h.

References m_algoBitNumber.

Referenced by L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap(), and L1GtTriggerMenuXmlParser::insertTechTriggerIntoMap().

95  {
96  return m_algoBitNumber;
97  }
const int L1GtAlgorithm::algoChipNumber ( ) const
inline

get / set algorithm bit number

Definition at line 105 of file L1GtAlgorithm.h.

References m_algoChipNumber.

Referenced by algoOutputPin(), L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap(), and setAlgoChipNumber().

106  {
107  return m_algoChipNumber;
108  }
int m_algoChipNumber
chip number (redundant with bit number)
const int L1GtAlgorithm::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 88 of file L1GtAlgorithm.cc.

References m_algoBitNumber.

91 {
92  int posChip = (m_algoBitNumber/pinsOnConditionChip) + 1;
93  for (int iChip = 0; iChip < numberConditionChips; ++iChip) {
94  if (posChip == orderConditionChip[iChip]) {
95  return iChip;
96  }
97  }
98 
99  // chip number not found
100  return -1;
101 }
std::string const& L1GtAlgorithm::algoLogicalExpression ( ) const
inline

get / set the logical expression for the algorithm

Definition at line 78 of file L1GtAlgorithm.h.

References m_algoLogicalExpression.

79  {
81  }
std::string m_algoLogicalExpression
algorithm logical expression
const std::string L1GtAlgorithm::algoName ( ) const
inline

get / set algorithm name

Definition at line 56 of file L1GtAlgorithm.h.

References m_algoName.

Referenced by L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap(), and L1GtTriggerMenuXmlParser::insertTechTriggerIntoMap().

57  {
58  return m_algoName;
59  }
std::string m_algoName
algorithm name
const int L1GtAlgorithm::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 104 of file L1GtAlgorithm.cc.

References algoChipNumber(), and m_algoBitNumber.

Referenced by L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap(), and setAlgoChipNumber().

107 {
108 
109  int iChip = algoChipNumber(numberConditionChips, pinsOnConditionChip, orderConditionChip);
110 
111  int outputPin = m_algoBitNumber - (orderConditionChip[iChip] -1)*pinsOnConditionChip + 1;
112 
113  return outputPin;
114 }
const int algoChipNumber() const
get / set algorithm bit number
const std::vector<L1GtLogicParser::TokenRPN>& L1GtAlgorithm::algoRpnVector ( ) const
inline

return the RPN vector

Definition at line 89 of file L1GtAlgorithm.h.

References m_algoRpnVector.

Referenced by L1TMenuHelper::getLUSOTrigger().

89  {
90  return m_algoRpnVector;
91  }
std::vector< L1GtLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector
void L1GtAlgorithm::print ( std::ostream &  myCout) const
virtual

print condition

Definition at line 119 of file L1GtAlgorithm.cc.

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

Referenced by operator<<(), setAlgoChipNumber(), and L1GtTriggerMenuXmlParser::workTechTrigger().

119  {
120 
121  myCout << std::endl;
122 
123  myCout << " Algorithm name: " << m_algoName << std::endl;
124  myCout << " Algorithm alias: " << m_algoAlias << std::endl;
125 
126  myCout << " Bit number: " << m_algoBitNumber;
127  if (m_algoBitNumber < 0) {
128  myCout << " - not properly initialized! " << std::endl;
129  }
130  else {
131  myCout << std::endl;
132  }
133 
134  myCout << " Located on chip number: " << m_algoChipNumber;
135  if (m_algoChipNumber < 0) {
136  myCout << " - not properly initialized! " << std::endl;
137  }
138  else {
139  myCout << std::endl;
140  }
141 
142  myCout << " Logical expresssion: " << m_algoLogicalExpression << std::endl;
143 
144  int rpnVectorSize = m_algoRpnVector.size();
145 
146  myCout << " RPN vector size: " << rpnVectorSize;
147 
148  if (rpnVectorSize == 0) {
149  myCout << " - not properly initialized! " << std::endl;
150  }
151  else {
152  myCout << std::endl;
153 
154  for (int i = 0; i < rpnVectorSize; ++i) {
155 
156  myCout << " ( " << (m_algoRpnVector[i]).operation << ", "
157  << (m_algoRpnVector[i]).operand << " )" << std::endl;
158  }
159 
160  }
161 
162  myCout << std::endl;
163 }
std::string m_algoLogicalExpression
algorithm logical expression
std::string m_algoAlias
algorithm alias
std::vector< L1GtLogicParser::TokenRPN > m_algoRpnVector
algorithm RPN vector
std::string m_algoName
algorithm name
int m_algoChipNumber
chip number (redundant with bit number)
template<class Archive >
void L1GtAlgorithm::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void L1GtAlgorithm::setAlgoAlias ( const std::string &  algoAliasValue)
inline

Definition at line 72 of file L1GtAlgorithm.h.

References m_algoAlias.

Referenced by L1GtTriggerMenuConfigOnlineProd::buildAlgorithmMap(), and L1GtTriggerMenuXmlParser::workTechTrigger().

73  {
74  m_algoAlias = algoAliasValue;
75  }
std::string m_algoAlias
algorithm alias
void L1GtAlgorithm::setAlgoBitNumber ( const int  algoBitNumberValue)
inline

Definition at line 99 of file L1GtAlgorithm.h.

References m_algoBitNumber.

100  {
101  m_algoBitNumber = algoBitNumberValue;
102  }
void L1GtAlgorithm::setAlgoChipNumber ( const int  algoChipNumberValue)
inline

Definition at line 110 of file L1GtAlgorithm.h.

References algoChipNumber(), algoOutputPin(), m_algoChipNumber, operator<<, and print().

Referenced by L1GtTriggerMenuConfigOnlineProd::buildAlgorithmMap().

111  {
112  m_algoChipNumber = algoChipNumberValue;
113  }
int m_algoChipNumber
chip number (redundant with bit number)
void L1GtAlgorithm::setAlgoLogicalExpresssion ( const std::string &  logicalExpression)
inline

Definition at line 83 of file L1GtAlgorithm.h.

References m_algoLogicalExpression.

84  {
85  m_algoLogicalExpression = logicalExpression;
86  }
std::string m_algoLogicalExpression
algorithm logical expression
void L1GtAlgorithm::setAlgoName ( const std::string &  algoNameValue)
inline

Definition at line 61 of file L1GtAlgorithm.h.

References m_algoName.

62  {
63  m_algoName = algoNameValue;
64  }
std::string m_algoName
algorithm name

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 158 of file L1GtAlgorithm.h.

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

Definition at line 158 of file L1GtAlgorithm.h.

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

output stream operator

Definition at line 166 of file L1GtAlgorithm.cc.

Referenced by setAlgoChipNumber().

167 {
168  result.print(os);
169  return os;
170 
171 }
virtual void print(std::ostream &myCout) const
print condition

Member Data Documentation

std::string L1GtAlgorithm::m_algoAlias
private

algorithm alias

Definition at line 141 of file L1GtAlgorithm.h.

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

int L1GtAlgorithm::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 152 of file L1GtAlgorithm.h.

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

int L1GtAlgorithm::m_algoChipNumber
private

chip number (redundant with bit number)

Definition at line 155 of file L1GtAlgorithm.h.

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

std::string L1GtAlgorithm::m_algoLogicalExpression
private

algorithm logical expression

Definition at line 144 of file L1GtAlgorithm.h.

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

std::string L1GtAlgorithm::m_algoName
private

algorithm name

Definition at line 138 of file L1GtAlgorithm.h.

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

std::vector<L1GtLogicParser::TokenRPN> L1GtAlgorithm::m_algoRpnVector
private

algorithm RPN vector

Definition at line 147 of file L1GtAlgorithm.h.

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