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...
 
CombinationsInCondgetCombinationsInCond () const
 get all the object combinations evaluated to true in the condition More...
 
virtual std::string getNumericExpression ()
 get numeric expression More...
 
 L1GtConditionEvaluation ()
 constructor More...
 
 L1GtConditionEvaluation (L1GtConditionEvaluation &)
 copy 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
 

Protected Attributes

CombinationsInCondm_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 ( )

constructor

Definition at line 34 of file L1GtConditionEvaluation.cc.

34  :
36  m_condLastResult(false),
38  m_verbosity(0)
39 
40 {
41 
42  // empty
43 
44 }
CombinationsInCond * m_combinationsInCond
store all the object combinations evaluated to true in the condition
bool m_condLastResult
the last result of evaluateCondition()
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
L1GtConditionEvaluation::L1GtConditionEvaluation ( L1GtConditionEvaluation cp)

copy constructor

Definition at line 47 of file L1GtConditionEvaluation.cc.

References condLastResult(), condMaxNumberObjects(), getCombinationsInCond(), m_combinationsInCond, m_condLastResult, m_condMaxNumberObjects, and m_verbosity.

47  {
48 
52 
54 
55 }
CombinationsInCond * m_combinationsInCond
store all the object combinations evaluated to true in the condition
CombinationsInCond * getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
bool m_condLastResult
the last result of evaluateCondition()
bool condLastResult() const
get the latest result for the condition
L1GtConditionEvaluation::~L1GtConditionEvaluation ( )
virtual

destructor

Definition at line 58 of file L1GtConditionEvaluation.cc.

References m_combinationsInCond.

58  {
59 
60  delete m_combinationsInCond;
61 
62 }
CombinationsInCond * m_combinationsInCond
store all the object combinations evaluated to true in the condition

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

References LogTrace, and m_verbosity.

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

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

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

132  {
133 
134  //if (value > 0) {
135  // LogTrace("L1GtConditionEvaluation") << " threshold check for condGEqValue = "
136  // << condGEqValue << "\n hex: " << std::hex << "threshold = " << threshold
137  // << " value = " << value << "\n dec: " << std::dec << "threshold = " << threshold
138  // << " value = " << value << std::endl;
139  //}
140 
141  if (condGEqValue) {
142  if (value >= threshold) {
143 
144  //LogTrace("L1GtConditionEvaluation") << " condGEqValue: value >= threshold"
145  // << std::endl;
146 
147  return true;
148  }
149 
150  return false;
151 
152  }
153  else {
154 
155  if (value == threshold) {
156 
157  //LogTrace("L1GtConditionEvaluation") << " condGEqValue: value = threshold"
158  // << std::endl;
159 
160  return true;
161  }
162 
163  return false;
164  }
165 }
float threshold
Definition: crabWrap.py:319
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 71 of file L1GtConditionEvaluation.h.

References evaluateCondition(), and m_condLastResult.

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

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

get numeric expression

Definition at line 79 of file L1GtConditionEvaluation.h.

References m_condLastResult.

79  {
80  if (m_condLastResult) {
81  return "1";
82  }
83  else {
84  return "0";
85  }
86  }
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 67 of file L1GtConditionEvaluation.cc.

References filterCSVwithJSON::copy, 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().

67  {
68 
69  myCout << "\n L1GtConditionEvaluation print...\n" << std::endl;
70  myCout << " Maximum number of objects in condition: " << m_condMaxNumberObjects << std::endl;
71  myCout << " Condition result: " << m_condLastResult << std::endl;
72 
73  CombinationsInCond::const_iterator itVV;
74  std::ostringstream myCout1;
75 
76  for (itVV = (*m_combinationsInCond).begin(); itVV != (*m_combinationsInCond).end(); itVV++) {
77 
78  myCout1 << "( ";
79 
80  std::copy((*itVV).begin(), (*itVV).end(), std::ostream_iterator<int> (myCout1, " "));
81 
82  myCout1 << "); ";
83 
84  }
85 
86  myCout
87  << "\n List of combinations passing all requirements for this condition: \n "
88  << myCout1.str()
89  << " \n"
90  << std::endl;
91 
92 }
bool m_condLastResult
the last result of evaluateCondition()
void L1GtConditionEvaluation::setCondMaxNumberObjects ( int  condMaxNumberObjectsValue)
inline

Definition at line 61 of file L1GtConditionEvaluation.h.

References m_condMaxNumberObjects.

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

Definition at line 96 of file L1GtConditionEvaluation.h.

References m_verbosity, and verbosity.

Referenced by L1GlobalTriggerGTL::run().

96  {
98  }
const int verbosity

Member Data Documentation

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