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...
 
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...
 
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() [1/3]

L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( )

constructors default

Definition at line 37 of file L1GtHfBitCountsCondition.cc.

38  // empty
39 }

◆ L1GtHfBitCountsCondition() [2/3]

L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( const L1GtCondition bcTemplate,
const L1GlobalTriggerPSB ptrPSB 
)

from base template condition (from event setup usually)

Definition at line 42 of file L1GtHfBitCountsCondition.cc.

44  m_gtHfBitCountsTemplate(static_cast<const L1GtHfBitCountsTemplate *>(bcTemplate)),
45  m_gtPSB(ptrPSB) {
46  // maximum number of objects received for the evaluation of the condition
47  // no objects, in fact, just a count
49 }

References L1GtConditionEvaluation::m_condMaxNumberObjects.

◆ L1GtHfBitCountsCondition() [3/3]

L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( const L1GtHfBitCountsCondition cp)

Definition at line 63 of file L1GtHfBitCountsCondition.cc.

64  copy(cp);
65 }

References copy(), and CommonMethods::cp().

◆ ~L1GtHfBitCountsCondition()

L1GtHfBitCountsCondition::~L1GtHfBitCountsCondition ( )
override

Definition at line 68 of file L1GtHfBitCountsCondition.cc.

68  {
69  // empty
70 }

Member Function Documentation

◆ copy()

void L1GtHfBitCountsCondition::copy ( const L1GtHfBitCountsCondition cp)
private

copy function for copy constructor and operator=

Definition at line 52 of file L1GtHfBitCountsCondition.cc.

52  {
53  m_gtHfBitCountsTemplate = cp.gtHfBitCountsTemplate();
54  m_gtPSB = cp.gtPSB();
55 
56  m_condMaxNumberObjects = cp.condMaxNumberObjects();
57  m_condLastResult = cp.condLastResult();
58  m_combinationsInCond = cp.getCombinationsInCond();
59 
60  m_verbosity = cp.m_verbosity;
61 }

References CommonMethods::cp(), L1GtConditionEvaluation::m_combinationsInCond, L1GtConditionEvaluation::m_condLastResult, L1GtConditionEvaluation::m_condMaxNumberObjects, m_gtHfBitCountsTemplate, m_gtPSB, and L1GtConditionEvaluation::m_verbosity.

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

◆ evaluateCondition()

const bool L1GtHfBitCountsCondition::evaluateCondition ( ) const
overridevirtual

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 87 of file L1GtHfBitCountsCondition.cc.

87  {
88  // number of trigger objects in the condition
89  // no objects, in fact, just a count
90  int iCondition = 0;
91 
92  // condition result condResult will be set to true if the HF bit counts
93  // passes the requirement
94  bool condResult = false;
95 
96  // store the index of the HfBitCounts object
97  // from the combination evaluated in the condition
98  SingleCombInCond objectsInComb;
99 
100  // clear the m_combinationsInCond vector
102 
103  // get the HF bit counts (event / condition)
104  const L1GctHFBitCounts *bitCounts = m_gtPSB->getCandL1HfBitCounts();
105 
106  // protection against missing HF bit counts collection
107  if (bitCounts == nullptr) {
108  return false;
109  }
110 
112 
113  // FIXME ask GCT to provide a method to retrieve it
114  const unsigned int numberL1HfBitCounts = 4;
115 
116  const unsigned int cIndex = objPar.countIndex;
117  if (cIndex >= numberL1HfBitCounts) {
118  edm::LogError("L1GlobalTrigger") << "\nL1GtHfBitCountsCondition error: countIndex " << cIndex
119  << "greater than GCT maximum index = " << numberL1HfBitCounts
120  << "\n ==> condResult = false " << std::endl;
121  return false;
122  }
123 
124  const unsigned int countValue = bitCounts->bitCount(cIndex);
125 
126  // check countThreshold
127  if (!checkThreshold(objPar.countThreshold, countValue, m_gtHfBitCountsTemplate->condGEq())) {
128  return false;
129  }
130 
131  // index is always zero - the object is in fact a count
132  int indexObj = 0;
133 
134  objectsInComb.push_back(indexObj);
135  (combinationsInCond()).push_back(objectsInComb);
136 
137  // if we get here all checks were successful for this combination
138  // set the general result for evaluateCondition to "true"
139 
140  condResult = true;
141  return condResult;
142 }

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

◆ gtHfBitCountsTemplate()

const L1GtHfBitCountsTemplate* L1GtHfBitCountsCondition::gtHfBitCountsTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 59 of file L1GtHfBitCountsCondition.h.

59 { return m_gtHfBitCountsTemplate; }

References m_gtHfBitCountsTemplate.

◆ gtPSB()

const L1GlobalTriggerPSB* L1GtHfBitCountsCondition::gtPSB ( ) const
inline

get / set the pointer to PSB

Definition at line 64 of file L1GtHfBitCountsCondition.h.

