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

430  {
431 
432  // number of objects in condition
433  int nObjInCond = m_gtMuonTemplate->nrObjects();
434 
435  if (iCondition >= nObjInCond || iCondition < 0) {
436  return false;
437  }
438 
439 // // empty candidates can not be compared
440 // if (cand.empty()) {
441 // return false;
442 // }
443 
444  const MuonTemplate::ObjectParameter objPar =
445  ( *(m_gtMuonTemplate->objectParameter()) )[iCondition];
446 
447  // using the logic table from GTL-9U-module.pdf
448  // "Truth table for Isolation bit"
449 
450  // check thresholds:
451 
452  // value < low pt threshold
453  // fail trigger
454 
455  // low pt threshold <= value < high pt threshold & non-isolated muon:
456  // requestIso true: fail trigger
457  // requestIso false, enableIso true: fail trigger
458  // requestIso false, enableIso false: OK, trigger
459 
460  // low pt threshold <= value < high pt threshold & isolated muon:
461  // requestIso true: OK, trigger
462  // requestIso false, enableIso true: OK, trigger
463  // requestIso false, enableIso false: OK, trigger
464 
465  // value >= high pt threshold & non-isolated muon:
466  // requestIso true: fail trigger
467  // requestIso false: OK, trigger
468 
469  // value >= high pt threshold & isolated muon:
470  // OK, trigger
471 
472  LogDebug("l1t|Global")
473  << "\n MuonTemplate::ObjectParameter : "
474  << "\n\t ptHighThreshold = " << objPar.ptHighThreshold
475  << "\n\t ptLowThreshold = " << objPar.ptLowThreshold
476  << "\n\t requestIso = " << objPar.requestIso
477  << "\n\t enableIso = " << objPar.enableIso
478  << "\n\t etaRange = " << objPar.etaRange
479  << "\n\t phiLow = " << objPar.phiLow
480  << "\n\t phiHigh = " << objPar.phiHigh
481  << "\n\t qualityRange = " << objPar.qualityRange
482  << "\n\t enableMip = " << objPar.enableMip
483  << std::endl;
484 
485  LogDebug("l1t|Global")
486  << "\n l1t::Muon : "
487  << "\n\t hwPt = " << cand.hwPt()
488  << "\n\t hwEta = " << cand.hwEta()
489  << "\n\t hwPhi = " << cand.hwPhi()
490  << "\n\t hwQual = " << cand.hwQual()
491  << "\n\t hwIso = " << cand.hwIso()
492  << "\n\t hwMip = " << cand.hwMip()
493  << std::endl;
494 
495 
496  if ( !checkThreshold(objPar.ptHighThreshold, cand.hwPt(), m_gtMuonTemplate->condGEq()) ) {
497 
498  if ( !checkThreshold(objPar.ptLowThreshold, cand.hwPt(), m_gtMuonTemplate->condGEq()) ) {
499  LogDebug("l1t|Global") << "\t\t Muon Failed checkThreshold " << std::endl;
500  return false;
501  }
502  else {
503  // check isolation
504  if ( !cand.hwIso() ) {
505  if (objPar.requestIso || objPar.enableIso) {
506  LogDebug("l1t|Global") << "\t\t Muon Failed hwIso " << std::endl;
507  return false;
508  }
509  }
510  }
511  }
512  else {
513 
514  if ( !cand.hwIso() ) {
515  if (objPar.requestIso) {
516  LogDebug("l1t|Global") << "\t\t Muon Failed hwIso " << std::endl;
517  return false;
518  }
519  }
520  }
521 
522  // check eta
523  // DP - Enable once muon conditions mature
524 // if( !checkRange(cand.hwEta(), objPar.etaRangeBegin, objPar.etaRangeEnd, objPar.etaRangeVetoBegin, objPar.etaRangeVetoEnd) ){
525 // return false;
526 // }
527 
528 // // check phi
529 // if( !checkRange(cand.hwPhi(), objPar.phiRangeBegin, objPar.phiRangeEnd, objPar.phiRangeVetoBegin, objPar.phiRangeVetoEnd) ){
530 // return false;
531 // }
532 
534 // if (!checkBit(objPar.etaRange, cand.hwEta())) {
535 // LogDebug("l1t|Global") << "\t\t Muon Failed checkBit(etaRange) " << std::endl;
536 // return false;
537 // }
538 
539 // // check phi - in the requested range (no LUT used - LUT too big for hw chip)
540 // // for phiLow <= phiHigh takes [phiLow, phiHigh]
541 // // for phiLow >= phiHigh takes [phiLow, phiHigh] over zero angle!
542 // if (objPar.phiHigh >= objPar.phiLow) {
543 // if (! ( (objPar.phiLow <= (unsigned int)cand.hwPhi()) && ((unsigned int)cand.hwPhi() <= objPar.phiHigh ) )) {
544 // LogDebug("l1t|Global") << "\t\t Muon Failed checkBit(phiRange) " << std::endl;
545 // return false;
546 // }
547 // }
548 // else { // go over zero angle!!
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 
555  // check quality ( bit check )
556 
557  // A number of values is required to trigger (at least one).
558  // "Don’t care" means that all values are allowed.
559  // Qual = 000 means then NO MUON (GTL module)
560 
561  if (cand.hwQual() == 0) {
562  LogDebug("l1t|Global") << "\t\t Muon Failed hwQual() == 0" << std::endl;
563  return false;
564  }
565 
566  if (objPar.qualityRange == 0) {
567  LogDebug("l1t|Global") << "\t\t Muon Failed qualityRange == 0" << std::endl;
568  return false;
569  }
570  else {
571  if (!checkBit(objPar.qualityRange, cand.hwQual())) {
572  LogDebug("l1t|Global") << "\t\t Muon Failed checkBit(qualityRange) " << std::endl;
573  return false;
574  }
575  }
576 
577  // check mip
578  if (objPar.enableMip) {
579  if (!cand.hwMip()) {
580  LogDebug("l1t|Global") << "\t\t Muon Failed enableMip" << std::endl;
581  return false;
582  }
583  }
584 
585  // particle matches if we get here
586  //LogTrace("L1GlobalTrigger")
587  // << " checkObjectParameter: muon object OK, passes all requirements\n" << std::endl;
588 
589  return true;
590 }
#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:86
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(), DeDxDiscriminatorTools::charge(), MuonTemplate::CorrelationParameter::chargeCorrelation, hitfit::clear(), MuonTemplate::CorrelationParameter::deltaEtaRange, MuonTemplate::CorrelationParameter::deltaPhiRange0Word, MuonTemplate::CorrelationParameter::deltaPhiRange1Word, factorial(), 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("L1GlobalTrigger") << " 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 jumpIndex = 1;
166  int jump = factorial(numberObjects - nObjInCond);
167 
168  int totalLoops = 0;
169  int passLoops = 0;
170 
171  // condition result condResult set to true if at least one permutation
172  // passes all requirements
173  // all possible permutations are checked
174  bool condResult = false;
175 
176  // store the indices of the muon objects
177  // from the combination evaluated in the condition
178  SingleCombInCond objectsInComb;
179  objectsInComb.reserve(nObjInCond);
180 
181  // clear the m_combinationsInCond vector
183 
184  do {
185 
186  if (--jumpIndex)
187  continue;
188 
189  jumpIndex = jump;
190  totalLoops++;
191 
192  // clear the indices in the combination
193  objectsInComb.clear();
194 
195  bool tmpResult = true;
196 
197  bool passCondition = false;
198  // check if there is a permutation that matches object-parameter requirements
199  for (int i = 0; i < nObjInCond; i++) {
200 
201  passCondition = checkObjectParameter(i, *(candVec->at(useBx,index[i]) )); //BLW Change for BXVector
202  tmpResult &= passCondition;
203  if( passCondition )
204  LogDebug("l1t|Global") << "===> MuCondition::evaluateCondition, CONGRATS!! This muon passed the condition." << std::endl;
205  else
206  LogDebug("l1t|Global") << "===> MuCondition::evaluateCondition, FAIL!! This muon failed the condition." << std::endl;
207  objectsInComb.push_back(index[i]);
208 
209  }
210 
211  // if permutation does not match particle conditions
212  // skip charge correlation and spatial correlations
213  if ( !tmpResult) {
214 
215  continue;
216 
217  }
218 
219  // get the correlation parameters (chargeCorrelation included here also)
222 
223  // charge_correlation consists of 3 relevant bits (D2, D1, D0)
224  unsigned int chargeCorr = corrPar.chargeCorrelation;
225 
226  // charge ignore bit (D0) not set?
227  if ((chargeCorr & 1) == 0) {
228 
229  for (int i = 0; i < nObjInCond; i++) {
230  // check valid charge - skip if invalid charge
231  int chargeValid = (candVec->at(useBx,index[i]))->hwChargeValid(); //BLW Change for BXVector
232  tmpResult &= chargeValid;
233 
234  if ( chargeValid==0) { //BLW type change for New Muon Class
235  continue;
236  }
237  }
238 
239  if ( !tmpResult) {
240  continue;
241  }
242 
243  if (nObjInCond == 1) { // one object condition
244 
245  // D2..enable pos, D1..enable neg
246  if ( ! ( ( (chargeCorr & 4) != 0 && (candVec->at(useBx,index[0]))->charge()> 0 ) //BLW Change for BXVector
247  || ( (chargeCorr & 2) != 0 && (candVec->at(useBx,index[0]))->charge() < 0 ) )) { //BLW Change for BXVector
248 
249  continue;
250  }
251 
252  }
253  else { // 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]))->charge() != (candVec->at(useBx,index[i+1]))->charge()) { //BLW Change for BXVector
259  equalSigns = false;
260  break;
261  }
262  }
263 
264  // two or three particle condition
265  if (nObjInCond == 2 || nObjInCond == 3) {
266  // D2..enable equal, D1..enable not equal
267  if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
268  && !equalSigns ) )) {
269 
270  continue;
271  }
272  }
273 
274  // four particle condition
275  if (nObjInCond == 4) {
276  //counter to count positive charges to determine if there are pairs
277  unsigned int posCount = 0;
278 
279  for (int i = 0; i < nObjInCond; i++) {
280  if ((candVec->at(useBx,index[i]))->charge()> 0) { //BLW Change for BXVector
281  posCount++;
282  }
283  }
284 
285  // D2..enable equal, D1..enable pairs
286  if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
287  && posCount == 2 ) )) {
288 
289  continue;
290  }
291  }
292  }
293  } // end signchecks
294 
295 
296  if (m_gtMuonTemplate->wsc()) {
297 
298  // wsc requirements have always nObjInCond = 2
299  // one can use directly index[0] and index[1] to compute
300  // eta and phi differences
301  const int ObjInWscComb = 2;
302  if (nObjInCond != ObjInWscComb) {
303 
304  edm::LogError("L1GlobalTrigger") << "\n Error: "
305  << "number of particles in condition with spatial correlation = " << nObjInCond
306  << "\n it must be = " << ObjInWscComb << std::endl;
307  // TODO Perhaps I should throw here an exception,
308  // since something is really wrong if nObjInCond != ObjInWscComb (=2)
309  continue;
310  }
311 
312  unsigned int candDeltaEta;
313  unsigned int candDeltaPhi;
314 
315  // check candDeltaEta
316 
317  // get eta index and the sign bit of the eta index (MSB is the sign)
318  // signedEta[i] is the signed eta index of (*candVec)[index[i]]
319  int signedEta[ObjInWscComb];
320  int signBit[ObjInWscComb] = { 0, 0 };
321 
322  int scaleEta = 1 << (m_ifMuEtaNumberBits - 1);
323 
324  for (int i = 0; i < ObjInWscComb; ++i) {
325  signBit[i] = ((candVec->at(useBx,index[i]))->hwEta() & scaleEta)>>(m_ifMuEtaNumberBits - 1); //BLW Change for BXVector
326  signedEta[i] = ((candVec->at(useBx,index[i]))->hwEta() )%scaleEta; //BLW Change for BXVector
327 
328  if (signBit[i] == 1) {
329  signedEta[i] = (-1)*signedEta[i];
330  }
331 
332  }
333 
334  // compute candDeltaEta - add 1 if signs are different (due to +0/-0 indices)
335  candDeltaEta = static_cast<int> (std::abs(signedEta[1] - signedEta[0]))
336  + static_cast<int> (signBit[1]^signBit[0]);
337 
338  if ( !checkBit(corrPar.deltaEtaRange, candDeltaEta) ) {
339  continue;
340  }
341 
342  // check candDeltaPhi
343 
344  // calculate absolute value of candDeltaPhi
345  if ((candVec->at(useBx,index[0]))->hwPhi()> (candVec->at(useBx,index[1]))->hwPhi()) { //BLW Change for BXVector
346  candDeltaPhi = (candVec->at(useBx,index[0]))->hwPhi() - (candVec->at(useBx,index[1]))->hwPhi(); //BLW Change for BXVector
347  }
348  else {
349  candDeltaPhi = (candVec->at(useBx,index[1]))->hwPhi() - (candVec->at(useBx,index[0]))->hwPhi(); //BLW Change for BXVector
350  }
351 
352  // check if candDeltaPhi > 180 (via delta_phi_maxbits)
353  // delta_phi contains bits for 0..180 (0 and 180 included)
354  // protect also against infinite loop...
355 
356  int nMaxLoop = 10;
357  int iLoop = 0;
358 
359  while (candDeltaPhi >= m_corrParDeltaPhiNrBins) {
360 
361  unsigned int candDeltaPhiInitial = candDeltaPhi;
362 
363  // candDeltaPhi > 180 ==> take 360 - candDeltaPhi
364  candDeltaPhi = (m_corrParDeltaPhiNrBins - 1) * 2 - candDeltaPhi;
365  if (m_verbosity) {
366  LogTrace("L1GlobalTrigger")
367  << " Initial candDeltaPhi = "
368  << candDeltaPhiInitial
369  << " > m_corrParDeltaPhiNrBins = "
371  << " ==> candDeltaPhi rescaled to: "
372  << candDeltaPhi << " [ loop index " << iLoop
373  << "; breaks after " << nMaxLoop << " loops ]\n"
374  << std::endl;
375  }
376 
377  iLoop++;
378  if (iLoop > nMaxLoop) {
379  return false;
380  }
381  }
382 
383  // delta_phi bitmask is saved in two boost::uint64_t words
384  if (candDeltaPhi < 64) {
385  if (!checkBit(corrPar.deltaPhiRange0Word, candDeltaPhi) ) {
386  continue;
387  }
388  }
389  else {
390  if (!checkBit(corrPar.deltaPhiRange1Word, (candDeltaPhi - 64))) {
391  continue;
392  }
393  }
394 
395  } // end wsc check
396 
397  // if we get here all checks were successfull for this combination
398  // set the general result for evaluateCondition to "true"
399 
400  condResult = true;
401  passLoops++;
402  (combinationsInCond()).push_back(objectsInComb);
403 
404  } while (std::next_permutation(index.begin(), index.end()) );
405 
406  //LogTrace("L1GlobalTrigger")
407  // << "\n MuCondition: total number of permutations found: " << totalLoops
408  // << "\n MuCondition: number of permutations passing requirements: " << passLoops
409  // << "\n" << std::endl;
410 
411  return condResult;
412 
413 }
#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:430
std::vector< int > SingleCombInCond
typedefs
double charge(const std::vector< uint8_t > &Ampls)
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:79
#define LogTrace(id)
int m_verbosity
verbosity level
const bool wsc() const
Definition: GtCondition.cc:131
unsigned long long deltaPhiRange1Word
Definition: MuonTemplate.h:80
const BXVector< const l1t::Muon * > * getCandL1Mu() const
return global muon trigger candidate
Definition: GtBoard.h:137
unsigned long long deltaEtaRange
Definition: MuonTemplate.h:77
int getLastBX() const
const CorrelationParameter * correlationParameter() const
Definition: MuonTemplate.h:91
int factorial(int n)
factorial function
const T & at(int bx, int i) const
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const l1t::Muon * MuCondition::getCandidate ( const int  bx,
const int  indexCand 
) const
private

load muon candidates

Definition at line 416 of file MuCondition.cc.

References asciidump::at.

416  {
417 
418  return (m_gtGTL->getCandL1Mu())->at(bx,indexCand); //BLW Change for BXVector
419 }
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 592 of file MuCondition.cc.

References l1t::ConditionEvaluation::print().

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

592  {
593 
594  m_gtMuonTemplate->print(myCout);
595 
596  myCout << " Number of bits for eta of muon objects = "
597  << m_ifMuEtaNumberBits << std::endl;
598  myCout << " Maximum number of bins for the delta phi scales = "
599  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
600 
602 
603 }
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().