CMS 3D CMS Logo

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

#include <CaloCondition.h>

Inheritance diagram for l1t::CaloCondition:
l1t::ConditionEvaluation

Public Member Functions

 CaloCondition ()
 
 CaloCondition (const GlobalCondition *, const GlobalBoard *, const int nrL1EG, const int nrL1Jet, const int nrL1Tau, const int ifCaloEtaNumberBits)
 from base template condition (from event setup usually) More...
 
 CaloCondition (const CaloCondition &)
 
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 CaloTemplategtCaloTemplate () const
 get / set the pointer to a Condition More...
 
const int gtCorrParDeltaPhiNrBins () const
 get / set maximum number of bins for the delta phi scales More...
 
const int gtIfCaloEtaNumberBits () const
 get / set the number of bits for eta of calorimeter objects More...
 
CaloConditionoperator= (const CaloCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtCaloTemplate (const CaloTemplate *)
 
void setGtCorrParDeltaPhiNrBins (const int &)
 
void setGtIfCaloEtaNumberBits (const int &)
 
void setuGtB (const GlobalBoard *)
 set the pointer to uGT GlobalBoard More...
 
 ~CaloCondition () 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

const bool checkObjectParameter (const int iCondition, const l1t::L1Candidate &cand, const unsigned int index) const
 function to check a single object if it matches a condition More...
 
void copy (const CaloCondition &cp)
 copy function for copy constructor and operator= More...
 
const l1t::L1CandidategetCandidate (const int bx, const int indexCand) const
 load calo candidates More...
 

Private Attributes

unsigned int m_corrParDeltaPhiNrBins
 
const CaloTemplatem_gtCaloTemplate
 pointer to a CaloTemplate More...
 
int m_ifCaloEtaNumberBits
 number of bits for eta of calorimeter objects 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 >
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 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 range More...
 
template<class Type1 >
const bool checkRangeEta (const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR, const unsigned int nEtaBits) const
 check if a value is in a given range and outside of a veto range More...
 
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 range and outside of a veto 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 38 of file CaloCondition.h.

Constructor & Destructor Documentation

◆ CaloCondition() [1/3]

CaloCondition::CaloCondition ( )

constructors default

Definition at line 39 of file CaloCondition.cc.

References m_corrParDeltaPhiNrBins, and m_ifCaloEtaNumberBits.

42 }
unsigned int m_corrParDeltaPhiNrBins
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects

◆ CaloCondition() [2/3]

CaloCondition::CaloCondition ( const GlobalCondition caloTemplate,
const GlobalBoard ptrGTB,
const int  nrL1EG,
const int  nrL1Jet,
const int  nrL1Tau,
const int  ifCaloEtaNumberBits 
)

from base template condition (from event setup usually)

Definition at line 45 of file CaloCondition.cc.

References l1t::gtEG, l1t::gtJet, l1t::gtTau, l1t::ConditionEvaluation::m_condMaxNumberObjects, m_corrParDeltaPhiNrBins, m_gtCaloTemplate, and GlobalCondition::objectType().

52  m_gtCaloTemplate(static_cast<const CaloTemplate*>(caloTemplate)),
53  m_uGtB(ptrGTB),
54  m_ifCaloEtaNumberBits(ifCaloEtaNumberBits) {
56 
57  // maximum number of objects received for the evaluation of the condition
58  // retrieved before from event setup
59  // for a CondCalo, all objects ar of same type, hence it is enough to get the
60  // type for the first object
61 
62  switch ((m_gtCaloTemplate->objectType())[0]) {
63  case gtEG:
64  m_condMaxNumberObjects = nrL1EG;
65  break;
66 
67  case gtJet:
68  m_condMaxNumberObjects = nrL1Jet;
69  break;
70 
71  case gtTau:
72  m_condMaxNumberObjects = nrL1Tau;
73  break;
74  default:
76  break;
77  }
78 }
unsigned int m_corrParDeltaPhiNrBins
const std::vector< l1t::GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate

◆ CaloCondition() [3/3]

