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::MuCondition Class Reference

#include <MuCondition.h>

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

Public Member Functions

const bool evaluateCondition (const int bxEval) const
 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 GtBoardgtGTL () 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 GtCondition *, const GtBoard *, 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
 print condition More...
 
void setGtCorrParDeltaPhiNrBins (const int &)
 
void setGtGTL (const GtBoard *)
 set the pointer to GTL More...
 
void setGtIfMuEtaNumberBits (const int &)
 
void setGtMuonTemplate (const MuonTemplate *)
 
virtual ~MuCondition ()
 
- 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
 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 GtBoardm_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 checkRangeDeltaEta (const unsigned int obj1Eta, const unsigned int obj2Eta, const Type1 &lowerR, const Type1 &upperR) 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 &beginR, const Type1 &endR, const Type1 &beginVetoR, const Type1 &endVetoR) 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 &beginR, const Type1 &endR, const Type1 &beginVetoR, const Type1 &endVetoR) 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 &threshold, 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 36 of file MuCondition.h.

Constructor & Destructor Documentation

MuCondition::MuCondition ( )

constructors default

Definition at line 43 of file MuCondition.cc.

43  :
45 
46  // empty
47 
48 }
MuCondition::MuCondition ( const GtCondition muonTemplate,
const GtBoard ptrGTL,
const int  nrL1Mu,
const int  ifMuEtaNumberBits 
)

from base template condition (from event setup usually)

Definition at line 51 of file MuCondition.cc.

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

53  :
55  m_gtMuonTemplate(static_cast<const MuonTemplate*>(muonTemplate)),
56  m_gtGTL(ptrGTL),
57  m_ifMuEtaNumberBits(ifMuEtaNumberBits)
58 {
60  m_condMaxNumberObjects = nrL1Mu;
61 }
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:121
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:124
const GtBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:118
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:115
MuCondition::MuCondition ( const MuCondition cp)

Definition at line 80 of file MuCondition.cc.

References copy().

80  :
82  copy(cp);
83 }
void copy(const MuCondition &cp)
copy function for copy constructor and operator=
Definition: MuCondition.cc:64
MuCondition::~MuCondition ( )
virtual

Definition at line 86 of file MuCondition.cc.

86  {
87 
88  // empty
89 
90 }

Member Function Documentation

