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

Definition at line 37 of file L1GtConditionEvaluation.h.

Constructor & Destructor Documentation

L1GtConditionEvaluation::L1GtConditionEvaluation ( )
inline

constructor

Definition at line 43 of file L1GtConditionEvaluation.h.

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

destructor

Definition at line 50 of file L1GtConditionEvaluation.h.

50 {}

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

References LogTrace, and m_verbosity.

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

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

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

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

References evaluateCondition(), and m_condLastResult.

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

70  {
72  }
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 88 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().

88  {
89  return m_combinationsInCond;
90  }
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 78 of file L1GtConditionEvaluation.h.

References m_condLastResult.

78  {
79  if (m_condLastResult) {
80  return "1";
81  }
82  else {
83  return "0";
84  }
85  }
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 36 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().

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

Definition at line 60 of file L1GtConditionEvaluation.h.

References m_condMaxNumberObjects.

60  {
61  m_condMaxNumberObjects = condMaxNumberObjectsValue;
62  }
void L1GtConditionEvaluation::setVerbosity ( const int  verbosity)
inline

Definition at line 96 of file L1GtConditionEvaluation.h.

References m_verbosity, and HLT_25ns14e33_v1_cff::verbosity.

Referenced by L1GlobalTriggerGTL::run().

96  {
98  }

Member Data Documentation

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