test
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 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
 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 *)
 
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 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 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 36 of file MuCondition.h.

Constructor & Destructor Documentation

MuCondition::MuCondition ( )

constructors default

Definition at line 40 of file MuCondition.cc.

40  :
42 
43  // empty
44 
45 }
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 48 of file MuCondition.cc.

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

50  :
52  m_gtMuonTemplate(static_cast<const MuonTemplate*>(muonTemplate)),
53  m_gtGTL(ptrGTL),
54  m_ifMuEtaNumberBits(ifMuEtaNumberBits)
55 {
57  m_condMaxNumberObjects = nrL1Mu;
58 }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:118
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
MuCondition::MuCondition ( const MuCondition cp)

Definition at line 77 of file MuCondition.cc.

References copy().

77  :
79  copy(cp);
80 }
void copy(const MuCondition &cp)
copy function for copy constructor and operator=
Definition: MuCondition.cc:61
MuCondition::~MuCondition ( )
virtual

Definition at line 83 of file MuCondition.cc.

83  {
84 
85  // empty
86 
87 }

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 356 of file MuCondition.cc.

References MuonTemplate::ObjectParameter::charge, 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::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), MuonTemplate::ObjectParameter::isolationLUT, LogDebug, 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.

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

copy function for copy constructor and operator=

Definition at line 61 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().

61  {
62 
63  m_gtMuonTemplate = cp.gtMuonTemplate();
64  m_gtGTL = cp.gtGTL();
65 
66  m_ifMuEtaNumberBits = cp.gtIfMuEtaNumberBits();
67  m_corrParDeltaPhiNrBins = cp.m_corrParDeltaPhiNrBins;
68 
69  m_condMaxNumberObjects = cp.condMaxNumberObjects();
70  m_condLastResult = cp.condLastResult();
71  m_combinationsInCond = cp.getCombinationsInCond();
72 
73  m_verbosity = cp.m_verbosity;
74 
75 }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
Definition: MuCondition.h:118
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
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 129 of file MuCondition.cc.

References BXVector< T >::at(), MuonTemplate::CorrelationParameter::chargeCorrelation, MuonTemplate::CorrelationParameter::deltaEtaRangeLower, MuonTemplate::CorrelationParameter::deltaEtaRangeUpper, MuonTemplate::CorrelationParameter::deltaPhiRangeLower, MuonTemplate::CorrelationParameter::deltaPhiRangeUpper, BXVector< T >::getLastBX(), i, cmsHarvester::index, LogDebug, and BXVector< T >::size().

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

342  {
343 
344  return (m_gtGTL->getCandL1Mu())->at(bx,indexCand); //BLW Change for BXVector
345 }
const GlobalBoard * 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: GlobalBoard.h:143
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 GlobalBoard* 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 GlobalBoard * 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 90 of file MuCondition.cc.

References filterCSVwithJSON::copy.

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

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 516 of file MuCondition.cc.

References l1t::ConditionEvaluation::print().

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

516  {
517 
518  m_gtMuonTemplate->print(myCout);
519 
520  myCout << " Number of bits for eta of muon objects = "
521  << m_ifMuEtaNumberBits << std::endl;
522  myCout << " Maximum number of bins for the delta phi scales = "
523  << m_corrParDeltaPhiNrBins << "\n " << std::endl;
524 
526 
527 }
virtual void print(std::ostream &myCout) const
print the condition
Definition: MuonTemplate.cc:97
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 120 of file MuCondition.cc.

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

set the pointer to GTL

Definition at line 104 of file MuCondition.cc.

104  {
105 
106  m_gtGTL = ptrGTL;
107 
108 }
const GlobalBoard * 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 112 of file MuCondition.cc.

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

Definition at line 97 of file MuCondition.cc.

97  {
98 
99  m_gtMuonTemplate = muonTempl;
100 
101 }
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 GlobalBoard* 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().