CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1GtHfBitCountsCondition Class Reference

#include <L1GtHfBitCountsCondition.h>

Inheritance diagram for L1GtHfBitCountsCondition:
L1GtConditionEvaluation

Public Member Functions

const bool evaluateCondition () const override
 the core function to check if the condition matches More...
 
const L1GtHfBitCountsTemplategtHfBitCountsTemplate () const
 get / set the pointer to a L1GtCondition More...
 
const L1GlobalTriggerPSBgtPSB () const
 get / set the pointer to PSB More...
 
 L1GtHfBitCountsCondition ()
 
 L1GtHfBitCountsCondition (const L1GtCondition *, const L1GlobalTriggerPSB *)
 from base template condition (from event setup usually) More...
 
 L1GtHfBitCountsCondition (const L1GtHfBitCountsCondition &)
 
L1GtHfBitCountsConditionoperator= (const L1GtHfBitCountsCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtHfBitCountsTemplate (const L1GtHfBitCountsTemplate *)
 
void setGtPSB (const L1GlobalTriggerPSB *)
 set the pointer to PSB More...
 
 ~L1GtHfBitCountsCondition () override
 
- Public Member Functions inherited from L1GtConditionEvaluation
bool condLastResult () const
 get the latest result for the condition More...
 
int condMaxNumberObjects () const
 
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...
 
void setCondMaxNumberObjects (int condMaxNumberObjectsValue)
 
void setVerbosity (const int verbosity)
 
virtual ~L1GtConditionEvaluation ()
 destructor More...
 

Private Member Functions

void copy (const L1GtHfBitCountsCondition &cp)
 copy function for copy constructor and operator= More...
 

Private Attributes

const L1GtHfBitCountsTemplatem_gtHfBitCountsTemplate
 pointer to a L1GtHfBitCountsTemplate More...
 
const L1GlobalTriggerPSBm_gtPSB
 pointer to PSB, to be able to get the trigger objects More...
 

Additional Inherited Members

- Protected Member Functions inherited from L1GtConditionEvaluation
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 inherited from L1GtConditionEvaluation
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: evaluation of a CondHfBitCounts condition.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 32 of file L1GtHfBitCountsCondition.h.

Constructor & Destructor Documentation

L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( )

constructors default

Definition at line 37 of file L1GtHfBitCountsCondition.cc.

39 
40  // empty
41 }
L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( const L1GtCondition bcTemplate,
const L1GlobalTriggerPSB ptrPSB 
)

from base template condition (from event setup usually)

Definition at line 44 of file L1GtHfBitCountsCondition.cc.

References L1GtConditionEvaluation::m_condMaxNumberObjects.

48  static_cast<const L1GtHfBitCountsTemplate *>(bcTemplate)),
49  m_gtPSB(ptrPSB) {
50 
51  // maximum number of objects received for the evaluation of the condition
52  // no objects, in fact, just a count
54 }
const L1GtHfBitCountsTemplate * m_gtHfBitCountsTemplate
pointer to a L1GtHfBitCountsTemplate
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( const L1GtHfBitCountsCondition cp)

Definition at line 69 of file L1GtHfBitCountsCondition.cc.

References copy().

72 
73  copy(cp);
74 }
void copy(const L1GtHfBitCountsCondition &cp)
copy function for copy constructor and operator=
L1GtHfBitCountsCondition::~L1GtHfBitCountsCondition ( )
override

Definition at line 77 of file L1GtHfBitCountsCondition.cc.

References operator=().

77  {
78 
79  // empty
80 }

Member Function Documentation

void L1GtHfBitCountsCondition::copy ( const L1GtHfBitCountsCondition cp)
private

copy function for copy constructor and operator=

Definition at line 57 of file L1GtHfBitCountsCondition.cc.

References L1GtConditionEvaluation::condLastResult(), L1GtConditionEvaluation::condMaxNumberObjects(), L1GtConditionEvaluation::getCombinationsInCond(), gtHfBitCountsTemplate(), gtPSB(), L1GtConditionEvaluation::m_combinationsInCond, L1GtConditionEvaluation::m_condLastResult, L1GtConditionEvaluation::m_condMaxNumberObjects, m_gtHfBitCountsTemplate, m_gtPSB, and L1GtConditionEvaluation::m_verbosity.

Referenced by gtPSB(), L1GtHfBitCountsCondition(), and operator=().

57  {
58 
60  m_gtPSB = cp.gtPSB();
61 
65 
67 }
bool m_condLastResult
the last result of evaluateCondition()
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
const L1GtHfBitCountsTemplate * gtHfBitCountsTemplate() const
get / set the pointer to a L1GtCondition
const L1GtHfBitCountsTemplate * m_gtHfBitCountsTemplate
pointer to a L1GtHfBitCountsTemplate
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
const L1GlobalTriggerPSB * gtPSB() const
get / set the pointer to PSB
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
bool condLastResult() const
get the latest result for the condition
const bool L1GtHfBitCountsCondition::evaluateCondition ( ) const
overridevirtual

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 103 of file L1GtHfBitCountsCondition.cc.

References L1GctHFBitCounts::bitCount(), L1GtConditionEvaluation::checkThreshold(), hitfit::clear(), L1GtConditionEvaluation::combinationsInCond(), L1GtCondition::condGEq(), L1GtHfBitCountsTemplate::ObjectParameter::countIndex, L1GtHfBitCountsTemplate::ObjectParameter::countThreshold, L1GlobalTriggerPSB::getCandL1HfBitCounts(), m_gtHfBitCountsTemplate, m_gtPSB, and L1GtHfBitCountsTemplate::objectParameter().