const bool MuCondition::checkObjectParameter ( const int  iCondition,
const l1t::Muon 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 436 of file MuCondition.cc.

References MuonTemplate::ObjectParameter::enableIso, MuonTemplate::ObjectParameter::enableMip, MuonTemplate::ObjectParameter::etaRange, l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::Muon::hwMip(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), LogDebug, MuonTemplate::ObjectParameter::phiHigh, MuonTemplate::ObjectParameter::phiLow, MuonTemplate::ObjectParameter::ptHighThreshold, MuonTemplate::ObjectParameter::ptLowThreshold, MuonTemplate::ObjectParameter::qualityRange, and MuonTemplate::ObjectParameter::requestIso.

436  {
437 
438  // number of objects in condition
439  int nObjInCond = m_gtMuonTemplate->nrObjects();
440 
441  if (iCondition >= nObjInCond || iCondition < 0) {
442  return false;
443  }
444 
445 // // empty candidates can not be compared
446 // if (cand.empty()) {
447 // return false;
448 // }
449 
450  const MuonTemplate::ObjectParameter objPar =
451  ( *(m_gtMuonTemplate->objectParameter()) )[iCondition];
452 
453  // using the logic table from GTL-9U-module.pdf
454  // "Truth table for Isolation bit"
455 
456  // check thresholds:
457 
458  // value < low pt threshold
459  // fail trigger
460 
461  // low pt threshold <= value < high pt threshold & non-isolated muon:
462  // requestIso true: fail trigger
463  // requestIso false, enableIso true: fail trigger
464  // requestIso false, enableIso false: OK, trigger
465 
466  // low pt threshold <= value < high pt threshold & isolated muon:
467  // requestIso true: OK, trigger
468  // requestIso false, enableIso true: OK, trigger
469  // requestIso false, enableIso false: OK, trigger
470 
471  // value >= high pt threshold & non-isolated muon:
472  // requestIso true: fail trigger
473  // requestIso false: OK, trigger
474 
475  // value >= high pt threshold & isolated muon:
476  // OK, trigger
477 
478  LogDebug("l1t|Global")
479  << "\n MuonTemplate::ObjectParameter : "
480  << "\n\t ptHighThreshold = " << objPar.ptHighThreshold
481  << "\n\t ptLowThreshold = " << objPar.ptLowThreshold
482  << "\n\t requestIso = " << objPar.requestIso
483  << "\n\t enableIso = " << objPar.enableIso
484  << "\n\t etaRange = " << objPar.etaRange
485  << "\n\t phiLow = " << objPar.phiLow
486  << "\n\t phiHigh = " << objPar.phiHigh
487  << "\n\t qualityRange = " << objPar.qualityRange
488  << "\n\t enableMip = " << objPar.enableMip
489  << std::endl;
490 
491  LogDebug("l1t|Global")
492  << "\n l1t::Muon : "
493  << "\n\t hwPt = " << cand.hwPt()
494  << "\n\t hwEta = " << cand.hwEta()
495  << "\n\t hwPhi = " << cand.hwPhi()
496  << "\n\t hwQual = " << cand.hwQual()
497  << "\n\t hwIso = " << cand.hwIso()
498  << "\n\t hwMip = " << cand.hwMip()
499  << std::endl;
500 
501 
502  if ( !checkThreshold(objPar.ptHighThreshold, cand.hwPt(), m_gtMuonTemplate->condGEq()) ) {
503 
504  if ( !checkThreshold(objPar.ptLowThreshold, cand.hwPt(), m_gtMuonTemplate->condGEq()) ) {
505  LogDebug("l1t|Global") << "\t\t Muon Failed checkThreshold " << std::endl;
506  return false;
507  }
508  else {
509  // check isolation
510  if ( !cand.hwIso() ) {
511  if (objPar.requestIso || objPar.enableIso) {
512  LogDebug("l1t|Global") << "\t\t Muon Failed hwIso " << std::endl;
513  return false;
514  }
515  }
516  }
517  }
518  else {
519 
520  if ( !cand.hwIso() ) {
521  if (objPar.requestIso) {
522  LogDebug("l1t|Global") << "\t\t Muon Failed hwIso " << std::endl;
523  return false;
524  }
525  }
526  }
527 
528  // check eta
529  // DP - Enable once muon conditions mature
530 // if( !checkRange(cand.hwEta(), objPar.etaRangeBegin, objPar.etaRangeEnd, objPar.etaRangeVetoBegin, objPar.etaRangeVetoEnd) ){
531 // return false;
532 // }
533 
534 // // check phi
535 // if( !checkRange(cand.hwPhi(), objPar.phiRangeBegin, objPar.phiRangeEnd, objPar.phiRangeVetoBegin, objPar.phiRangeVetoEnd) ){
536 // return false;
537 // }
538 
540 // if (!checkBit(objPar.etaRange, cand.hwEta())) {
541 // LogDebug("l1t|Global") << "\t\t Muon Failed checkBit(etaRange) " << std::endl;
542 // return false;
543 // }
544 
545 // // check phi - in the requested range (no LUT used - LUT too big for hw chip)
546 // // for phiLow <= phiHigh takes [phiLow, phiHigh]
547 // // for phiLow >= phiHigh takes [phiLow, phiHigh] over zero angle!
548 // if (objPar.phiHigh >= objPar.phiLow) {
549 // if (! ( (objPar.phiLow <= (unsigned int)cand.hwPhi()) && ((unsigned int)cand.hwPhi() <= objPar.phiHigh ) )) {
550 // LogDebug("l1t|Global") << "\t\t Muon Failed checkBit(phiRange) " << std::endl;
551 // return false;
552 // }
553 // }
554 // else { // go over zero angle!!
555 // if (! ( (objPar.phiLow <= (unsigned int)cand.hwPhi()) || ((unsigned int)cand.hwPhi() <= objPar.phiHigh ) )) {
556 // LogDebug("l1t|Global") << "\t\t Muon Failed checkBit(phiRange) " << std::endl;
557 // return false;
558 // }
559 // }
560 
561  // check quality ( bit check )
562 
563  // A number of values is required to trigger (at least one).
564  // "Don’t care" means that all values are allowed.
565  // Qual = 000 means then NO MUON (GTL module)
566 
567  if (cand.hwQual() == 0) {
568  LogDebug("l1t|Global") << "\t\t Muon Failed hwQual() == 0" << std::endl;
569  return false;
570  }
571 
572  if (objPar.qualityRange == 0) {
573  LogDebug("l1t|Global") << "\t\t Muon Failed qualityRange == 0" << std::endl;
574  return false;
575  }
576  else {
577  if (!checkBit(objPar.qualityRange, cand.hwQual())) {
578  LogDebug("l1t|Global") << "\t\t Muon Failed checkBit(qualityRange) " << std::endl;
579  return false;
580  }
581  }
582 
583  // check mip
584  if (objPar.enableMip) {
585  if (!cand.hwMip()) {
586  LogDebug("l1t|Global") << "\t\t Muon Failed enableMip" << std::endl;
587  return false;
588  }
589  }
590 
591  // particle matches if we get here
592  //LogTrace("l1t|Global")
593  // << " checkObjectParameter: muon object OK, passes all requirements\n" << std::endl;
594 
595  return true;
596 }
#define LogDebug(id)
int hwPhi() const
Definition: L1Candidate.cc:79
int hwMip() const
Definition: Muon.cc:59
int hwIso() const
Definition: L1Candidate.cc:84
const std::vector< ObjectParameter > * objectParameter() const
Definition: MuonTemplate.h:108
const int nrObjects() const
get number of trigger objects
Definition: GtCondition.cc:74
unsigned long long etaRange
Definition: MuonTemplate.h:66
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:115
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
const bool checkThreshold(const Type1 &threshold, const Type2 &value, bool condGEqValue) const
int hwPt() const
Definition: L1Candidate.cc:69
const bool condGEq() const
get / set condition GEq flag
Definition: GtCondition.h:100
void MuCondition::copy ( const MuCondition cp)
private

copy function for copy constructor and operator=

Definition at line 64 of file MuCondition.cc.

References l1t::ConditionEvaluation::condLastResult(), l1t::ConditionEvaluation::condMaxNumberObjects(), l1t::ConditionEvaluation::getCombinationsInCond(), gtGTL(), gtIfMuEtaNumberBits(), gtMuonTemplate(), m_corrParDeltaPhiNrBins, and l1t::ConditionEvaluation::m_verbosity.

Referenced by MuCondition().

64  {
65 
66  m_gtMuonTemplate = cp.gtMuonTemplate();
67  m_gtGTL = cp.gtGTL();
68 
69  m_ifMuEtaNumberBits = cp.gtIfMuEtaNumberBits();
70  m_corrParDeltaPhiNrBins = cp.m_corrParDeltaPhiNrBins;
71 
72  m_condMaxNumberObjects = cp.condMaxNumberObjects();
73  m_condLastResult = cp.condLastResult();
74  m_combinationsInCond = cp.getCombinationsInCond();
75 
76  m_verbosity = cp.m_verbosity;
77 
78 }
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:121
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:124
const GtBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:118
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:115
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
virtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 132 of file MuCondition.cc.

References funct::abs(), BXVector< T >::at(), MuonTemplate::CorrelationParameter::chargeCorrelation, hitfit::clear(), MuonTemplate::CorrelationParameter::deltaEtaRange, MuonTemplate::CorrelationParameter::deltaPhiRange0Word, MuonTemplate::CorrelationParameter::deltaPhiRange1Word, BXVector< T >::getLastBX(), i, cmsHarvester::index, LogDebug, LogTrace, and BXVector< T >::size().

132  {
133 
134  // BLW Need to pass this as an argument
135  //const int bxEval=0; //BLW Change for BXVector
136 
137  // number of trigger objects in the condition
138  int nObjInCond = m_gtMuonTemplate->nrObjects();
139 
140  // the candidates
141  const BXVector<const l1t::Muon*>* candVec = m_gtGTL->getCandL1Mu(); //BLW Change for BXVector
142 
143  // Look at objects in bx = bx + relativeBx
144  int useBx = bxEval + m_gtMuonTemplate->condRelativeBx();
145 
146  // Fail condition if attempting to get Bx outside of range
147  if( ( useBx < candVec->getFirstBX() ) ||
148  ( useBx > candVec->getLastBX() ) ) {
149  return false;
150  }
151 
152  int numberObjects = candVec->size(useBx); //BLW Change for BXVector
153  //LogTrace("l1t|Global") << " numberObjects: " << numberObjects
154  // << std::endl;
155  if (numberObjects < nObjInCond) {
156  return false;
157  }
158 
159  std::vector<int> index(numberObjects);
160 
161  for (int i = 0; i < numberObjects; ++i) {
162  index[i] = i;
163  }
164 
165  int numberForFactorial = numberObjects - nObjInCond;
166 
167  // TEMPORARY FIX UNTIL IMPLEMENT NEW MUON CONDITIONS
168  int myfactorial = 1;
169  for( int i=numberForFactorial; i>0; i-- ) myfactorial *= i;
170 
171  int jumpIndex = 1;
172  int jump = myfactorial;//factorial(numberObjects - nObjInCond);
173 
174  int totalLoops = 0;
175  int passLoops = 0;
176 
177  // condition result condResult set to true if at least one permutation
178  // passes all requirements
179  // all possible permutations are checked
180  bool condResult = false;
181 
182  // store the indices of the muon objects
183  // from the combination evaluated in the condition
184  SingleCombInCond objectsInComb;
185  objectsInComb.reserve(nObjInCond);
186 
187  // clear the m_combinationsInCond vector
189 
190  do {
191 
192  if (--jumpIndex)
193  continue;
194 
195  jumpIndex = jump;
196  totalLoops++;
197 
198  // clear the indices in the combination
199  objectsInComb.clear();
200 
201  bool tmpResult = true;
202 
203  bool passCondition = false;
204  // check if there is a permutation that matches object-parameter requirements
205  for (int i = 0; i < nObjInCond; i++) {
206 
207  passCondition = checkObjectParameter(i, *(candVec->at(useBx,index[i]) )); //BLW Change for BXVector
208  tmpResult &= passCondition;
209  if( passCondition )
210  LogDebug("l1t|Global") << "===> MuCondition::evaluateCondition, CONGRATS!! This muon passed the condition." << std::endl;
211  else
212  LogDebug("l1t|Global") << "===> MuCondition::evaluateCondition, FAIL!! This muon failed the condition." << std::endl;
213  objectsInComb.push_back(index[i]);
214 
215  }
216 
217  // if permutation does not match particle conditions
218  // skip charge correlation and spatial correlations
219  if ( !tmpResult) {
220 
221  continue;
222 
223  }
224 
225  // get the correlation parameters (chargeCorrelation included here also)
228 
229  // charge_correlation consists of 3 relevant bits (D2, D1, D0)
230  unsigned int chargeCorr = corrPar.chargeCorrelation;
231 
232  // charge ignore bit (D0) not set?
233  if ((chargeCorr & 1) == 0) {
234 
235  for (int i = 0; i < nObjInCond; i++) {
236  // check valid charge - skip if invalid charge
237  int chargeValid = (candVec->at(useBx,index[i]))->hwChargeValid(); //BLW Change for BXVector
238  tmpResult &= chargeValid;
239 
240  if ( chargeValid==0) { //BLW type change for New Muon Class
241  continue;
242  }
243  }
244 
245  if ( !tmpResult) {
246  continue;
247  }
248 
249  if (nObjInCond == 1) { // one object condition
250 
251  // D2..enable pos, D1..enable neg
252  if ( ! ( ( (chargeCorr & 4) != 0 && (candVec->at(useBx,index[0]))->charge()> 0 ) //BLW Change for BXVector
253  || ( (chargeCorr & 2) != 0 && (candVec->at(useBx,index[0]))->charge() < 0 ) )) { //BLW Change for BXVector
254 
255  continue;
256  }
257 
258  }
259  else { // more objects condition
260 
261  // find out if signs are equal
262  bool equalSigns = true;
263  for (int i = 0; i < nObjInCond-1; i++) {
264  if ((candVec->at(useBx,index[i]))->charge() != (candVec->at(useBx,index[i+1]))->charge()) { //BLW Change for BXVector
265  equalSigns = false;
266  break;
267  }
268  }
269 
270  // two or three particle condition
271  if (nObjInCond == 2 || nObjInCond == 3) {
272  // D2..enable equal, D1..enable not equal
273  if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
274  && !equalSigns ) )) {
275 
276  continue;
277  }
278  }
279 
280  // four particle condition
281  if (nObjInCond == 4) {
282  //counter to count positive charges to determine if there are pairs
283  unsigned int posCount = 0;
284 
285  for (int i = 0; i < nObjInCond; i++) {
286  if ((candVec->at(useBx,index[i]))->charge()> 0) { //BLW Change for BXVector
287  posCount++;
288  }
289  }
290 
291  // D2..enable equal, D1..enable pairs
292  if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
293  && posCount == 2 ) )) {
294 
295  continue;
296  }
297  }
298  }
299  } // end signchecks
300 
301 
302  if (m_gtMuonTemplate->wsc()) {
303 
304  // wsc requirements have always nObjInCond = 2
305  // one can use directly index[0] and index[1] to compute
306  // eta and phi differences
307  const int ObjInWscComb = 2;
308  if (nObjInCond != ObjInWscComb) {
309 
310  edm::LogError("l1t|Global") << "\n Error: "
311  << "number of particles in condition with spatial correlation = " << nObjInCond
312  << "\n it must be = " << ObjInWscComb << std::endl;
313  // TODO Perhaps I should throw here an exception,
314  // since something is really wrong if nObjInCond != ObjInWscComb (=2)
315  continue;
316  }
317 
318  unsigned int candDeltaEta;
319  unsigned int candDeltaPhi;
320 
321  // check candDeltaEta
322 
323  // get eta index and the sign bit of the eta index (MSB is the sign)
324  // signedEta[i] is the signed eta index of (*candVec)[index[i]]
325  int signedEta[ObjInWscComb];
326  int signBit[ObjInWscComb] = { 0, 0 };
327 
328  int scaleEta = 1 << (m_ifMuEtaNumberBits - 1);
329 
330  for (int i = 0; i < ObjInWscComb; ++i) {
331  signBit[i] = ((candVec->at(useBx,index[i]))->hwEta() & scaleEta)>>(m_ifMuEtaNumberBits - 1); //BLW Change for BXVector
332  signedEta[i] = ((candVec->at(useBx,index[i]))->hwEta() )%scaleEta; //BLW Change for BXVector
333 
334  if (signBit[i] == 1) {
335  signedEta[i] = (-1)*signedEta[i];
336  }
337 
338  }
339 
340  // compute candDeltaEta - add 1 if signs are different (due to +0/-0 indices)
341  candDeltaEta = static_cast<int> (std::abs(signedEta[1] - signedEta[0]))
342  + static_cast<int> (signBit[1]^signBit[0]);
343 
344  if ( !checkBit(corrPar.deltaEtaRange, candDeltaEta) ) {
345  continue;
346  }
347 
348  // check candDeltaPhi
349 
350  // calculate absolute value of candDeltaPhi
351  if ((candVec->at(useBx,index[0]))->hwPhi()> (candVec->at(useBx,index[1]))->hwPhi()) { //BLW Change for BXVector
352  candDeltaPhi = (candVec->at(useBx,index[0]))->hwPhi() - (candVec->at(useBx,index[1]))->hwPhi(); //BLW Change for BXVector
353  }
354  else {
355  candDeltaPhi = (candVec->at(useBx,index[1]))->hwPhi() - (candVec->at(useBx,index[0]))->hwPhi(); //BLW Change for BXVector
356  }
357 
358  // check if candDeltaPhi > 180 (via delta_phi_maxbits)
359  // delta_phi contains bits for 0..180 (0 and 180 included)
360  // protect also against infinite loop...
361 
362  int nMaxLoop = 10;
363  int iLoop = 0;
364 
365  while (candDeltaPhi >= m_corrParDeltaPhiNrBins) {
366 
367  unsigned int candDeltaPhiInitial = candDeltaPhi;
368 
369  // candDeltaPhi > 180 ==> take 360 - candDeltaPhi
370  candDeltaPhi = (m_corrParDeltaPhiNrBins - 1) * 2 - candDeltaPhi;
371  if (m_verbosity) {
372  LogTrace("l1t|Global")
373  << " Initial candDeltaPhi = "
374  << candDeltaPhiInitial
375  << " > m_corrParDeltaPhiNrBins = "
377  << " ==> candDeltaPhi rescaled to: "
378  << candDeltaPhi << " [ loop index " << iLoop
379  << "; breaks after " << nMaxLoop << " loops ]\n"
380  << std::endl;
381  }
382 
383  iLoop++;
384  if (iLoop > nMaxLoop) {
385  return false;
386  }
387  }
388 
389  // delta_phi bitmask is saved in two boost::uint64_t words
390  if (candDeltaPhi < 64) {
391  if (!checkBit(corrPar.deltaPhiRange0Word, candDeltaPhi) ) {
392  continue;
393  }
394  }
395  else {
396  if (!checkBit(corrPar.deltaPhiRange1Word, (candDeltaPhi - 64))) {
397  continue;
398  }
399  }
400 
401  } // end wsc check
402 
403  // if we get here all checks were successfull for this combination
404  // set the general result for evaluateCondition to "true"
405 
406  condResult = true;
407  passLoops++;
408  (combinationsInCond()).push_back(objectsInComb);
409 
410  } while (std::next_permutation(index.begin(), index.end()) );
411 
412  //LogTrace("l1t|Global")
413  // << "\n MuCondition: total number of permutations found: " << totalLoops
414  // << "\n MuCondition: number of permutations passing requirements: " << passLoops
415  // << "\n" << std::endl;
416 
417  return condResult;
418 
419 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
unsigned size(int bx) const
const bool checkObjectParameter(const int iCondition, const l1t::Muon &cand) const
function to check a single object if it matches a condition
Definition: MuCondition.cc:436
std::vector< int > SingleCombInCond
typedefs
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:121
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:122
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:124
const GtBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:118
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:115
unsigned long long deltaPhiRange0Word
Definition: MuonTemplate.h:89
#define LogTrace(id)
int m_verbosity
verbosity level
const bool wsc() const
Definition: GtCondition.cc:131
unsigned long long deltaPhiRange1Word
Definition: MuonTemplate.h:90
const BXVector< const l1t::Muon * > * getCandL1Mu() const
return global muon trigger candidate
Definition: GtBoard.h:137
unsigned long long deltaEtaRange
Definition: MuonTemplate.h:93
int getLastBX() const
const CorrelationParameter * correlationParameter() const
Definition: MuonTemplate.h:113
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 422 of file MuCondition.cc.