64 { return m_gtPSB; }

References m_gtPSB.

◆ operator=()

L1GtHfBitCountsCondition & L1GtHfBitCountsCondition::operator= ( const L1GtHfBitCountsCondition cp)

Definition at line 73 of file L1GtHfBitCountsCondition.cc.

73  {
74  copy(cp);
75  return *this;
76 }

References copy(), and CommonMethods::cp().

◆ print()

void L1GtHfBitCountsCondition::print ( std::ostream &  myCout) const
overridevirtual

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 144 of file L1GtHfBitCountsCondition.cc.

144  {
147 }

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

Referenced by L1GlobalTriggerGTL::run().

◆ setGtHfBitCountsTemplate()

void L1GtHfBitCountsCondition::setGtHfBitCountsTemplate ( const L1GtHfBitCountsTemplate bcTemplate)

Definition at line 79 of file L1GtHfBitCountsCondition.cc.

79  {
80  m_gtHfBitCountsTemplate = bcTemplate;
81 }

References m_gtHfBitCountsTemplate.

◆ setGtPSB()

void L1GtHfBitCountsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 84 of file L1GtHfBitCountsCondition.cc.

84 { m_gtPSB = ptrPSB; }

References m_gtPSB.

Member Data Documentation

◆ m_gtHfBitCountsTemplate

const L1GtHfBitCountsTemplate* L1GtHfBitCountsCondition::m_gtHfBitCountsTemplate
private

◆ m_gtPSB

const L1GlobalTriggerPSB* L1GtHfBitCountsCondition::m_gtPSB
private

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

Definition at line 77 of file L1GtHfBitCountsCondition.h.

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

L1GtHfBitCountsCondition::m_gtPSB
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
Definition: L1GtHfBitCountsCondition.h:77
L1GtConditionEvaluation::m_verbosity
int m_verbosity
verbosity level
Definition: L1GtConditionEvaluation.h:105
L1GtHfBitCountsTemplate::ObjectParameter::countThreshold
unsigned int countThreshold
Definition: L1GtHfBitCountsTemplate.h:58
L1GtConditionEvaluation::combinationsInCond
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
Definition: L1GtConditionEvaluation.h:82
L1GtCondition::condGEq
const bool condGEq() const
get / set condition GEq flag
Definition: L1GtCondition.h:72
L1GtConditionEvaluation::print
virtual void print(std::ostream &myCout) const
print condition
Definition: L1GtConditionEvaluation.cc:34
L1GtHfBitCountsCondition::m_gtHfBitCountsTemplate
const L1GtHfBitCountsTemplate * m_gtHfBitCountsTemplate
pointer to a L1GtHfBitCountsTemplate
Definition: L1GtHfBitCountsCondition.h:74
L1GctHFBitCounts
L1 GCT HF ring Et sums.
Definition: L1GctHFBitCounts.h:16
L1GtConditionEvaluation::m_combinationsInCond
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
Definition: L1GtConditionEvaluation.h:102
L1GtConditionEvaluation::checkThreshold
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
Definition: L1GtConditionEvaluation.h:113
L1GtConditionEvaluation::m_condLastResult
bool m_condLastResult
the last result of evaluateCondition()
Definition: L1GtConditionEvaluation.h:99
SingleCombInCond
std::vector< int > SingleCombInCond
typedefs
Definition: L1GlobalTriggerObjectMapFwd.h:29
L1GtHfBitCountsTemplate::ObjectParameter
typedef for a single object template
Definition: L1GtHfBitCountsTemplate.h:56
L1GtConditionEvaluation::L1GtConditionEvaluation
L1GtConditionEvaluation()
constructor
Definition: L1GtConditionEvaluation.h:40
L1GtHfBitCountsTemplate::ObjectParameter::countIndex
unsigned int countIndex
Definition: L1GtHfBitCountsTemplate.h:57
L1GctHFBitCounts::bitCount
uint16_t bitCount(unsigned const i) const
Definition: L1GctHFBitCounts.cc:47
clear
void clear(HadCaloObj &c)
Definition: data.h:124
L1GtConditionEvaluation::m_condMaxNumberObjects
int m_condMaxNumberObjects
Definition: L1GtConditionEvaluation.h:96
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
L1GlobalTriggerPSB::getCandL1HfBitCounts
const L1GctHFBitCounts * getCandL1HfBitCounts() const
pointer to HfBitCounts data list
Definition: L1GlobalTriggerPSB.h:174
L1GtHfBitCountsTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: L1GtHfBitCountsTemplate.cc:77
L1GtHfBitCountsTemplate::objectParameter
const std::vector< ObjectParameter > * objectParameter() const
Definition: L1GtHfBitCountsTemplate.h:64
L1GtHfBitCountsCondition::copy
void copy(const L1GtHfBitCountsCondition &cp)
copy function for copy constructor and operator=
Definition: L1GtHfBitCountsCondition.cc:52
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192