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
 
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::CaloCondition ( )

constructors default

Definition at line 39 of file CaloCondition.cc.

References m_corrParDeltaPhiNrBins, and m_ifCaloEtaNumberBits.

39  :
41 
44 
45 }
unsigned int m_corrParDeltaPhiNrBins
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
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 48 of file CaloCondition.cc.

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

52  :
54  m_gtCaloTemplate(static_cast<const CaloTemplate*>(caloTemplate)),
55  m_uGtB(ptrGTB),
56  m_ifCaloEtaNumberBits(ifCaloEtaNumberBits)
57 {
58 
60 
61  // maximum number of objects received for the evaluation of the condition
62  // retrieved before from event setup
63  // for a CondCalo, all objects ar of same type, hence it is enough to get the
64  // type for the first object
65 
66  switch ((m_gtCaloTemplate->objectType())[0]) {
67  case gtEG:
68  m_condMaxNumberObjects = nrL1EG;
69  break;
70 
71  case gtJet:
72  m_condMaxNumberObjects = nrL1Jet;
73  break;
74 
75  case gtTau:
76  m_condMaxNumberObjects = nrL1Tau;
77  break;
78  default:
80  break;
81  }
82 
83 }
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::CaloCondition ( const CaloCondition cp)

Definition at line 102 of file CaloCondition.cc.

References copy().

102  :
104 
105  copy(cp);
106 
107 }
void copy(const CaloCondition &cp)
copy function for copy constructor and operator=
CaloCondition::~CaloCondition ( )
override

Definition at line 110 of file CaloCondition.cc.

110  {
111 
112  // empty
113 
114 }

Member Function Documentation

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 493 of file CaloCondition.cc.

References l1t::ConditionEvaluation::checkIndex(), l1t::ConditionEvaluation::checkRangeEta(), l1t::ConditionEvaluation::checkRangePhi(), l1t::ConditionEvaluation::checkThreshold(), GlobalCondition::condGEq(), GlobalCondition::condRelativeBx(), CaloTemplate::ObjectParameter::etaRange, CaloTemplate::ObjectParameter::etaWindow1Lower, CaloTemplate::ObjectParameter::etaWindow1Upper, CaloTemplate::ObjectParameter::etaWindow2Lower, CaloTemplate::ObjectParameter::etaWindow2Upper, CaloTemplate::ObjectParameter::etHighThreshold, CaloTemplate::ObjectParameter::etLowThreshold, l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), CaloTemplate::ObjectParameter::indexHigh, CaloTemplate::ObjectParameter::indexLow, CaloTemplate::ObjectParameter::isolationLUT, LogDebug, m_gtCaloTemplate, GlobalCondition::nrObjects(), CaloTemplate::objectParameter(), CaloTemplate::ObjectParameter::phiRange, CaloTemplate::ObjectParameter::phiWindow1Lower, CaloTemplate::ObjectParameter::phiWindow1Upper, CaloTemplate::ObjectParameter::phiWindow2Lower, and CaloTemplate::ObjectParameter::phiWindow2Upper.

Referenced by evaluateCondition(), and gtCorrParDeltaPhiNrBins().

