CMS 3D CMS Logo

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

#include <L1GtHfRingEtSumsCondition.h>

Inheritance diagram for L1GtHfRingEtSumsCondition:
L1GtConditionEvaluation

Public Member Functions

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

Private Attributes

const L1GtHfRingEtSumsTemplatem_gtHfRingEtSumsTemplate
 pointer to a L1GtHfRingEtSumsTemplate 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 CondHfRingEtSums condition.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 32 of file L1GtHfRingEtSumsCondition.h.

Constructor & Destructor Documentation

L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition ( )

constructors default

Definition at line 37 of file L1GtHfRingEtSumsCondition.cc.

37  :
39 
40  //empty
41 
42 }
L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition ( const L1GtCondition etTemplate,
const L1GlobalTriggerPSB ptrPSB 
)

from base template condition (from event setup usually)

Definition at line 45 of file L1GtHfRingEtSumsCondition.cc.

References L1GtConditionEvaluation::m_condMaxNumberObjects.

46  :
48  static_cast<const L1GtHfRingEtSumsTemplate*> (etTemplate)), m_gtPSB(
49  ptrPSB)
50 {
51 
52  // maximum number of objects received for the evaluation of the condition
53  // no objects, in fact, just a number
55 
56 }
const L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition ( const L1GtHfRingEtSumsCondition cp)

Definition at line 72 of file L1GtHfRingEtSumsCondition.cc.

References copy().

72  :
74 
75  copy(cp);
76 
77 }
void copy(const L1GtHfRingEtSumsCondition &cp)
copy function for copy constructor and operator=
L1GtHfRingEtSumsCondition::~L1GtHfRingEtSumsCondition ( )
override

Definition at line 80 of file L1GtHfRingEtSumsCondition.cc.

80  {
81 
82  // empty
83 
84 }

Member Function Documentation

void L1GtHfRingEtSumsCondition::copy ( const L1GtHfRingEtSumsCondition cp)
private

copy function for copy constructor and operator=

Definition at line 59 of file L1GtHfRingEtSumsCondition.cc.

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

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

59  {
60 
62  m_gtPSB = cp.gtPSB();
63 
67 
69 
70 }
bool m_condLastResult
the last result of evaluateCondition()
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
const L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
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
const L1GtHfRingEtSumsTemplate * gtHfRingEtSumsTemplate() const
get / set the pointer to a L1GtCondition
bool condLastResult() const
get the latest result for the condition
const bool L1GtHfRingEtSumsCondition::evaluateCondition ( ) const
overridevirtual

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 108 of file L1GtHfRingEtSumsCondition.cc.

References L1GtConditionEvaluation::checkThreshold(), hitfit::clear(), L1GtConditionEvaluation::combinationsInCond(), L1GtCondition::condGEq(), L1GctHFRingEtSums::etSum(), L1GtHfRingEtSumsTemplate::ObjectParameter::etSumIndex, L1GtHfRingEtSumsTemplate::ObjectParameter::etSumThreshold, L1GlobalTriggerPSB::getCandL1HfRingEtSums(), m_gtHfRingEtSumsTemplate, m_gtPSB, and L1GtHfRingEtSumsTemplate::objectParameter().

