CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 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
 print condition More...
 
void setGtJetCountsTemplate (const L1GtJetCountsTemplate *)
 
void setGtPSB (const L1GlobalTriggerPSB *)
 set the pointer to PSB More...
 
virtual ~L1GtJetCountsCondition ()
 
- 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 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

$Date$ $Revision$

Definition at line 35 of file L1GtJetCountsCondition.h.

Constructor & Destructor Documentation

L1GtJetCountsCondition::L1GtJetCountsCondition ( )

constructors default

Definition at line 39 of file L1GtJetCountsCondition.cc.

39  :
41 
42  //empty
43 
44 }
L1GtJetCountsCondition::L1GtJetCountsCondition ( const L1GtCondition jcTemplate,
const L1GlobalTriggerPSB ptrPSB,
const int  nrL1JetCounts 
)

from base template condition (from event setup usually)

Definition at line 47 of file L1GtJetCountsCondition.cc.

References L1GtConditionEvaluation::m_condMaxNumberObjects.

48  :
50  m_gtJetCountsTemplate(static_cast<const L1GtJetCountsTemplate*>(jcTemplate)),
51  m_gtPSB(ptrPSB),
52  m_numberL1JetCounts(nrL1JetCounts)
53 {
54 
55  // maximum number of objects received for the evaluation of the condition
56  // no objects, in fact, just a number
58 
59 }
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
unsigned int m_numberL1JetCounts
maximum number of jet counts
const L1GtJetCountsTemplate * m_gtJetCountsTemplate
pointer to a L1GtJetCountsTemplate
L1GtJetCountsCondition::L1GtJetCountsCondition ( const L1GtJetCountsCondition cp)

Definition at line 75 of file L1GtJetCountsCondition.cc.

References copy().

75  :
77 
78  copy(cp);
79 
80 }
void copy(const L1GtJetCountsCondition &cp)
copy function for copy constructor and operator=
L1GtJetCountsCondition::~L1GtJetCountsCondition ( )
virtual

Definition at line 83 of file L1GtJetCountsCondition.cc.

83  {
84 
85  // empty
86 
87 }

Member Function Documentation

void L1GtJetCountsCondition::copy ( const L1GtJetCountsCondition cp)
private

copy function for copy constructor and operator=

Definition at line 62 of file L1GtJetCountsCondition.cc.

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

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

62  {
63 
65  m_gtPSB = cp.gtPSB();
66 
70 
72 
73 }
bool m_condLastResult
the last result of evaluateCondition()
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
const L1GtJetCountsTemplate * gtJetCountsTemplate() const
get / set the pointer to a L1GtCondition
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
const L1GtJetCountsTemplate * m_gtJetCountsTemplate
pointer to a L1GtJetCountsTemplate
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 L1GtJetCountsCondition::evaluateCondition ( ) const
virtual

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 111 of file L1GtJetCountsCondition.cc.

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