493  {
494 
495  // number of objects in condition
496  int nObjInCond = m_gtCaloTemplate->nrObjects();
497 
498  if (iCondition >= nObjInCond || iCondition < 0) {
499  return false;
500  }
501 
502  // empty candidates can not be compared
503 // if (cand.empty()) {
504 // return false;
505 // }
506 
507  const CaloTemplate::ObjectParameter objPar = ( *(m_gtCaloTemplate->objectParameter()) )[iCondition];
508 
509  LogDebug("L1TGlobal")
510  << "\n CaloTemplate: "
511  << "\n\t condRelativeBx = " << m_gtCaloTemplate->condRelativeBx()
512  << "\n ObjectParameter : "
513  << "\n\t etThreshold = " << objPar.etLowThreshold << " - " << objPar.etHighThreshold
514  << "\n\t indexRange = " << objPar.indexLow << " - " << objPar.indexHigh
515  << "\n\t etaRange = " << objPar.etaRange
516  << "\n\t phiRange = " << objPar.phiRange
517  << "\n\t isolationLUT= " << objPar.isolationLUT
518  << std::endl;
519 
520  LogDebug("L1TGlobal")
521  << "\n l1t::Candidate : "
522  << "\n\t hwPt = " << cand.hwPt()
523  << "\n\t hwEta = " << cand.hwEta()
524  << "\n\t hwPhi = " << cand.hwPhi()
525  << std::endl;
526 
527 
528  // check energy threshold
529  if ( !checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, cand.hwPt(), m_gtCaloTemplate->condGEq()) ) {
530  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkThreshold" << std::endl;
531  return false;
532  }
533 
534  // check index
535  if ( !checkIndex(objPar.indexLow, objPar.indexHigh, index) ) {
536  LogDebug("L1TGlobal") << "\t\t ilt::Candidate Failed checkIndex " << std::endl;
537  return false;
538  }
539 
540  // check eta
541  if( !checkRangeEta(cand.hwEta(), objPar.etaWindow1Lower, objPar.etaWindow1Upper, objPar.etaWindow2Lower, objPar.etaWindow2Upper, 7) ){
542  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
543  return false;
544  }
545 
546 // if (!checkBit(objPar.etaRange, cand.hwEta())) {
547 // return false;
548 // }
549 
550  // check phi
551  if( !checkRangePhi(cand.hwPhi(), objPar.phiWindow1Lower, objPar.phiWindow1Upper, objPar.phiWindow2Lower, objPar.phiWindow2Upper) ){
552  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
553  return false;
554  }
555 
556  // check isolation ( bit check ) with isolation LUT
557  // sanity check on candidate isolation
558  if( cand.hwIso()>4 ){
559  LogDebug("L1TGlobal") << "\t\t l1t::Candidate has out of range hwIso = " << cand.hwIso() << std::endl;
560  return false;
561  }
562  bool passIsoLUT = ( (objPar.isolationLUT >> cand.hwIso()) & 1 );
563  if( !passIsoLUT ){
564  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed isolation requirement" << std::endl;
565  return false;
566  }
567 // if (!checkBit(objPar.phiRange, cand.hwPhi())) {
568 // return false;
569 // }
570 
571  // particle matches if we get here
572  //LogTrace("L1TGlobal")
573  // << " checkObjectParameter: calorimeter object OK, passes all requirements\n"
574  // << std::endl;
575 
576  return true;
577 }
#define LogDebug(id)
const int nrObjects() const
get number of trigger objects
const std::vector< ObjectParameter > * objectParameter() const
Definition: CaloTemplate.h:102
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 bool condGEq() const
get / set condition GEq flag
int hwPhi() const
Definition: L1Candidate.h:50
const bool checkThreshold(const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
typedef for a single object template
Definition: CaloTemplate.h:59
int hwIso() const
Definition: L1Candidate.h:52
const int & condRelativeBx() const
get / set the condition relative bx
int hwEta() const
Definition: L1Candidate.h:49
int hwPt() const
Definition: L1Candidate.h:48
const bool checkIndex(const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
check if a index is in a given range
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 CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
void CaloCondition::copy ( const CaloCondition cp)
private

copy function for copy constructor and operator=

Definition at line 86 of file CaloCondition.cc.

References l1t::ConditionEvaluation::condLastResult(), l1t::ConditionEvaluation::condMaxNumberObjects(), l1t::ConditionEvaluation::getCombinationsInCond(), getuGtB(), gtCaloTemplate(), gtIfCaloEtaNumberBits(), l1t::ConditionEvaluation::m_combinationsInCond, l1t::ConditionEvaluation::m_condLastResult, l1t::ConditionEvaluation::m_condMaxNumberObjects, m_corrParDeltaPhiNrBins, m_gtCaloTemplate, m_ifCaloEtaNumberBits, m_uGtB, and l1t::ConditionEvaluation::m_verbosity.

Referenced by CaloCondition(), gtCorrParDeltaPhiNrBins(), and operator=().

86  {
87 
88  m_gtCaloTemplate = cp.gtCaloTemplate();
89  m_uGtB = cp.getuGtB();
90 
91  m_ifCaloEtaNumberBits = cp.gtIfCaloEtaNumberBits();
92  m_corrParDeltaPhiNrBins = cp.m_corrParDeltaPhiNrBins;
93 
94  m_condMaxNumberObjects = cp.condMaxNumberObjects();
95  m_condLastResult = cp.condLastResult();
96  m_combinationsInCond = cp.getCombinationsInCond();
97 
98  m_verbosity = cp.m_verbosity;
99 
100 }
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
const bool CaloCondition::evaluateCondition ( const int  bxEval) const
overridevirtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 152 of file CaloCondition.cc.

References BXVector< T >::at(), checkObjectParameter(), l1t::ConditionEvaluation::checkRangeDeltaEta(), l1t::ConditionEvaluation::checkRangeDeltaPhi(), l1t::ConditionEvaluation::combinationsInCond(), GlobalCondition::condRelativeBx(), CaloTemplate::correlationParameter(), CaloTemplate::CorrelationParameter::deltaEtaRangeLower, CaloTemplate::CorrelationParameter::deltaEtaRangeUpper, CaloTemplate::CorrelationParameter::deltaPhiRangeLower, CaloTemplate::CorrelationParameter::deltaPhiRangeUpper, l1t::GlobalBoard::getCandL1EG(), l1t::GlobalBoard::getCandL1Jet(), l1t::GlobalBoard::getCandL1Tau(), BXVector< T >::getLastBX(), l1t::gtEG, l1t::gtJet, l1t::gtTau, mps_fire::i, gen::k, LogDebug, LogTrace, funct::m, m_gtCaloTemplate, m_uGtB, l1t::ConditionEvaluation::m_verbosity, GlobalCondition::nrObjects(), GlobalCondition::objectType(), BXVector< T >::size(), and GlobalCondition::wsc().

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

load calo candidates

Definition at line 459 of file CaloCondition.cc.

References l1t::GlobalBoard::getCandL1EG(), l1t::GlobalBoard::getCandL1Jet(), l1t::GlobalBoard::getCandL1Tau(), l1t::gtEG, l1t::gtJet, l1t::gtTau, m_gtCaloTemplate, m_uGtB, and GlobalCondition::objectType().

Referenced by gtCorrParDeltaPhiNrBins().

459  {
460 
461  // objectType() gives the type for nrObjects() only,
462  // but in a CondCalo all objects have the same type
463  // take type from the type of the first object
464  switch ((m_gtCaloTemplate->objectType())[0]) {
465  case gtEG:
466  return (m_uGtB->getCandL1EG())->at(bx,indexCand);
467  break;
468 
469  case gtJet:
470  return (m_uGtB->getCandL1Jet())->at(bx,indexCand);
471  break;
472 
473  case gtTau:
474  return (m_uGtB->getCandL1Tau())->at(bx,indexCand);
475  break;
476  default:
477  return nullptr;
478  break;
479  }
480 
481  return nullptr;
482 }
const BXVector< const l1t::L1Candidate * > * getCandL1Tau() const
pointer to Tau data list
Definition: GlobalBoard.h:162
const BXVector< const l1t::L1Candidate * > * getCandL1Jet() const
pointer to Jet data list
Definition: GlobalBoard.h:155
const BXVector< const l1t::L1Candidate * > * getCandL1EG() const
pointer to EG data list
Definition: GlobalBoard.h:149
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 CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
const GlobalBoard* l1t::CaloCondition::getuGtB ( ) const
inline

get / set the pointer to uGt GlobalBoard

Definition at line 81 of file CaloCondition.h.

References m_uGtB, and setuGtB().

Referenced by copy().

81  {
82  return m_uGtB;
83  }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
const CaloTemplate* l1t::CaloCondition::gtCaloTemplate ( ) const
inline

get / set the pointer to a Condition

Definition at line 74 of file CaloCondition.h.

References m_gtCaloTemplate, and setGtCaloTemplate().

Referenced by copy().

74  {
75  return m_gtCaloTemplate;
76  }
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
const int l1t::CaloCondition::gtCorrParDeltaPhiNrBins ( ) const
inline

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

Definition at line 96 of file CaloCondition.h.

References checkObjectParameter(), copy(), SimDataFormats::CaloAnalysis::cp, getCandidate(), m_corrParDeltaPhiNrBins, and setGtCorrParDeltaPhiNrBins().

96  {
98  }
unsigned int m_corrParDeltaPhiNrBins
const int l1t::CaloCondition::gtIfCaloEtaNumberBits ( ) const
inline

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

Definition at line 89 of file CaloCondition.h.

References m_ifCaloEtaNumberBits, and setGtIfCaloEtaNumberBits().

Referenced by copy().

89  {
90  return m_ifCaloEtaNumberBits;
91  }
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
l1t::CaloCondition & CaloCondition::operator= ( const CaloCondition cp)

Definition at line 117 of file CaloCondition.cc.

References copy().

117  {
118  copy(cp);
119  return *this;
120 }
void copy(const CaloCondition &cp)
copy function for copy constructor and operator=
void CaloCondition::print ( std::ostream &  myCout) const
overridevirtual

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 579 of file CaloCondition.cc.

References m_corrParDeltaPhiNrBins, m_gtCaloTemplate, m_ifCaloEtaNumberBits, l1t::ConditionEvaluation::print(), and CaloTemplate::print().

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

579  {
580 
581  m_gtCaloTemplate->print(myCout);
582 
583  myCout << " Number of bits for eta of calorimeter objects = "
584  << m_ifCaloEtaNumberBits << std::endl;
585  myCout << " Maximum number of bins for the delta phi scales = "
586  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
587 
589 
590 }
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:97
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
void CaloCondition::setGtCaloTemplate ( const CaloTemplate caloTempl)

Definition at line 123 of file CaloCondition.cc.

References m_gtCaloTemplate.

Referenced by gtCaloTemplate().

123  {
124 
125  m_gtCaloTemplate = caloTempl;
126 
127 }
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
void CaloCondition::setGtCorrParDeltaPhiNrBins ( const int &  corrParDeltaPhiNrBins)

Definition at line 144 of file CaloCondition.cc.

References m_corrParDeltaPhiNrBins.

Referenced by gtCorrParDeltaPhiNrBins().

145  {
146 
147  m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
148 
149 }
unsigned int m_corrParDeltaPhiNrBins
void CaloCondition::setGtIfCaloEtaNumberBits ( const int &  ifCaloEtaNumberBitsValue)

Definition at line 137 of file CaloCondition.cc.

References m_ifCaloEtaNumberBits.

Referenced by gtIfCaloEtaNumberBits().

137  {
138 
139  m_ifCaloEtaNumberBits = ifCaloEtaNumberBitsValue;
140 
141 }
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
void CaloCondition::setuGtB ( const GlobalBoard ptrGTB)

set the pointer to uGT GlobalBoard

Definition at line 130 of file CaloCondition.cc.

References m_uGtB.

Referenced by getuGtB().

130  {
131 
132  m_uGtB = ptrGTB;
133 
134 }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

Member Data Documentation

unsigned int l1t::CaloCondition::m_corrParDeltaPhiNrBins
private
const CaloTemplate* l1t::CaloCondition::m_gtCaloTemplate
private
int l1t::CaloCondition::m_ifCaloEtaNumberBits
private

number of bits for eta of calorimeter objects

Definition at line 123 of file CaloCondition.h.

Referenced by CaloCondition(), copy(), gtIfCaloEtaNumberBits(), print(), and setGtIfCaloEtaNumberBits().

const GlobalBoard* l1t::CaloCondition::m_uGtB
private

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

Definition at line 120 of file CaloCondition.h.

Referenced by copy(), evaluateCondition(), getCandidate(), getuGtB(), and setuGtB().