CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
l1t::EnergySumCondition Class Reference

#include <EnergySumCondition.h>

Inheritance diagram for l1t::EnergySumCondition:
l1t::ConditionEvaluation

Public Member Functions

 EnergySumCondition ()
 
 EnergySumCondition (const GlobalCondition *, const GlobalBoard *)
 from base template condition (from event setup usually) More...
 
 EnergySumCondition (const EnergySumCondition &)
 
const bool evaluateCondition (const int bxEval) const override
 the core function to check if the condition matches More...
 
const GlobalBoardgetuGtB () const
 get / set the pointer to uGt GlobalBoard More...
 
const EnergySumTemplategtEnergySumTemplate () const
 get / set the pointer to a L1GtCondition More...
 
EnergySumConditionoperator= (const EnergySumCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtEnergySumTemplate (const EnergySumTemplate *)
 
void setuGtB (const GlobalBoard *)
 set the pointer to uGT GlobalBoard More...
 
 ~EnergySumCondition () override
 
- Public Member Functions inherited from l1t::ConditionEvaluation
 ConditionEvaluation ()
 constructor More...
 
bool condLastResult () const
 get the latest result for the condition More...
 
int condMaxNumberObjects () const
 
void evaluateConditionStoreResult (const int bxEval)
 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...
 
void setCondMaxNumberObjects (int condMaxNumberObjectsValue)
 
void setVerbosity (const int verbosity)
 
virtual ~ConditionEvaluation ()
 destructor More...
 

Private Member Functions

void copy (const EnergySumCondition &cp)
 copy function for copy constructor and operator= More...
 

Private Attributes

const EnergySumTemplatem_gtEnergySumTemplate
 pointer to a EnergySumTemplate More...
 
const GlobalBoardm_uGtB
 pointer to uGt GlobalBoard, to be able to get the trigger objects More...
 

Additional Inherited Members

- Protected Member Functions inherited from l1t::ConditionEvaluation
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 checkCut (const Type1 &cutL, const Type2 &value, bool condGEqValue) const
 
template<class Type1 >
const bool checkIndex (const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
 check if a index is in a given range More...
 
template<class Type1 >
const bool checkRangeDeltaEta (const unsigned int obj1Eta, const unsigned int obj2Eta, const Type1 &lowerR, const Type1 &upperR, const unsigned int nEtaBits) const
 check if a value is in a given deltaEta range More...
 
template<class Type1 >
const bool checkRangeDeltaPhi (const unsigned int obj1Phi, const unsigned int obj2Phi, const Type1 &lowerR, const Type1 &upperR) const
 check if a value is in a given deltaPhi range More...
 
template<class Type1 >
const bool checkRangeEta (const unsigned int bitNumber, const std::vector< Type1 > &windows, const unsigned int nEtaBits) const
 
template<class Type1 >
const bool checkRangePhi (const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR) const
 check if a value is in a given phi range and outside of a veto range More...
 
template<class Type1 >
const bool checkRangeTfMuonIndex (const unsigned int bitNumber, const std::vector< Type1 > &windows) const
 check if a value is in a given muon track finder index range More...
 
template<class Type1 , class Type2 >
const bool checkThreshold (const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
 
template<class Type1 , class Type2 >
const bool checkUnconstrainedPt (const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
 
CombinationsInCondcombinationsInCond () const
 get all the object combinations (to fill it...) More...
 
- Protected Attributes inherited from l1t::ConditionEvaluation
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

Definition at line 37 of file EnergySumCondition.h.

Constructor & Destructor Documentation

◆ EnergySumCondition() [1/3]

EnergySumCondition::EnergySumCondition ( )

constructors default

Definition at line 36 of file EnergySumCondition.cc.

37  //empty
38 }

◆ EnergySumCondition() [2/3]

EnergySumCondition::EnergySumCondition ( const GlobalCondition eSumTemplate,
const GlobalBoard ptrGTB 
)

from base template condition (from event setup usually)

Definition at line 41 of file EnergySumCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

43  m_gtEnergySumTemplate(static_cast<const EnergySumTemplate*>(eSumTemplate)),
44  m_uGtB(ptrGTB)
45 
46 {
47  // maximum number of objects received for the evaluation of the condition
48  // energy sums are global quantities - one object per event
49 
51 }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
const EnergySumTemplate * m_gtEnergySumTemplate
pointer to a EnergySumTemplate

◆ EnergySumCondition() [3/3]

EnergySumCondition::EnergySumCondition ( const EnergySumCondition cp)

Definition at line 65 of file EnergySumCondition.cc.

References copy().

65 : ConditionEvaluation() { copy(cp); }
void copy(const EnergySumCondition &cp)
copy function for copy constructor and operator=

◆ ~EnergySumCondition()

EnergySumCondition::~EnergySumCondition ( )
override

Definition at line 68 of file EnergySumCondition.cc.

68  {
69  // empty
70 }

Member Function Documentation

◆ copy()

void EnergySumCondition::copy ( const EnergySumCondition cp)
private

copy function for copy constructor and operator=

Definition at line 54 of file EnergySumCondition.cc.

Referenced by EnergySumCondition().

54  {
55  m_gtEnergySumTemplate = cp.gtEnergySumTemplate();
56  m_uGtB = cp.getuGtB();
57 
58  m_condMaxNumberObjects = cp.condMaxNumberObjects();
59  m_condLastResult = cp.condLastResult();
60  m_combinationsInCond = cp.getCombinationsInCond();
61 
62  m_verbosity = cp.m_verbosity;
63 }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
const EnergySumTemplate * m_gtEnergySumTemplate
pointer to a EnergySumTemplate
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
int m_verbosity
verbosity level
bool m_condLastResult
the last result of evaluateCondition()

◆ evaluateCondition()

const bool EnergySumCondition::evaluateCondition ( const int  bxEval) const
overridevirtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 87 of file EnergySumCondition.cc.

References BXVector< T >::at(), l1ct::clear(), EnergySumTemplate::ObjectParameter::etHighThreshold, EnergySumTemplate::ObjectParameter::etLowThreshold, BXVector< T >::getLastBX(), l1t::gtAsymmetryEt, l1t::gtAsymmetryEtHF, l1t::gtAsymmetryHt, l1t::gtAsymmetryHtHF, l1t::gtCentrality0, l1t::gtCentrality1, l1t::gtCentrality2, l1t::gtCentrality3, l1t::gtCentrality4, l1t::gtCentrality5, l1t::gtCentrality6, l1t::gtCentrality7, l1t::gtETM, l1t::gtETMHF, l1t::gtETT, l1t::gtETTem, l1t::gtHTM, l1t::gtHTMHF, l1t::gtHTT, l1t::gtMinBiasHFM0, l1t::gtMinBiasHFM1, l1t::gtMinBiasHFP0, l1t::gtMinBiasHFP1, l1t::gtTowerCount, l1t::gtZDCM, l1t::gtZDCP, L1Analysis::kAsymEt, L1Analysis::kAsymEtHF, L1Analysis::kAsymHt, L1Analysis::kAsymHtHF, L1Analysis::kCentrality, L1Analysis::kMinBiasHFM0, L1Analysis::kMinBiasHFM1, L1Analysis::kMinBiasHFP0, L1Analysis::kMinBiasHFP1, L1Analysis::kMissingEt, L1Analysis::kMissingEtHF, L1Analysis::kMissingHt, L1Analysis::kMissingHtHF, L1Analysis::kTotalEt, L1Analysis::kTotalEtEm, L1Analysis::kTotalHt, L1Analysis::kTowerCount, L1Analysis::kZDCM, L1Analysis::kZDCP, LogDebug, EnergySumTemplate::ObjectParameter::phiWindow1Lower, EnergySumTemplate::ObjectParameter::phiWindow1Upper, EnergySumTemplate::ObjectParameter::phiWindow2Lower, EnergySumTemplate::ObjectParameter::phiWindow2Upper, push_back(), and BXVector< T >::size().

87  {
88  // number of trigger objects in the condition
89  // in fact, there is only one object
90  int iCondition = 0;
91 
92  // condition result condResult set to true if the energy sum
93  // passes all requirements
94  bool condResult = false;
95 
96  // store the indices of the calorimeter objects
97  // from the combination evaluated in the condition
98  SingleCombInCond objectsInComb;
99 
100  // clear the m_combinationsInCond vector
102 
103  // clear the indices in the combination
104  objectsInComb.clear();
105 
107 
108  // Look at objects in bx = bx + relativeBx
109  int useBx = bxEval + m_gtEnergySumTemplate->condRelativeBx();
110 
111  // Fail condition if attempting to get Bx outside of range
112  if ((useBx < candVec->getFirstBX()) || (useBx > candVec->getLastBX())) {
113  return false;
114  }
115 
116  // If no candidates, no use looking any further.
117  int numberObjects = candVec->size(useBx);
118  if (numberObjects < 1) {
119  return false;
120  }
121 
123  bool MissingEnergy = false;
124  int centbit = 0;
125  switch ((m_gtEnergySumTemplate->objectType())[0]) {
126  case gtETM:
128  MissingEnergy = true;
129  break;
130  case gtETT:
132  MissingEnergy = false;
133  break;
134  case gtETTem:
136  MissingEnergy = false;
137  break;
138  case gtHTM:
140  MissingEnergy = true;
141  break;
142  case gtHTT:
144  MissingEnergy = false;
145  break;
146  case gtETMHF:
148  MissingEnergy = true;
149  break;
150  case gtHTMHF:
152  MissingEnergy = true;
153  break;
154  case gtTowerCount:
156  MissingEnergy = false;
157  break;
158  case gtMinBiasHFP0:
160  MissingEnergy = false;
161  break;
162  case gtMinBiasHFM0:
164  MissingEnergy = false;
165  break;
166  case gtMinBiasHFP1:
168  MissingEnergy = false;
169  break;
170  case gtMinBiasHFM1:
172  MissingEnergy = false;
173  break;
174  case gtAsymmetryEt:
176  MissingEnergy = false;
177  break;
178  case gtAsymmetryHt:
180  MissingEnergy = false;
181  break;
182  case gtAsymmetryEtHF:
184  MissingEnergy = false;
185  break;
186  case gtAsymmetryHtHF:
188  MissingEnergy = false;
189  break;
190  case gtCentrality0:
191  centbit = 0;
193  MissingEnergy = false;
194  break;
195  case gtCentrality1:
196  centbit = 1;
198  MissingEnergy = false;
199  break;
200  case gtCentrality2:
201  centbit = 2;
203  MissingEnergy = false;
204  break;
205  case gtCentrality3:
206  centbit = 3;
208  MissingEnergy = false;
209  break;
210  case gtCentrality4:
211  centbit = 4;
213  MissingEnergy = false;
214  break;
215  case gtCentrality5:
216  centbit = 5;
218  MissingEnergy = false;
219  break;
220  case gtCentrality6:
221  centbit = 6;
223  MissingEnergy = false;
224  break;
225  case gtCentrality7:
226  centbit = 7;
228  MissingEnergy = false;
229  break;
230  case gtZDCP:
232  MissingEnergy = false;
233  break;
234  case gtZDCM:
236  MissingEnergy = false;
237  break;
238  default:
239  edm::LogError("L1TGlobal")
240  << "\n Error: "
241  << "Unmatched object type from template to EtSumType, (m_gtEnergySumTemplate->objectType())[0] = "
242  << (m_gtEnergySumTemplate->objectType())[0] << std::endl;
244  break;
245  }
246 
247  // get energy, phi (ETM and HTM) and overflow for the trigger object
248  unsigned int candEt = 0;
249  unsigned int candPhi = 0;
250  bool candOverflow = false;
251  for (int iEtSum = 0; iEtSum < numberObjects; ++iEtSum) {
252  l1t::EtSum cand = *(candVec->at(useBx, iEtSum));
253  if (cand.getType() != type)
254  continue;
255  candEt = cand.hwPt();
256  candPhi = cand.hwPhi();
257  }
258 
260 
261  // check energy threshold and overflow
262  // overflow evaluation:
263  // for condGEq >=
264  // candidate overflow true -> condition true
265  // candidate overflow false -> evaluate threshold
266  // for condGEq =
267  // candidate overflow true -> condition false
268  // candidate overflow false -> evaluate threshold
269  //
270 
271  bool condGEqVal = m_gtEnergySumTemplate->condGEq();
272 
274  bool myres = checkBit(candEt, centbit);
275  //std::cout << "CCLC: Checking bit " << centbit << "\tResult is: " << myres << std::endl;
276  if (!myres) {
277  LogDebug("L1TGlobal") << "\t\t l1t::EtSum failed Centrality bit" << std::endl;
278  return false;
279  }
281  return false;
282  } else {
283  // check energy threshold
284  if (!checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, candEt, condGEqVal)) {
285  LogDebug("L1TGlobal") << "\t\t l1t::EtSum failed checkThreshold" << std::endl;
286  return false;
287  }
288 
289  if (!condGEqVal && candOverflow)
290  return false;
291 
292  // for ETM and HTM check phi also
293  // for overflow, the phi requirements are ignored
294  if (MissingEnergy) {
295  // check phi
296  if (!checkRangePhi(
297  candPhi, objPar.phiWindow1Lower, objPar.phiWindow1Upper, objPar.phiWindow2Lower, objPar.phiWindow2Upper)) {
298  LogDebug("L1TGlobal") << "\t\t l1t::EtSum failed checkRange(phi)" << std::endl;
299  return false;
300  }
301  }
302  }
303 
304  // index is always zero, as they are global quantities (there is only one object)
305  int indexObj = 0;
306 
307  objectsInComb.push_back(indexObj);
308  (combinationsInCond()).push_back(objectsInComb);
309 
310  // if we get here all checks were successfull for this combination
311  // set the general result for evaluateCondition to "true"
312 
313  condResult = true;
314  return condResult;
315 }
int getLastBX() const
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
const bool checkRangePhi(const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR) const
check if a value is in a given phi range and outside of a veto range
std::vector< int > SingleCombInCond
typedefs
Log< level::Error, false > LogError
const bool checkThreshold(const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
unsigned size(int bx) const
const EnergySumTemplate * m_gtEnergySumTemplate
pointer to a EnergySumTemplate
const bool condGEq() const
get / set condition GEq flag
const std::vector< l1t::GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
typedef for a single object template
const std::vector< ObjectParameter > * objectParameter() const
const T & at(int bx, unsigned i) const
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
const BXVector< const l1t::EtSum * > * getCandL1EtSum() const
pointer to EtSum data list
Definition: GlobalBoard.h:174
const int & condRelativeBx() const
get / set the condition relative bx
void clear(EGIsoObj &c)
Definition: egamma.h:82
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
EtSumType
Definition: EtSum.h:27
#define LogDebug(id)

◆ getuGtB()

const GlobalBoard* l1t::EnergySumCondition::getuGtB ( ) const
inline

get / set the pointer to uGt GlobalBoard

Definition at line 69 of file EnergySumCondition.h.

References m_uGtB.

69 { return m_uGtB; }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

◆ gtEnergySumTemplate()

const EnergySumTemplate* l1t::EnergySumCondition::gtEnergySumTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 64 of file EnergySumCondition.h.

References m_gtEnergySumTemplate.

64 { return m_gtEnergySumTemplate; }
const EnergySumTemplate * m_gtEnergySumTemplate
pointer to a EnergySumTemplate

◆ operator=()

l1t::EnergySumCondition & EnergySumCondition::operator= ( const EnergySumCondition cp)

Definition at line 73 of file EnergySumCondition.cc.

References filterCSVwithJSON::copy.

73  {
74  copy(cp);
75  return *this;
76 }
void copy(const EnergySumCondition &cp)
copy function for copy constructor and operator=

◆ print()

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

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 317 of file EnergySumCondition.cc.

References l1t::ConditionEvaluation::print().

Referenced by l1t::CorrCondition::evaluateCondition(), l1t::CorrWithOverlapRemovalCondition::evaluateCondition(), and l1t::GlobalBoard::runGTL().

317  {
318  m_gtEnergySumTemplate->print(myCout);
320 }
const EnergySumTemplate * m_gtEnergySumTemplate
pointer to a EnergySumTemplate
virtual void print(std::ostream &myCout) const
print condition
void print(std::ostream &myCout) const override
print the condition

◆ setGtEnergySumTemplate()

void EnergySumCondition::setGtEnergySumTemplate ( const EnergySumTemplate eSumTempl)

Definition at line 79 of file EnergySumCondition.cc.

79  {
80  m_gtEnergySumTemplate = eSumTempl;
81 }
const EnergySumTemplate * m_gtEnergySumTemplate
pointer to a EnergySumTemplate

◆ setuGtB()

void EnergySumCondition::setuGtB ( const GlobalBoard ptrGTB)

set the pointer to uGT GlobalBoard

Definition at line 84 of file EnergySumCondition.cc.

84 { m_uGtB = ptrGTB; }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

Member Data Documentation

◆ m_gtEnergySumTemplate

const EnergySumTemplate* l1t::EnergySumCondition::m_gtEnergySumTemplate
private

pointer to a EnergySumTemplate

Definition at line 79 of file EnergySumCondition.h.

Referenced by gtEnergySumTemplate().

◆ m_uGtB

const GlobalBoard* l1t::EnergySumCondition::m_uGtB
private

pointer to uGt GlobalBoard, to be able to get the trigger objects

Definition at line 82 of file EnergySumCondition.h.

Referenced by getuGtB().