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 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 range More...
 
template<class Type1 >
const bool checkRangeEta (const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR, const unsigned int nEtaBits) const
 check if a value is in a given range and outside of a veto range More...
 
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 range and outside of a veto 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 43 of file MuonShowerCondition.cc.

44  // empty
45 }

◆ 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 48 of file MuonShowerCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

52  m_gtMuonShowerTemplate(static_cast<const MuonShowerTemplate*>(muonShowerTemplate)),
53  m_gtGTL(ptrGTL) {
54  m_condMaxNumberObjects = nrL1MuShower;
55 }
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 69 of file MuonShowerCondition.cc.

References copy().

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

◆ ~MuonShowerCondition()

MuonShowerCondition::~MuonShowerCondition ( )
override

Definition at line 72 of file MuonShowerCondition.cc.

72  {
73  // empty
74 }

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 166 of file MuonShowerCondition.cc.

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

168  {
169  // number of objects in condition
170  int nObjInCond = m_gtMuonShowerTemplate->nrObjects();
171 
172  if (iCondition >= nObjInCond || iCondition < 0) {
173  return false;
174  }
175 
177 
178  LogDebug("L1TGlobal") << "\n MuonShowerTemplate::ObjectParameter (utm objects, checking which condition is parsed): "
179  << std::hex << "\n\t MuonShower0 = 0x " << objPar.MuonShower0 << "\n\t MuonShower1 = 0x "
180  << objPar.MuonShower1 << "\n\t MuonShowerOutOfTime0 = 0x " << objPar.MuonShowerOutOfTime0
181  << "\n\t MuonShowerOutOfTime1 = 0x " << objPar.MuonShowerOutOfTime1 << std::endl;
182 
183  LogDebug("L1TGlobal") << "\n l1t::MuonShower (uGT emulator bits): "
184  << "\n\t MuonShower0: isOneNominalInTime() = " << cand.isOneNominalInTime()
185  << "\n\t MuonShower1: isOneTightInTime() = " << cand.isOneTightInTime()
186  << "\n\t MuonShowerOutOfTime0: musOutOfTime0() = " << cand.musOutOfTime0()
187  << "\n\t MuonShowerOutOfTime1: musOutOfTime1() = " << cand.musOutOfTime1() << std::endl;
188 
189  // Check oneNominalInTime
190  if (cand.isOneNominalInTime() != objPar.MuonShower0) {
191  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower0 requirement" << std::endl;
192  return false;
193  }
194  // Check oneTightInTime
195  if (cand.isOneTightInTime() != objPar.MuonShower1) {
196  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower1 requirement" << std::endl;
197  return false;
198  }
199  if (cand.musOutOfTime0() != objPar.MuonShowerOutOfTime0) {
200  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShowerOutOfTime0 requirement" << std::endl;
201  return false;
202  }
203  if (cand.musOutOfTime1() != objPar.MuonShowerOutOfTime1) {
204  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShowerOutOfTime1 requirement" << std::endl;
205  return false;
206  }
207 
208  return true;
209 }
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 58 of file MuonShowerCondition.cc.

Referenced by MuonShowerCondition().

58  {
59  m_gtMuonShowerTemplate = cp.gtMuonShowerTemplate();
60  m_gtGTL = cp.gtGTL();
61 
62  m_condMaxNumberObjects = cp.condMaxNumberObjects();
63  m_condLastResult = cp.condLastResult();
64  m_combinationsInCond = cp.getCombinationsInCond();
65 
66  m_verbosity = cp.m_verbosity;
67 }
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 91 of file MuonShowerCondition.cc.

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

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

References filterCSVwithJSON::copy.

77  {
78  copy(cp);
79  return *this;
80 }
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 211 of file MuonShowerCondition.cc.

References l1t::ConditionEvaluation::print().

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

211  {
212  m_gtMuonShowerTemplate->print(myCout);
214 }
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 88 of file MuonShowerCondition.cc.

88 { 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 83 of file MuonShowerCondition.cc.

83  {
84  m_gtMuonShowerTemplate = muonTempl;
85 }
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().