#include <L1GtConditionEvaluation.h>
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 |
CombinationsInCond & | combinationsInCond () 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 |
Description: Base class for evaluation of the L1 Global Trigger object templates.
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Definition at line 39 of file L1GtConditionEvaluation.h.
L1GtConditionEvaluation::L1GtConditionEvaluation | ( | ) | [inline] |
constructor
Definition at line 45 of file L1GtConditionEvaluation.h.
: m_condMaxNumberObjects(0), m_condLastResult(false), m_verbosity(0) {}
virtual L1GtConditionEvaluation::~L1GtConditionEvaluation | ( | ) | [inline, virtual] |
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); }
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] |
get all the object combinations (to fill it...)
Definition at line 105 of file L1GtConditionEvaluation.h.
References m_combinationsInCond.
Referenced by L1GtCaloCondition::evaluateCondition(), L1GtCorrelationCondition::evaluateCondition(), L1GtCastorCondition::evaluateCondition(), L1GtBptxCondition::evaluateCondition(), L1GtJetCountsCondition::evaluateCondition(), L1GtExternalCondition::evaluateCondition(), L1GtMuonCondition::evaluateCondition(), L1GtEnergySumCondition::evaluateCondition(), L1GtHfRingEtSumsCondition::evaluateCondition(), and L1GtHfBitCountsCondition::evaluateCondition().
{ return m_combinationsInCond; }
bool L1GtConditionEvaluation::condLastResult | ( | ) | const [inline] |
get the latest result for the condition
Definition at line 67 of file L1GtConditionEvaluation.h.
References m_condLastResult.
Referenced by L1GtCastorCondition::copy(), L1GtEnergySumCondition::copy(), L1GtCaloCondition::copy(), L1GtExternalCondition::copy(), L1GtBptxCondition::copy(), L1GtHfBitCountsCondition::copy(), L1GtMuonCondition::copy(), L1GtJetCountsCondition::copy(), L1GtHfRingEtSumsCondition::copy(), and L1GtCorrelationCondition::evaluateCondition().
{ return m_condLastResult; }
int L1GtConditionEvaluation::condMaxNumberObjects | ( | ) | const [inline] |
get / set the maximum number of objects received for the evaluation of the condition
Definition at line 58 of file L1GtConditionEvaluation.h.
References m_condMaxNumberObjects.
Referenced by L1GtCastorCondition::copy(), L1GtEnergySumCondition::copy(), L1GtCaloCondition::copy(), L1GtExternalCondition::copy(), L1GtBptxCondition::copy(), L1GtHfBitCountsCondition::copy(), L1GtMuonCondition::copy(), L1GtJetCountsCondition::copy(), and L1GtHfRingEtSumsCondition::copy().
{ return m_condMaxNumberObjects; }
virtual const bool L1GtConditionEvaluation::evaluateCondition | ( | ) | const [pure virtual] |
the core function to check if the condition matches
Implemented in L1GtBptxCondition, L1GtCaloCondition, L1GtCastorCondition, L1GtCorrelationCondition, L1GtEnergySumCondition, L1GtExternalCondition, L1GtHfBitCountsCondition, L1GtHfRingEtSumsCondition, L1GtJetCountsCondition, and L1GtMuonCondition.
Referenced by evaluateConditionStoreResult().
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().
{ m_condLastResult = evaluateCondition(); }
CombinationsInCond const& L1GtConditionEvaluation::getCombinationsInCond | ( | ) | const [inline] |
get all the object combinations evaluated to true in the condition
Definition at line 90 of file L1GtConditionEvaluation.h.
References m_combinationsInCond.
Referenced by L1GtCastorCondition::copy(), L1GtEnergySumCondition::copy(), L1GtCaloCondition::copy(), L1GtExternalCondition::copy(), L1GtBptxCondition::copy(), L1GtHfBitCountsCondition::copy(), L1GtMuonCondition::copy(), L1GtJetCountsCondition::copy(), L1GtHfRingEtSumsCondition::copy(), and L1GtCorrelationCondition::evaluateCondition().
{ return m_combinationsInCond; }
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] |
Definition at line 98 of file L1GtConditionEvaluation.h.
References m_verbosity, and PFRecoTauDiscriminationAgainstMuon2_cfi::verbosity.
Referenced by L1GlobalTriggerGTL::run().
{ m_verbosity = verbosity; }
CombinationsInCond L1GtConditionEvaluation::m_combinationsInCond [mutable, protected] |
store all the object combinations evaluated to true in the condition
Definition at line 127 of file L1GtConditionEvaluation.h.
Referenced by combinationsInCond(), L1GtCastorCondition::copy(), L1GtEnergySumCondition::copy(), L1GtCaloCondition::copy(), L1GtCorrelationCondition::copy(), L1GtExternalCondition::copy(), L1GtBptxCondition::copy(), L1GtHfBitCountsCondition::copy(), L1GtMuonCondition::copy(), L1GtJetCountsCondition::copy(), L1GtHfRingEtSumsCondition::copy(), getCombinationsInCond(), and print().
bool L1GtConditionEvaluation::m_condLastResult [protected] |
the last result of evaluateCondition()
Definition at line 124 of file L1GtConditionEvaluation.h.
Referenced by condLastResult(), L1GtCastorCondition::copy(), L1GtEnergySumCondition::copy(), L1GtCaloCondition::copy(), L1GtCorrelationCondition::copy(), L1GtExternalCondition::copy(), L1GtBptxCondition::copy(), L1GtHfBitCountsCondition::copy(), L1GtMuonCondition::copy(), L1GtJetCountsCondition::copy(), L1GtHfRingEtSumsCondition::copy(), evaluateConditionStoreResult(), getNumericExpression(), and print().
int L1GtConditionEvaluation::m_condMaxNumberObjects [protected] |
maximum number of objects received for the evaluation of the condition usually retrieved from event setup
Definition at line 121 of file L1GtConditionEvaluation.h.
Referenced by condMaxNumberObjects(), L1GtCastorCondition::copy(), L1GtEnergySumCondition::copy(), L1GtCaloCondition::copy(), L1GtCorrelationCondition::copy(), L1GtExternalCondition::copy(), L1GtBptxCondition::copy(), L1GtHfBitCountsCondition::copy(), L1GtMuonCondition::copy(), L1GtJetCountsCondition::copy(), L1GtHfRingEtSumsCondition::copy(), L1GtBptxCondition::L1GtBptxCondition(), L1GtCaloCondition::L1GtCaloCondition(), L1GtCastorCondition::L1GtCastorCondition(), L1GtCorrelationCondition::L1GtCorrelationCondition(), L1GtEnergySumCondition::L1GtEnergySumCondition(), L1GtExternalCondition::L1GtExternalCondition(), L1GtHfBitCountsCondition::L1GtHfBitCountsCondition(), L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition(), L1GtJetCountsCondition::L1GtJetCountsCondition(), L1GtMuonCondition::L1GtMuonCondition(), print(), and setCondMaxNumberObjects().
int L1GtConditionEvaluation::m_verbosity [protected] |
verbosity level
Definition at line 130 of file L1GtConditionEvaluation.h.
Referenced by checkBit(), L1GtCastorCondition::copy(), L1GtEnergySumCondition::copy(), L1GtCaloCondition::copy(), L1GtCorrelationCondition::copy(), L1GtExternalCondition::copy(), L1GtBptxCondition::copy(), L1GtHfBitCountsCondition::copy(), L1GtMuonCondition::copy(), L1GtJetCountsCondition::copy(), L1GtHfRingEtSumsCondition::copy(), L1GtCaloCondition::evaluateCondition(), L1GtCorrelationCondition::evaluateCondition(), L1GtMuonCondition::evaluateCondition(), and setVerbosity().