CMS 3D CMS Logo

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

Constructor & Destructor Documentation

L1GtConditionEvaluation::L1GtConditionEvaluation ( )
inline

constructor

Definition at line 42 of file L1GtConditionEvaluation.h.

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

destructor

Definition at line 46 of file L1GtConditionEvaluation.h.

46 {}

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

References LogTrace, and m_verbosity.

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

164  {
165 
166  boost::uint64_t oneBit = 1ULL;
167 
168  if (bitNumber >= (sizeof(oneBit) * 8)) {
169 
170  if (m_verbosity) {
171 
172  LogTrace("L1GlobalTrigger")
173  << " checkBit "
174  << "\n Bit number = " << bitNumber
175  << " larger than maximum allowed " << sizeof(oneBit) * 8 << std::endl;
176  }
177 
178  return false;
179  }
180 
181  oneBit <<= bitNumber;
182 
183  // LogTrace("L1GlobalTrigger") << " checkBit " << "\n mask address = "
184  // << &mask
185  // << std::dec << "\n dec: " << "mask = " << mask << " oneBit = " <<
186  // oneBit
187  // << " bitNumber = " << bitNumber << std::hex << "\n hex: " << "mask =
188  // " << mask
189  // << " oneBit = " << oneBit << " bitNumber = " << bitNumber << std::dec
190  // << "\n mask & oneBit result = " << bool ( mask & oneBit ) <<
191  // std::endl;
192 
193  return (mask & oneBit);
194 }
#define LogTrace(id)
unsigned long long uint64_t
Definition: Time.h:15
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 123 of file L1GtConditionEvaluation.h.

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

124  {
125 
126  // if (value > 0) {
127  // LogTrace("L1GlobalTrigger") << " threshold check for condGEqValue = "
128  // << condGEqValue << "\n hex: " << std::hex << "threshold = " <<
129  // threshold
130  // << " value = " << value << "\n dec: " << std::dec << "threshold =
131  // " << threshold
132  // << " value = " << value << std::endl;
133  //}
134 
135  if (condGEqValue) {
136  if (value >= threshold) {
137 
138  // LogTrace("L1GlobalTrigger") << " condGEqValue: value >= threshold"
139  // << std::endl;
140 
141  return true;
142  }
143 
144  return false;
145 
146  } else {
147 
148  if (value == threshold) {
149 
150  // LogTrace("L1GlobalTrigger") << " condGEqValue: value = threshold"
151  // << std::endl;
152 
153  return true;
154  }
155 
156  return false;
157  }
158 }
Definition: value.py:1
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 61 of file L1GtConditionEvaluation.h.

References evaluateCondition(), and m_condLastResult.

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

61  {
63  }
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

get all the object combinations evaluated to true in the condition

Definition at line 78 of file L1GtConditionEvaluation.h.

References m_combinationsInCond, and print().

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

78  {
79  return m_combinationsInCond;
80  }
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
virtual std::string L1GtConditionEvaluation::getNumericExpression ( ) const
inlinevirtual

get numeric expression

Definition at line 69 of file L1GtConditionEvaluation.h.

References m_condLastResult.

69  {
70  if (m_condLastResult) {
71  return "1";
72  } else {
73  return "0";
74  }
75  }
bool m_condLastResult
the last result of evaluateCondition()
void L1GtConditionEvaluation::print ( std::ostream &  myCout) const
virtual

print condition

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

Definition at line 34 of file L1GtConditionEvaluation.cc.

References begin, popcon2dropbox::copy(), end, m_combinationsInCond, m_condLastResult, and m_condMaxNumberObjects.

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

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

Definition at line 53 of file L1GtConditionEvaluation.h.

References m_condMaxNumberObjects.

53  {
54  m_condMaxNumberObjects = condMaxNumberObjectsValue;
55  }
void L1GtConditionEvaluation::setVerbosity ( const int  verbosity)
inline

Member Data Documentation

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