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);
131 bool condResult =
false;
136 objectsInComb.reserve(nObjInCond);
148 objectsInComb.clear();
150 bool tmpResult =
true;
154 for (
int i = 0;
i < nObjInCond;
i++) {
156 objectsInComb.push_back(
index[
i]);
172 if ((chargeCorr & 1) == 0) {
173 for (
int i = 0;
i < nObjInCond;
i++) {
175 bool chargeValid = (*candVec)[
index[
i]]->charge_valid();
176 tmpResult &= chargeValid;
187 if (nObjInCond == 1) {
190 if (!(((chargeCorr & 4) != 0 && (*candVec)[
index[0]]->
charge() > 0) ||
191 ((chargeCorr & 2) != 0 && (*candVec)[
index[0]]->
charge() < 0))) {
198 bool equalSigns =
true;
199 for (
int i = 0;
i < nObjInCond - 1;
i++) {
207 if (nObjInCond == 2 || nObjInCond == 3) {
209 if (!(((chargeCorr & 4) != 0 && equalSigns) || ((chargeCorr & 2) != 0 && !equalSigns))) {
215 if (nObjInCond == 4) {
217 unsigned int posCount = 0;
219 for (
int i = 0;
i < nObjInCond;
i++) {
226 if (!(((chargeCorr & 4) != 0 && equalSigns) || ((chargeCorr & 2) != 0 && posCount == 2))) {
237 const int ObjInWscComb = 2;
238 if (nObjInCond != ObjInWscComb) {
240 <<
"number of particles in condition with spatial correlation = " << nObjInCond
241 <<
"\n it must be = " << ObjInWscComb << std::endl;
247 unsigned int candDeltaEta;
248 unsigned int candDeltaPhi;
254 int signedEta[ObjInWscComb];
255 int signBit[ObjInWscComb] = {0, 0};
259 for (
int i = 0;
i < ObjInWscComb; ++
i) {
261 signedEta[
i] = ((*candVec)[
index[
i]]->etaIndex()) % scaleEta;
263 if (signBit[
i] == 1) {
264 signedEta[
i] = (-1) * signedEta[
i];
271 static_cast<int>(
std::abs(signedEta[1] - signedEta[0])) + static_cast<int>(signBit[1] ^ signBit[0]);
280 if ((*candVec)[
index[0]]->phiIndex() > (*candVec)[
index[1]]->phiIndex()) {
281 candDeltaPhi = (*candVec)[
index[0]]->phiIndex() - (*candVec)[
index[1]]->phiIndex();
283 candDeltaPhi = (*candVec)[
index[1]]->phiIndex() - (*candVec)[
index[0]]->phiIndex();
294 unsigned int candDeltaPhiInitial = candDeltaPhi;
299 LogTrace(
"L1GlobalTrigger") <<
" Initial candDeltaPhi = " << candDeltaPhiInitial
301 <<
" ==> candDeltaPhi rescaled to: " << candDeltaPhi <<
" [ loop index " << iLoop
302 <<
"; breaks after " << nMaxLoop <<
" loops ]\n" 307 if (iLoop > nMaxLoop) {
313 if (candDeltaPhi < 64) {
331 }
while (std::next_permutation(
index.begin(),
index.end()));
353 if (iCondition >= nObjInCond || iCondition < 0) {
436 if (
cand.quality() == 0) {
466 myCout <<
" Number of bits for eta of muon objects = " <<
m_ifMuEtaNumberBits << std::endl;
467 myCout <<
" Maximum number of bins for the delta phi scales = " <<
m_corrParDeltaPhiNrBins <<
"\n " << std::endl;
L1GtMuonCondition & operator=(const L1GtMuonCondition &)
unsigned int ptHighThreshold
int m_verbosity
verbosity level
unsigned long long etaRange
bool m_condLastResult
the last result of evaluateCondition()
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
void setGtIfMuEtaNumberBits(const int &)
unsigned int m_corrParDeltaPhiNrBins
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
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
Log< level::Error, false > LogError
virtual void print(std::ostream &myCout) const
print condition
const std::vector< const L1MuGMTCand * > * getCandL1Mu() const
return global muon trigger candidate
const L1GtMuonTemplate * m_gtMuonTemplate
pointer to a L1GtMuonTemplate
const bool checkObjectParameter(const int iCondition, const L1MuGMTCand &cand) const
function to check a single object if it matches a condition
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
unsigned long long deltaPhiRange0Word
Abs< T >::type abs(const T &t)
unsigned int chargeCorrelation
const CorrelationParameter * correlationParameter() const
~L1GtMuonCondition() override
const bool condGEq() const
get / set condition GEq flag
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
void setGtMuonTemplate(const L1GtMuonTemplate *)
const std::vector< ObjectParameter > * objectParameter() const
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
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
void setGtCorrParDeltaPhiNrBins(const int &)
int factorial(int n)
factorial function
const int nrObjects() const
get number of trigger objects
unsigned long long deltaPhiRange1Word
const L1MuGMTCand * getCandidate(const int indexCand) const
load muon candidates