CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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

$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.

45  :
47  m_condLastResult(false),
48  m_verbosity(0) {}
bool m_condLastResult
the last result of evaluateCondition()
virtual L1GtConditionEvaluation::~L1GtConditionEvaluation ( )
inlinevirtual

destructor

Definition at line 52 of file L1GtConditionEvaluation.h.

52 {}

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(), L1GtEnergySumCondition::evaluateCondition(), L1GtMuonCondition::evaluateCondition(), L1GtCorrelationCondition::evaluateCondition(), and L1GtCaloCondition::evaluateCondition().

176  {
177 
178  boost::uint64_t oneBit = 1ULL;
179 
180  if (bitNumber >= (sizeof(oneBit)*8)) {
181 
182  if (m_verbosity) {
183 
184  LogTrace("L1GlobalTrigger")
185  << " checkBit " << "\n Bit number = "
186  << bitNumber << " larger than maximum allowed " << sizeof ( oneBit ) * 8
187  << std::endl;
188  }
189 
190  return false;
191  }
192 
193  oneBit <<= bitNumber;
194 
195  //LogTrace("L1GlobalTrigger") << " checkBit " << "\n mask address = " << &mask
196  // << std::dec << "\n dec: " << "mask = " << mask << " oneBit = " << oneBit
197  // << " bitNumber = " << bitNumber << std::hex << "\n hex: " << "mask = " << mask
198  // << " oneBit = " << oneBit << " bitNumber = " << bitNumber << std::dec
199  // << "\n mask & oneBit result = " << bool ( mask & oneBit ) << std::endl;
200 
201  return (mask & oneBit);
202 }
#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 138 of file L1GtConditionEvaluation.h.

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

139  {
140 
141  //if (value > 0) {
142  // LogTrace("L1GlobalTrigger") << " threshold check for condGEqValue = "
143  // << condGEqValue << "\n hex: " << std::hex << "threshold = " << threshold
144  // << " value = " << value << "\n dec: " << std::dec << "threshold = " << threshold
145  // << " value = " << value << std::endl;
146  //}
147 
148  if (condGEqValue) {
149  if (value >= threshold) {
150 
151  //LogTrace("L1GlobalTrigger") << " condGEqValue: value >= threshold"
152  // << std::endl;
153 
154  return true;
155  }
156 
157  return false;
158 
159  }
160  else {
161 
162  if (value == threshold) {
163 
164  //LogTrace("L1GlobalTrigger") << " condGEqValue: value = threshold"
165  // << std::endl;
166 
167  return true;
168  }
169 
170  return false;
171  }
172 }
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 72 of file L1GtConditionEvaluation.h.

References evaluateCondition(), and m_condLastResult.

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

72  {
74  }
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 90 of file L1GtConditionEvaluation.h.

References m_combinationsInCond.

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

90  {
91  return m_combinationsInCond;
92  }
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 80 of file L1GtConditionEvaluation.h.

References m_condLastResult.

80  {
81  if (m_condLastResult) {
82  return "1";
83  }
84  else {
85  return "0";
86  }
87  }
bool m_condLastResult
the last result of evaluateCondition()
void L1GtConditionEvaluation::print ( std::ostream &  myCout) const
virtual

print condition

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

Definition at line 38 of file L1GtConditionEvaluation.cc.

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

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

38  {
39 
40  myCout << "\n L1GtConditionEvaluation print...\n" << std::endl;
41  myCout << " Maximum number of objects in condition: " << m_condMaxNumberObjects << std::endl;
42  myCout << " Condition result: " << m_condLastResult << std::endl;
43 
44  CombinationsInCond::const_iterator itVV;
45  std::ostringstream myCout1;
46 
47  for (itVV = (m_combinationsInCond).begin(); itVV != (m_combinationsInCond).end(); itVV++) {
48 
49  myCout1 << "( ";
50 
51  std::copy((*itVV).begin(), (*itVV).end(), std::ostream_iterator<int> (myCout1, " "));
52 
53  myCout1 << "); ";
54 
55  }
56 
57  myCout
58  << "\n List of combinations passing all requirements for this condition: \n "
59  << myCout1.str()
60  << " \n"
61  << std::endl;
62 
63 }
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:38
#define begin
Definition: vmac.h:31
void L1GtConditionEvaluation::setCondMaxNumberObjects ( int  condMaxNumberObjectsValue)
inline

Definition at line 62 of file L1GtConditionEvaluation.h.

References m_condMaxNumberObjects.

62  {
63  m_condMaxNumberObjects = condMaxNumberObjectsValue;
64  }
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