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() [1/4]

L1GtAlgorithm::L1GtAlgorithm ( )

constructor(s) empty

Definition at line 30 of file L1GtAlgorithm.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)

◆ L1GtAlgorithm() [2/4]

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

name only

Definition at line 38 of file L1GtAlgorithm.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 }
std::string m_algoName
algorithm name
int m_algoChipNumber
chip number (redundant with bit number)

◆ L1GtAlgorithm() [3/4]

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

name and logical expression

Definition at line 46 of file L1GtAlgorithm.cc.

References m_algoBitNumber, m_algoChipNumber, m_algoLogicalExpression, m_algoRpnVector, and L1GtLogicParser::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 }
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() [4/4]

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

name, logical expression and bit number

Definition at line 57 of file L1GtAlgorithm.cc.

References m_algoChipNumber, m_algoLogicalExpression, m_algoRpnVector, and L1GtLogicParser::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 }
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::~L1GtAlgorithm ( )
virtual

destructor

Definition at line 73 of file L1GtAlgorithm.cc.

73  {
74  // empty
75 }

Member Function Documentation

◆ algoAlias()

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

get / set algorithm alias

Definition at line 57 of file L1GtAlgorithm.h.

References m_algoAlias.

Referenced by L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap().

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

◆ algoBitNumber()

int L1GtAlgorithm::algoBitNumber ( ) const
inline

get / set algorithm bit number

Definition at line 72 of file L1GtAlgorithm.h.

References m_algoBitNumber.

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

72 { return m_algoBitNumber; }

◆ algoChipNumber() [1/2]

const int L1GtAlgorithm::algoChipNumber ( ) const
inline

get / set algorithm bit number

Definition at line 77 of file L1GtAlgorithm.h.

References m_algoChipNumber.

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

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

◆ algoChipNumber() [2/2]

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 80 of file L1GtAlgorithm.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& L1GtAlgorithm::algoLogicalExpression ( ) const
inline

get / set the logical expression for the algorithm

Definition at line 62 of file L1GtAlgorithm.h.

References m_algoLogicalExpression.

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

◆ algoName()

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

get / set algorithm name

Definition at line 52 of file L1GtAlgorithm.h.

References m_algoName.

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

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

◆ algoOutputPin()

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 95 of file L1GtAlgorithm.cc.

References algoChipNumber(), and m_algoBitNumber.

Referenced by L1GtTriggerMenuXmlParser::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
Definition: L1GtAlgorithm.h:77

◆ algoRpnVector()

const std::vector<L1GtLogicParser::TokenRPN>& L1GtAlgorithm::algoRpnVector ( ) const
inline

return the RPN vector

Definition at line 69 of file L1GtAlgorithm.h.

References m_algoRpnVector.

Referenced by L1TMenuHelper::getLUSOTrigger().

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

◆ print()

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

print condition

Definition at line 106 of file L1GtAlgorithm.cc.

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

Referenced by L1GtTriggerMenuXmlParser::workTechTrigger().

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_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)

◆ serialize()

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

◆ setAlgoAlias()

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

Definition at line 59 of file L1GtAlgorithm.h.

References m_algoAlias.

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

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

◆ setAlgoBitNumber()

void L1GtAlgorithm::setAlgoBitNumber ( const int  algoBitNumberValue)
inline

Definition at line 74 of file L1GtAlgorithm.h.

References m_algoBitNumber.

74 { m_algoBitNumber = algoBitNumberValue; }

◆ setAlgoChipNumber()

void L1GtAlgorithm::setAlgoChipNumber ( const int  algoChipNumberValue)
inline

Definition at line 79 of file L1GtAlgorithm.h.

References m_algoChipNumber.

Referenced by L1GtTriggerMenuConfigOnlineProd::buildAlgorithmMap().

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

◆ setAlgoLogicalExpresssion()

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

◆ setAlgoName()

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

Definition at line 54 of file L1GtAlgorithm.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 L1GtAlgorithm.h.

◆ cond::serialization::access

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

Definition at line 119 of file L1GtAlgorithm.h.

◆ operator<<

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

output stream operator

Definition at line 147 of file L1GtAlgorithm.cc.

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

Member Data Documentation

◆ m_algoAlias

std::string L1GtAlgorithm::m_algoAlias
private

algorithm alias

Definition at line 103 of file L1GtAlgorithm.h.

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

◆ m_algoBitNumber

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 114 of file L1GtAlgorithm.h.

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

◆ m_algoChipNumber

int L1GtAlgorithm::m_algoChipNumber
private

chip number (redundant with bit number)

Definition at line 117 of file L1GtAlgorithm.h.

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

◆ m_algoLogicalExpression

std::string L1GtAlgorithm::m_algoLogicalExpression
private

algorithm logical expression

Definition at line 106 of file L1GtAlgorithm.h.

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

◆ m_algoName

std::string L1GtAlgorithm::m_algoName
private

algorithm name

Definition at line 100 of file L1GtAlgorithm.h.

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

◆ m_algoRpnVector

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

algorithm RPN vector

Definition at line 109 of file L1GtAlgorithm.h.

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