50 const int ifMuEtaNumberBits) :
113 const int& ifMuEtaNumberBitsValue) {
121 const int& corrParDeltaPhiNrBins) {
144 if( ( useBx < candVec->getFirstBX() ) ||
149 int numberObjects = candVec->
size(useBx);
152 if (numberObjects < nObjInCond) {
156 std::vector<int>
index(numberObjects);
158 for (
int i = 0;
i < numberObjects; ++
i) {
162 int numberForFactorial = numberObjects - nObjInCond;
166 for(
int i=numberForFactorial;
i>0;
i-- ) myfactorial *=
i;
169 int jump = myfactorial;
177 bool condResult =
false;
182 objectsInComb.reserve(nObjInCond);
196 objectsInComb.clear();
198 bool tmpResult =
true;
200 bool passCondition =
false;
202 for (
int i = 0;
i < nObjInCond;
i++) {
205 tmpResult &= passCondition;
207 LogDebug(
"L1TGlobal") <<
"===> MuCondition::evaluateCondition, CONGRATS!! This muon passed the condition." << std::endl;
209 LogDebug(
"L1TGlobal") <<
"===> MuCondition::evaluateCondition, FAIL!! This muon failed the condition." << std::endl;
210 objectsInComb.push_back(index[i]);
231 if ((chargeCorr & 1) == 0) {
234 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: Checking Charge Correlation" << std::endl;
236 for (
int i = 0;
i < nObjInCond;
i++) {
238 int chargeValid = (candVec->
at(useBx,index[
i]))->hwChargeValid();
239 tmpResult &= chargeValid;
241 if ( chargeValid==0) {
247 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: Charge Correlation Failed...No Valid Charges" << std::endl;
252 if( nObjInCond > 1 ){
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()) {
264 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: Checking Charge Correlation equalSigns = " << equalSigns << std::endl;
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;
273 else if (nObjInCond == 4) {
275 unsigned int posCount = 0;
277 for (
int i = 0;
i < nObjInCond;
i++) {
278 if ((candVec->
at(useBx,index[
i]))->hwCharge()> 0) {
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;
297 const int ObjInWscComb = 2;
298 if (nObjInCond != ObjInWscComb) {
301 <<
"number of particles in condition with spatial correlation = " << nObjInCond
302 <<
"\n it must be = " << ObjInWscComb << std::endl;
310 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
317 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
330 }
while (std::next_permutation(index.begin(), index.end()) );
361 if (iCondition >= nObjInCond || iCondition < 0) {
399 <<
"\n MuonTemplate::ObjectParameter : " << std::hex
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 411 <<
"\n\t charge = 0x " << objPar.
charge 412 <<
"\n\t qualityLUT = 0x " << objPar.
qualityLUT 414 <<
"\n\t enableMip = 0x " << objPar.
enableMip 419 <<
"\n\t hwPt = 0x " << cand.
hwPt()
420 <<
"\n\t hwEtaAtVtx = 0x " << cand.
hwEtaAtVtx()
421 <<
"\n\t hwPhiAtVtx = 0x " << cand.
hwPhiAtVtx()
422 <<
"\n\t hwCharge = 0x " << cand.
hwCharge()
423 <<
"\n\t hwQual = 0x " << cand.
hwQual()
429 LogDebug(
"L1TGlobal") <<
"\t\t Muon Failed checkThreshold " << std::endl;
436 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
442 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
449 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed charge requirement" << std::endl;
459 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate has out of range hwQual = " << cand.
hwQual() << std::endl;
464 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed quality requirement" << std::endl;
471 if( cand.
hwIso()>4 ){
472 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate has out of range hwIso = " << cand.
hwIso() << std::endl;
477 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed isolation requirement" << std::endl;
520 myCout <<
" Number of bits for eta of muon objects = " 522 myCout <<
" Maximum number of bins for the delta phi scales = "
unsigned int isolationLUT
unsigned int phiWindow2Upper
const int nrObjects() const
get number of trigger objects
void setGtGTL(const GlobalBoard *)
set the pointer to GTL
unsigned size(int bx) const
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
unsigned int deltaEtaRangeLower
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 MuonTemplate * gtMuonTemplate() const
get / set the pointer to a Condition
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
virtual void print(std::ostream &myCout) const
print the condition
unsigned int ptHighThreshold
void print(std::ostream &myCout) const
print condition
const bool checkObjectParameter(const int iCondition, const l1t::Muon &cand) const
function to check a single object if it matches a condition
virtual void print(std::ostream &myCout) const
print condition
std::vector< int > SingleCombInCond
typedefs
const bool condGEq() const
get / set condition GEq flag
const GlobalBoard * gtGTL() const
get / set the pointer to GTL
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
unsigned int phiWindow2Lower
const bool checkThreshold(const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
const bool evaluateCondition(const int bxEval) const
the core function to check if the condition matches
unsigned int ptLowThreshold
bool condLastResult() const
get the latest result for the condition
const int gtIfMuEtaNumberBits() const
get / set the number of bits for eta of muon objects
const int & condRelativeBx() const
get / set the condition relative bx
unsigned int etaWindow2Lower
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
unsigned int phiWindow1Lower
const std::vector< ObjectParameter > * objectParameter() const
unsigned long long etaRange
unsigned int m_corrParDeltaPhiNrBins
unsigned int deltaPhiRangeLower
const MuonTemplate * m_gtMuonTemplate
pointer to a MuonTemplate
void setGtIfMuEtaNumberBits(const int &)
unsigned int etaWindow2Upper
unsigned int deltaPhiRangeUpper
unsigned int phiWindow1Upper
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
const BXVector< const l1t::Muon * > * getCandL1Mu() const
return global muon trigger candidate
int m_verbosity
verbosity level
void setGtCorrParDeltaPhiNrBins(const int &)
int condMaxNumberObjects() const
void copy(const MuCondition &cp)
copy function for copy constructor and operator=
bool m_condLastResult
the last result of evaluateCondition()
void setGtMuonTemplate(const MuonTemplate *)
const CorrelationParameter * correlationParameter() const
unsigned int etaWindow1Lower
int m_condMaxNumberObjects
const bool checkRangeDeltaEta(const unsigned int obj1Eta, const unsigned int obj2Eta, const Type1 &lowerR, const Type1 &upperR, const unsigned int nEtaBits) const
check if a value is in a given range
const l1t::Muon * getCandidate(const int bx, const int indexCand) const
load muon candidates
unsigned int etaWindow1Upper
unsigned int chargeCorrelation
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
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
MuCondition & operator=(const MuCondition &)
unsigned int deltaEtaRangeUpper
const T & at(int bx, unsigned i) const