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 GtCondition *, const GtBoard *, 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 GtBoardgetuGtB () const
 get / set the pointer to uGt GtBoard 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 GtBoard *)
 set the pointer to uGT GtBoard 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 GtBoardm_uGtB
 pointer to uGt GtBoard, 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 41 of file CaloCondition.cc.

References m_corrParDeltaPhiNrBins, and m_ifCaloEtaNumberBits.

41  :
43 
46 
47 }
unsigned int m_corrParDeltaPhiNrBins
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
CaloCondition::CaloCondition ( const GtCondition caloTemplate,
const GtBoard ptrGTB,
const int  nrL1EG,
const int  nrL1Jet,
const int  nrL1Tau,
const int  ifCaloEtaNumberBits 
)

from base template condition (from event setup usually)

Definition at line 50 of file CaloCondition.cc.

References CenJet, l1t::ConditionEvaluation::m_condMaxNumberObjects, m_corrParDeltaPhiNrBins, m_gtCaloTemplate, NoIsoEG, GtCondition::objectType(), and TauJet.

54  :
56  m_gtCaloTemplate(static_cast<const CaloTemplate*>(caloTemplate)),
57  m_uGtB(ptrGTB),
58  m_ifCaloEtaNumberBits(ifCaloEtaNumberBits)
59 {
60 
62 
63  // maximum number of objects received for the evaluation of the condition
64  // retrieved before from event setup
65  // for a CondCalo, all objects ar of same type, hence it is enough to get the
66  // type for the first object
67 
68  switch ((m_gtCaloTemplate->objectType())[0]) {
69  case NoIsoEG:
70  m_condMaxNumberObjects = nrL1EG;
71  break;
72 /* case IsoEG:
73  m_condMaxNumberObjects = nrL1IsoEG;
74  break;
75 */
76  case CenJet:
77  m_condMaxNumberObjects = nrL1Jet;
78  break;
79 /* case ForJet:
80  m_condMaxNumberObjects = nrL1ForJet;
81  break;
82 */
83  case TauJet:
84  m_condMaxNumberObjects = nrL1Tau;
85  break;
86  default:
88  break;
89  }
90 
91 }
const GtBoard * m_uGtB
pointer to uGt GtBoard, to be able to get the trigger objects
unsigned int m_corrParDeltaPhiNrBins
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: GtCondition.h:90
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 110 of file CaloCondition.cc.

References copy().

110  :
112 
113  copy(cp);
114 
115 }
void copy(const CaloCondition &cp)
copy function for copy constructor and operator=
CaloCondition::~CaloCondition ( )
virtual

Definition at line 118 of file CaloCondition.cc.

118  {
119 
120  // empty
121 
122 }

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

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

94  {
95 
96  m_gtCaloTemplate = cp.gtCaloTemplate();
97  m_uGtB = cp.getuGtB();
98 
99  m_ifCaloEtaNumberBits = cp.gtIfCaloEtaNumberBits();
100  m_corrParDeltaPhiNrBins = cp.m_corrParDeltaPhiNrBins;
101 
102  m_condMaxNumberObjects = cp.condMaxNumberObjects();
103  m_condLastResult = cp.condLastResult();
104  m_combinationsInCond = cp.getCombinationsInCond();
105 
106  m_verbosity = cp.m_verbosity;
107 
108 }
const GtBoard * m_uGtB
pointer to uGt GtBoard, to be able to get the trigger objects
unsigned int m_corrParDeltaPhiNrBins
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
int m_verbosity
verbosity level
bool m_condLastResult
the last result of evaluateCondition()
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 160 of file CaloCondition.cc.

References BXVector< T >::at(), CenJet, CaloTemplate::CorrelationParameter::deltaEtaRangeLower, CaloTemplate::CorrelationParameter::deltaEtaRangeUpper, CaloTemplate::CorrelationParameter::deltaPhiRangeLower, CaloTemplate::CorrelationParameter::deltaPhiRangeUpper, BXVector< T >::getLastBX(), i, cmsHarvester::index, j, relval_2017::k, LogDebug, LogTrace, visualization-live-secondInstance_cfg::m, NoIsoEG, BXVector< T >::size(), and TauJet.

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

References CenJet, NoIsoEG, and TauJet.

473  {
474 
475  // objectType() gives the type for nrObjects() only,
476  // but in a CondCalo all objects have the same type
477  // take type from the type of the first object
478  switch ((m_gtCaloTemplate->objectType())[0]) {
479  case NoIsoEG:
480  return (m_uGtB->getCandL1EG())->at(bx,indexCand);
481  break;
482 
483  case CenJet:
484  return (m_uGtB->getCandL1Jet())->at(bx,indexCand);
485  break;
486 
487  case TauJet:
488  return (m_uGtB->getCandL1Tau())->at(bx,indexCand);
489  break;
490  default:
491  return 0;
492  break;
493  }
494 
495  return 0;
496 }
const GtBoard * m_uGtB
pointer to uGt GtBoard, to be able to get the trigger objects
const BXVector< const l1t::L1Candidate * > * getCandL1Jet() const
pointer to Jet data list
Definition: GtBoard.h:162
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: GtCondition.h:90
const BXVector< const l1t::L1Candidate * > * getCandL1EG() const
pointer to EG data list
Definition: GtBoard.h:156
const BXVector< const l1t::L1Candidate * > * getCandL1Tau() const
pointer to Tau data list
Definition: GtBoard.h:169
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
const GtBoard* l1t::CaloCondition::getuGtB ( ) const
inline

get / set the pointer to uGt GtBoard

Definition at line 80 of file CaloCondition.h.

References m_uGtB.

Referenced by copy().

80  {
81  return m_uGtB;
82  }
const GtBoard * m_uGtB
pointer to uGt GtBoard, 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 125 of file CaloCondition.cc.

References filterCSVwithJSON::copy.

125  {
126  copy(cp);
127  return *this;
128 }
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 586 of file CaloCondition.cc.

References l1t::ConditionEvaluation::print().

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

586  {
587 
588  m_gtCaloTemplate->print(myCout);
589 
590  myCout << " Number of bits for eta of calorimeter objects = "
591  << m_ifCaloEtaNumberBits << std::endl;
592  myCout << " Maximum number of bins for the delta phi scales = "
593  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
594 
596 
597 }
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:97
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
void CaloCondition::setGtCaloTemplate ( const CaloTemplate caloTempl)

Definition at line 131 of file CaloCondition.cc.

131  {
132 
133  m_gtCaloTemplate = caloTempl;
134 
135 }
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
void CaloCondition::setGtCorrParDeltaPhiNrBins ( const int &  corrParDeltaPhiNrBins)

Definition at line 152 of file CaloCondition.cc.

153  {
154 
155  m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
156 
157 }
unsigned int m_corrParDeltaPhiNrBins
void CaloCondition::setGtIfCaloEtaNumberBits ( const int &  ifCaloEtaNumberBitsValue)

Definition at line 145 of file CaloCondition.cc.

145  {
146 
147  m_ifCaloEtaNumberBits = ifCaloEtaNumberBitsValue;
148 
149 }
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
void CaloCondition::setuGtB ( const GtBoard ptrGTB)

set the pointer to uGT GtBoard

Definition at line 138 of file CaloCondition.cc.

138  {
139 
140  m_uGtB = ptrGTB;
141 
142 }
const GtBoard * m_uGtB
pointer to uGt GtBoard, 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 GtBoard* l1t::CaloCondition::m_uGtB
private

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

Definition at line 119 of file CaloCondition.h.

Referenced by getuGtB().