CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
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
 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
 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...
 
virtual ~CaloCondition ()
 
- 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
 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 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 37 of file CaloCondition.h.

Constructor & Destructor Documentation

CaloCondition::CaloCondition ( )

constructors default

Definition at line 38 of file CaloCondition.cc.

References m_corrParDeltaPhiNrBins, and m_ifCaloEtaNumberBits.

38  :
40 
43 
44 }
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 47 of file CaloCondition.cc.

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

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

References copy().

101  :
103 
104  copy(cp);
105 
106 }
void copy(const CaloCondition &cp)
copy function for copy constructor and operator=
CaloCondition::~CaloCondition ( )
virtual

Definition at line 109 of file CaloCondition.cc.

109  {
110 
111  // empty
112 
113 }

Member Function Documentation

const bool CaloCondition::checkObjectParameter ( const int  iCondition,
const l1t::L1Candidate cand 
) 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 498 of file CaloCondition.cc.

References 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::isolationLUT, LogDebug, CaloTemplate::ObjectParameter::phiRange, CaloTemplate::ObjectParameter::phiWindow1Lower, CaloTemplate::ObjectParameter::phiWindow1Upper, CaloTemplate::ObjectParameter::phiWindow2Lower, and CaloTemplate::ObjectParameter::phiWindow2Upper.

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

References l1t::ConditionEvaluation::condLastResult(), l1t::ConditionEvaluation::condMaxNumberObjects(), l1t::ConditionEvaluation::getCombinationsInCond(), getuGtB(), gtCaloTemplate(), gtIfCaloEtaNumberBits(), m_corrParDeltaPhiNrBins, and l1t::ConditionEvaluation::m_verbosity.

Referenced by CaloCondition().

85  {
86 
88  m_uGtB = cp.getuGtB();
89 
92 
96 
98 
99 }
const CaloTemplate * gtCaloTemplate() const
get / set the pointer to a Condition
Definition: CaloCondition.h:73
unsigned int m_corrParDeltaPhiNrBins
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
bool condLastResult() const
get the latest result for the condition
const int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
Definition: CaloCondition.h:88
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()
const GlobalBoard * getuGtB() const
get / set the pointer to uGt GlobalBoard
Definition: CaloCondition.h:80
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
virtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 151 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, i, cmsHarvester::index, j, relval_2017::k, LogDebug, LogTrace, visualization-live-secondInstance_cfg::m, and BXVector< T >::size().

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

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

464  {
465 
466  // objectType() gives the type for nrObjects() only,
467  // but in a CondCalo all objects have the same type
468  // take type from the type of the first object
469  switch ((m_gtCaloTemplate->objectType())[0]) {
470  case gtEG:
471  return (m_uGtB->getCandL1EG())->at(bx,indexCand);
472  break;
473 
474  case gtJet:
475  return (m_uGtB->getCandL1Jet())->at(bx,indexCand);
476  break;
477 
478  case gtTau:
479  return (m_uGtB->getCandL1Tau())->at(bx,indexCand);
480  break;
481  default:
482  return 0;
483  break;
484  }
485 
486  return 0;
487 }
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< 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 80 of file CaloCondition.h.

References m_uGtB.

Referenced by copy().

80  {
81  return m_uGtB;
82  }
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 73 of file CaloCondition.h.

References m_gtCaloTemplate.

Referenced by copy().

73  {
74  return m_gtCaloTemplate;
75  }
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 95 of file CaloCondition.h.

References m_corrParDeltaPhiNrBins.

95  {
97  }
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 88 of file CaloCondition.h.

References m_ifCaloEtaNumberBits.

Referenced by copy().

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

Definition at line 116 of file CaloCondition.cc.

References filterCSVwithJSON::copy.

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

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 577 of file CaloCondition.cc.

References l1t::ConditionEvaluation::print().

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

577  {
578 
579  m_gtCaloTemplate->print(myCout);
580 
581  myCout << " Number of bits for eta of calorimeter objects = "
582  << m_ifCaloEtaNumberBits << std::endl;
583  myCout << " Maximum number of bins for the delta phi scales = "
584  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
585 
587 
588 }
unsigned int m_corrParDeltaPhiNrBins
virtual void print(std::ostream &myCout) const
print condition
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
virtual void print(std::ostream &myCout) const
print the condition
Definition: CaloTemplate.cc:96
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
void CaloCondition::setGtCaloTemplate ( const CaloTemplate caloTempl)

Definition at line 122 of file CaloCondition.cc.

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

Definition at line 143 of file CaloCondition.cc.

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

Definition at line 136 of file CaloCondition.cc.

136  {
137 
138  m_ifCaloEtaNumberBits = ifCaloEtaNumberBitsValue;
139 
140 }
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 129 of file CaloCondition.cc.

129  {
130 
131  m_uGtB = ptrGTB;
132 
133 }
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

Definition at line 125 of file CaloCondition.h.

Referenced by CaloCondition(), copy(), and gtCorrParDeltaPhiNrBins().

const CaloTemplate* l1t::CaloCondition::m_gtCaloTemplate
private

pointer to a CaloTemplate

Definition at line 116 of file CaloCondition.h.

Referenced by CaloCondition(), and gtCaloTemplate().

int l1t::CaloCondition::m_ifCaloEtaNumberBits
private

number of bits for eta of calorimeter objects

Definition at line 122 of file CaloCondition.h.

Referenced by CaloCondition(), and gtIfCaloEtaNumberBits().

const GlobalBoard* l1t::CaloCondition::m_uGtB
private

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

Definition at line 119 of file CaloCondition.h.

Referenced by getuGtB().