55 const int ifMuEtaNumberBits) :
59 m_ifMuEtaNumberBits(ifMuEtaNumberBits)
118 const int& ifMuEtaNumberBitsValue) {
126 const int& corrParDeltaPhiNrBins) {
142 int numberObjects = candVec->size();
145 if (numberObjects < nObjInCond) {
149 std::vector<int>
index(numberObjects);
151 for (
int i = 0;
i < numberObjects; ++
i) {
156 int jump =
factorial(numberObjects - nObjInCond);
164 bool condResult =
false;
169 objectsInComb.reserve(nObjInCond);
183 objectsInComb.clear();
185 bool tmpResult =
true;
188 for (
int i = 0;
i < nObjInCond;
i++) {
191 objectsInComb.push_back(index[i]);
211 if ((chargeCorr & 1) == 0) {
213 for (
int i = 0;
i < nObjInCond;
i++) {
215 bool chargeValid = (*candVec)[index[
i]]->charge_valid();
216 tmpResult &= chargeValid;
227 if (nObjInCond == 1) {
230 if ( ! ( ( (chargeCorr & 4) != 0 && (*candVec)[index[0]]->
charge()> 0 )
231 || ( (chargeCorr & 2) != 0 && (*candVec)[index[0]]->
charge() < 0 ) )) {
240 bool equalSigns =
true;
241 for (
int i = 0;
i < nObjInCond-1;
i++) {
242 if ((*candVec)[index[
i]]->
charge() != (*candVec)[index[
i+1]]->
charge()) {
249 if (nObjInCond == 2 || nObjInCond == 3) {
251 if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
252 && !equalSigns ) )) {
259 if (nObjInCond == 4) {
261 unsigned int posCount = 0;
263 for (
int i = 0;
i < nObjInCond;
i++) {
264 if ((*candVec)[index[
i]]->
charge()> 0) {
270 if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
271 && posCount == 2 ) )) {
285 const int ObjInWscComb = 2;
286 if (nObjInCond != ObjInWscComb) {
289 <<
"number of particles in condition with spatial correlation = " << nObjInCond
290 <<
"\n it must be = " << ObjInWscComb << std::endl;
296 unsigned int candDeltaEta;
297 unsigned int candDeltaPhi;
303 int signedEta[ObjInWscComb];
304 int signBit[ObjInWscComb] = { 0, 0 };
308 for (
int i = 0;
i < ObjInWscComb; ++
i) {
310 signedEta[
i] = ((*candVec)[index[
i]]->etaIndex() )%scaleEta;
312 if (signBit[
i] == 1) {
313 signedEta[
i] = (-1)*signedEta[
i];
319 candDeltaEta =
static_cast<int> (
std::abs(signedEta[1] - signedEta[0]))
320 + static_cast<int> (signBit[1]^signBit[0]);
329 if ((*candVec)[index[0]]->phiIndex()> (*candVec)[index[1]]->phiIndex()) {
330 candDeltaPhi = (*candVec)[index[0]]->phiIndex() - (*candVec)[index[1]]->phiIndex();
333 candDeltaPhi = (*candVec)[index[1]]->phiIndex() - (*candVec)[index[0]]->phiIndex();
345 unsigned int candDeltaPhiInitial = candDeltaPhi;
351 <<
" Initial candDeltaPhi = "
352 << candDeltaPhiInitial
353 <<
" > m_corrParDeltaPhiNrBins = "
355 <<
" ==> candDeltaPhi rescaled to: "
356 << candDeltaPhi <<
" [ loop index " << iLoop
357 <<
"; breaks after " << nMaxLoop <<
" loops ]\n"
362 if (iLoop > nMaxLoop) {
368 if (candDeltaPhi < 64) {
388 }
while (std::next_permutation(index.begin(), index.end()) );
419 if (iCondition >= nObjInCond || iCondition < 0) {
466 if ( !cand.
isol() ) {
478 if ( !cand.
isol() ) {
550 myCout <<
" Number of bits for eta of muon objects = "
552 myCout <<
" Maximum number of bins for the delta phi scales = "
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
virtual ~L1GtMuonCondition()
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
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?
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
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
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
const std::vector< const L1MuGMTCand * > * getCandL1Mu() const
return global muon trigger candidate
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