References asciidump::at.

422  {
423 
424  return (m_gtGTL->getCandL1Mu())->at(bx,indexCand); //BLW Change for BXVector
425 }
const GtBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:118
const BXVector< const l1t::Muon * > * getCandL1Mu() const
return global muon trigger candidate
Definition: GtBoard.h:137
list at
Definition: asciidump.py:428
const int l1t::MuCondition::gtCorrParDeltaPhiNrBins ( ) const
inline

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

Definition at line 93 of file MuCondition.h.

References m_corrParDeltaPhiNrBins.

93  {
95  }
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:124
const GtBoard* l1t::MuCondition::gtGTL ( ) const
inline

get / set the pointer to GTL

Definition at line 77 of file MuCondition.h.

References m_gtGTL.

Referenced by copy().

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

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

Definition at line 85 of file MuCondition.h.

References m_ifMuEtaNumberBits.

Referenced by copy().

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

get / set the pointer to a Condition

Definition at line 70 of file MuCondition.h.

References m_gtMuonTemplate.

Referenced by copy().

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

Definition at line 93 of file MuCondition.cc.

References filterCSVwithJSON::copy.

94 {
95  copy(cp);
96  return *this;
97 }
void copy(const MuCondition &cp)
copy function for copy constructor and operator=
Definition: MuCondition.cc:64
void MuCondition::print ( std::ostream &  myCout) const
virtual

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 598 of file MuCondition.cc.

