CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

L1GtConditionEvaluation Class Reference

#include <L1GtConditionEvaluation.h>

Inheritance diagram for L1GtConditionEvaluation:
L1GtBptxCondition L1GtCaloCondition L1GtCastorCondition L1GtCorrelationCondition L1GtEnergySumCondition L1GtExternalCondition L1GtHfBitCountsCondition L1GtHfRingEtSumsCondition L1GtJetCountsCondition L1GtMuonCondition

List of all members.

Public Member Functions

bool condLastResult () const
 get the latest result for the condition
int condMaxNumberObjects () const
virtual const bool evaluateCondition () const =0
 the core function to check if the condition matches
void evaluateConditionStoreResult ()
 call evaluateCondition and save last result
CombinationsInCond const & getCombinationsInCond () const
 get all the object combinations evaluated to true in the condition
virtual std::string getNumericExpression () const
 get numeric expression
 L1GtConditionEvaluation ()
 constructor
virtual void print (std::ostream &myCout) const
 print condition
void setCondMaxNumberObjects (int condMaxNumberObjectsValue)
void setVerbosity (const int verbosity)
virtual ~L1GtConditionEvaluation ()
 destructor

Protected Member Functions

template<class Type1 >
const bool checkBit (const Type1 &mask, const unsigned int bitNumber) const
 check if a bit with a given number is set in a mask