111  {
112 
113  // number of trigger objects in the condition
114  // in fact, there is only one object
115  int iCondition = 0;
116 
117  // condition result condResult will be set to true if the jet counts
118  // passes the requirement
119  bool condResult = false;
120 
121  // store the index of the JetCount object
122  // from the combination evaluated in the condition
123  SingleCombInCond objectsInComb;
124 
125  // clear the m_combinationsInCond vector
127 
128  // get the jet counts (event / condition)
129  const L1GctJetCounts* jetCounts = m_gtPSB->getCandL1JetCounts();
130 
131  // protection against missing jet counts collection
132  if (jetCounts == 0) {
133  return false;
134  }
135 
137  ( *(m_gtJetCountsTemplate->objectParameter()) )[iCondition];
138 
139  unsigned int cIndex = objPar.countIndex;
140 
141  if (cIndex >= m_numberL1JetCounts) {
142 
143  edm::LogError("L1GlobalTrigger") << "\nL1GtJetCountsCondition error: countIndex "
144  << cIndex << "greater than maximum allowed count = " << m_numberL1JetCounts
145  << "\n ==> condResult = false " << std::endl;
146  return false;
147 
148  }
149 
150  unsigned int countValue = jetCounts->count(cIndex);
151 
152  // check countThreshold
153  if ( !checkThreshold(objPar.countThreshold, countValue, m_gtJetCountsTemplate->condGEq()) ) {
154 
155  return false;
156  }
157 
158  // index is always zero, as they are global quantities (there is only one object)
159  int indexObj = 0;
160 
161  objectsInComb.push_back(indexObj);
162  (combinationsInCond()).push_back(objectsInComb);
163 
164  // if we get here all checks were successful for this combination
165  // set the general result for evaluateCondition to "true"
166 
167  condResult = true;
168  return condResult;
169 
170 }
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
std::vector< int > SingleCombInCond
typedefs
typedef for a single object template
const std::vector< ObjectParameter > * objectParameter() const
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:168
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
unsigned int m_numberL1JetCounts
maximum number of jet counts
unsigned count(unsigned i) const
get count by index
const L1GtJetCountsTemplate * m_gtJetCountsTemplate
pointer to a L1GtJetCountsTemplate
const bool condGEq() const
get / set condition GEq flag
Definition: L1GtCondition.h:99
const L1GctJetCounts * getCandL1JetCounts() const
pointer to JetCounts data list
const L1GtJetCountsTemplate* L1GtJetCountsCondition::gtJetCountsTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 67 of file L1GtJetCountsCondition.h.

References m_gtJetCountsTemplate.

Referenced by copy().

67  {
68  return m_gtJetCountsTemplate;
69  }
const L1GtJetCountsTemplate * m_gtJetCountsTemplate
pointer to a L1GtJetCountsTemplate
const L1GlobalTriggerPSB* L1GtJetCountsCondition::gtPSB ( ) const
inline

get / set the pointer to PSB

Definition at line 74 of file L1GtJetCountsCondition.h.

References m_gtPSB.

Referenced by copy().

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

Definition at line 90 of file L1GtJetCountsCondition.cc.

References copy().

91 {
92  copy(cp);
93  return *this;
94 }
void copy(const L1GtJetCountsCondition &cp)
copy function for copy constructor and operator=
void L1GtJetCountsCondition::print ( std::ostream &  myCout) const
virtual

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 172 of file L1GtJetCountsCondition.cc.

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

Referenced by L1GlobalTriggerGTL::run().

172  {
173 
174  m_gtJetCountsTemplate->print(myCout);
176 
177 }
virtual void print(std::ostream &myCout) const
print the condition
const L1GtJetCountsTemplate * m_gtJetCountsTemplate
pointer to a L1GtJetCountsTemplate
virtual void print(std::ostream &myCout) const
print condition
void L1GtJetCountsCondition::setGtJetCountsTemplate ( const L1GtJetCountsTemplate jcTemplate)

Definition at line 97 of file L1GtJetCountsCondition.cc.

References m_gtJetCountsTemplate.

97  {
98 
99  m_gtJetCountsTemplate = jcTemplate;
100 
101 }
const L1GtJetCountsTemplate * m_gtJetCountsTemplate
pointer to a L1GtJetCountsTemplate
void L1GtJetCountsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 104 of file L1GtJetCountsCondition.cc.

References m_gtPSB.

104  {
105 
106  m_gtPSB = ptrPSB;
107 
108 }
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects

Member Data Documentation

const L1GtJetCountsTemplate* L1GtJetCountsCondition::m_gtJetCountsTemplate
private
const L1GlobalTriggerPSB* L1GtJetCountsCondition::m_gtPSB
private

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

Definition at line 91 of file L1GtJetCountsCondition.h.

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

unsigned int L1GtJetCountsCondition::m_numberL1JetCounts
private

maximum number of jet counts

Definition at line 94 of file L1GtJetCountsCondition.h.

Referenced by evaluateCondition().