CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
L1GtConditionEvaluation Class Referenceabstract

#include <L1GtConditionEvaluation.h>

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

Public Member Functions

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

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 More...
 
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...) More...
 

Protected Attributes

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

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

Definition at line 37 of file L1GtConditionEvaluation.h.

Constructor & Destructor Documentation

L1GtConditionEvaluation::L1GtConditionEvaluation ( )
inline

constructor

Definition at line 40 of file L1GtConditionEvaluation.h.

bool m_condLastResult
the last result of evaluateCondition()
virtual L1GtConditionEvaluation::~L1GtConditionEvaluation ( )
inlinevirtual

destructor

Definition at line 43 of file L1GtConditionEvaluation.h.

43 {}

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 149 of file L1GtConditionEvaluation.h.

References LogTrace, and m_verbosity.

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

149  {
150  uint64_t oneBit = 1ULL;
151 
152  if (bitNumber >= (sizeof(oneBit) * 8)) {
153  if (m_verbosity) {
154  LogTrace("L1GlobalTrigger") << " checkBit "
155  << "\n Bit number = " << bitNumber << " larger than maximum allowed "
156  << sizeof(oneBit) * 8 << std::endl;
157  }
158 
159  return false;
160  }
161 
162  oneBit <<= bitNumber;
163 
164  // LogTrace("L1GlobalTrigger") << " checkBit " << "\n mask address = "
165  // << &mask
166  // << std::dec << "\n dec: " << "mask = " << mask << " oneBit = " <<
167  // oneBit
168  // << " bitNumber = " << bitNumber << std::hex << "\n hex: " << "mask =
169  // " << mask
170  // << " oneBit = " << oneBit << " bitNumber = " << bitNumber << std::dec
171  // << "\n mask & oneBit result = " << bool ( mask & oneBit ) <<
172  // std::endl;
173 
174  return (mask & oneBit);
175 }
#define LogTrace(id)
unsigned long long uint64_t
Definition: Time.h:13
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 113 of file L1GtConditionEvaluation.h.

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

115  {
116  // if (value > 0) {
117  // LogTrace("L1GlobalTrigger") << " threshold check for condGEqValue = "
118  // << condGEqValue << "\n hex: " << std::hex << "threshold = " <<
119  // threshold
120  // << " value = " << value << "\n dec: " << std::dec << "threshold =
121  // " << threshold
122  // << " value = " << value << std::endl;
123  //}
124 
125  if (condGEqValue) {
126  if (value >= threshold) {
127  // LogTrace("L1GlobalTrigger") << " condGEqValue: value >= threshold"
128  // << std::endl;
129 
130  return true;
131  }
132 
133  return false;
134 
135  } else {
136  if (value == threshold) {
137  // LogTrace("L1GlobalTrigger") << " condGEqValue: value = threshold"
138  // << std::endl;
139 
140  return true;
141  }
142 
143  return false;
144  }
145 }
CombinationsInCond& L1GtConditionEvaluation::combinationsInCond ( ) const
inlineprotected
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 58 of file L1GtConditionEvaluation.h.

References evaluateCondition(), and m_condLastResult.

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

bool m_condLastResult
the last result of evaluateCondition()
virtual const bool evaluateCondition() const =0
the core function to check if the condition matches
CombinationsInCond const& L1GtConditionEvaluation::getCombinationsInCond ( ) const
inline
virtual std::string L1GtConditionEvaluation::getNumericExpression ( ) const
inlinevirtual

get numeric expression

Definition at line 64 of file L1GtConditionEvaluation.h.

References m_condLastResult.

64  {
65  if (m_condLastResult) {
66  return "1";
67  } else {
68  return "0";
69  }
70  }
bool m_condLastResult
the last result of evaluateCondition()
void L1GtConditionEvaluation::print ( std::ostream &  myCout) const
virtual

print condition

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

Definition at line 34 of file L1GtConditionEvaluation.cc.

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

Referenced by L1GtBptxCondition::print(), L1GtHfRingEtSumsCondition::print(), L1GtCastorCondition::print(), L1GtExternalCondition::print(), L1GtHfBitCountsCondition::print(), L1GtEnergySumCondition::print(), L1GtJetCountsCondition::print(), L1GtMuonCondition::print(), L1GtCaloCondition::print(), and L1GtCorrelationCondition::print().

34  {
35  myCout << "\n L1GtConditionEvaluation print...\n" << std::endl;
36  myCout << " Maximum number of objects in condition: " << m_condMaxNumberObjects << std::endl;
37  myCout << " Condition result: " << m_condLastResult << std::endl;
38 
39  CombinationsInCond::const_iterator itVV;
40  std::ostringstream myCout1;
41 
42  for (itVV = (m_combinationsInCond).begin(); itVV != (m_combinationsInCond).end(); itVV++) {
43  myCout1 << "( ";
44 
45  std::copy((*itVV).begin(), (*itVV).end(), std::ostream_iterator<int>(myCout1, " "));
46 
47  myCout1 << "); ";
48  }
49 
50  myCout << "\n List of combinations passing all requirements for this "
51  "condition: \n "
52  << myCout1.str() << " \n"
53  << std::endl;
54 }
bool m_condLastResult
the last result of evaluateCondition()
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
string end
Definition: dataset.py:937
void L1GtConditionEvaluation::setCondMaxNumberObjects ( int  condMaxNumberObjectsValue)
inline

Definition at line 50 of file L1GtConditionEvaluation.h.

References m_condMaxNumberObjects.

50  {
51  m_condMaxNumberObjects = condMaxNumberObjectsValue;
52  }
void L1GtConditionEvaluation::setVerbosity ( const int  verbosity)
inline

Definition at line 78 of file L1GtConditionEvaluation.h.

References m_verbosity, and HLT_FULL_cff::verbosity.

Referenced by L1GlobalTriggerGTL::run().

Member Data Documentation

CombinationsInCond L1GtConditionEvaluation::m_combinationsInCond
mutableprotected
bool L1GtConditionEvaluation::m_condLastResult
protected
int L1GtConditionEvaluation::m_condMaxNumberObjects
protected
int L1GtConditionEvaluation::m_verbosity
protected