53 const int ifMuEtaNumberBits) :
57 m_ifMuEtaNumberBits(ifMuEtaNumberBits)
116 const int& ifMuEtaNumberBitsValue) {
124 const int& corrParDeltaPhiNrBins) {
140 int numberObjects = candVec->size();
143 if (numberObjects < nObjInCond) {
147 std::vector<int>
index(numberObjects);
149 for (
int i = 0;
i < numberObjects; ++
i) {
154 int jump =
factorial(numberObjects - nObjInCond);
162 bool condResult =
false;
167 objectsInComb.reserve(nObjInCond);
181 objectsInComb.clear();
183 bool tmpResult =
true;
186 for (
int i = 0;
i < nObjInCond;
i++) {
189 objectsInComb.push_back(index[i]);
209 if ((chargeCorr & 1) == 0) {
211 for (
int i = 0;
i < nObjInCond;
i++) {
213 bool chargeValid = (*candVec)[index[
i]]->charge_valid();
214 tmpResult &= chargeValid;
225 if (nObjInCond == 1) {
228 if ( ! ( ( (chargeCorr & 4) != 0 && (*candVec)[index[0]]->charge()> 0 )
229 || ( (chargeCorr & 2) != 0 && (*candVec)[index[0]]->charge() < 0 ) )) {
238 bool equalSigns =
true;
239 for (
int i = 0;
i < nObjInCond-1;
i++) {
240 if ((*candVec)[index[
i]]->charge() != (*candVec)[index[
i+1]]->charge()) {
247 if (nObjInCond == 2 || nObjInCond == 3) {
249 if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
250 && !equalSigns ) )) {
257 if (nObjInCond == 4) {
259 unsigned int posCount = 0;
261 for (
int i = 0;
i < nObjInCond;
i++) {
262 if ((*candVec)[index[
i]]->charge()> 0) {
268 if ( ! ( ( (chargeCorr & 4) != 0 && equalSigns ) || ( (chargeCorr & 2) != 0
269 && posCount == 2 ) )) {
283 const int ObjInWscComb = 2;
284 if (nObjInCond != ObjInWscComb) {
287 <<
"number of particles in condition with spatial correlation = " << nObjInCond
288 <<
"\n it must be = " << ObjInWscComb << std::endl;
294 unsigned int candDeltaEta;
295 unsigned int candDeltaPhi;
301 int signedEta[ObjInWscComb];
302 int signBit[ObjInWscComb] = { 0, 0 };
306 for (
int i = 0;
i < ObjInWscComb; ++
i) {
308 signedEta[
i] = ((*candVec)[index[
i]]->etaIndex() )%scaleEta;
310 if (signBit[
i] == 1) {
311 signedEta[
i] = (-1)*signedEta[
i];
317 candDeltaEta =
static_cast<int> (
std::abs(signedEta[1] - signedEta[0]))
318 + static_cast<int> (signBit[1]^signBit[0]);
327 if ((*candVec)[index[0]]->phiIndex()> (*candVec)[index[1]]->phiIndex()) {
328 candDeltaPhi = (*candVec)[index[0]]->phiIndex() - (*candVec)[index[1]]->phiIndex();
331 candDeltaPhi = (*candVec)[index[1]]->phiIndex() - (*candVec)[index[0]]->phiIndex();
343 unsigned int candDeltaPhiInitial = candDeltaPhi;
349 <<
" Initial candDeltaPhi = "
350 << candDeltaPhiInitial
351 <<
" > m_corrParDeltaPhiNrBins = "
353 <<
" ==> candDeltaPhi rescaled to: "
354 << candDeltaPhi <<
" [ loop index " << iLoop
355 <<
"; breaks after " << nMaxLoop <<
" loops ]\n"
360 if (iLoop > nMaxLoop) {
366 if (candDeltaPhi < 64) {
386 }
while (std::next_permutation(index.begin(), index.end()) );
417 if (iCondition >= nObjInCond || iCondition < 0) {
464 if ( !cand.
isol() ) {
476 if ( !cand.
isol() ) {
548 myCout <<
" Number of bits for eta of muon objects = "
550 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
Abs< T >::type abs(const T &t)
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