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++) {
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++) {
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) {
449 if (
cand.quality() == 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 &)
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 clear(HadCaloObj &c)
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