CMS 3D CMS Logo

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

#include <L1GtEnergySumCondition.h>

Inheritance diagram for L1GtEnergySumCondition:
L1GtConditionEvaluation

Public Member Functions

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

Private Attributes

const L1GtEnergySumTemplatem_gtEnergySumTemplate
 pointer to a L1GtEnergySumTemplate 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 CondEnergySum condition.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 33 of file L1GtEnergySumCondition.h.

Constructor & Destructor Documentation

◆ L1GtEnergySumCondition() [1/3]

L1GtEnergySumCondition::L1GtEnergySumCondition ( )

constructors default

Definition at line 40 of file L1GtEnergySumCondition.cc.

41  // empty
42 }

◆ L1GtEnergySumCondition() [2/3]

L1GtEnergySumCondition::L1GtEnergySumCondition ( const L1GtCondition eSumTemplate,
const L1GlobalTriggerPSB ptrPSB 
)

from base template condition (from event setup usually)

Definition at line 45 of file L1GtEnergySumCondition.cc.

47  m_gtEnergySumTemplate(static_cast<const L1GtEnergySumTemplate *>(eSumTemplate)),
48  m_gtPSB(ptrPSB)
49 
50 {
51  // maximum number of objects received for the evaluation of the condition
52  // energy sums are global quantities - one object per event
53 
55 }

References L1GtConditionEvaluation::m_condMaxNumberObjects.

◆ L1GtEnergySumCondition() [3/3]

L1GtEnergySumCondition::L1GtEnergySumCondition ( const L1GtEnergySumCondition cp)

Definition at line 69 of file L1GtEnergySumCondition.cc.

70  copy(cp);
71 }

References copy().

◆ ~L1GtEnergySumCondition()

L1GtEnergySumCondition::~L1GtEnergySumCondition ( )
override

Definition at line 74 of file L1GtEnergySumCondition.cc.

74  {
75  // empty
76 }

Member Function Documentation

◆ copy()

void L1GtEnergySumCondition::copy ( const L1GtEnergySumCondition cp)
private

copy function for copy constructor and operator=

Definition at line 58 of file L1GtEnergySumCondition.cc.

58  {
59  m_gtEnergySumTemplate = cp.gtEnergySumTemplate();
60  m_gtPSB = cp.gtPSB();
61 
62  m_condMaxNumberObjects = cp.condMaxNumberObjects();
63  m_condLastResult = cp.condLastResult();
64  m_combinationsInCond = cp.getCombinationsInCond();
65 
66  m_verbosity = cp.m_verbosity;
67 }

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

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

◆ evaluateCondition()

const bool L1GtEnergySumCondition::evaluateCondition ( ) const
overridevirtual

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 93 of file L1GtEnergySumCondition.cc.

93  {
94  // number of trigger objects in the condition
95  // in fact, there is only one object
96  int iCondition = 0;
97 
98  // condition result condResult set to true if the energy sum
99  // passes all requirements
100  bool condResult = false;
101 
102  // store the indices of the calorimeter objects
103  // from the combination evaluated in the condition
104  SingleCombInCond objectsInComb;
105 
106  // clear the m_combinationsInCond vector
108 
109  // clear the indices in the combination
110  objectsInComb.clear();
111 
112  // get energy, phi (ETM and HTM) and overflow for the trigger object
113 
114  unsigned int candEt = 0;
115  unsigned int candPhi = 0;
116  bool candOverflow = false;
117 
118  switch ((m_gtEnergySumTemplate->objectType())[0]) {
119  case ETT: {
120  const L1GctEtTotal *cand1 = m_gtPSB->getCandL1ETT();
121 
122  if (cand1 == nullptr) {
123  return false;
124  }
125 
126  candEt = cand1->et();
127  candOverflow = cand1->overFlow();
128 
129  break;
130  }
131  case ETM: {
132  const L1GctEtMiss *cand2 = m_gtPSB->getCandL1ETM();
133 
134  if (cand2 == nullptr) {
135  return false;
136  }
137 
138  candEt = cand2->et();
139  candPhi = cand2->phi();
140  candOverflow = cand2->overFlow();
141 
142  break;
143  }
144  case HTT: {
145  const L1GctEtHad *cand3 = m_gtPSB->getCandL1HTT();
146 
147  if (cand3 == nullptr) {
148  return false;
149  }
150 
151  candEt = cand3->et();
152  candOverflow = cand3->overFlow();
153 
154  break;
155  }
156  case HTM: {
157  const L1GctHtMiss *cand4 = m_gtPSB->getCandL1HTM();
158 
159  if (cand4 == nullptr) {
160  return false;
161  }
162 
163  candEt = cand4->et();
164  candPhi = cand4->phi();
165  candOverflow = cand4->overFlow();
166 
167  break;
168  }
169  default: {
170  // should not arrive here
171  return false;
172 
173  break;
174  }
175  }
176 
178 
179  // check energy threshold and overflow
180  // overflow evaluation:
181  // for condGEq >=
182  // candidate overflow true -> condition true
183  // candidate overflow false -> evaluate threshold
184  // for condGEq =
185  // candidate overflow true -> condition false
186  // candidate overflow false -> evaluate threshold
187  //
188 
189  bool condGEqVal = m_gtEnergySumTemplate->condGEq();
190 
191  if (condGEqVal) {
192  if (!candOverflow) {
193  if (!checkThreshold(objPar.etThreshold, candEt, condGEqVal)) {
194  return false;
195  }
196  }
197  } else {
198  if (candOverflow) {
199  return false;
200  } else {
201  if (!checkThreshold(objPar.etThreshold, candEt, condGEqVal)) {
202  return false;
203  }
204  }
205  }
206 
207  // for ETM and HTM check phi also
208  // for overflow, the phi requirements are ignored
209 
210  if (!candOverflow) {
211  if ((m_gtEnergySumTemplate->objectType())[0] == ETM) {
212  // phi bitmask is saved in two uint64_t (see parser)
213  if (candPhi < 64) {
214  if (!checkBit(objPar.phiRange0Word, candPhi)) {
215  return false;
216  }
217  } else {
218  if (!checkBit(objPar.phiRange1Word, candPhi - 64)) {
219  return false;
220  }
221  }
222 
223  } else if ((m_gtEnergySumTemplate->objectType())[0] == HTM) {
224  // phi bitmask is in the first word for HTM
225  if (candPhi < 64) {
226  if (!checkBit(objPar.phiRange0Word, candPhi)) {
227  return false;
228  }
229  } else {
230  if (!checkBit(objPar.phiRange1Word, candPhi - 64)) {
231  return false;
232  }
233  }
234  }
235  }
236 
237  // index is always zero, as they are global quantities (there is only one
238  // object)
239  int indexObj = 0;
240 
241  objectsInComb.push_back(indexObj);
242  (combinationsInCond()).push_back(objectsInComb);
243 
244  // if we get here all checks were successfull for this combination
245  // set the general result for evaluateCondition to "true"
246 
247  condResult = true;
248  return condResult;
249 }

