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...
 
const CombinationsInCondgetCombinationsInCond () 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::L1GtConditionEvaluation ( )
inline

constructor

Definition at line 40 of file L1GtConditionEvaluation.h.

◆ ~L1GtConditionEvaluation()

virtual L1GtConditionEvaluation::~L1GtConditionEvaluation ( )
inlinevirtual

destructor

Definition at line 43 of file L1GtConditionEvaluation.h.

43 {}

Member Function Documentation

◆ checkBit()

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.

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 }

References L1TBPTX_cfi::bitNumber, LogTrace, and m_verbosity.

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

◆ checkThreshold()

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.

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 }

References remoteMonitoring_LED_IterMethod_cfg::threshold.

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

◆ combinationsInCond()

CombinationsInCond& L1GtConditionEvaluation::combinationsInCond ( ) const
inlineprotected

◆ condLastResult()

bool L1GtConditionEvaluation::condLastResult ( ) const
inline

get the latest result for the condition

Definition at line 55 of file L1GtConditionEvaluation.h.

55 { return m_condLastResult; }

References m_condLastResult.

Referenced by L1GtCorrelationCondition::evaluateCondition().

◆ condMaxNumberObjects()

int L1GtConditionEvaluation::condMaxNumberObjects ( ) const
inline

get / set the maximum number of objects received for the evaluation of the condition

Definition at line 48 of file L1GtConditionEvaluation.h.

48 { return m_condMaxNumberObjects; }

References m_condMaxNumberObjects.

◆ evaluateCondition()

virtual const bool L1GtConditionEvaluation::evaluateCondition ( ) const
pure virtual

◆ evaluateConditionStoreResult()

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

◆ getCombinationsInCond()

const CombinationsInCond& L1GtConditionEvaluation::getCombinationsInCond ( ) const
inline

get all the object combinations evaluated to true in the condition

Definition at line 73 of file L1GtConditionEvaluation.h.

73 { return m_combinationsInCond; }

References m_combinationsInCond.

Referenced by L1GtCorrelationCondition::evaluateCondition().

◆ getNumericExpression()

virtual std::string L1GtConditionEvaluation::getNumericExpression ( ) const
inlinevirtual

get numeric expression

Definition at line 64 of file L1GtConditionEvaluation.h.

64  {
65  if (m_condLastResult) {
66  return "1";
67  } else {
68  return "0";
69  }
70  }

References m_condLastResult.

◆ print()

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.

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 }

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

◆ setCondMaxNumberObjects()

void L1GtConditionEvaluation::setCondMaxNumberObjects ( int  condMaxNumberObjectsValue)
inline

Definition at line 50 of file L1GtConditionEvaluation.h.

50  {
51  m_condMaxNumberObjects = condMaxNumberObjectsValue;
52  }

References m_condMaxNumberObjects.

◆ setVerbosity()

void L1GtConditionEvaluation::setVerbosity ( const int  verbosity)
inline

Member Data Documentation

◆ m_combinationsInCond

CombinationsInCond L1GtConditionEvaluation::m_combinationsInCond
mutableprotected

◆ m_condLastResult

bool L1GtConditionEvaluation::m_condLastResult
protected

◆ m_condMaxNumberObjects

int L1GtConditionEvaluation::m_condMaxNumberObjects
protected

◆ m_verbosity

int L1GtConditionEvaluation::m_verbosity
protected
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
L1GtConditionEvaluation::m_verbosity
int m_verbosity
verbosity level
Definition: L1GtConditionEvaluation.h:105
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
L1GtConditionEvaluation::m_combinationsInCond
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
Definition: L1GtConditionEvaluation.h:102
L1GtConditionEvaluation::m_condLastResult
bool m_condLastResult
the last result of evaluateCondition()
Definition: L1GtConditionEvaluation.h:99
mps_fire.end
end
Definition: mps_fire.py:242
L1GtConditionEvaluation::m_condMaxNumberObjects
int m_condMaxNumberObjects
Definition: L1GtConditionEvaluation.h:96
value
Definition: value.py:1
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
L1TBPTX_cfi.bitNumber
bitNumber
Definition: L1TBPTX_cfi.py:26
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
L1GtConditionEvaluation::evaluateCondition
virtual const bool evaluateCondition() const =0
the core function to check if the condition matches