CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

L1GtAlgorithm Class Reference

#include <L1GtAlgorithm.h>

List of all members.

Public Member Functions

std::string const & algoAlias () const
 get / set algorithm alias
int algoBitNumber () const
 get / set algorithm bit number
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
const int algoChipNumber () const
 get / set algorithm bit number
std::string const & algoLogicalExpression () const
 get / set the logical expression for the algorithm
const std::string algoName () const
 get / set algorithm name
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
const std::vector
< L1GtLogicParser::TokenRPN > & 
algoRpnVector () const
 return the RPN vector
 L1GtAlgorithm (const std::string &, const std::string &)
 name and logical expression
 L1GtAlgorithm (const std::string &algoNameValue)
 name only
 L1GtAlgorithm ()
 L1GtAlgorithm (const std::string &, const std::string &, const int)
 name, logical expression and bit number
virtual void print (std::ostream &myCout) const
 print condition
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

Private Attributes

std::string m_algoAlias
 algorithm alias
int m_algoBitNumber
int m_algoChipNumber
 chip number (redundant with bit number)
std::string m_algoLogicalExpression
 algorithm logical expression
std::string m_algoName
 algorithm name
std::vector
< L1GtLogicParser::TokenRPN
m_algoRpnVector
 algorithm RPN vector

Friends

std::ostream & operator<< (std::ostream &, const L1GtAlgorithm &)
 output stream operator

Detailed Description

Description: L1 GT algorithm.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 30 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.

