CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
l1t::MuonShowerCondition Class Reference

#include <MuonShowerCondition.h>

Inheritance diagram for l1t::MuonShowerCondition:
l1t::ConditionEvaluation

Public Member Functions

const bool evaluateCondition (const int bxEval) const override
 the core function to check if the condition matches More...
 
const GlobalBoardgtGTL () const
 get / set the pointer to GTL More...
 
const MuonShowerTemplategtMuonShowerTemplate () const
 get / set the pointer to a Condition More...
 
 MuonShowerCondition ()
 
 MuonShowerCondition (const GlobalCondition *, const GlobalBoard *, const int nrL1MuShower)
 from base template condition (from event setup usually) More...
 
 MuonShowerCondition (const MuonShowerCondition &)
 
MuonShowerConditionoperator= (const MuonShowerCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtGTL (const GlobalBoard *)
 Set the pointer to GTL. More...
 
void setGtMuonShowerTemplate (const MuonShowerTemplate *)
 
 ~MuonShowerCondition () override
 
- Public Member Functions inherited from l1t::ConditionEvaluation
 ConditionEvaluation ()
 constructor More...
 
bool condLastResult () const
 get the latest result for the condition More...
 
int condMaxNumberObjects () const
 
void evaluateConditionStoreResult (const int bxEval)
 call evaluateCondition and save last result More...
 
CombinationsInCond const & getCombinationsInCond () const
 get all the object combinations evaluated to true in the condition More...
 
virtual std::string getNumericExpression () const
 get numeric expression More...
 
void setCondMaxNumberObjects (int condMaxNumberObjectsValue)
 
void setVerbosity (const int verbosity)
 
virtual ~ConditionEvaluation ()
 destructor More...
 

Private Member Functions

const bool checkObjectParameter (const int iCondition, const l1t::MuonShower &cand, const unsigned int index) const
 function to check a single object if it matches a condition More...
 
void copy (const MuonShowerCondition &cp)
 copy function for copy constructor and operator= More...
 
const l1t::MuonShowergetCandidate (const int bx, const int indexCand) const
 load muon candidates More...
 

Private Attributes

const GlobalBoardm_gtGTL
 pointer to GTL, to be able to get the trigger objects More...
 
const MuonShowerTemplatem_gtMuonShowerTemplate
 pointer to a MuonShowerTemplate More...
 

Additional Inherited Members

- Protected Member Functions inherited from l1t::ConditionEvaluation
template<class Type1 >
const bool checkBit (const Type1 &mask, const unsigned int bitNumber) const
 check if a bit with a given number is set in a mask More...
 
template<class Type1 >
const bool checkIndex (const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
 check if a index is in a given range More...
 
template<class Type1 >
const bool checkRangeDeltaEta (const unsigned int obj1Eta, const unsigned int obj2Eta, const Type1 &lowerR, const Type1 &upperR, const unsigned int nEtaBits) const
 check if a value is in a given deltaEta range More...
 
template<class Type1 >
const bool checkRangeDeltaPhi (const unsigned int obj1Phi, const unsigned int obj2Phi, const Type1 &lowerR, const Type1 &upperR) const
 check if a value is in a given deltaPhi range More...
 
template<class Type1 >
const bool checkRangeEta (const unsigned int bitNumber, const std::vector< Type1 > &windows, const unsigned int nEtaBits) const
 
template<class Type1 >
const bool checkRangePhi (const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR) const
 check if a value is in a given phi range and outside of a veto range More...
 
template<class Type1 >
const bool checkRangeTfMuonIndex (const unsigned int bitNumber, const std::vector< Type1 > &windows) const
 check if a value is in a given muon track finder index range More...
 
template<class Type1 , class Type2 >
const bool checkThreshold (const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
 
template<class Type1 , class Type2 >
const bool checkUnconstrainedPt (const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
 
CombinationsInCondcombinationsInCond () const
 get all the object combinations (to fill it...) More...
 
- Protected Attributes inherited from l1t::ConditionEvaluation
CombinationsInCond m_combinationsInCond
 store all the object combinations evaluated to true in the condition More...
 
bool m_condLastResult
 the last result of evaluateCondition() More...
 
int m_condMaxNumberObjects
 
int m_verbosity
 verbosity level More...
 

Detailed Description

Definition at line 29 of file MuonShowerCondition.h.

Constructor & Destructor Documentation

◆ MuonShowerCondition() [1/3]

MuonShowerCondition::MuonShowerCondition ( )

constructors default

Definition at line 45 of file MuonShowerCondition.cc.

46  // empty
47 }

◆ MuonShowerCondition() [2/3]

MuonShowerCondition::MuonShowerCondition ( const GlobalCondition muonShowerTemplate,
const GlobalBoard ptrGTL,
const int  nrL1MuShower 
)

from base template condition (from event setup usually)

Definition at line 50 of file MuonShowerCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

54  m_gtMuonShowerTemplate(static_cast<const MuonShowerTemplate*>(muonShowerTemplate)),
55  m_gtGTL(ptrGTL) {
56  m_condMaxNumberObjects = nrL1MuShower;
57 }
const MuonShowerTemplate * m_gtMuonShowerTemplate
pointer to a MuonShowerTemplate
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects

◆ MuonShowerCondition() [3/3]

MuonShowerCondition::MuonShowerCondition ( const MuonShowerCondition cp)

Definition at line 71 of file MuonShowerCondition.cc.

References copy().

71 : ConditionEvaluation() { copy(cp); }
void copy(const MuonShowerCondition &cp)
copy function for copy constructor and operator=

◆ ~MuonShowerCondition()

MuonShowerCondition::~MuonShowerCondition ( )
override

Definition at line 74 of file MuonShowerCondition.cc.

74  {
75  // empty
76 }

Member Function Documentation

◆ checkObjectParameter()

const bool MuonShowerCondition::checkObjectParameter ( const int  iCondition,
const l1t::MuonShower cand,
const unsigned int  index 
) const
private

function to check a single object if it matches a condition

checkObjectParameter - Check if the bit associated to the type of shower is set to 1

Parameters
iConditionThe number of the condition.
candThe candidate to compare.
Returns
The result of the check on the condition (false if a condition does not exist)

Definition at line 168 of file MuonShowerCondition.cc.

References LogDebug, MuonShowerTemplate::ObjectParameter::MuonShower0, MuonShowerTemplate::ObjectParameter::MuonShower1, MuonShowerTemplate::ObjectParameter::MuonShower2, MuonShowerTemplate::ObjectParameter::MuonShowerOutOfTime0, and MuonShowerTemplate::ObjectParameter::MuonShowerOutOfTime1.

170  {
171  // number of objects in condition
172  int nObjInCond = m_gtMuonShowerTemplate->nrObjects();
173 
174  if (iCondition >= nObjInCond || iCondition < 0) {
175  return false;
176  }
177 
179 
180  LogDebug("L1TGlobal") << "\n MuonShowerTemplate::ObjectParameter (utm objects, checking which condition is parsed): "
181  << std::hex << "\n\t MuonShower0 = 0x " << objPar.MuonShower0 << "\n\t MuonShower1 = 0x "
182  << objPar.MuonShower1 << "\n\t MuonShower2 = 0x " << objPar.MuonShower2
183  << "\n\t MuonShowerOutOfTime0 = 0x " << objPar.MuonShowerOutOfTime0
184  << "\n\t MuonShowerOutOfTime1 = 0x " << objPar.MuonShowerOutOfTime1 << std::endl;
185 
186  LogDebug("L1TGlobal") << "\n l1t::MuonShower (uGT emulator bits): "
187  << "\n\t MuonShower0: isOneNominalInTime() = " << cand.isOneNominalInTime()
188  << "\n\t MuonShower1: isOneTightInTime() = " << cand.isOneTightInTime()
189  << "\n\t MuonShower2: isTwoLooseDiffSectorsInTime() = " << cand.isTwoLooseDiffSectorsInTime()
190  << "\n\t MuonShowerOutOfTime0: musOutOfTime0() = " << cand.musOutOfTime0()
191  << "\n\t MuonShowerOutOfTime1: musOutOfTime1() = " << cand.musOutOfTime1() << std::endl;
192 
193  // Check oneNominalInTime
194  if (cand.isOneNominalInTime() != objPar.MuonShower0) {
195  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower0 requirement" << std::endl;
196  return false;
197  }
198  // Check oneTightInTime
199  if (cand.isOneTightInTime() != objPar.MuonShower1) {
200  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower1 requirement" << std::endl;
201  return false;
202  }
203  // Check twoLooseInTime
204  if (cand.isTwoLooseDiffSectorsInTime() != objPar.MuonShower2) {
205  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower2 requirement" << std::endl;
206  return false;
207  }
208  if (cand.musOutOfTime0() != objPar.MuonShowerOutOfTime0) {
209  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShowerOutOfTime0 requirement" << std::endl;
210  return false;
211  }
212  if (cand.musOutOfTime1() != objPar.MuonShowerOutOfTime1) {
213  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShowerOutOfTime1 requirement" << std::endl;
214  return false;
215  }
216 
217  return true;
218 }
const std::vector< ObjectParameter > * objectParameter() const
const MuonShowerTemplate * m_gtMuonShowerTemplate
pointer to a MuonShowerTemplate
const int nrObjects() const
get number of trigger objects
#define LogDebug(id)

◆ copy()

void MuonShowerCondition::copy ( const MuonShowerCondition cp)
private

copy function for copy constructor and operator=

Definition at line 60 of file MuonShowerCondition.cc.

Referenced by MuonShowerCondition().

60  {
61  m_gtMuonShowerTemplate = cp.gtMuonShowerTemplate();
62  m_gtGTL = cp.gtGTL();
63 
64  m_condMaxNumberObjects = cp.condMaxNumberObjects();
65  m_condLastResult = cp.condLastResult();
66  m_combinationsInCond = cp.getCombinationsInCond();
67 
68  m_verbosity = cp.m_verbosity;
69 }
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
int m_verbosity
verbosity level
bool m_condLastResult
the last result of evaluateCondition()
const MuonShowerTemplate * m_gtMuonShowerTemplate
pointer to a MuonShowerTemplate
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects

◆ evaluateCondition()

const bool MuonShowerCondition::evaluateCondition ( const int  bxEval) const
overridevirtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 93 of file MuonShowerCondition.cc.

References BXVector< T >::at(), BXVector< T >::getLastBX(), mps_fire::i, LogDebug, push_back(), and BXVector< T >::size().

93  {
94  bool condResult = false;
95 
96  /* Number of trigger objects in the condition:
97  // it is always 1 because at the uGT there is only one shower object per BX (that can be of several types).
98  // See DN2020_033_v4 (sections 7.5 and 7.6) for reference
99  */
100  int nObjInCond = m_gtMuonShowerTemplate->nrObjects();
101 
103 
104  // Look at objects in BX = BX + relativeBX
105  int useBx = bxEval + m_gtMuonShowerTemplate->condRelativeBx();
106  LogDebug("MuonShowerCondition") << "Considering BX " << useBx << std::endl;
107 
108  // Fail condition if attempting to get BX outside of range
109  if ((useBx < candVec->getFirstBX()) || (useBx > candVec->getLastBX())) {
110  return false;
111  }
112 
113  // Store the indices of the shower objects from the combination evaluated in the condition
114  SingleCombInCond objectsInComb;
115  objectsInComb.reserve(nObjInCond);
116 
117  // Clear the m_combinationsInCond vector
118  combinationsInCond().clear();
119  // Clear the indices in the combination
120  objectsInComb.clear();
121 
122  /* If no candidates, no need to check further.
123  // If there is a muon shower trigger, the size of the candidates vector is always 4:
124  // in fact, we have four muon shower objects created in the Global Board.
125  */
126  int numberObjects = candVec->size(useBx);
127  if (numberObjects < 1) {
128  return false;
129  }
130 
131  std::vector<int> index(numberObjects);
132  for (int i = 0; i < numberObjects; ++i) {
133  index[i] = i;
134  }
135 
136  // index is always zero, as they are global quantities (there is only one object)
137  int indexObj = 0;
138 
139  bool passCondition = false;
140 
141  for (int i = 0; i < numberObjects; i++) {
142  passCondition = checkObjectParameter(0, *(candVec->at(useBx, index[i])), index[i]); //BLW Change for BXVector
143  condResult |= passCondition;
144  if (passCondition) {
145  LogDebug("MuonShowerCondition")
146  << "===> MuShowerCondition::evaluateCondition, PASS! This muon shower passed the condition." << std::endl;
147  objectsInComb.push_back(indexObj);
148  } else
149  LogDebug("MuonShowerCondition")
150  << "===> MuShowerCondition::evaluateCondition, FAIL! This muon shower failed the condition." << std::endl;
151  }
152 
153  // if we get here all checks were successfull for this combination
154  // set the general result for evaluateCondition to "true"
155  (combinationsInCond()).push_back(objectsInComb);
156 
157  return condResult;
158 }
int getLastBX() const
const BXVector< std::shared_ptr< l1t::MuonShower > > * getCandL1MuShower() const
return global muon trigger candidate
Definition: GlobalBoard.h:153
const bool checkObjectParameter(const int iCondition, const l1t::MuonShower &cand, const unsigned int index) const
function to check a single object if it matches a condition
std::vector< int > SingleCombInCond
typedefs
unsigned size(int bx) const
const T & at(int bx, unsigned i) const
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
const int & condRelativeBx() const
get / set the condition relative bx
const MuonShowerTemplate * m_gtMuonShowerTemplate
pointer to a MuonShowerTemplate
const int nrObjects() const
get number of trigger objects
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects
#define LogDebug(id)

◆ getCandidate()

const l1t::MuonShower* l1t::MuonShowerCondition::getCandidate ( const int  bx,
const int  indexCand 
) const
private

load muon candidates

◆ gtGTL()

const GlobalBoard* l1t::MuonShowerCondition::gtGTL ( ) const
inline

get / set the pointer to GTL

Definition at line 59 of file MuonShowerCondition.h.

References m_gtGTL.

59 { return m_gtGTL; }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects

◆ gtMuonShowerTemplate()

const MuonShowerTemplate* l1t::MuonShowerCondition::gtMuonShowerTemplate ( ) const
inline

get / set the pointer to a Condition

Definition at line 54 of file MuonShowerCondition.h.

References m_gtMuonShowerTemplate.

54 { return m_gtMuonShowerTemplate; }
const MuonShowerTemplate * m_gtMuonShowerTemplate
pointer to a MuonShowerTemplate

◆ operator=()

l1t::MuonShowerCondition & MuonShowerCondition::operator= ( const MuonShowerCondition cp)

Definition at line 79 of file MuonShowerCondition.cc.

References filterCSVwithJSON::copy.

79  {
80  copy(cp);
81  return *this;
82 }
void copy(const MuonShowerCondition &cp)
copy function for copy constructor and operator=

◆ print()

void MuonShowerCondition::print ( std::ostream &  myCout) const
overridevirtual

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 220 of file MuonShowerCondition.cc.

References l1t::ConditionEvaluation::print().

Referenced by l1t::GlobalBoard::runGTL().

220  {
221  m_gtMuonShowerTemplate->print(myCout);
223 }
virtual void print(std::ostream &myCout) const
print condition
const MuonShowerTemplate * m_gtMuonShowerTemplate
pointer to a MuonShowerTemplate
void print(std::ostream &myCout) const override
print the condition

◆ setGtGTL()

void MuonShowerCondition::setGtGTL ( const GlobalBoard ptrGTL)

Set the pointer to GTL.

Definition at line 90 of file MuonShowerCondition.cc.

90 { m_gtGTL = ptrGTL; }
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects

◆ setGtMuonShowerTemplate()

void MuonShowerCondition::setGtMuonShowerTemplate ( const MuonShowerTemplate muonTempl)

Definition at line 85 of file MuonShowerCondition.cc.

85  {
86  m_gtMuonShowerTemplate = muonTempl;
87 }
const MuonShowerTemplate * m_gtMuonShowerTemplate
pointer to a MuonShowerTemplate

Member Data Documentation

◆ m_gtGTL

const GlobalBoard* l1t::MuonShowerCondition::m_gtGTL
private

pointer to GTL, to be able to get the trigger objects

Definition at line 77 of file MuonShowerCondition.h.

Referenced by gtGTL().

◆ m_gtMuonShowerTemplate

const MuonShowerTemplate* l1t::MuonShowerCondition::m_gtMuonShowerTemplate
private

pointer to a MuonShowerTemplate

Definition at line 74 of file MuonShowerCondition.h.

Referenced by gtMuonShowerTemplate().