CaloCondition::CaloCondition ( const CaloCondition cp)

Definition at line 95 of file CaloCondition.cc.

References copy().

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

◆ ~CaloCondition()

CaloCondition::~CaloCondition ( )
override

Definition at line 98 of file CaloCondition.cc.

98  {
99  // empty
100 }

Member Function Documentation

◆ checkObjectParameter()

const bool CaloCondition::checkObjectParameter ( const int  iCondition,
const l1t::L1Candidate cand,
const unsigned int  index 
) const
private

function to check a single object if it matches a condition

checkObjectParameter - Compare a single particle with a numbered condition.

Parameters
iConditionThe number of the condition.
candThe candidate to compare.
Returns
The result of the comparison (false if a condition does not exist).

Definition at line 452 of file CaloCondition.cc.

References CaloTemplate::ObjectParameter::displacedLUT, CaloTemplate::ObjectParameter::etaRange, CaloTemplate::ObjectParameter::etaWindow1Lower, CaloTemplate::ObjectParameter::etaWindow1Upper, CaloTemplate::ObjectParameter::etaWindow2Lower, CaloTemplate::ObjectParameter::etaWindow2Upper, CaloTemplate::ObjectParameter::etHighThreshold, CaloTemplate::ObjectParameter::etLowThreshold, CaloTemplate::ObjectParameter::indexHigh, CaloTemplate::ObjectParameter::indexLow, CaloTemplate::ObjectParameter::isolationLUT, LogDebug, CaloTemplate::ObjectParameter::phiRange, CaloTemplate::ObjectParameter::phiWindow1Lower, CaloTemplate::ObjectParameter::phiWindow1Upper, CaloTemplate::ObjectParameter::phiWindow2Lower, and CaloTemplate::ObjectParameter::phiWindow2Upper.