{
    // default values for private members not set
    // the other private members are C++ initialized
    m_algoBitNumber = -1;
    m_algoChipNumber = -1;

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

name only

Definition at line 40 of file L1GtAlgorithm.cc.

References m_algoBitNumber, and m_algoChipNumber.

                                                           :
    m_algoName(algoNameValue) {

    // default values for private members not set
    // the other private members are C++ initialized
    m_algoBitNumber = -1;
    m_algoChipNumber = -1;

}
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().

                                                                                     :
    m_algoName(algoNameValue), m_algoLogicalExpression(algoLogicalExpressionValue) {

    L1GtLogicParser logicParser(m_algoLogicalExpression);
    m_algoRpnVector = logicParser.rpnVector();

    // default values for private members not set
    m_algoBitNumber = -1;
    m_algoChipNumber = -1;
}
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().

                                      :
    m_algoName(algoNameValue), m_algoLogicalExpression(algoLogicalExpressionValue),
            m_algoBitNumber(algoBitNumberValue)

{
    L1GtLogicParser logicParser(m_algoLogicalExpression);
    m_algoRpnVector = logicParser.rpnVector();

    // default values for private members not set
    m_algoChipNumber = -1;

}
L1GtAlgorithm::~L1GtAlgorithm ( ) [virtual]

destructor

Definition at line 80 of file L1GtAlgorithm.cc.

{
    // empty
}

Member Function Documentation

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

get / set algorithm alias

Definition at line 65 of file L1GtAlgorithm.h.

References m_algoAlias.

Referenced by L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap().

    {
        return m_algoAlias;
    }
int L1GtAlgorithm::algoBitNumber ( ) const [inline]

get / set algorithm bit number

Definition at line 92 of file L1GtAlgorithm.h.

References m_algoBitNumber.

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

    {
        return m_algoBitNumber;
    }
const int L1GtAlgorithm::algoChipNumber ( ) const [inline]

get / set algorithm bit number

Definition at line 103 of file L1GtAlgorithm.h.

References m_algoChipNumber.

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

    {
        return m_algoChipNumber;
    }
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.

{
    int posChip = (m_algoBitNumber/pinsOnConditionChip) + 1;
    for (int iChip = 0; iChip < numberConditionChips; ++iChip) {
        if (posChip == orderConditionChip[iChip]) {
            return iChip;
        }
    }

    // chip number not found
    return -1;
}
std::string const& L1GtAlgorithm::algoLogicalExpression ( ) const [inline]

get / set the logical expression for the algorithm

Definition at line 76 of file L1GtAlgorithm.h.

References m_algoLogicalExpression.

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

get / set algorithm name

Definition at line 54 of file L1GtAlgorithm.h.

References m_algoName.

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

    {
        return m_algoName;
    }
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().

{

    int iChip = algoChipNumber(numberConditionChips, pinsOnConditionChip, orderConditionChip);

    int outputPin = m_algoBitNumber - (orderConditionChip[iChip] -1)*pinsOnConditionChip + 1;

    return outputPin;
}
const std::vector<L1GtLogicParser::TokenRPN>& L1GtAlgorithm::algoRpnVector ( ) const [inline]

return the RPN vector

Definition at line 87 of file L1GtAlgorithm.h.

References m_algoRpnVector.

Referenced by L1TMenuHelper::getLUSOTrigger().

                                                                           {
        return m_algoRpnVector;
    }
void L1GtAlgorithm::print ( std::ostream &  myCout) const [virtual]

print condition

Definition at line 119 of file L1GtAlgorithm.cc.

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

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

                                                  {

    myCout << std::endl;

    myCout << "    Algorithm name:         " << m_algoName << std::endl;
    myCout << "    Algorithm alias:        " << m_algoAlias << std::endl;

    myCout << "    Bit number:             " << m_algoBitNumber;
    if (m_algoBitNumber < 0) {
        myCout << "   - not properly initialized! " << std::endl;
    }
    else {
        myCout << std::endl;
    }

    myCout << "    Located on chip number: " << m_algoChipNumber;
    if (m_algoChipNumber < 0) {
        myCout << "   - not properly initialized! " << std::endl;
    }
    else {
        myCout << std::endl;
    }

    myCout << "    Logical expresssion:    " << m_algoLogicalExpression << std::endl;

    int rpnVectorSize = m_algoRpnVector.size();

    myCout << "    RPN vector size:        " << rpnVectorSize;

    if (rpnVectorSize == 0) {
        myCout << "   - not properly initialized! " << std::endl;
    }
    else {
        myCout << std::endl;

        for (int i = 0; i < rpnVectorSize; ++i) {

            myCout << "      ( " << (m_algoRpnVector[i]).operation << ", "
            << (m_algoRpnVector[i]).operand << " )" << std::endl;
        }

    }

    myCout << std::endl;
}
void L1GtAlgorithm::setAlgoAlias ( const std::string &  algoAliasValue) [inline]
void L1GtAlgorithm::setAlgoBitNumber ( const int  algoBitNumberValue) [inline]

Definition at line 97 of file L1GtAlgorithm.h.

References m_algoBitNumber.

    {
        m_algoBitNumber = algoBitNumberValue;
    }
void L1GtAlgorithm::setAlgoChipNumber ( const int  algoChipNumberValue) [inline]

Definition at line 108 of file L1GtAlgorithm.h.

References m_algoChipNumber.

Referenced by L1GtTriggerMenuConfigOnlineProd::buildAlgorithmMap().

    {
        m_algoChipNumber = algoChipNumberValue;
    }
void L1GtAlgorithm::setAlgoLogicalExpresssion ( const std::string &  logicalExpression) [inline]

Definition at line 81 of file L1GtAlgorithm.h.

References m_algoLogicalExpression.

    {
        m_algoLogicalExpression = logicalExpression;
    }
void L1GtAlgorithm::setAlgoName ( const std::string &  algoNameValue) [inline]

Definition at line 59 of file L1GtAlgorithm.h.

References m_algoName.

    {
        m_algoName = algoNameValue;
    }

Friends And Related Function Documentation

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

output stream operator

Definition at line 166 of file L1GtAlgorithm.cc.

{
    result.print(os);
    return os;

}

Member Data Documentation

std::string L1GtAlgorithm::m_algoAlias [private]

algorithm alias

Definition at line 139 of file L1GtAlgorithm.h.

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

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

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

chip number (redundant with bit number)

Definition at line 153 of file L1GtAlgorithm.h.

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

algorithm logical expression

Definition at line 142 of file L1GtAlgorithm.h.

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

std::string L1GtAlgorithm::m_algoName [private]

algorithm name

Definition at line 136 of file L1GtAlgorithm.h.

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

algorithm RPN vector

Definition at line 145 of file L1GtAlgorithm.h.

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