CMS 3D CMS Logo

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

#include <L1GtJetCountsCondition.h>

Inheritance diagram for L1GtJetCountsCondition:
L1GtConditionEvaluation

Public Member Functions

const bool evaluateCondition () const override
 the core function to check if the condition matches More...
 
const L1GtJetCountsTemplategtJetCountsTemplate () const
 get / set the pointer to a L1GtCondition More...
 
const L1GlobalTriggerPSBgtPSB () const
 get / set the pointer to PSB More...
 
 L1GtJetCountsCondition ()
 
 L1GtJetCountsCondition (const L1GtCondition *, const L1GlobalTriggerPSB *, const int nrL1JetCounts)
 from base template condition (from event setup usually) More...
 
 L1GtJetCountsCondition (const L1GtJetCountsCondition &)
 
L1GtJetCountsConditionoperator= (const L1GtJetCountsCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtJetCountsTemplate (const L1GtJetCountsTemplate *)
 
void setGtPSB (const L1GlobalTriggerPSB *)
 set the pointer to PSB More...
 
 ~L1GtJetCountsCondition () 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 L1GtJetCountsCondition &cp)
 copy function for copy constructor and operator= More...
 

Private Attributes

const L1GtJetCountsTemplatem_gtJetCountsTemplate
 pointer to a L1GtJetCountsTemplate More...
 
const L1GlobalTriggerPSBm_gtPSB
 pointer to PSB, to be able to get the trigger objects More...
 
unsigned int m_numberL1JetCounts
 maximum number of jet counts 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 CondJetCounts condition.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 33 of file L1GtJetCountsCondition.h.

Constructor & Destructor Documentation

◆ L1GtJetCountsCondition() [1/3]

L1GtJetCountsCondition::L1GtJetCountsCondition ( )

constructors default

Definition at line 37 of file L1GtJetCountsCondition.cc.

38  // empty
39 }

◆ L1GtJetCountsCondition() [2/3]

L1GtJetCountsCondition::L1GtJetCountsCondition ( const L1GtCondition jcTemplate,
const L1GlobalTriggerPSB ptrPSB,
const int  nrL1JetCounts 
)

from base template condition (from event setup usually)

Definition at line 42 of file L1GtJetCountsCondition.cc.

46  m_gtJetCountsTemplate(static_cast<const L1GtJetCountsTemplate *>(jcTemplate)),
47  m_gtPSB(ptrPSB),
48  m_numberL1JetCounts(nrL1JetCounts) {
49  // maximum number of objects received for the evaluation of the condition
50  // no objects, in fact, just a number
52 }

References L1GtConditionEvaluation::m_condMaxNumberObjects.

◆ L1GtJetCountsCondition() [3/3]

L1GtJetCountsCondition::L1GtJetCountsCondition ( const L1GtJetCountsCondition cp)

Definition at line 66 of file L1GtJetCountsCondition.cc.

67  copy(cp);
68 }

References copy().

◆ ~L1GtJetCountsCondition()

L1GtJetCountsCondition::~L1GtJetCountsCondition ( )
override

Definition at line 71 of file L1GtJetCountsCondition.cc.

71  {
72  // empty
73 }

Member Function Documentation

◆ copy()

void L1GtJetCountsCondition::copy ( const L1GtJetCountsCondition cp)
private

copy function for copy constructor and operator=

Definition at line 55 of file L1GtJetCountsCondition.cc.

55  {
56  m_gtJetCountsTemplate = cp.gtJetCountsTemplate();
57  m_gtPSB = cp.gtPSB();
58 
59  m_condMaxNumberObjects = cp.condMaxNumberObjects();
60  m_condLastResult = cp.condLastResult();
61  m_combinationsInCond = cp.getCombinationsInCond();
62 
63  m_verbosity = cp.m_verbosity;
64 }

References L1GtConditionEvaluation::m_combinationsInCond, L1GtConditionEvaluation::m_condLastResult, L1GtConditionEvaluation::m_condMaxNumberObjects, m_gtJetCountsTemplate, m_gtPSB, and L1GtConditionEvaluation::m_verbosity.

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

◆ evaluateCondition()

const bool L1GtJetCountsCondition::evaluateCondition ( ) const
overridevirtual

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 90 of file L1GtJetCountsCondition.cc.

90  {
91  // number of trigger objects in the condition
92  // in fact, there is only one object
93  int iCondition = 0;
94 
95  // condition result condResult will be set to true if the jet counts
96  // passes the requirement
97  bool condResult = false;
98 
99  // store the index of the JetCount object
100  // from the combination evaluated in the condition
101  SingleCombInCond objectsInComb;
102 
103  // clear the m_combinationsInCond vector
105 
106  // get the jet counts (event / condition)
107  const L1GctJetCounts *jetCounts = m_gtPSB->getCandL1JetCounts();
108 
109  // protection against missing jet counts collection
110  if (jetCounts == nullptr) {
111  return false;
112  }
113 
115 
116  unsigned int cIndex = objPar.countIndex;
117 
118  if (cIndex >= m_numberL1JetCounts) {
119  edm::LogError("L1GlobalTrigger") << "\nL1GtJetCountsCondition error: countIndex " << cIndex
120  << "greater than maximum allowed count = " << m_numberL1JetCounts
121  << "\n ==> condResult = false " << std::endl;
122  return false;
123  }
124 
125  unsigned int countValue = jetCounts->count(cIndex);
126 
127  // check countThreshold
128  if (!checkThreshold(objPar.countThreshold, countValue, m_gtJetCountsTemplate->condGEq())) {
129  return false;
130  }
131 
132  // index is always zero, as they are global quantities (there is only one
133  // object)
134  int indexObj = 0;
135 
136  objectsInComb.push_back(indexObj);
137  (combinationsInCond()).push_back(objectsInComb);
138 
139  // if we get here all checks were successful for this combination
140  // set the general result for evaluateCondition to "true"
141 
142  condResult = true;
143  return condResult;
144 }