454  {
455  // number of objects in condition
456  int nObjInCond = m_gtCaloTemplate->nrObjects();
457 
458  if (iCondition >= nObjInCond || iCondition < 0) {
459  return false;
460  }
461 
462  // empty candidates can not be compared
463  // if (cand.empty()) {
464  // return false;
465  // }
466 
467  const CaloTemplate::ObjectParameter objPar = (*(m_gtCaloTemplate->objectParameter()))[iCondition];
468 
469  LogDebug("L1TGlobal") << "\n CaloTemplate: "
470  << "\n\t condRelativeBx = " << m_gtCaloTemplate->condRelativeBx() << "\n ObjectParameter : "
471  << "\n\t etThreshold = " << objPar.etLowThreshold << " - " << objPar.etHighThreshold
472  << "\n\t indexRange = " << objPar.indexLow << " - " << objPar.indexHigh
473  << "\n\t etaRange = " << objPar.etaRange << "\n\t phiRange = " << objPar.phiRange
474  << "\n\t isolationLUT= " << objPar.isolationLUT << std::endl;
475 
476  LogDebug("L1TGlobal") << "\n l1t::Candidate : "
477  << "\n\t hwPt = " << cand.hwPt() << "\n\t hwEta = " << cand.hwEta()
478  << "\n\t hwPhi = " << cand.hwPhi() << std::endl;
479 
480  // check energy threshold
481  if (!checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, cand.hwPt(), m_gtCaloTemplate->condGEq())) {
482  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkThreshold" << std::endl;
483  return false;
484  }
485 
486  // check index
487  if (!checkIndex(objPar.indexLow, objPar.indexHigh, index)) {
488  LogDebug("L1TGlobal") << "\t\t ilt::Candidate Failed checkIndex " << std::endl;
489  return false;
490  }
491 
492  // check eta
493  if (!checkRangeEta(cand.hwEta(),
494  objPar.etaWindow1Lower,
495  objPar.etaWindow1Upper,
496  objPar.etaWindow2Lower,
497  objPar.etaWindow2Upper,
498  7)) {
499  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
500  return false;
501  }
502 
503  // if (!checkBit(objPar.etaRange, cand.hwEta())) {
504  // return false;
505  // }
506 
507  // check phi
508  if (!checkRangePhi(cand.hwPhi(),
509  objPar.phiWindow1Lower,
510  objPar.phiWindow1Upper,
511  objPar.phiWindow2Lower,
512  objPar.phiWindow2Upper)) {
513  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
514  return false;
515  }
516 
517  // check isolation ( bit check ) with isolation LUT
518  // sanity check on candidate isolation
519  if (cand.hwIso() > 4) {
520  LogDebug("L1TGlobal") << "\t\t l1t::Candidate has out of range hwIso = " << cand.hwIso() << std::endl;
521  return false;
522  }
523  bool passIsoLUT = ((objPar.isolationLUT >> cand.hwIso()) & 1);
524  if (!passIsoLUT) {
525  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed isolation requirement" << std::endl;
526  return false;
527  }
528 
529  // sanity check for hwQual ( 3-bit wide check corresponding to bits 27-28-29 in the L1T Jet Word ).
530  // note that this check includes the entire 3-bit width of hwQual, of which only the least significant bit
531  // is currently defined (the other two bits are not yet defined).
532  if (cand.hwQual() > 7) {
533  LogDebug("L1TGlobal") << "\t\t l1t::Candidate has out of range hwQual = " << cand.hwQual() << std::endl;
534  return false;
535  }
536 
537  bool hasDisplacedLUT =
538  objPar.displacedLUT & 1; // Does this algorithm have an LLP cut defined for the algo in the menu?
539  bool passDisplacedLUT = (objPar.displacedLUT & cand.hwQual()); // Did this candidate pass the LLP cut?
540  if (hasDisplacedLUT &&
541  !passDisplacedLUT) { // Require an inclusive trigger: if LLP cut is not part of algo, ignore cut.
542  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed displaced requirement" << std::endl;
543  return false;
544  }
545 
546  // if (!checkBit(objPar.phiRange, cand.hwPhi())) {
547  // return false;
548  // }
549 
550  // particle matches if we get here
551  //LogTrace("L1TGlobal")
552  // << " checkObjectParameter: calorimeter object OK, passes all requirements\n"
553  // << std::endl;
554 
555  return true;
556 }
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 range and outside of a veto range
const bool checkThreshold(const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
typedef for a single object template
Definition: CaloTemplate.h:61
const bool condGEq() const
get / set condition GEq flag
const bool checkIndex(const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
check if a index is in a given range
const std::vector< ObjectParameter > * objectParameter() const
Definition: CaloTemplate.h:99
const int & condRelativeBx() const
get / set the condition relative bx
const bool checkRangeEta(const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR, const unsigned int nEtaBits) const
check if a value is in a given range and outside of a veto range
const int nrObjects() const
get number of trigger objects
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
#define LogDebug(id)

◆ copy()

void CaloCondition::copy ( const CaloCondition cp)
private

copy function for copy constructor and operator=

Definition at line 81 of file CaloCondition.cc.

Referenced by CaloCondition().

81  {
82  m_gtCaloTemplate = cp.gtCaloTemplate();
83  m_uGtB = cp.getuGtB();
84 
85  m_ifCaloEtaNumberBits = cp.gtIfCaloEtaNumberBits();
86  m_corrParDeltaPhiNrBins = cp.m_corrParDeltaPhiNrBins;
87 
88  m_condMaxNumberObjects = cp.condMaxNumberObjects();
89  m_condLastResult = cp.condLastResult();
90  m_combinationsInCond = cp.getCombinationsInCond();
91 
92  m_verbosity = cp.m_verbosity;
93 }
unsigned int m_corrParDeltaPhiNrBins
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
int m_verbosity
verbosity level
bool m_condLastResult
the last result of evaluateCondition()
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate

◆ evaluateCondition()

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

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 125 of file CaloCondition.cc.

References BXVector< T >::at(), CaloTemplate::CorrelationParameter::deltaEtaRangeLower, CaloTemplate::CorrelationParameter::deltaEtaRangeUpper, CaloTemplate::CorrelationParameter::deltaPhiRangeLower, CaloTemplate::CorrelationParameter::deltaPhiRangeUpper, BXVector< T >::getLastBX(), l1t::gtEG, l1t::gtJet, l1t::gtTau, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, LogDebug, LogTrace, visualization-live-secondInstance_cfg::m, and BXVector< T >::size().

125  {
126  // number of trigger objects in the condition
127  int nObjInCond = m_gtCaloTemplate->nrObjects();
128  //LogTrace("L1TGlobal") << " nObjInCond: " << nObjInCond
129  // << std::endl;
130 
131  // the candidates
132 
133  // objectType() gives the type for nrObjects() only,
134  // but in a CondCalo all objects have the same type
135  // take type from the type of the first object
136 
137  const BXVector<const l1t::L1Candidate*>* candVec;
138 
139  switch ((m_gtCaloTemplate->objectType())[0]) {
140  case gtEG:
141  candVec = m_uGtB->getCandL1EG();
142  break;
143 
144  case gtJet:
145  candVec = m_uGtB->getCandL1Jet();
146  break;
147 
148  case gtTau:
149  candVec = m_uGtB->getCandL1Tau();
150  break;
151 
152  default:
153  return false;
154  break;
155  }
156 
157  // Look at objects in bx = bx + relativeBx
158  int useBx = bxEval + m_gtCaloTemplate->condRelativeBx();
159 
160  // Fail condition if attempting to get Bx outside of range
161  if ((useBx < candVec->getFirstBX()) || (useBx > candVec->getLastBX())) {
162  return false;
163  }
164 
165  int numberObjects = candVec->size(useBx);
166  //LogTrace("L1TGlobal") << " numberObjects: " << numberObjects
167  // << std::endl;
168  if (numberObjects < nObjInCond) {
169  return false;
170  }
171 
172  std::vector<int> index(numberObjects);
173 
174  for (int i = 0; i < numberObjects; ++i) {
175  index[i] = i;
176  }
177 
178  int totalLoops = 0;
179  int passLoops = 0;
180 
181  // condition result condResult set to true if at least one permutation
182  // passes all requirements
183  // all possible permutations are checked
184  bool condResult = false;
185 
186  // store the indices of the calorimeter objects
187  // from the combination evaluated in the condition
188  SingleCombInCond objectsInComb;
189  objectsInComb.reserve(nObjInCond);
190 
191  // clear the m_combinationsInCond vector
192  combinationsInCond().clear();
193 
195  if (nObjInCond == 1) {
196  // clear the indices in the combination
197  //objectsInComb.clear();
198 
199  for (int i = 0; i < numberObjects; i++) {
200  // clear the indices in the combination
201  objectsInComb.clear();
202 
203  totalLoops++;
204  bool passCondition = checkObjectParameter(0, *(candVec->at(useBx, i)), index[i]);
205  if (passCondition) {
206  objectsInComb.push_back(i);
207  condResult = true;
208  passLoops++;
209  combinationsInCond().push_back(objectsInComb);
210  }
211  }
212  } else if (nObjInCond == 2) {
213  for (int i = 0; i < numberObjects; i++) {
214  bool passCondition0i = checkObjectParameter(0, *(candVec->at(useBx, i)), index[i]);
215  bool passCondition1i = checkObjectParameter(1, *(candVec->at(useBx, i)), index[i]);
216 
217  if (!(passCondition0i || passCondition1i))
218  continue;
219 
220  for (int j = 0; j < numberObjects; j++) {
221  if (i == j)
222  continue;
223  totalLoops++;
224 
225  bool passCondition0j = checkObjectParameter(0, *(candVec->at(useBx, j)), index[i]);
226  bool passCondition1j = checkObjectParameter(1, *(candVec->at(useBx, j)), index[i]);
227 
228  bool pass = ((passCondition0i && passCondition1j) || (passCondition0j && passCondition1i));
229 
230  if (pass) {
231  if (m_gtCaloTemplate->wsc()) {
232  // wsc requirements have always nObjInCond = 2
233  // one can use directly 0] and 1] to compute
234  // eta and phi differences
235  const int ObjInWscComb = 2;
236  if (nObjInCond != ObjInWscComb) {
237  if (m_verbosity) {
238  edm::LogError("L1TGlobal")
239  << "\n Error: "
240  << "number of particles in condition with spatial correlation = " << nObjInCond
241  << "\n it must be = " << ObjInWscComb << std::endl;
242  }
243 
244  continue;
245  }
246 
248 
249  // check delta eta
250  if (!checkRangeDeltaEta((candVec->at(useBx, i))->hwEta(),
251  (candVec->at(useBx, j))->hwEta(),
252  corrPar.deltaEtaRangeLower,
253  corrPar.deltaEtaRangeUpper,
254  7)) {
255  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
256  continue;
257  }
258 
259  // check delta phi
260  if (!checkRangeDeltaPhi((candVec->at(useBx, i))->hwPhi(),
261  (candVec->at(useBx, j))->hwPhi(),
262  corrPar.deltaPhiRangeLower,
263  corrPar.deltaPhiRangeUpper)) {
264  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
265  continue;
266  }
267 
268  } // end wsc check
269 
270  objectsInComb.clear();
271  objectsInComb.push_back(i);
272  objectsInComb.push_back(j);
273  condResult = true;
274  passLoops++;
275  combinationsInCond().push_back(objectsInComb);
276  }
277  }
278  }
279  } else if (nObjInCond == 3) {
280  for (int i = 0; i < numberObjects; i++) {
281  bool passCondition0i = checkObjectParameter(0, *(candVec->at(useBx, i)), index[i]);
282  bool passCondition1i = checkObjectParameter(1, *(candVec->at(useBx, i)), index[i]);
283  bool passCondition2i = checkObjectParameter(2, *(candVec->at(useBx, i)), index[i]);
284 
285  if (!(passCondition0i || passCondition1i || passCondition2i))
286  continue;
287 
288  for (int j = 0; j < numberObjects; j++) {
289  if (i == j)
290  continue;
291 
292  bool passCondition0j = checkObjectParameter(0, *(candVec->at(useBx, j)), index[i]);
293  bool passCondition1j = checkObjectParameter(1, *(candVec->at(useBx, j)), index[i]);
294  bool passCondition2j = checkObjectParameter(2, *(candVec->at(useBx, j)), index[i]);
295 
296  if (!(passCondition0j || passCondition1j || passCondition2j))
297  continue;
298 
299  for (int k = 0; k < numberObjects; k++) {
300  if (k == i || k == j)
301  continue;
302  totalLoops++;
303 
304  bool passCondition0k = checkObjectParameter(0, *(candVec->at(useBx, k)), index[i]);
305  bool passCondition1k = checkObjectParameter(1, *(candVec->at(useBx, k)), index[i]);
306  bool passCondition2k = checkObjectParameter(2, *(candVec->at(useBx, k)), index[i]);
307 
308  bool pass = ((passCondition0i && passCondition1j && passCondition2k) ||
309  (passCondition0i && passCondition1k && passCondition2j) ||
310  (passCondition0j && passCondition1k && passCondition2i) ||
311  (passCondition0j && passCondition1i && passCondition2k) ||
312  (passCondition0k && passCondition1i && passCondition2j) ||
313  (passCondition0k && passCondition1j && passCondition2i));
314  if (pass) {
315  condResult = true;
316  passLoops++;
317  objectsInComb.clear();
318  objectsInComb.push_back(i);
319  objectsInComb.push_back(j);
320  objectsInComb.push_back(k);
321  combinationsInCond().push_back(objectsInComb);
322  }
323  } // end loop on k
324  } // end loop on j
325  } // end loop on i
326  } // end if condition has 3 objects
327  else if (nObjInCond == 4) {
328  for (int i = 0; i < numberObjects; i++) {
329  bool passCondition0i = checkObjectParameter(0, *(candVec->at(useBx, i)), index[i]);
330  bool passCondition1i = checkObjectParameter(1, *(candVec->at(useBx, i)), index[i]);
331  bool passCondition2i = checkObjectParameter(2, *(candVec->at(useBx, i)), index[i]);
332  bool passCondition3i = checkObjectParameter(3, *(candVec->at(useBx, i)), index[i]);
333 
334  if (!(passCondition0i || passCondition1i || passCondition2i || passCondition3i))
335  continue;
336 
337  for (int j = 0; j < numberObjects; j++) {
338  if (j == i)
339  continue;
340 
341  bool passCondition0j = checkObjectParameter(0, *(candVec->at(useBx, j)), index[i]);
342  bool passCondition1j = checkObjectParameter(1, *(candVec->at(useBx, j)), index[i]);
343  bool passCondition2j = checkObjectParameter(2, *(candVec->at(useBx, j)), index[i]);
344  bool passCondition3j = checkObjectParameter(3, *(candVec->at(useBx, j)), index[i]);
345 
346  if (!(passCondition0j || passCondition1j || passCondition2j || passCondition3j))
347  continue;
348 
349  for (int k = 0; k < numberObjects; k++) {
350  if (k == i || k == j)
351  continue;
352 
353  bool passCondition0k = checkObjectParameter(0, *(candVec->at(useBx, k)), index[i]);
354  bool passCondition1k = checkObjectParameter(1, *(candVec->at(useBx, k)), index[i]);
355  bool passCondition2k = checkObjectParameter(2, *(candVec->at(useBx, k)), index[i]);
356  bool passCondition3k = checkObjectParameter(3, *(candVec->at(useBx, k)), index[i]);
357 
358  if (!(passCondition0k || passCondition1k || passCondition2k || passCondition3k))
359  continue;
360 
361  for (int m = 0; m < numberObjects; m++) {
362  if (m == i || m == j || m == k)
363  continue;
364  totalLoops++;
365 
366  bool passCondition0m = checkObjectParameter(0, *(candVec->at(useBx, m)), index[i]);
367  bool passCondition1m = checkObjectParameter(1, *(candVec->at(useBx, m)), index[i]);
368  bool passCondition2m = checkObjectParameter(2, *(candVec->at(useBx, m)), index[i]);
369  bool passCondition3m = checkObjectParameter(3, *(candVec->at(useBx, m)), index[i]);
370 
371  bool pass = ((passCondition0i && passCondition1j && passCondition2k && passCondition3m) ||
372  (passCondition0i && passCondition1j && passCondition2m && passCondition3k) ||
373  (passCondition0i && passCondition1k && passCondition2j && passCondition3m) ||
374  (passCondition0i && passCondition1k && passCondition2m && passCondition3j) ||
375  (passCondition0i && passCondition1m && passCondition2j && passCondition3k) ||
376  (passCondition0i && passCondition1m && passCondition2k && passCondition3j) ||
377  (passCondition0j && passCondition1i && passCondition2k && passCondition3m) ||
378  (passCondition0j && passCondition1i && passCondition2m && passCondition3k) ||
379  (passCondition0j && passCondition1k && passCondition2i && passCondition3m) ||
380  (passCondition0j && passCondition1k && passCondition2m && passCondition3i) ||
381  (passCondition0j && passCondition1m && passCondition2i && passCondition3k) ||
382  (passCondition0j && passCondition1m && passCondition2k && passCondition3i) ||
383  (passCondition0k && passCondition1i && passCondition2j && passCondition3m) ||
384  (passCondition0k && passCondition1i && passCondition2m && passCondition3j) ||
385  (passCondition0k && passCondition1j && passCondition2i && passCondition3m) ||
386  (passCondition0k && passCondition1j && passCondition2m && passCondition3i) ||
387  (passCondition0k && passCondition1m && passCondition2i && passCondition3j) ||
388  (passCondition0k && passCondition1m && passCondition2j && passCondition3i) ||
389  (passCondition0m && passCondition1i && passCondition2j && passCondition3k) ||
390  (passCondition0m && passCondition1i && passCondition2k && passCondition3j) ||
391  (passCondition0m && passCondition1j && passCondition2i && passCondition3k) ||
392  (passCondition0m && passCondition1j && passCondition2k && passCondition3i) ||
393  (passCondition0m && passCondition1k && passCondition2i && passCondition3j) ||
394  (passCondition0m && passCondition1k && passCondition2j && passCondition3i));
395  if (pass) {
396  objectsInComb.clear();
397  objectsInComb.push_back(i);
398  objectsInComb.push_back(j);
399  objectsInComb.push_back(k);
400  objectsInComb.push_back(m);
401  condResult = true;
402  passLoops++;
403  combinationsInCond().push_back(objectsInComb);
404  }
405  } // end loop on m
406  } // end loop on k
407  } // end loop on j
408  } // end loop on i
409  } // end if condition has 4 objects
410 
411  LogTrace("L1TGlobal") << "\n CaloCondition: total number of permutations found: " << totalLoops
412  << "\n CaloCondition: number of permutations passing requirements: " << passLoops << "\n"
413  << std::endl;
414 
415  return condResult;
416 }
int getLastBX() const
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 range
const bool wsc() const
std::vector< int > SingleCombInCond
typedefs
const BXVector< const l1t::L1Candidate * > * getCandL1Tau() const
pointer to Tau data list
Definition: GlobalBoard.h:162
Log< level::Error, false > LogError
#define LogTrace(id)
unsigned size(int bx) const
const std::vector< l1t::GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
const T & at(int bx, unsigned i) const
int m_verbosity
verbosity level
const BXVector< const l1t::L1Candidate * > * getCandL1Jet() const
pointer to Jet data list
Definition: GlobalBoard.h:159
typedef for correlation parameters
Definition: CaloTemplate.h:85
const int & condRelativeBx() const
get / set the condition relative bx
const CorrelationParameter * correlationParameter() const
Definition: CaloTemplate.h:101
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 range
const int nrObjects() const
get number of trigger objects
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
const BXVector< const l1t::L1Candidate * > * getCandL1EG() const
pointer to EG data list
Definition: GlobalBoard.h:156
const bool checkObjectParameter(const int iCondition, const l1t::L1Candidate &cand, const unsigned int index) const
function to check a single object if it matches a condition
#define LogDebug(id)

◆ getCandidate()

const l1t::L1Candidate * CaloCondition::getCandidate ( const int  bx,
const int  indexCand 
) const
private

load calo candidates

Definition at line 419 of file CaloCondition.cc.

References simKBmtfDigis_cfi::bx, l1t::gtEG, l1t::gtJet, and l1t::gtTau.

419  {
420  // objectType() gives the type for nrObjects() only,
421  // but in a CondCalo all objects have the same type
422  // take type from the type of the first object
423  switch ((m_gtCaloTemplate->objectType())[0]) {
424  case gtEG:
425  return (m_uGtB->getCandL1EG())->at(bx, indexCand);
426  break;
427 
428  case gtJet:
429  return (m_uGtB->getCandL1Jet())->at(bx, indexCand);
430  break;
431 
432  case gtTau:
433  return (m_uGtB->getCandL1Tau())->at(bx, indexCand);
434  break;
435  default:
436  return nullptr;
437  break;
438  }
439 
440  return nullptr;
441 }
const BXVector< const l1t::L1Candidate * > * getCandL1Tau() const
pointer to Tau data list
Definition: GlobalBoard.h:162
const std::vector< l1t::GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
const BXVector< const l1t::L1Candidate * > * getCandL1Jet() const
pointer to Jet data list
Definition: GlobalBoard.h:159
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
const BXVector< const l1t::L1Candidate * > * getCandL1EG() const
pointer to EG data list
Definition: GlobalBoard.h:156

◆ getuGtB()

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

get / set the pointer to uGt GlobalBoard

Definition at line 75 of file CaloCondition.h.

References m_uGtB.

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

◆ gtCaloTemplate()

const CaloTemplate* l1t::CaloCondition::gtCaloTemplate ( ) const
inline

get / set the pointer to a Condition

Definition at line 70 of file CaloCondition.h.

References m_gtCaloTemplate.

70 { return m_gtCaloTemplate; }
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate

◆ gtCorrParDeltaPhiNrBins()

const int l1t::CaloCondition::gtCorrParDeltaPhiNrBins ( ) const
inline

get / set maximum number of bins for the delta phi scales

Definition at line 85 of file CaloCondition.h.

References m_corrParDeltaPhiNrBins.

85 { return m_corrParDeltaPhiNrBins; }
unsigned int m_corrParDeltaPhiNrBins

◆ gtIfCaloEtaNumberBits()

const int l1t::CaloCondition::gtIfCaloEtaNumberBits ( ) const
inline

get / set the number of bits for eta of calorimeter objects

Definition at line 80 of file CaloCondition.h.

References m_ifCaloEtaNumberBits.

80 { return m_ifCaloEtaNumberBits; }
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects

◆ operator=()

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

Definition at line 103 of file CaloCondition.cc.

References filterCSVwithJSON::copy.

103  {
104  copy(cp);
105  return *this;
106 }
void copy(const CaloCondition &cp)
copy function for copy constructor and operator=

◆ print()

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

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 558 of file CaloCondition.cc.

References l1t::ConditionEvaluation::print().

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

558  {
559  m_gtCaloTemplate->print(myCout);
560 
561  myCout << " Number of bits for eta of calorimeter objects = " << m_ifCaloEtaNumberBits << std::endl;
562  myCout << " Maximum number of bins for the delta phi scales = " << m_corrParDeltaPhiNrBins << "\n " << std::endl;
563 
565 }
unsigned int m_corrParDeltaPhiNrBins
virtual void print(std::ostream &myCout) const
print condition
void print(std::ostream &myCout) const override
print the condition
Definition: CaloTemplate.cc:69
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate

◆ setGtCaloTemplate()

void CaloCondition::setGtCaloTemplate ( const CaloTemplate caloTempl)

Definition at line 109 of file CaloCondition.cc.

109 { m_gtCaloTemplate = caloTempl; }
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate

◆ setGtCorrParDeltaPhiNrBins()

void CaloCondition::setGtCorrParDeltaPhiNrBins ( const int &  corrParDeltaPhiNrBins)

Definition at line 120 of file CaloCondition.cc.

120  {
121  m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
122 }
unsigned int m_corrParDeltaPhiNrBins

◆ setGtIfCaloEtaNumberBits()

void CaloCondition::setGtIfCaloEtaNumberBits ( const int &  ifCaloEtaNumberBitsValue)

Definition at line 115 of file CaloCondition.cc.

115  {
116  m_ifCaloEtaNumberBits = ifCaloEtaNumberBitsValue;
117 }
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects

◆ setuGtB()

void CaloCondition::setuGtB ( const GlobalBoard ptrGTB)

set the pointer to uGT GlobalBoard

Definition at line 112 of file CaloCondition.cc.

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

Member Data Documentation

◆ m_corrParDeltaPhiNrBins

unsigned int l1t::CaloCondition::m_corrParDeltaPhiNrBins
private

Definition at line 110 of file CaloCondition.h.

Referenced by CaloCondition(), and gtCorrParDeltaPhiNrBins().

◆ m_gtCaloTemplate

const CaloTemplate* l1t::CaloCondition::m_gtCaloTemplate
private

pointer to a CaloTemplate

Definition at line 101 of file CaloCondition.h.

Referenced by CaloCondition(), and gtCaloTemplate().

◆ m_ifCaloEtaNumberBits

int l1t::CaloCondition::m_ifCaloEtaNumberBits
private

number of bits for eta of calorimeter objects

Definition at line 107 of file CaloCondition.h.

Referenced by CaloCondition(), and gtIfCaloEtaNumberBits().

◆ m_uGtB

const GlobalBoard* l1t::CaloCondition::m_uGtB
private

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

Definition at line 104 of file CaloCondition.h.

Referenced by getuGtB().