55 const int ifMuEtaNumberBits) :
59 m_ifMuEtaNumberBits(ifMuEtaNumberBits)
130 int numberObjects = candVec->size();
133 if (numberObjects < nObjInCond) {
137 std::vector<int>
index(numberObjects);
139 for (
int i = 0;
i < numberObjects; ++
i) {
144 int jump =
factorial(numberObjects - nObjInCond);
152 bool condResult =
false;
157 objectsInComb.reserve(nObjInCond);
160 (*m_combinationsInCond).clear();
171 objectsInComb.clear();
173 bool tmpResult =
true;
176 for (
int i = 0;
i < nObjInCond;
i++) {
179 objectsInComb.push_back(index[i]);
199 if ((chargeCorr & 1) == 0) {
201 for (
int i = 0;
i < nObjInCond;
i++) {
203 bool chargeValid = (*candVec)[index[
i]]->charge_valid();
204 tmpResult &= chargeValid;
215 if (nObjInCond == 1) {
218 if ( ! ( ( (chargeCorr & 4) != 0 && (*candVec)[index[0]]->
charge()> 0 )
219 || ( (chargeCorr & 2) != 0 && (*candVec)[index[0]]->
charge() < 0 ) )) {
228 bool equalSigns =
true;
229 for (
int i = 0;
i < nObjInCond-1;
i++) {
230 if ((*candVec)[index[
i]]->
charge() != (*candVec)[index[
i+1]]->
charge()) {
237 if (nObjInCond == 2 || nObjInCond == 3) {
239 if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
240 && !equalSigns ) )) {
247 if (nObjInCond == 4) {
249 unsigned int posCount = 0;
251 for (
int i = 0;
i < nObjInCond;
i++) {
252 if ((*candVec)[index[
i]]->
charge()> 0) {
258 if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
259 && posCount == 2 ) )) {
273 const int ObjInWscComb = 2;
274 if (nObjInCond != ObjInWscComb) {
277 <<
"number of particles in condition with spatial correlation = " << nObjInCond
278 <<
"\n it must be = " << ObjInWscComb << std::endl;
284 unsigned int candDeltaEta;
285 unsigned int candDeltaPhi;
291 int signedEta[ObjInWscComb];
292 int signBit[ObjInWscComb] = { 0, 0 };
296 for (
int i = 0;
i < ObjInWscComb; ++
i) {
298 signedEta[
i] = ((*candVec)[index[
i]]->etaIndex() )%scaleEta;
300 if (signBit[
i] == 1) {
301 signedEta[
i] = (-1)*signedEta[
i];
307 candDeltaEta =
static_cast<int> (
std::abs(signedEta[1] - signedEta[0]))
308 + static_cast<int> (signBit[1]^signBit[0]);
317 if ((*candVec)[index[0]]->phiIndex()> (*candVec)[index[1]]->phiIndex()) {
318 candDeltaPhi = (*candVec)[index[0]]->phiIndex() - (*candVec)[index[1]]->phiIndex();
321 candDeltaPhi = (*candVec)[index[1]]->phiIndex() - (*candVec)[index[0]]->phiIndex();
330 LogTrace(
"L1GtMuonCondition") <<
" candDeltaPhi rescaled to: " << candDeltaPhi
335 if (candDeltaPhi < 64) {
353 (*m_combinationsInCond).push_back(objectsInComb);
355 }
while (std::next_permutation(index.begin(), index.end()) );
386 if (iCondition >= nObjInCond || iCondition < 0) {
433 if ( !cand.
isol() ) {
445 if ( !cand.
isol() ) {
L1GtMuonCondition & operator=(const L1GtMuonCondition &)
CombinationsInCond * m_combinationsInCond
store all the object combinations evaluated to true in the condition
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
virtual ~L1GtMuonCondition()
unsigned int ptHighThreshold
int m_verbosity
verbosity level
unsigned long long etaRange
CombinationsInCond * getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
bool m_condLastResult
the last result of evaluateCondition()
unsigned int phiIndex() const
get phi-code
unsigned int deltaPhiMaxbits
void setGtIfMuEtaNumberBits(const int &)
unsigned int etaIndex() const
get eta-code
void copy(const L1GtMuonCondition &cp)
copy function for copy constructor and operator=
std::vector< int > SingleCombInCond
typedefs
int m_ifMuEtaNumberBits
number of bits for eta of muon objects
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
unsigned int chargeCorrelation
const bool checkObjectParameter(const int iCondition, const L1MuGMTCand &cand) const
function to check a single object if it matches a condition
void setGtGTL(const L1GlobalTriggerGTL *)
set the pointer to GTL
unsigned int qualityRange
unsigned int ptLowThreshold
int m_condMaxNumberObjects
unsigned int quality() const
get quality
void setGtMuonTemplate(const L1GtMuonTemplate *)
const bool evaluateCondition() const
the core function to check if the condition matches
const L1GlobalTriggerGTL * m_gtGTL
pointer to GTL, to be able to get the trigger objects
virtual void print(std::ostream &myCout) const
print the condition
unsigned long long deltaEtaRange
const L1GtMuonTemplate * gtMuonTemplate() const
get / set the pointer to a L1GtCondition
void print(std::ostream &myCout) const
print condition
int factorial(int n)
factorial function
virtual void print(std::ostream &myCout) const
print condition
const bool condGEq() const
get / set condition GEq flag
const std::vector< const L1MuGMTCand * > * getCandL1Mu() const
return global muon trigger candidate
unsigned long long deltaPhiRange1Word
unsigned int ptIndex() const
get pt-code
bool condLastResult() const
get the latest result for the condition