References L1GtConditionEvaluation::checkThreshold(), clear(), L1GtConditionEvaluation::combinationsInCond(), L1GtCondition::condGEq(), L1GctJetCounts::count(), L1GtJetCountsTemplate::ObjectParameter::countIndex, L1GtJetCountsTemplate::ObjectParameter::countThreshold, L1GlobalTriggerPSB::getCandL1JetCounts(), m_gtJetCountsTemplate, m_gtPSB, m_numberL1JetCounts, and L1GtJetCountsTemplate::objectParameter().

◆ gtJetCountsTemplate()

const L1GtJetCountsTemplate* L1GtJetCountsCondition::gtJetCountsTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 60 of file L1GtJetCountsCondition.h.

60 { return m_gtJetCountsTemplate; }

References m_gtJetCountsTemplate.

◆ gtPSB()

const L1GlobalTriggerPSB* L1GtJetCountsCondition::gtPSB ( ) const
inline

get / set the pointer to PSB

Definition at line 65 of file L1GtJetCountsCondition.h.

65 { return m_gtPSB; }

References m_gtPSB.

◆ operator=()

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

Definition at line 76 of file L1GtJetCountsCondition.cc.

76  {
77  copy(cp);
78  return *this;
79 }

References copy().

◆ print()

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

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 146 of file L1GtJetCountsCondition.cc.

146  {
147  m_gtJetCountsTemplate->print(myCout);
149 }

References m_gtJetCountsTemplate, L1GtJetCountsTemplate::print(), and L1GtConditionEvaluation::print().

Referenced by L1GlobalTriggerGTL::run().

◆ setGtJetCountsTemplate()

void L1GtJetCountsCondition::setGtJetCountsTemplate ( const L1GtJetCountsTemplate jcTemplate)

Definition at line 82 of file L1GtJetCountsCondition.cc.

82  {
83  m_gtJetCountsTemplate = jcTemplate;
84 }

References m_gtJetCountsTemplate.

◆ setGtPSB()

void L1GtJetCountsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 87 of file L1GtJetCountsCondition.cc.

87 { m_gtPSB = ptrPSB; }

References m_gtPSB.

Member Data Documentation

◆ m_gtJetCountsTemplate

const L1GtJetCountsTemplate* L1GtJetCountsCondition::m_gtJetCountsTemplate
private

◆ m_gtPSB

const L1GlobalTriggerPSB* L1GtJetCountsCondition::m_gtPSB
private

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

Definition at line 78 of file L1GtJetCountsCondition.h.

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

◆ m_numberL1JetCounts

unsigned int L1GtJetCountsCondition::m_numberL1JetCounts
private

maximum number of jet counts

Definition at line 81 of file L1GtJetCountsCondition.h.

Referenced by evaluateCondition().

L1GtConditionEvaluation::m_verbosity
int m_verbosity
verbosity level
Definition: L1GtConditionEvaluation.h:105
L1GtJetCountsTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: L1GtJetCountsTemplate.cc:77
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
L1GtConditionEvaluation::m_combinationsInCond
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
Definition: L1GtConditionEvaluation.h:102
hgcal_conditions::parameters
Definition: HGCConditions.h:86
L1GtJetCountsTemplate::ObjectParameter::countThreshold
unsigned int countThreshold
Definition: L1GtJetCountsTemplate.h:59
L1GtJetCountsTemplate::ObjectParameter
typedef for a single object template
Definition: L1GtJetCountsTemplate.h:56
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
L1GtJetCountsTemplate::ObjectParameter::countIndex
unsigned int countIndex
Definition: L1GtJetCountsTemplate.h:58
L1GtJetCountsCondition::m_gtPSB
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
Definition: L1GtJetCountsCondition.h:78
SingleCombInCond
std::vector< int > SingleCombInCond
typedefs
Definition: L1GlobalTriggerObjectMapFwd.h:29
L1GtJetCountsCondition::m_numberL1JetCounts
unsigned int m_numberL1JetCounts
maximum number of jet counts
Definition: L1GtJetCountsCondition.h:81
L1GtConditionEvaluation::L1GtConditionEvaluation
L1GtConditionEvaluation()
constructor
Definition: L1GtConditionEvaluation.h:40
clear
void clear(HadCaloObj &c)
Definition: data.h:124
L1GtConditionEvaluation::m_condMaxNumberObjects
int m_condMaxNumberObjects
Definition: L1GtConditionEvaluation.h:96
L1GtJetCountsCondition::m_gtJetCountsTemplate
const L1GtJetCountsTemplate * m_gtJetCountsTemplate
pointer to a L1GtJetCountsTemplate
Definition: L1GtJetCountsCondition.h:75
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
L1GctJetCounts
Definition: L1GctJetCounts.h:16
L1GctJetCounts::count
unsigned count(unsigned i) const
get count by index
Definition: L1GctJetCounts.cc:63
L1GtJetCountsTemplate::objectParameter
const std::vector< ObjectParameter > * objectParameter() const
Definition: L1GtJetCountsTemplate.h:67
L1GtJetCountsCondition::copy
void copy(const L1GtJetCountsCondition &cp)
copy function for copy constructor and operator=
Definition: L1GtJetCountsCondition.cc:55
L1GlobalTriggerPSB::getCandL1JetCounts
const L1GctJetCounts * getCandL1JetCounts() const
pointer to JetCounts data list
Definition: L1GlobalTriggerPSB.h:171