51 const int ifMuEtaNumberBits) :
114 const int& ifMuEtaNumberBitsValue) {
122 const int& corrParDeltaPhiNrBins) {
145 if( ( useBx < candVec->getFirstBX() ) ||
150 int numberObjects = candVec->
size(useBx);
153 if (numberObjects < nObjInCond) {
157 std::vector<int>
index(numberObjects);
159 for (
int i = 0;
i < numberObjects; ++
i) {
163 int numberForFactorial = numberObjects - nObjInCond;
167 for(
int i=numberForFactorial;
i>0;
i-- ) myfactorial *=
i;
170 int jump = myfactorial;
178 bool condResult =
false;
183 objectsInComb.reserve(nObjInCond);
197 objectsInComb.clear();
199 bool tmpResult =
true;
201 bool passCondition =
false;
203 for (
int i = 0;
i < nObjInCond;
i++) {
206 tmpResult &= passCondition;
208 LogDebug(
"L1TGlobal") <<
"===> MuCondition::evaluateCondition, CONGRATS!! This muon passed the condition." << std::endl;
210 LogDebug(
"L1TGlobal") <<
"===> MuCondition::evaluateCondition, FAIL!! This muon failed the condition." << std::endl;
211 objectsInComb.push_back(index[i]);
232 if ((chargeCorr & 1) == 0) {
235 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: Checking Charge Correlation" << std::endl;
237 for (
int i = 0;
i < nObjInCond;
i++) {
239 int chargeValid = (candVec->
at(useBx,index[
i]))->hwChargeValid();
240 tmpResult &= chargeValid;
242 if ( chargeValid==0) {
248 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: Charge Correlation Failed...No Valid Charges" << std::endl;
253 if( nObjInCond > 1 ){
256 bool equalSigns =
true;
257 for (
int i = 0;
i < nObjInCond-1;
i++) {
258 if ((candVec->
at(useBx,index[
i]))->hwCharge() != (candVec->
at(useBx,index[i+1]))->hwCharge()) {
265 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: Checking Charge Correlation equalSigns = " << equalSigns << std::endl;
268 if (nObjInCond == 2 || nObjInCond == 3) {
269 if( !( ((chargeCorr & 2)!=0 && equalSigns) || ((chargeCorr & 4)!=0 && !equalSigns) ) ){
270 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: 2/3 Muon Fail Charge Correlation Condition =" << chargeCorr << std::endl;
274 else if (nObjInCond == 4) {
276 unsigned int posCount = 0;
278 for (
int i = 0;
i < nObjInCond;
i++) {
279 if ((candVec->
at(useBx,index[
i]))->hwCharge()> 0) {
284 if( !( ((chargeCorr & 2)!=0 && equalSigns) || ((chargeCorr & 4)!=0 && posCount==2) ) ){
285 LogDebug(
"L1TGlobal") <<
"===> MuCondition:: 4 Muon Fail Charge Correlation Condition = " << chargeCorr <<
" posCnt " << posCount << std::endl;
298 const int ObjInWscComb = 2;
299 if (nObjInCond != ObjInWscComb) {
302 <<
"number of particles in condition with spatial correlation = " << nObjInCond
303 <<
"\n it must be = " << ObjInWscComb << std::endl;
311 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
318 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
331 }
while (std::next_permutation(index.begin(), index.end()) );
362 if (iCondition >= nObjInCond || iCondition < 0) {
400 <<
"\n MuonTemplate::ObjectParameter : " << std::hex
403 <<
"\n\t indexHigh = 0x " << objPar.
indexHigh 404 <<
"\n\t indexLow = 0x " << objPar.
indexLow 405 <<
"\n\t requestIso = 0x " << objPar.
requestIso 406 <<
"\n\t enableIso = 0x " << objPar.
enableIso 407 <<
"\n\t etaRange = 0x " << objPar.
etaRange 408 <<
"\n\t phiLow = 0x " << objPar.
phiLow 409 <<
"\n\t phiHigh = 0x " << objPar.
phiHigh 414 <<
"\n\t charge = 0x " << objPar.
charge 415 <<
"\n\t qualityLUT = 0x " << objPar.
qualityLUT 417 <<
"\n\t enableMip = 0x " << objPar.
enableMip 422 <<
"\n\t hwPt = 0x " << cand.
hwPt()
423 <<
"\n\t hwEtaAtVtx = 0x " << cand.
hwEtaAtVtx()
424 <<
"\n\t hwPhiAtVtx = 0x " << cand.
hwPhiAtVtx()
425 <<
"\n\t hwCharge = 0x " << cand.
hwCharge()
426 <<
"\n\t hwQual = 0x " << cand.
hwQual()
432 LogDebug(
"L1TGlobal") <<
"\t\t Muon Failed checkThreshold " << std::endl;
438 LogDebug(
"L1TGlobal") <<
"\t\t Muon Failed checkIndex " << std::endl;
444 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
450 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
457 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed charge requirement" << std::endl;
467 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate has out of range hwQual = " << cand.
hwQual() << std::endl;
472 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed quality requirement" << std::endl;
479 if( cand.
hwIso()>4 ){
480 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate has out of range hwIso = " << cand.
hwIso() << std::endl;
485 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed isolation requirement" << std::endl;
528 myCout <<
" Number of bits for eta of muon objects = " 530 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
const bool evaluateCondition(const int bxEval) const override
the core function to check if the condition matches
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
void print(std::ostream &myCout) const override
print condition
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
unsigned int ptHighThreshold
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
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
void print(std::ostream &myCout) const override
print the condition
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 bool checkObjectParameter(const int iCondition, const l1t::Muon &cand, const unsigned int index) const
function to check a single object if it matches a condition
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
const bool checkIndex(const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
check if a index is in a given range
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