template<class Type1 , class Type2 >
const bool checkThreshold (const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
CombinationsInCondcombinationsInCond () const
 get all the object combinations (to fill it...)

Protected Attributes

CombinationsInCond m_combinationsInCond
 store all the object combinations evaluated to true in the condition
bool m_condLastResult
 the last result of evaluateCondition()
int m_condMaxNumberObjects
int m_verbosity
 verbosity level

Detailed Description

Description: Base class for evaluation of the L1 Global Trigger object templates.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 39 of file L1GtConditionEvaluation.h.


Constructor & Destructor Documentation

L1GtConditionEvaluation::L1GtConditionEvaluation ( ) [inline]

constructor

Definition at line 45 of file L1GtConditionEvaluation.h.

virtual L1GtConditionEvaluation::~L1GtConditionEvaluation ( ) [inline, virtual]

destructor

Definition at line 52 of file L1GtConditionEvaluation.h.

{}

Member Function Documentation

template<class Type1 >
const bool L1GtConditionEvaluation::checkBit ( const Type1 &  mask,
const unsigned int  bitNumber 
) const [protected]

check if a bit with a given number is set in a mask

Definition at line 175 of file L1GtConditionEvaluation.h.

References LogTrace, and m_verbosity.

Referenced by L1GtMuonCondition::checkObjectParameter(), L1GtCaloCondition::checkObjectParameter(), L1GtCorrelationCondition::evaluateCondition(), L1GtCaloCondition::evaluateCondition(), L1GtMuonCondition::evaluateCondition(), and L1GtEnergySumCondition::evaluateCondition().

                                        {

    boost::uint64_t oneBit = 1ULL;

    if (bitNumber >= (sizeof(oneBit)*8)) {

        if (m_verbosity) {

            LogTrace("L1GlobalTrigger")
                << "    checkBit " << "\n     Bit number = "
                << bitNumber << " larger than maximum allowed " << sizeof ( oneBit ) * 8
                << std::endl;
        }

        return false;
    }

    oneBit <<= bitNumber;

    //LogTrace("L1GlobalTrigger") << "    checkBit " << "\n     mask address = " << &mask
    //    << std::dec << "\n     dec: " << "mask = " << mask << " oneBit = " << oneBit
    //    << " bitNumber = " << bitNumber << std::hex << "\n     hex: " << "mask = " << mask
    //    << " oneBit = " << oneBit << " bitNumber = " << bitNumber << std::dec
    //    << "\n     mask & oneBit result = " << bool ( mask & oneBit ) << std::endl;

    return (mask & oneBit);
}
template<class Type1 , class Type2 >
const bool L1GtConditionEvaluation::checkThreshold ( const Type1 &  threshold,
const Type2 &  value,
const bool  condGEqValue 
) const [protected]

check if a value is greater than a threshold or greater-or-equal depending on the value of the condGEqValue flag

Definition at line 138 of file L1GtConditionEvaluation.h.

Referenced by L1GtMuonCondition::checkObjectParameter(), L1GtCaloCondition::checkObjectParameter(), L1GtJetCountsCondition::evaluateCondition(), L1GtEnergySumCondition::evaluateCondition(), L1GtHfRingEtSumsCondition::evaluateCondition(), and L1GtHfBitCountsCondition::evaluateCondition().

                                                                               {

    //if (value > 0) {
    //    LogTrace("L1GlobalTrigger") << "  threshold check for condGEqValue = "
    //        << condGEqValue << "\n    hex: " << std::hex << "threshold = " << threshold
    //        << " value = " << value << "\n    dec: " << std::dec << "threshold = " << threshold
    //        << " value = " << value << std::endl;
    //}

    if (condGEqValue) {
        if (value >= threshold) {

            //LogTrace("L1GlobalTrigger") << "    condGEqValue: value >= threshold"
            //    << std::endl;

            return true;
        }

        return false;

    }
    else {

        if (value == threshold) {

            //LogTrace("L1GlobalTrigger") << "    condGEqValue: value = threshold"
            //    << std::endl;

            return true;
        }

        return false;
    }
}
CombinationsInCond& L1GtConditionEvaluation::combinationsInCond ( ) const [inline, protected]
bool L1GtConditionEvaluation::condLastResult ( ) const [inline]
int L1GtConditionEvaluation::condMaxNumberObjects ( ) const [inline]
virtual const bool L1GtConditionEvaluation::evaluateCondition ( ) const [pure virtual]
void L1GtConditionEvaluation::evaluateConditionStoreResult ( ) [inline]

call evaluateCondition and save last result

Definition at line 72 of file L1GtConditionEvaluation.h.

References evaluateCondition(), and m_condLastResult.

Referenced by L1GtCorrelationCondition::evaluateCondition(), and L1GlobalTriggerGTL::run().

CombinationsInCond const& L1GtConditionEvaluation::getCombinationsInCond ( ) const [inline]
virtual std::string L1GtConditionEvaluation::getNumericExpression ( ) const [inline, virtual]

get numeric expression

Definition at line 80 of file L1GtConditionEvaluation.h.

References m_condLastResult.

                                                   {
        if (m_condLastResult) {
            return "1";
        }
        else {
            return "0";
        }
    }
void L1GtConditionEvaluation::print ( std::ostream &  myCout) const [virtual]

print condition

Reimplemented in L1GtBptxCondition, L1GtCaloCondition, L1GtCastorCondition, L1GtCorrelationCondition, L1GtEnergySumCondition, L1GtExternalCondition, L1GtHfBitCountsCondition, L1GtHfRingEtSumsCondition, L1GtJetCountsCondition, and L1GtMuonCondition.

Definition at line 38 of file L1GtConditionEvaluation.cc.

References begin, filterCSVwithJSON::copy, end, m_combinationsInCond, m_condLastResult, and m_condMaxNumberObjects.

                                                            {

    myCout << "\n  L1GtConditionEvaluation print...\n" << std::endl;
    myCout << "  Maximum number of objects in condition: " << m_condMaxNumberObjects << std::endl;
    myCout << "  Condition result:                       " << m_condLastResult << std::endl;

    CombinationsInCond::const_iterator itVV;
    std::ostringstream myCout1;

    for (itVV = (m_combinationsInCond).begin(); itVV != (m_combinationsInCond).end(); itVV++) {

        myCout1 << "( ";

        std::copy((*itVV).begin(), (*itVV).end(), std::ostream_iterator<int> (myCout1, " "));

        myCout1 << "); ";

    }

    myCout
    << "\n  List of combinations passing all requirements for this condition: \n  "
    << myCout1.str()
    << " \n"
    << std::endl;

}
void L1GtConditionEvaluation::setCondMaxNumberObjects ( int  condMaxNumberObjectsValue) [inline]

Definition at line 62 of file L1GtConditionEvaluation.h.

References m_condMaxNumberObjects.

                                                                       {
        m_condMaxNumberObjects = condMaxNumberObjectsValue;
    }
void L1GtConditionEvaluation::setVerbosity ( const int  verbosity) [inline]

Member Data Documentation