103  {
104 
105  // number of trigger objects in the condition
106  // no objects, in fact, just a count
107  int iCondition = 0;
108 
109  // condition result condResult will be set to true if the HF bit counts
110  // passes the requirement
111  bool condResult = false;
112 
113  // store the index of the HfBitCounts object
114  // from the combination evaluated in the condition
115  SingleCombInCond objectsInComb;
116 
117  // clear the m_combinationsInCond vector
119 
120  // get the HF bit counts (event / condition)
121  const L1GctHFBitCounts *bitCounts = m_gtPSB->getCandL1HfBitCounts();
122 
123  // protection against missing HF bit counts collection
124  if (bitCounts == nullptr) {
125  return false;
126  }
127 
129  (*(m_gtHfBitCountsTemplate->objectParameter()))[iCondition];
130 
131  // FIXME ask GCT to provide a method to retrieve it
132  const unsigned int numberL1HfBitCounts = 4;
133 
134  const unsigned int cIndex = objPar.countIndex;
135  if (cIndex >= numberL1HfBitCounts) {
136 
137  edm::LogError("L1GlobalTrigger")
138  << "\nL1GtHfBitCountsCondition error: countIndex " << cIndex
139  << "greater than GCT maximum index = " << numberL1HfBitCounts
140  << "\n ==> condResult = false " << std::endl;
141  return false;
142  }
143 
144  const unsigned int countValue = bitCounts->bitCount(cIndex);
145 
146  // check countThreshold
147  if (!checkThreshold(objPar.countThreshold, countValue,
149 
150  return false;
151  }
152 
153  // index is always zero - the object is in fact a count
154  int indexObj = 0;
155 
156  objectsInComb.push_back(indexObj);
157  (combinationsInCond()).push_back(objectsInComb);
158 
159  // if we get here all checks were successful for this combination
160  // set the general result for evaluateCondition to "true"
161 
162  condResult = true;
163  return condResult;
164 }
typedef for a single object template
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
std::vector< int > SingleCombInCond
typedefs
uint16_t bitCount(unsigned const i) const
const L1GtHfBitCountsTemplate * m_gtHfBitCountsTemplate
pointer to a L1GtHfBitCountsTemplate
L1 GCT HF ring Et sums.
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
const L1GctHFBitCounts * getCandL1HfBitCounts() const
pointer to HfBitCounts data list
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
const bool condGEq() const
get / set condition GEq flag
const std::vector< ObjectParameter > * objectParameter() const
const L1GtHfBitCountsTemplate* L1GtHfBitCountsCondition::gtHfBitCountsTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 60 of file L1GtHfBitCountsCondition.h.

References m_gtHfBitCountsTemplate, and setGtHfBitCountsTemplate().

Referenced by copy().

60  {
62  }
const L1GtHfBitCountsTemplate * m_gtHfBitCountsTemplate
pointer to a L1GtHfBitCountsTemplate
const L1GlobalTriggerPSB* L1GtHfBitCountsCondition::gtPSB ( ) const
inline

get / set the pointer to PSB

Definition at line 67 of file L1GtHfBitCountsCondition.h.

References copy(), SimDataFormats::CaloAnalysis::cp, m_gtPSB, and setGtPSB().

Referenced by copy().

67 { return m_gtPSB; }
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
L1GtHfBitCountsCondition & L1GtHfBitCountsCondition::operator= ( const L1GtHfBitCountsCondition cp)

Definition at line 84 of file L1GtHfBitCountsCondition.cc.

References copy().

Referenced by ~L1GtHfBitCountsCondition().

84  {
85  copy(cp);
86  return *this;
87 }
void copy(const L1GtHfBitCountsCondition &cp)
copy function for copy constructor and operator=
void L1GtHfBitCountsCondition::print ( std::ostream &  myCout) const
overridevirtual

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 166 of file L1GtHfBitCountsCondition.cc.

References m_gtHfBitCountsTemplate, L1GtConditionEvaluation::print(), and L1GtHfBitCountsTemplate::print().

Referenced by L1GlobalTriggerGTL::run().

166  {
167 
170 }
const L1GtHfBitCountsTemplate * m_gtHfBitCountsTemplate
pointer to a L1GtHfBitCountsTemplate
void print(std::ostream &myCout) const override
print the condition
virtual void print(std::ostream &myCout) const
print condition
void L1GtHfBitCountsCondition::setGtHfBitCountsTemplate ( const L1GtHfBitCountsTemplate bcTemplate)

Definition at line 90 of file L1GtHfBitCountsCondition.cc.

References m_gtHfBitCountsTemplate.

Referenced by gtHfBitCountsTemplate().

91  {
92 
93  m_gtHfBitCountsTemplate = bcTemplate;
94 }
const L1GtHfBitCountsTemplate * m_gtHfBitCountsTemplate
pointer to a L1GtHfBitCountsTemplate
void L1GtHfBitCountsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 97 of file L1GtHfBitCountsCondition.cc.

References m_gtPSB.

Referenced by gtPSB().

97  {
98 
99  m_gtPSB = ptrPSB;
100 }
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects

Member Data Documentation

const L1GtHfBitCountsTemplate* L1GtHfBitCountsCondition::m_gtHfBitCountsTemplate
private
const L1GlobalTriggerPSB* L1GtHfBitCountsCondition::m_gtPSB
private

pointer to PSB, to be able to get the trigger objects

Definition at line 80 of file L1GtHfBitCountsCondition.h.

Referenced by copy(), evaluateCondition(), gtPSB(), and setGtPSB().