References L1GtConditionEvaluation::checkBit(), L1GtConditionEvaluation::checkThreshold(), clear(), L1GtConditionEvaluation::combinationsInCond(), L1GtCondition::condGEq(), L1GctEtTotal::et(), L1GctEtHad::et(), L1GctEtMiss::et(), L1GctHtMiss::et(), ETM, ETT, L1GtEnergySumTemplate::ObjectParameter::etThreshold, L1GlobalTriggerPSB::getCandL1ETM(), L1GlobalTriggerPSB::getCandL1ETT(), L1GlobalTriggerPSB::getCandL1HTM(), L1GlobalTriggerPSB::getCandL1HTT(), HTM, HTT, m_gtEnergySumTemplate, m_gtPSB, L1GtEnergySumTemplate::objectParameter(), L1GtCondition::objectType(), L1GctEtTotal::overFlow(), L1GctEtHad::overFlow(), L1GctEtMiss::overFlow(), L1GctHtMiss::overFlow(), L1GctEtMiss::phi(), L1GctHtMiss::phi(), L1GtEnergySumTemplate::ObjectParameter::phiRange0Word, and L1GtEnergySumTemplate::ObjectParameter::phiRange1Word.

◆ gtEnergySumTemplate()

const L1GtEnergySumTemplate* L1GtEnergySumCondition::gtEnergySumTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 60 of file L1GtEnergySumCondition.h.

60 { return m_gtEnergySumTemplate; }

References m_gtEnergySumTemplate.

◆ gtPSB()

const L1GlobalTriggerPSB* L1GtEnergySumCondition::gtPSB ( ) const
inline

get / set the pointer to PSB

Definition at line 65 of file L1GtEnergySumCondition.h.

65 { return m_gtPSB; }

References m_gtPSB.

◆ operator=()

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

Definition at line 79 of file L1GtEnergySumCondition.cc.

79  {
80  copy(cp);
81  return *this;
82 }

References copy().

◆ print()

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

◆ setGtEnergySumTemplate()

void L1GtEnergySumCondition::setGtEnergySumTemplate ( const L1GtEnergySumTemplate eSumTempl)

Definition at line 85 of file L1GtEnergySumCondition.cc.

85  {
86  m_gtEnergySumTemplate = eSumTempl;
87 }

References m_gtEnergySumTemplate.

◆ setGtPSB()

void L1GtEnergySumCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 90 of file L1GtEnergySumCondition.cc.

90 { m_gtPSB = ptrPSB; }

References m_gtPSB.

Member Data Documentation

◆ m_gtEnergySumTemplate

const L1GtEnergySumTemplate* L1GtEnergySumCondition::m_gtEnergySumTemplate
private

◆ m_gtPSB

const L1GlobalTriggerPSB* L1GtEnergySumCondition::m_gtPSB
private

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

Definition at line 78 of file L1GtEnergySumCondition.h.

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