108  {
109 
110  // number of trigger objects in the condition
111  // no objects, in fact, just a number
112  int iCondition = 0;
113 
114  // condition result condResult will be set to true if the HF Ring Et sums
115  // passes the requirement
116  bool condResult = false;
117 
118  // store the index of the HfRingEtSums object
119  // from the combination evaluated in the condition
120  SingleCombInCond objectsInComb;
121 
122  // clear the m_combinationsInCond vector
124 
125  // get the HF Ring Et sums (event / condition)
126  const L1GctHFRingEtSums* etSumCand = m_gtPSB->getCandL1HfRingEtSums();
127 
128  // protection against missing HF Ring Et sums collection
129  if (etSumCand == nullptr) {
130  return false;
131  }
132 
134  ( *(m_gtHfRingEtSumsTemplate->objectParameter()) )[iCondition];
135 
136  // FIXME ask GCT to provide a method to retrieve it
137  const unsigned int numberL1HfRingEtSums = 4;
138 
139  const unsigned int cIndex = objPar.etSumIndex;
140  if (cIndex >= numberL1HfRingEtSums) {
141 
142  edm::LogError("L1GlobalTrigger") << "\nL1GtHfRingEtSumsCondition error: etSumIndex "
143  << cIndex << "greater than GCT maximum index = " << numberL1HfRingEtSums
144  << "\n ==> condResult = false " << std::endl;
145  return false;
146 
147  }
148 
149  const unsigned int etSumValue = etSumCand->etSum(cIndex);
150 
151  // check countThreshold
152  if ( !checkThreshold(objPar.etSumThreshold, etSumValue, m_gtHfRingEtSumsTemplate->condGEq()) ) {
153 
154  return false;
155  }
156 
157  // index is always zero - the object is in fact a count
158  int indexObj = 0;
159 
160  objectsInComb.push_back(indexObj);
161  (combinationsInCond()).push_back(objectsInComb);
162 
163  // if we get here all checks were successful for this combination
164  // set the general result for evaluateCondition to "true"
165 
166  condResult = true;
167  return condResult;
168 
169 }
typedef for a single object template
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const L1GctHFRingEtSums * getCandL1HfRingEtSums() const
pointer to HfRingEtSums data list
std::vector< int > SingleCombInCond
typedefs
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 L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
L1 GCT HF ring Et sums.
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
uint16_t etSum(unsigned const i) const
const bool condGEq() const
get / set condition GEq flag
const std::vector< ObjectParameter > * objectParameter() const
const L1GtHfRingEtSumsTemplate* L1GtHfRingEtSumsCondition::gtHfRingEtSumsTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 64 of file L1GtHfRingEtSumsCondition.h.

References m_gtHfRingEtSumsTemplate, and setGtHfRingEtSumsTemplate().

Referenced by copy().

64  {
66  }
const L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
const L1GlobalTriggerPSB* L1GtHfRingEtSumsCondition::gtPSB ( ) const
inline

get / set the pointer to PSB

Definition at line 71 of file L1GtHfRingEtSumsCondition.h.

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

Referenced by copy().

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

Definition at line 87 of file L1GtHfRingEtSumsCondition.cc.

References copy().

88 {
89  copy(cp);
90  return *this;
91 }
void copy(const L1GtHfRingEtSumsCondition &cp)
copy function for copy constructor and operator=
void L1GtHfRingEtSumsCondition::print ( std::ostream &  myCout) const
overridevirtual

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 171 of file L1GtHfRingEtSumsCondition.cc.

References m_gtHfRingEtSumsTemplate, L1GtHfRingEtSumsTemplate::print(), and L1GtConditionEvaluation::print().

Referenced by L1GlobalTriggerGTL::run().

171  {
172 
175 
176 }
void print(std::ostream &myCout) const override
print the condition
const L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
virtual void print(std::ostream &myCout) const
print condition
void L1GtHfRingEtSumsCondition::setGtHfRingEtSumsTemplate ( const L1GtHfRingEtSumsTemplate etTemplate)

Definition at line 94 of file L1GtHfRingEtSumsCondition.cc.

References m_gtHfRingEtSumsTemplate.

Referenced by gtHfRingEtSumsTemplate().

94  {
95 
96  m_gtHfRingEtSumsTemplate = etTemplate;
97 
98 }
const L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
void L1GtHfRingEtSumsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 101 of file L1GtHfRingEtSumsCondition.cc.

References m_gtPSB.

Referenced by gtPSB().

101  {
102 
103  m_gtPSB = ptrPSB;
104 
105 }
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects

Member Data Documentation

const L1GtHfRingEtSumsTemplate* L1GtHfRingEtSumsCondition::m_gtHfRingEtSumsTemplate
private
const L1GlobalTriggerPSB* L1GtHfRingEtSumsCondition::m_gtPSB
private

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

Definition at line 88 of file L1GtHfRingEtSumsCondition.h.

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