References l1t::ConditionEvaluation::print().

Referenced by l1t::GtBoard::runGTL().

598  {
599 
600  m_gtMuonTemplate->print(myCout);
601 
602  myCout << " Number of bits for eta of muon objects = "
603  << m_ifMuEtaNumberBits << std::endl;
604  myCout << " Maximum number of bins for the delta phi scales = "
605  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
606 
608 
609 }
virtual void print(std::ostream &myCout) const
print the condition
Definition: MuonTemplate.cc:99
virtual void print(std::ostream &myCout) const
print condition
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Definition: MuCondition.h:121
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:124
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:115
void MuCondition::setGtCorrParDeltaPhiNrBins ( const int &  corrParDeltaPhiNrBins)

Definition at line 123 of file MuCondition.cc.

124  {
125 
126  m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
127 
128 }
unsigned int m_corrParDeltaPhiNrBins
Definition: MuCondition.h:124
void MuCondition::setGtGTL ( const GtBoard ptrGTL)

set the pointer to GTL

Definition at line 107 of file MuCondition.cc.

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

Definition at line 115 of file MuCondition.cc.

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

Definition at line 100 of file MuCondition.cc.

100  {
101 
102  m_gtMuonTemplate = muonTempl;
103 
104 }
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
Definition: MuCondition.h:115

Member Data Documentation

unsigned int l1t::MuCondition::m_corrParDeltaPhiNrBins
private

Definition at line 124 of file MuCondition.h.

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

const GtBoard* l1t::MuCondition::m_gtGTL
private

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

Definition at line 118 of file MuCondition.h.

Referenced by gtGTL().

const MuonTemplate* l1t::MuCondition::m_gtMuonTemplate
private

pointer to a MuonTemplate

Definition at line 115 of file MuCondition.h.

Referenced by gtMuonTemplate().

int l1t::MuCondition::m_ifMuEtaNumberBits
private

number of bits for eta of muon objects

Definition at line 121 of file MuCondition.h.

Referenced by gtIfMuEtaNumberBits().