51 const int ifMuEtaNumberBits)
55 m_ifMuEtaNumberBits(ifMuEtaNumberBits) {
112 int numberObjects = candVec->size();
115 if (numberObjects < nObjInCond) {
119 std::vector<int>
index(numberObjects);
121 for (
int i = 0;
i < numberObjects; ++
i) {
126 int jump =
factorial(numberObjects - nObjInCond);
134 bool condResult =
false;
139 objectsInComb.reserve(nObjInCond);
152 objectsInComb.clear();
154 bool tmpResult =
true;
158 for (
int i = 0;
i < nObjInCond;
i++) {
160 objectsInComb.push_back(index[i]);
176 if ((chargeCorr & 1) == 0) {
177 for (
int i = 0;
i < nObjInCond;
i++) {
179 bool chargeValid = (*candVec)[index[
i]]->charge_valid();
180 tmpResult &= chargeValid;
191 if (nObjInCond == 1) {
194 if (!(((chargeCorr & 4) != 0 && (*candVec)[index[0]]->
charge() > 0) ||
195 ((chargeCorr & 2) != 0 && (*candVec)[index[0]]->
charge() < 0))) {
202 bool equalSigns =
true;
203 for (
int i = 0;
i < nObjInCond - 1;
i++) {
204 if ((*candVec)[index[
i]]->
charge() != (*candVec)[index[
i + 1]]->
charge()) {
211 if (nObjInCond == 2 || nObjInCond == 3) {
213 if (!(((chargeCorr & 4) != 0 && equalSigns) || ((chargeCorr & 2) != 0 && !equalSigns))) {
219 if (nObjInCond == 4) {
221 unsigned int posCount = 0;
223 for (
int i = 0;
i < nObjInCond;
i++) {
224 if ((*candVec)[index[
i]]->
charge() > 0) {
230 if (!(((chargeCorr & 4) != 0 && equalSigns) || ((chargeCorr & 2) != 0 && posCount == 2))) {
241 const int ObjInWscComb = 2;
242 if (nObjInCond != ObjInWscComb) {
244 <<
"number of particles in condition with spatial correlation = " << nObjInCond
245 <<
"\n it must be = " << ObjInWscComb << std::endl;
251 unsigned int candDeltaEta;
252 unsigned int candDeltaPhi;
258 int signedEta[ObjInWscComb];
259 int signBit[ObjInWscComb] = {0, 0};
263 for (
int i = 0;
i < ObjInWscComb; ++
i) {
265 signedEta[
i] = ((*candVec)[index[
i]]->etaIndex()) % scaleEta;
267 if (signBit[
i] == 1) {
268 signedEta[
i] = (-1) * signedEta[
i];
275 static_cast<int>(
std::abs(signedEta[1] - signedEta[0])) + static_cast<int>(signBit[1] ^ signBit[0]);
284 if ((*candVec)[index[0]]->phiIndex() > (*candVec)[index[1]]->phiIndex()) {
285 candDeltaPhi = (*candVec)[index[0]]->phiIndex() - (*candVec)[index[1]]->phiIndex();
287 candDeltaPhi = (*candVec)[index[1]]->phiIndex() - (*candVec)[index[0]]->phiIndex();
298 unsigned int candDeltaPhiInitial = candDeltaPhi;
303 LogTrace(
"L1GlobalTrigger") <<
" Initial candDeltaPhi = " << candDeltaPhiInitial
305 <<
" ==> candDeltaPhi rescaled to: " << candDeltaPhi <<
" [ loop index " << iLoop
306 <<
"; breaks after " << nMaxLoop <<
" loops ]\n"
311 if (iLoop > nMaxLoop) {
317 if (candDeltaPhi < 64) {
336 }
while (std::next_permutation(index.begin(), index.end()));
366 if (iCondition >= nObjInCond || iCondition < 0) {
479 myCout <<
" Number of bits for eta of muon objects = " <<
m_ifMuEtaNumberBits << std::endl;
480 myCout <<
" Maximum number of bins for the delta phi scales = " <<
m_corrParDeltaPhiNrBins <<
"\n " << std::endl;
L1GtMuonCondition & operator=(const L1GtMuonCondition &)
const int nrObjects() const
get number of trigger objects
const CorrelationParameter * correlationParameter() const
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
unsigned int ptHighThreshold
int m_verbosity
verbosity level
unsigned long long etaRange
bool m_condLastResult
the last result of evaluateCondition()
unsigned int phiIndex() const
get phi-code
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
void setGtIfMuEtaNumberBits(const int &)
unsigned int m_corrParDeltaPhiNrBins
unsigned int etaIndex() const
get eta-code
void copy(const L1GtMuonCondition &cp)
copy function for copy constructor and operator=
std::vector< int > SingleCombInCond
typedefs
const bool evaluateCondition() const override
the core function to check if the condition matches
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
Log< level::Error, false > LogError
int condMaxNumberObjects() const
const L1GtMuonTemplate * m_gtMuonTemplate
pointer to a L1GtMuonTemplate
bool isol() const
get isolation
const int gtIfMuEtaNumberBits() const
get / set the number of bits for eta of muon objects
bool empty() const
is it an empty muon candidate?
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
const L1MuGMTCand * getCandidate(const int indexCand) const
load muon candidates
const L1GlobalTriggerGTL * gtGTL() const
get / set the pointer to GTL
unsigned long long deltaPhiRange0Word
const std::vector< ObjectParameter > * objectParameter() const
Abs< T >::type abs(const T &t)
unsigned int chargeCorrelation
~L1GtMuonCondition() override
const bool checkObjectParameter(const int iCondition, const L1MuGMTCand &cand) const
function to check a single object if it matches a condition
void print(std::ostream &myCout) const override
print the condition
void setGtGTL(const L1GlobalTriggerGTL *)
set the pointer to GTL
unsigned int qualityRange
unsigned int ptLowThreshold
int m_condMaxNumberObjects
const std::vector< const L1MuGMTCand * > * getCandL1Mu() const
return global muon trigger candidate
unsigned int quality() const
get quality
void setGtMuonTemplate(const L1GtMuonTemplate *)
const L1GlobalTriggerGTL * m_gtGTL
pointer to GTL, to be able to get the trigger objects
void print(std::ostream &myCout) const override
print condition
unsigned long long deltaEtaRange
const L1GtMuonTemplate * gtMuonTemplate() const
get / set the pointer to a L1GtCondition
void setGtCorrParDeltaPhiNrBins(const int &)
int factorial(int n)
factorial function
virtual void print(std::ostream &myCout) const
print condition
const bool condGEq() const
get / set condition GEq flag
unsigned long long deltaPhiRange1Word
unsigned int ptIndex() const
get pt-code
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
bool condLastResult() const
get the latest result for the condition