L1GctHtMiss
Persistable copy of missing Et measured at Level-1.
Definition: L1GctHtMiss.h:16
HTM
Definition: L1GtObject.h:38
L1GtConditionEvaluation::m_verbosity
int m_verbosity
verbosity level
Definition: L1GtConditionEvaluation.h:105
L1GctEtMiss::et
unsigned et() const
get the magnitude
Definition: L1GctEtMiss.h:56
L1GlobalTriggerPSB::getCandL1HTM
const L1GctHtMiss * getCandL1HTM() const
pointer to HTM data list
Definition: L1GlobalTriggerPSB.h:168
L1GtConditionEvaluation::combinationsInCond
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
Definition: L1GtConditionEvaluation.h:82
ETM
Definition: L1GtObject.h:35
L1GtCondition::condGEq
const bool condGEq() const
get / set condition GEq flag
Definition: L1GtCondition.h:72
L1GtConditionEvaluation::checkBit
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
Definition: L1GtConditionEvaluation.h:149
L1GtConditionEvaluation::print
virtual void print(std::ostream &myCout) const
print condition
Definition: L1GtConditionEvaluation.cc:34
L1GtEnergySumCondition::m_gtEnergySumTemplate
const L1GtEnergySumTemplate * m_gtEnergySumTemplate
pointer to a L1GtEnergySumTemplate
Definition: L1GtEnergySumCondition.h:75
L1GctEtMiss::phi
unsigned phi() const
get the Et
Definition: L1GctEtMiss.h:62
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
L1GtCondition::objectType
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:67
L1GtEnergySumCondition::m_gtPSB
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
Definition: L1GtEnergySumCondition.h:78
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
L1GctEtMiss
Persistable copy of missing Et measured at Level-1.
Definition: L1GctEtMiss.h:17
L1GlobalTriggerPSB::getCandL1HTT
const L1GctEtHad * getCandL1HTT() const
pointer to HTT data list
Definition: L1GlobalTriggerPSB.h:165
HTT
Definition: L1GtObject.h:37
L1GtEnergySumTemplate::ObjectParameter::phiRange0Word
unsigned long long phiRange0Word
Definition: L1GtEnergySumTemplate.h:62
L1GtConditionEvaluation::L1GtConditionEvaluation
L1GtConditionEvaluation()
constructor
Definition: L1GtConditionEvaluation.h:40
L1GctEtTotal
Persistable copy of total Et measured at Level-1.
Definition: L1GctEtTotal.h:17
L1GtEnergySumTemplate::ObjectParameter
typedef for a single object template
Definition: L1GtEnergySumTemplate.h:56
L1GtEnergySumCondition::copy
void copy(const L1GtEnergySumCondition &cp)
copy function for copy constructor and operator=
Definition: L1GtEnergySumCondition.cc:58
clear
void clear(HadCaloObj &c)
Definition: data.h:124
L1GtConditionEvaluation::m_condMaxNumberObjects
int m_condMaxNumberObjects
Definition: L1GtConditionEvaluation.h:96
L1GtEnergySumTemplate::ObjectParameter::phiRange1Word
unsigned long long phiRange1Word
Definition: L1GtEnergySumTemplate.h:63
L1GctEtTotal::overFlow
bool overFlow() const
get the overflow
Definition: L1GctEtTotal.h:46
ETT
Definition: L1GtObject.h:36
L1GctHtMiss::phi
unsigned phi() const
get the Et
Definition: L1GctHtMiss.h:65
L1GctEtHad::overFlow
bool overFlow() const
get the overflow
Definition: L1GctEtHad.h:46
L1GctEtHad
Persistable copy of total Ht measured at Level-1.
Definition: L1GctEtHad.h:17
L1GctEtHad::et
unsigned et() const
get the Et
Definition: L1GctEtHad.h:43
L1GtEnergySumTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: L1GtEnergySumTemplate.cc:75
L1GlobalTriggerPSB::getCandL1ETM
const L1GctEtMiss * getCandL1ETM() const
pointer to ETM data list
Definition: L1GlobalTriggerPSB.h:159
L1GlobalTriggerPSB::getCandL1ETT
const L1GctEtTotal * getCandL1ETT() const
pointer to ETT data list
Definition: L1GlobalTriggerPSB.h:162
L1GctHtMiss::overFlow
bool overFlow() const
get the overflow
Definition: L1GctHtMiss.h:62
L1GctEtMiss::overFlow
bool overFlow() const
get the overflow
Definition: L1GctEtMiss.h:59
L1GtEnergySumTemplate::objectParameter
const std::vector< ObjectParameter > * objectParameter() const
Definition: L1GtEnergySumTemplate.h:74
L1GctHtMiss::et
unsigned et() const
get the magnitude
Definition: L1GctHtMiss.h:59
L1GctEtTotal::et
unsigned et() const
get the Et
Definition: L1GctEtTotal.h:43
L1GtEnergySumTemplate::ObjectParameter::etThreshold
unsigned int etThreshold
Definition: L1GtEnergySumTemplate.h:57