CMS 3D CMS Logo

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

#include <MuCondition.h>

Inheritance diagram for l1t::MuCondition:
l1t::ConditionEvaluation

Public Member Functions

const bool evaluateCondition (const int bxEval) const override
 the core function to check if the condition matches More...
 
const int gtCorrParDeltaPhiNrBins () const
 get / set maximum number of bins for the delta phi scales More...
 
const GlobalBoardgtGTL () const
 get / set the pointer to GTL More...
 
const int gtIfMuEtaNumberBits () const
 get / set the number of bits for eta of muon objects More...
 
const MuonTemplategtMuonTemplate () const
 get / set the pointer to a Condition More...
 
 MuCondition ()
 
 MuCondition (const GlobalCondition *, const GlobalBoard *, const int nrL1Mu, const int ifMuEtaNumberBits)
 from base template condition (from event setup usually) More...
 
 MuCondition (const MuCondition &)
 
MuConditionoperator= (const MuCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtCorrParDeltaPhiNrBins (const int &)
 
void setGtGTL (const GlobalBoard *)
 set the pointer to GTL More...
 
void setGtIfMuEtaNumberBits (const int &)
 
void setGtMuonTemplate (const MuonTemplate *)
 
 ~MuCondition () override
 
- Public Member Functions inherited from l1t::ConditionEvaluation
 ConditionEvaluation ()
 constructor More...
 
bool condLastResult () const
 get the latest result for the condition More...
 
int condMaxNumberObjects () const
 
void evaluateConditionStoreResult (const int bxEval)
 call evaluateCondition and save last result More...
 
CombinationsInCond const & getCombinationsInCond () const
 get all the object combinations evaluated to true in the condition More...
 
virtual std::string getNumericExpression () const
 get numeric expression More...
 
void setCondMaxNumberObjects (int condMaxNumberObjectsValue)
 
void setVerbosity (const int verbosity)
 
virtual ~ConditionEvaluation ()
 destructor More...
 

Private Member Functions

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

Private Attributes

unsigned int m_corrParDeltaPhiNrBins
 
const GlobalBoardm_gtGTL
 pointer to GTL, to be able to get the trigger objects More...
 
const MuonTemplatem_gtMuonTemplate
 pointer to a MuonTemplate More...
 
int m_ifMuEtaNumberBits
 number of bits for eta of muon objects More...
 

Additional Inherited Members

- Protected Member Functions inherited from l1t::ConditionEvaluation
template<class Type1 >
const bool checkBit (const Type1 &mask, const unsigned int bitNumber) const
 check if a bit with a given number is set in a mask More...
 
template<class Type1 >
const bool checkIndex (const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
 check if a index is in a given range More...
 
template<class Type1 >
const bool checkRangeDeltaEta (const unsigned int obj1Eta, const unsigned int obj2Eta, const Type1 &lowerR, const Type1 &upperR, const unsigned int nEtaBits) const
 check if a value is in a given range More...
 
template<class Type1 >
const bool checkRangeDeltaPhi (const unsigned int obj1Phi, const unsigned int obj2Phi, const Type1 &lowerR, const Type1 &upperR) const
 check if a value is in a given range More...
 
template<class Type1 >
const bool checkRangeEta (const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR, const unsigned int nEtaBits) const
 check if a value is in a given range and outside of a veto range More...
 
template<class Type1 >
const bool checkRangePhi (const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR) const
 check if a value is in a given range and outside of a veto range More...
 
template<class Type1 , class Type2 >
const bool checkThreshold (const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
 
CombinationsInCondcombinationsInCond () const
 get all the object combinations (to fill it...) More...
 
- Protected Attributes inherited from l1t::ConditionEvaluation
CombinationsInCond m_combinationsInCond
 store all the object combinations evaluated to true in the condition More...
 
bool m_condLastResult
 the last result of evaluateCondition() More...
 
int m_condMaxNumberObjects
 
int m_verbosity
 verbosity level More...
 

Detailed Description

Definition at line 37 of file MuCondition.h.

Constructor & Destructor Documentation

MuCondition::MuCondition ( )

constructors default

Definition at line 41 of file MuCondition.cc.

41  :
43 
44  // empty
45 
46 }
MuCondition::MuCondition ( const GlobalCondition muonTemplate,
const GlobalBoard ptrGTL,
const int  nrL1Mu,
const int  ifMuEtaNumberBits 
)

from base template condition (from event setup usually)

Definition at line 49 of file MuCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects, and m_corrParDeltaPhiNrBins.

51  :
53  m_gtMuonTemplate(static_cast<const MuonTemplate*>(muonTemplate)),
54  m_gtGTL(ptrGTL),
55  m_ifMuEtaNumberBits(ifMuEtaNumberBits)
56 {
58  m_condMaxNumberObjects = nrL1Mu;
59 }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:119
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:122
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:125
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:116
MuCondition::MuCondition ( const MuCondition cp)

Definition at line 78 of file MuCondition.cc.

References copy().

78  :
80  copy(cp);
81 }
void copy(const MuCondition &cp)
copy function for copy constructor and operator=
Definition: MuCondition.cc:62
MuCondition::~MuCondition ( )
override

Definition at line 84 of file MuCondition.cc.

84  {
85 
86  // empty
87 
88 }

Member Function Documentation

const bool MuCondition::checkObjectParameter ( const int  iCondition,
const l1t::Muon cand,
const unsigned int  index 
) const
private

function to check a single object if it matches a condition

checkObjectParameter - Compare a single particle with a numbered condition.

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

Definition at line 357 of file MuCondition.cc.

References MuonTemplate::ObjectParameter::charge, l1t::ConditionEvaluation::checkIndex(), l1t::ConditionEvaluation::checkRangeEta(), l1t::ConditionEvaluation::checkRangePhi(), l1t::ConditionEvaluation::checkThreshold(), GlobalCondition::condGEq(), TauDecayModes::dec, MuonTemplate::ObjectParameter::enableIso, MuonTemplate::ObjectParameter::enableMip, MuonTemplate::ObjectParameter::etaRange, MuonTemplate::ObjectParameter::etaWindow1Lower, MuonTemplate::ObjectParameter::etaWindow1Upper, MuonTemplate::ObjectParameter::etaWindow2Lower, MuonTemplate::ObjectParameter::etaWindow2Upper, l1t::Muon::hwCharge(), l1t::Muon::hwEtaAtVtx(), l1t::L1Candidate::hwIso(), l1t::Muon::hwPhiAtVtx(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), MuonTemplate::ObjectParameter::indexHigh, MuonTemplate::ObjectParameter::indexLow, MuonTemplate::ObjectParameter::isolationLUT, LogDebug, m_gtMuonTemplate, GlobalCondition::nrObjects(), MuonTemplate::objectParameter(), MuonTemplate::ObjectParameter::phiHigh, MuonTemplate::ObjectParameter::phiLow, MuonTemplate::ObjectParameter::phiWindow1Lower, MuonTemplate::ObjectParameter::phiWindow1Upper, MuonTemplate::ObjectParameter::phiWindow2Lower, MuonTemplate::ObjectParameter::phiWindow2Upper, MuonTemplate::ObjectParameter::ptHighThreshold, MuonTemplate::ObjectParameter::ptLowThreshold, MuonTemplate::ObjectParameter::qualityLUT, and MuonTemplate::ObjectParameter::requestIso.

Referenced by evaluateCondition(), and gtCorrParDeltaPhiNrBins().

357  {
358 
359  // number of objects in condition
360  int nObjInCond = m_gtMuonTemplate->nrObjects();
361 
362  if (iCondition >= nObjInCond || iCondition < 0) {
363  return false;
364  }
365 
366 // // empty candidates can not be compared
367 // if (cand.empty()) {
368 // return false;
369 // }
370 
371  const MuonTemplate::ObjectParameter objPar =
372  ( *(m_gtMuonTemplate->objectParameter()) )[iCondition];
373 
374  // using the logic table from GTL-9U-module.pdf
375  // "Truth table for Isolation bit"
376 
377  // check thresholds:
378 
379  // value < low pt threshold
380  // fail trigger
381 
382  // low pt threshold <= value < high pt threshold & non-isolated muon:
383  // requestIso true: fail trigger
384  // requestIso false, enableIso true: fail trigger
385  // requestIso false, enableIso false: OK, trigger
386 
387  // low pt threshold <= value < high pt threshold & isolated muon:
388  // requestIso true: OK, trigger
389  // requestIso false, enableIso true: OK, trigger
390  // requestIso false, enableIso false: OK, trigger
391 
392  // value >= high pt threshold & non-isolated muon:
393  // requestIso true: fail trigger
394  // requestIso false: OK, trigger
395 
396  // value >= high pt threshold & isolated muon:
397  // OK, trigger
398 
399  LogDebug("L1TGlobal")
400  << "\n MuonTemplate::ObjectParameter : " << std::hex
401  << "\n\t ptHighThreshold = 0x " << objPar.ptHighThreshold
402  << "\n\t ptLowThreshold = 0x " << objPar.ptLowThreshold
403  << "\n\t indexHigh = 0x " << objPar.indexHigh
404  << "\n\t indexLow = 0x " << objPar.indexLow
405  << "\n\t requestIso = 0x " << objPar.requestIso
406  << "\n\t enableIso = 0x " << objPar.enableIso
407  << "\n\t etaRange = 0x " << objPar.etaRange
408  << "\n\t phiLow = 0x " << objPar.phiLow
409  << "\n\t phiHigh = 0x " << objPar.phiHigh
410  << "\n\t phiWindow1Lower = 0x " << objPar.phiWindow1Lower
411  << "\n\t phiWindow1Upper = 0x " << objPar.phiWindow1Upper
412  << "\n\t phiWindow2Lower = 0x " << objPar.phiWindow2Lower
413  << "\n\t phiWindow2Lower = 0x " << objPar.phiWindow2Lower
414  << "\n\t charge = 0x " << objPar.charge
415  << "\n\t qualityLUT = 0x " << objPar.qualityLUT
416  << "\n\t isolationLUT = 0x " << objPar.isolationLUT
417  << "\n\t enableMip = 0x " << objPar.enableMip
418  << std::endl;
419 
420  LogDebug("L1TGlobal")
421  << "\n l1t::Muon : "
422  << "\n\t hwPt = 0x " << cand.hwPt()
423  << "\n\t hwEtaAtVtx = 0x " << cand.hwEtaAtVtx()
424  << "\n\t hwPhiAtVtx = 0x " << cand.hwPhiAtVtx()
425  << "\n\t hwCharge = 0x " << cand.hwCharge()
426  << "\n\t hwQual = 0x " << cand.hwQual()
427  << "\n\t hwIso = 0x " << cand.hwIso() << std::dec
428  << std::endl;
429 
430 
431  if ( !checkThreshold(objPar.ptLowThreshold, objPar.ptHighThreshold, cand.hwPt(), m_gtMuonTemplate->condGEq()) ) {
432  LogDebug("L1TGlobal") << "\t\t Muon Failed checkThreshold " << std::endl;
433  return false;
434  }
435 
436  // check index
437  if ( !checkIndex(objPar.indexLow, objPar.indexHigh, index) ) {
438  LogDebug("L1TGlobal") << "\t\t Muon Failed checkIndex " << std::endl;
439  return false;
440  }
441 
442  // check eta
443  if( !checkRangeEta(cand.hwEtaAtVtx(), objPar.etaWindow1Lower, objPar.etaWindow1Upper, objPar.etaWindow2Lower, objPar.etaWindow2Upper, 8) ){
444  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
445  return false;
446  }
447 
448  // check phi
449  if( !checkRangePhi(cand.hwPhiAtVtx(), objPar.phiWindow1Lower, objPar.phiWindow1Upper, objPar.phiWindow2Lower, objPar.phiWindow2Upper) ){
450  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
451  return false;
452  }
453 
454  // check charge
455  if( objPar.charge>=0 ){
456  if( cand.hwCharge() != objPar.charge ){
457  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed charge requirement" << std::endl;
458  return false;
459  }
460  }
461 
462 
463 
464  // check quality ( bit check ) with quality LUT
465  // sanity check on candidate quality
466  if( cand.hwQual()>16 ){
467  LogDebug("L1TGlobal") << "\t\t l1t::Candidate has out of range hwQual = " << cand.hwQual() << std::endl;
468  return false;
469  }
470  bool passQualLUT = ( (objPar.qualityLUT >> cand.hwQual()) & 1 );
471  if( !passQualLUT ){
472  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed quality requirement" << std::endl;
473  return false;
474  }
475 
476 
477  // check isolation ( bit check ) with isolation LUT
478  // sanity check on candidate isolation
479  if( cand.hwIso()>4 ){
480  LogDebug("L1TGlobal") << "\t\t l1t::Candidate has out of range hwIso = " << cand.hwIso() << std::endl;
481  return false;
482  }
483  bool passIsoLUT = ( (objPar.isolationLUT >> cand.hwIso()) & 1 );
484  if( !passIsoLUT ){
485  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed isolation requirement" << std::endl;
486  return false;
487  }
488 
489  // A number of values is required to trigger (at least one).
490  // "Don’t care" means that all values are allowed.
491  // Qual = 000 means then NO MUON (GTL module)
492 
493  // if (cand.hwQual() == 0) {
494  // LogDebug("L1TGlobal") << "\t\t Muon Failed hwQual() == 0" << std::endl;
495  // return false;
496  // }
497 
498  // if (objPar.qualityRange == 0) {
499  // LogDebug("L1TGlobal") << "\t\t Muon Failed qualityRange == 0" << std::endl;
500  // return false;
501  // }
502  // else {
503  // if (!checkBit(objPar.qualityRange, cand.hwQual())) {
504  // LogDebug("L1TGlobal") << "\t\t Muon Failed checkBit(qualityRange) " << std::endl;
505  // return false;
506  // }
507  // }
508 
509  // check mip
510  if (objPar.enableMip) {
511  // if (!cand.hwMip()) {
512  // LogDebug("L1TGlobal") << "\t\t Muon Failed enableMip" << std::endl;
513  // return false;
514  // }
515  }
516 
517  // particle matches if we get here
518  //LogTrace("L1TGlobal")
519  // << " checkObjectParameter: muon object OK, passes all requirements\n" << std::endl;
520 
521  return true;
522 }
#define LogDebug(id)
const int nrObjects() const
get number of trigger objects
int hwPhiAtVtx() const
Definition: Muon.h:93
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
const bool checkThreshold(const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
int hwIso() const
Definition: L1Candidate.h:52
const std::vector< ObjectParameter > * objectParameter() const
Definition: MuonTemplate.h:114
unsigned long long etaRange
Definition: MuonTemplate.h:70
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:116
int hwQual() const
Definition: L1Candidate.h:51
int hwPt() const
Definition: L1Candidate.h:48
int hwEtaAtVtx() const
Definition: Muon.h:92
const bool checkIndex(const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
check if a index is in a given range
const bool checkRangePhi(const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR) const
check if a value is in a given range and outside of a veto range
int hwCharge() const
Definition: Muon.h:87
void MuCondition::copy ( const MuCondition cp)
private

copy function for copy constructor and operator=

Definition at line 62 of file MuCondition.cc.

References l1t::ConditionEvaluation::condLastResult(), l1t::ConditionEvaluation::condMaxNumberObjects(), l1t::ConditionEvaluation::getCombinationsInCond(), gtGTL(), gtIfMuEtaNumberBits(), gtMuonTemplate(), l1t::ConditionEvaluation::m_combinationsInCond, l1t::ConditionEvaluation::m_condLastResult, l1t::ConditionEvaluation::m_condMaxNumberObjects, m_corrParDeltaPhiNrBins, m_gtGTL, m_gtMuonTemplate, m_ifMuEtaNumberBits, and l1t::ConditionEvaluation::m_verbosity.

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

62  {
63 
64  m_gtMuonTemplate = cp.gtMuonTemplate();
65  m_gtGTL = cp.gtGTL();
66 
67  m_ifMuEtaNumberBits = cp.gtIfMuEtaNumberBits();
68  m_corrParDeltaPhiNrBins = cp.m_corrParDeltaPhiNrBins;
69 
70  m_condMaxNumberObjects = cp.condMaxNumberObjects();
71  m_condLastResult = cp.condLastResult();
72  m_combinationsInCond = cp.getCombinationsInCond();
73 
74  m_verbosity = cp.m_verbosity;
75 
76 }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:119
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:122
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:125
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:116
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()
const bool MuCondition::evaluateCondition ( const int  bxEval) const
overridevirtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 130 of file MuCondition.cc.

References BXVector< T >::at(), MuonTemplate::CorrelationParameter::chargeCorrelation, checkObjectParameter(), l1t::ConditionEvaluation::checkRangeDeltaEta(), l1t::ConditionEvaluation::checkRangeDeltaPhi(), l1t::ConditionEvaluation::combinationsInCond(), GlobalCondition::condRelativeBx(), MuonTemplate::correlationParameter(), MuonTemplate::CorrelationParameter::deltaEtaRangeLower, MuonTemplate::CorrelationParameter::deltaEtaRangeUpper, MuonTemplate::CorrelationParameter::deltaPhiRangeLower, MuonTemplate::CorrelationParameter::deltaPhiRangeUpper, l1t::GlobalBoard::getCandL1Mu(), BXVector< T >::getLastBX(), mps_fire::i, LogDebug, m_gtGTL, m_gtMuonTemplate, GlobalCondition::nrObjects(), BXVector< T >::size(), and GlobalCondition::wsc().

130  {
131 
132  // BLW Need to pass this as an argument
133  //const int bxEval=0; //BLW Change for BXVector
134 
135  // number of trigger objects in the condition
136  int nObjInCond = m_gtMuonTemplate->nrObjects();
137 
138  // the candidates
139  const BXVector<const l1t::Muon*>* candVec = m_gtGTL->getCandL1Mu(); //BLW Change for BXVector
140 
141  // Look at objects in bx = bx + relativeBx
142  int useBx = bxEval + m_gtMuonTemplate->condRelativeBx();
143 
144  // Fail condition if attempting to get Bx outside of range
145  if( ( useBx < candVec->getFirstBX() ) ||
146  ( useBx > candVec->getLastBX() ) ) {
147  return false;
148  }
149 
150  int numberObjects = candVec->size(useBx); //BLW Change for BXVector
151  //LogTrace("L1TGlobal") << " numberObjects: " << numberObjects
152  // << std::endl;
153  if (numberObjects < nObjInCond) {
154  return false;
155  }
156 
157  std::vector<int> index(numberObjects);
158 
159  for (int i = 0; i < numberObjects; ++i) {
160  index[i] = i;
161  }
162 
163  int numberForFactorial = numberObjects - nObjInCond;
164 
165  // TEMPORARY FIX UNTIL IMPLEMENT NEW MUON CONDITIONS
166  int myfactorial = 1;
167  for( int i=numberForFactorial; i>0; i-- ) myfactorial *= i;
168 
169  int jumpIndex = 1;
170  int jump = myfactorial;//factorial(numberObjects - nObjInCond);
171 
172  int totalLoops = 0;
173  int passLoops = 0;
174 
175  // condition result condResult set to true if at least one permutation
176  // passes all requirements
177  // all possible permutations are checked
178  bool condResult = false;
179 
180  // store the indices of the muon objects
181  // from the combination evaluated in the condition
182  SingleCombInCond objectsInComb;
183  objectsInComb.reserve(nObjInCond);
184 
185  // clear the m_combinationsInCond vector
186  combinationsInCond().clear();
187 
188  do {
189 
190  if (--jumpIndex)
191  continue;
192 
193  jumpIndex = jump;
194  totalLoops++;
195 
196  // clear the indices in the combination
197  objectsInComb.clear();
198 
199  bool tmpResult = true;
200 
201  bool passCondition = false;
202  // check if there is a permutation that matches object-parameter requirements
203  for (int i = 0; i < nObjInCond; i++) {
204 
205  passCondition = checkObjectParameter(i, *(candVec->at(useBx,index[i])), index[i] ); //BLW Change for BXVector
206  tmpResult &= passCondition;
207  if( passCondition )
208  LogDebug("L1TGlobal") << "===> MuCondition::evaluateCondition, CONGRATS!! This muon passed the condition." << std::endl;
209  else
210  LogDebug("L1TGlobal") << "===> MuCondition::evaluateCondition, FAIL!! This muon failed the condition." << std::endl;
211  objectsInComb.push_back(index[i]);
212 
213  }
214 
215 
216  // if permutation does not match particle conditions
217  // skip charge correlation and spatial correlations
218  if ( !tmpResult) {
219 
220  continue;
221 
222  }
223 
224  // get the correlation parameters (chargeCorrelation included here also)
227 
228  // charge_correlation consists of 3 relevant bits (D2, D1, D0)
229  unsigned int chargeCorr = corrPar.chargeCorrelation;
230 
231  // charge ignore bit (D0) not set?
232  if ((chargeCorr & 1) == 0) {
233 
234 
235  LogDebug("L1TGlobal") << "===> MuCondition:: Checking Charge Correlation" << std::endl;
236 
237  for (int i = 0; i < nObjInCond; i++) {
238  // check valid charge - skip if invalid charge
239  int chargeValid = (candVec->at(useBx,index[i]))->hwChargeValid(); //BLW Change for BXVector
240  tmpResult &= chargeValid;
241 
242  if ( chargeValid==0) { //BLW type change for New Muon Class
243  continue;
244  }
245  }
246 
247  if ( !tmpResult) {
248  LogDebug("L1TGlobal") << "===> MuCondition:: Charge Correlation Failed...No Valid Charges" << std::endl;
249  continue;
250  }
251 
252 
253  if( nObjInCond > 1 ){ // more objects condition
254 
255  // find out if signs are equal
256  bool equalSigns = true;
257  for (int i = 0; i < nObjInCond-1; i++) {
258  if ((candVec->at(useBx,index[i]))->hwCharge() != (candVec->at(useBx,index[i+1]))->hwCharge()) { //BLW Change for BXVector
259  equalSigns = false;
260  break;
261  }
262  }
263 
264 
265  LogDebug("L1TGlobal") << "===> MuCondition:: Checking Charge Correlation equalSigns = " << equalSigns << std::endl;
266 
267  // two or three particle condition
268  if (nObjInCond == 2 || nObjInCond == 3) {
269  if( !( ((chargeCorr & 2)!=0 && equalSigns) || ((chargeCorr & 4)!=0 && !equalSigns) ) ){
270  LogDebug("L1TGlobal") << "===> MuCondition:: 2/3 Muon Fail Charge Correlation Condition =" << chargeCorr << std::endl;
271  continue;
272  }
273  }
274  else if (nObjInCond == 4) {
275  //counter to count positive charges to determine if there are pairs
276  unsigned int posCount = 0;
277 
278  for (int i = 0; i < nObjInCond; i++) {
279  if ((candVec->at(useBx,index[i]))->hwCharge()> 0) { //BLW Change for BXVector
280  posCount++;
281  }
282  }
283 
284  if( !( ((chargeCorr & 2)!=0 && equalSigns) || ((chargeCorr & 4)!=0 && posCount==2) ) ){
285  LogDebug("L1TGlobal") << "===> MuCondition:: 4 Muon Fail Charge Correlation Condition = " << chargeCorr << " posCnt " << posCount << std::endl;
286  continue;
287  }
288  }
289  } // end require nObjInCond > 1
290  } // end signchecks
291 
292 
293  if (m_gtMuonTemplate->wsc()) {
294 
295  // wsc requirements have always nObjInCond = 2
296  // one can use directly index[0] and index[1] to compute
297  // eta and phi differences
298  const int ObjInWscComb = 2;
299  if (nObjInCond != ObjInWscComb) {
300 
301  edm::LogError("L1TGlobal") << "\n Error: "
302  << "number of particles in condition with spatial correlation = " << nObjInCond
303  << "\n it must be = " << ObjInWscComb << std::endl;
304  // TODO Perhaps I should throw here an exception,
305  // since something is really wrong if nObjInCond != ObjInWscComb (=2)
306  continue;
307  }
308 
309  // check delta eta
310  if( !checkRangeDeltaEta( (candVec->at(useBx,0))->hwEtaAtVtx(), (candVec->at(useBx,1))->hwEtaAtVtx(), corrPar.deltaEtaRangeLower, corrPar.deltaEtaRangeUpper, 8) ){
311  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
312  continue;
313  }
314 
315  // check delta phi
316  if( !checkRangeDeltaPhi( (candVec->at(useBx,0))->hwPhiAtVtx(), (candVec->at(useBx,1))->hwPhiAtVtx(),
317  corrPar.deltaPhiRangeLower, corrPar.deltaPhiRangeUpper) ){
318  LogDebug("L1TGlobal") << "\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
319  continue;
320  }
321 
322  } // end wsc check
323 
324  // if we get here all checks were successfull for this combination
325  // set the general result for evaluateCondition to "true"
326 
327  condResult = true;
328  passLoops++;
329  (combinationsInCond()).push_back(objectsInComb);
330 
331  } while (std::next_permutation(index.begin(), index.end()) );
332 
333  //LogTrace("L1TGlobal")
334  // << "\n MuCondition: total number of permutations found: " << totalLoops
335  // << "\n MuCondition: number of permutations passing requirements: " << passLoops
336  // << "\n" << std::endl;
337 
338  return condResult;
339 
340 }
#define LogDebug(id)
const int nrObjects() const
get number of 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 bool wsc() const
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:119
const int & condRelativeBx() const
get / set the condition relative bx
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:116
const BXVector< const l1t::Muon * > * getCandL1Mu() const
return global muon trigger candidate
Definition: GlobalBoard.h:143
const bool checkObjectParameter(const int iCondition, const l1t::Muon &cand, const unsigned int index) const
function to check a single object if it matches a condition
Definition: MuCondition.cc:357
int getLastBX() const
const CorrelationParameter * correlationParameter() const
Definition: MuonTemplate.h:119
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 T & at(int bx, unsigned i) const
const l1t::Muon * MuCondition::getCandidate ( const int  bx,
const int  indexCand 
) const
private

load muon candidates

Definition at line 343 of file MuCondition.cc.

References l1t::GlobalBoard::getCandL1Mu(), and m_gtGTL.

Referenced by gtCorrParDeltaPhiNrBins().

343  {
344 
345  return (m_gtGTL->getCandL1Mu())->at(bx,indexCand); //BLW Change for BXVector
346 }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:119
const BXVector< const l1t::Muon * > * getCandL1Mu() const
return global muon trigger candidate
Definition: GlobalBoard.h:143
const int l1t::MuCondition::gtCorrParDeltaPhiNrBins ( ) const
inline

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

Definition at line 94 of file MuCondition.h.

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

94  {
96  }
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:125
const GlobalBoard* l1t::MuCondition::gtGTL ( ) const
inline

get / set the pointer to GTL

Definition at line 78 of file MuCondition.h.

References m_gtGTL, and setGtGTL().

Referenced by copy().

78  {
79  return m_gtGTL;
80  }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:119
const int l1t::MuCondition::gtIfMuEtaNumberBits ( ) const
inline

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

Definition at line 86 of file MuCondition.h.

References m_ifMuEtaNumberBits, and setGtIfMuEtaNumberBits().

Referenced by copy().

86  {
87  return m_ifMuEtaNumberBits;
88  }
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:122
const MuonTemplate* l1t::MuCondition::gtMuonTemplate ( ) const
inline

get / set the pointer to a Condition

Definition at line 71 of file MuCondition.h.

References m_gtMuonTemplate, and setGtMuonTemplate().

Referenced by copy().

71  {
72  return m_gtMuonTemplate;
73  }
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:116
l1t::MuCondition & MuCondition::operator= ( const MuCondition cp)

Definition at line 91 of file MuCondition.cc.

References copy().

92 {
93  copy(cp);
94  return *this;
95 }
void copy(const MuCondition &cp)
copy function for copy constructor and operator=
Definition: MuCondition.cc:62
void MuCondition::print ( std::ostream &  myCout) const
overridevirtual

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 524 of file MuCondition.cc.

References m_corrParDeltaPhiNrBins, m_gtMuonTemplate, m_ifMuEtaNumberBits, l1t::ConditionEvaluation::print(), and MuonTemplate::print().

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

524  {
525 
526  m_gtMuonTemplate->print(myCout);
527 
528  myCout << " Number of bits for eta of muon objects = "
529  << m_ifMuEtaNumberBits << std::endl;
530  myCout << " Maximum number of bins for the delta phi scales = "
531  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
532 
534 
535 }
virtual void print(std::ostream &myCout) const
print condition
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:122
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:125
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:116
void print(std::ostream &myCout) const override
print the condition
Definition: MuonTemplate.cc:98
void MuCondition::setGtCorrParDeltaPhiNrBins ( const int &  corrParDeltaPhiNrBins)

Definition at line 121 of file MuCondition.cc.

References m_corrParDeltaPhiNrBins.

Referenced by gtCorrParDeltaPhiNrBins().

122  {
123 
124  m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
125 
126 }
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:125
void MuCondition::setGtGTL ( const GlobalBoard ptrGTL)

set the pointer to GTL

Definition at line 105 of file MuCondition.cc.

References m_gtGTL.

Referenced by gtGTL().

105  {
106 
107  m_gtGTL = ptrGTL;
108 
109 }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:119
void MuCondition::setGtIfMuEtaNumberBits ( const int &  ifMuEtaNumberBitsValue)

Definition at line 113 of file MuCondition.cc.

References m_ifMuEtaNumberBits.

Referenced by gtIfMuEtaNumberBits().

114  {
115 
116  m_ifMuEtaNumberBits = ifMuEtaNumberBitsValue;
117 
118 }
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:122
void MuCondition::setGtMuonTemplate ( const MuonTemplate muonTempl)

Definition at line 98 of file MuCondition.cc.

References m_gtMuonTemplate.

Referenced by gtMuonTemplate().

98  {
99 
100  m_gtMuonTemplate = muonTempl;
101 
102 }
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:116

Member Data Documentation

unsigned int l1t::MuCondition::m_corrParDeltaPhiNrBins
private
const GlobalBoard* l1t::MuCondition::m_gtGTL
private

pointer to GTL, to be able to get the trigger objects

Definition at line 119 of file MuCondition.h.

Referenced by copy(), evaluateCondition(), getCandidate(), gtGTL(), and setGtGTL().

const MuonTemplate* l1t::MuCondition::m_gtMuonTemplate
private
int l1t::MuCondition::m_ifMuEtaNumberBits
private

number of bits for eta of muon objects

Definition at line 122 of file MuCondition.h.

Referenced by copy(), gtIfMuEtaNumberBits(), print(), and setGtIfMuEtaNumberBits().