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 492 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.

492  {
493 
494  // number of objects in condition
495  int nObjInCond = m_gtCaloTemplate->nrObjects();
496 
497  if (iCondition >= nObjInCond || iCondition < 0) {
498  return false;
499  }
500 
501  // empty candidates can not be compared
502 // if (cand.empty()) {
503 // return false;
504 // }
505 
506  const CaloTemplate::ObjectParameter objPar = ( *(m_gtCaloTemplate->objectParameter()) )[iCondition];
507 
508  LogDebug("L1TGlobal")
509  << "\n CaloTemplate: "
510  << "\n\t condRelativeBx = " << m_gtCaloTemplate->condRelativeBx()
511  << "\n ObjectParameter : "
512  << "\n\t etThreshold = " << objPar.etLowThreshold << " - " << objPar.etHighThreshold
513  << "\n\t etaRange = " << objPar.etaRange
514  << "\n\t phiRange = " << objPar.phiRange
515  << "\n\t isolationLUT= " << objPar.isolationLUT
516  << std::endl;
517 
518  LogDebug("L1TGlobal")
519  << "\n l1t::Candidate : "
520  << "\n\t hwPt = " << cand.hwPt()
521  << "\n\t hwEta = " << cand.hwEta()
522  << "\n\t hwPhi = " << cand.hwPhi()
523  << std::endl;
524 
525 
526  // check energy threshold
527  if ( !checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, cand.hwPt(), m_gtCaloTemplate->condGEq()) ) {
528  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkThreshold" << std::endl;
529  return false;
530  }
531 
532  // check eta
533  if( !checkRangeEta(cand.hwEta(), objPar.etaWindow1Lower, objPar.etaWindow1Upper, objPar.etaWindow2Lower, objPar.etaWindow2Upper, 7) ){
534  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
535  return false;
536  }
537 
538 // if (!checkBit(objPar.etaRange, cand.hwEta())) {
539 // return false;
540 // }
541 
542  // check phi
543  if( !checkRangePhi(cand.hwPhi(), objPar.phiWindow1Lower, objPar.phiWindow1Upper, objPar.phiWindow2Lower, objPar.phiWindow2Upper) ){
544  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
545  return false;
546  }
547 
548  // check isolation ( bit check ) with isolation LUT
549  // sanity check on candidate isolation
550  if( cand.hwIso()>4 ){
551  LogDebug("L1TGlobal") << "\t\t l1t::Candidate has out of range hwIso = " << cand.hwIso() << std::endl;
552  return false;
553  }
554  bool passIsoLUT = ( (objPar.isolationLUT >> cand.hwIso()) & 1 );
555  if( !passIsoLUT ){
556  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed isolation requirement" << std::endl;
557  return false;
558  }
559 // if (!checkBit(objPar.phiRange, cand.hwPhi())) {
560 // return false;
561 // }
562 
563  // particle matches if we get here
564  //LogTrace("L1TGlobal")
565  // << " checkObjectParameter: calorimeter object OK, passes all requirements\n"
566  // << std::endl;
567 
568  return true;
569 }
#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  bool passCondition0i = checkObjectParameter(0, *(candVec->at(useBx,i)));
249  bool passCondition1i = checkObjectParameter(1, *(candVec->at(useBx,i)));
250 
251  if( !( passCondition0i || passCondition1i ) ) continue;
252 
253  for( int j=0; j<numberObjects; j++ ){
254  if( i==j ) continue;
255  totalLoops++;
256 
257  bool passCondition0j = checkObjectParameter(0, *(candVec->at(useBx,j)));
258  bool passCondition1j = checkObjectParameter(1, *(candVec->at(useBx,j)));
259 
260  bool pass = (
261  (passCondition0i && passCondition1j) ||
262  (passCondition0j && passCondition1i)
263  );
264 
265  if( pass ){
266 
267  if (m_gtCaloTemplate->wsc()) {
268 
269  // wsc requirements have always nObjInCond = 2
270  // one can use directly 0] and 1] to compute
271  // eta and phi differences
272  const int ObjInWscComb = 2;
273  if (nObjInCond != ObjInWscComb) {
274 
275  if (m_verbosity) {
276  edm::LogError("L1TGlobal")
277  << "\n Error: "
278  << "number of particles in condition with spatial correlation = "
279  << nObjInCond << "\n it must be = " << ObjInWscComb
280  << std::endl;
281  }
282 
283  continue;
284  }
285 
288 
289  // check delta eta
290  if( !checkRangeDeltaEta( (candVec->at(useBx,i))->hwEta(), (candVec->at(useBx,j))->hwEta(), corrPar.deltaEtaRangeLower, corrPar.deltaEtaRangeUpper, 7) ){
291  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
292  continue;
293  }
294 
295  // check delta phi
296  if( !checkRangeDeltaPhi( (candVec->at(useBx,i))->hwPhi(), (candVec->at(useBx,j))->hwPhi(),
297  corrPar.deltaPhiRangeLower, corrPar.deltaPhiRangeUpper) ){
298  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
299  continue;
300  }
301 
302  } // end wsc check
303 
304 
305  objectsInComb.clear();
306  objectsInComb.push_back(i);
307  objectsInComb.push_back(j);
308  condResult = true;
309  passLoops++;
310  combinationsInCond().push_back(objectsInComb);
311  }
312  }
313  }
314  }
315  else if( nObjInCond==3 ){
316 
317  for( int i=0; i<numberObjects; i++ ){
318 
319 
320  bool passCondition0i = checkObjectParameter(0, *(candVec->at(useBx,i)));
321  bool passCondition1i = checkObjectParameter(1, *(candVec->at(useBx,i)));
322  bool passCondition2i = checkObjectParameter(2, *(candVec->at(useBx,i)));
323 
324  if( !( passCondition0i || passCondition1i || passCondition2i ) ) continue;
325 
326  for( int j=0; j<numberObjects; j++ ){
327  if( i==j ) continue;
328 
329  bool passCondition0j = checkObjectParameter(0, *(candVec->at(useBx,j)));
330  bool passCondition1j = checkObjectParameter(1, *(candVec->at(useBx,j)));
331  bool passCondition2j = checkObjectParameter(2, *(candVec->at(useBx,j)));
332 
333  if( !( passCondition0j || passCondition1j || passCondition2j ) ) continue;
334 
335  for( int k=0; k<numberObjects; k++ ){
336  if( k==i || k==j ) continue;
337  totalLoops++;
338 
339  bool passCondition0k = checkObjectParameter(0, *(candVec->at(useBx,k)));
340  bool passCondition1k = checkObjectParameter(1, *(candVec->at(useBx,k)));
341  bool passCondition2k = checkObjectParameter(2, *(candVec->at(useBx,k)));
342 
343  bool pass = (
344  (passCondition0i && passCondition1j && passCondition2k) ||
345  (passCondition0i && passCondition1k && passCondition2j) ||
346  (passCondition0j && passCondition1k && passCondition2i) ||
347  (passCondition0j && passCondition1i && passCondition2k) ||
348  (passCondition0k && passCondition1i && passCondition2j) ||
349  (passCondition0k && passCondition1j && passCondition2i)
350  );
351  if( pass ){
352  condResult = true;
353  passLoops++;
354  objectsInComb.clear();
355  objectsInComb.push_back(i);
356  objectsInComb.push_back(j);
357  objectsInComb.push_back(k);
358  combinationsInCond().push_back(objectsInComb);
359  }
360  }// end loop on k
361  }// end loop on j
362  }// end loop on i
363  } // end if condition has 3 objects
364  else if( nObjInCond==4 ){
365 
366 
367  for( int i=0; i<numberObjects; i++ ){
368 
369  bool passCondition0i = checkObjectParameter(0, *(candVec->at(useBx,i)));
370  bool passCondition1i = checkObjectParameter(1, *(candVec->at(useBx,i)));
371  bool passCondition2i = checkObjectParameter(2, *(candVec->at(useBx,i)));
372  bool passCondition3i = checkObjectParameter(3, *(candVec->at(useBx,i)));
373 
374  if( !( passCondition0i || passCondition1i || passCondition2i || passCondition3i ) ) continue;
375 
376  for( int j=0; j<numberObjects; j++ ){
377  if( j==i ) continue;
378 
379  bool passCondition0j = checkObjectParameter(0, *(candVec->at(useBx,j)));
380  bool passCondition1j = checkObjectParameter(1, *(candVec->at(useBx,j)));
381  bool passCondition2j = checkObjectParameter(2, *(candVec->at(useBx,j)));
382  bool passCondition3j = checkObjectParameter(3, *(candVec->at(useBx,j)));
383 
384  if( !( passCondition0j || passCondition1j || passCondition2j || passCondition3j ) ) continue;
385 
386  for( int k=0; k<numberObjects; k++ ){
387  if( k==i || k==j ) continue;
388 
389  bool passCondition0k = checkObjectParameter(0, *(candVec->at(useBx,k)));
390  bool passCondition1k = checkObjectParameter(1, *(candVec->at(useBx,k)));
391  bool passCondition2k = checkObjectParameter(2, *(candVec->at(useBx,k)));
392  bool passCondition3k = checkObjectParameter(3, *(candVec->at(useBx,k)));
393 
394  if( !( passCondition0k || passCondition1k || passCondition2k || passCondition3k ) ) continue;
395 
396  for( int m=0; m<numberObjects; m++ ){
397  if( m==i || m==j || m==k ) continue;
398  totalLoops++;
399 
400  bool passCondition0m = checkObjectParameter(0, *(candVec->at(useBx,m)));
401  bool passCondition1m = checkObjectParameter(1, *(candVec->at(useBx,m)));
402  bool passCondition2m = checkObjectParameter(2, *(candVec->at(useBx,m)));
403  bool passCondition3m = checkObjectParameter(3, *(candVec->at(useBx,m)));
404 
405  bool pass = (
406  (passCondition0i && passCondition1j && passCondition2k && passCondition3m) ||
407  (passCondition0i && passCondition1j && passCondition2m && passCondition3k) ||
408  (passCondition0i && passCondition1k && passCondition2j && passCondition3m) ||
409  (passCondition0i && passCondition1k && passCondition2m && passCondition3j) ||
410  (passCondition0i && passCondition1m && passCondition2j && passCondition3k) ||
411  (passCondition0i && passCondition1m && passCondition2k && passCondition3j) ||
412  (passCondition0j && passCondition1i && passCondition2k && passCondition3m) ||
413  (passCondition0j && passCondition1i && passCondition2m && passCondition3k) ||
414  (passCondition0j && passCondition1k && passCondition2i && passCondition3m) ||
415  (passCondition0j && passCondition1k && passCondition2m && passCondition3i) ||
416  (passCondition0j && passCondition1m && passCondition2i && passCondition3k) ||
417  (passCondition0j && passCondition1m && passCondition2k && passCondition3i) ||
418  (passCondition0k && passCondition1i && passCondition2j && passCondition3m) ||
419  (passCondition0k && passCondition1i && passCondition2m && passCondition3j) ||
420  (passCondition0k && passCondition1j && passCondition2i && passCondition3m) ||
421  (passCondition0k && passCondition1j && passCondition2m && passCondition3i) ||
422  (passCondition0k && passCondition1m && passCondition2i && passCondition3j) ||
423  (passCondition0k && passCondition1m && passCondition2j && passCondition3i) ||
424  (passCondition0m && passCondition1i && passCondition2j && passCondition3k) ||
425  (passCondition0m && passCondition1i && passCondition2k && passCondition3j) ||
426  (passCondition0m && passCondition1j && passCondition2i && passCondition3k) ||
427  (passCondition0m && passCondition1j && passCondition2k && passCondition3i) ||
428  (passCondition0m && passCondition1k && passCondition2i && passCondition3j) ||
429  (passCondition0m && passCondition1k && passCondition2j && passCondition3i)
430  );
431  if( pass ){
432  objectsInComb.clear();
433  objectsInComb.push_back(i);
434  objectsInComb.push_back(j);
435  objectsInComb.push_back(k);
436  objectsInComb.push_back(m);
437  condResult = true;
438  passLoops++;
439  combinationsInCond().push_back(objectsInComb);
440  }
441  }// end loop on m
442  }// end loop on k
443  }// end loop on j
444  }// end loop on i
445  } // end if condition has 4 objects
446 
447 
448  LogTrace("L1TGlobal")
449  << "\n CaloCondition: total number of permutations found: " << totalLoops
450  << "\n CaloCondition: number of permutations passing requirements: " << passLoops
451  << "\n" << std::endl;
452 
453  return condResult;
454 
455 }
#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 458 of file CaloCondition.cc.

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

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

References l1t::ConditionEvaluation::print().

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

571  {
572 
573  m_gtCaloTemplate->print(myCout);
574 
575  myCout << " Number of bits for eta of calorimeter objects = "
576  << m_ifCaloEtaNumberBits << std::endl;
577  myCout << " Maximum number of bins for the delta phi scales = "
578  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
579 
581 
582 }
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().