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

27  // empty
28 }

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

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

35  m_gtMuonShowerTemplate(static_cast<const MuonShowerTemplate*>(muonShowerTemplate)),
36  m_gtGTL(ptrGTL) {
37  m_condMaxNumberObjects = nrL1MuShower;
38 }
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 52 of file MuonShowerCondition.cc.

References copy().

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

◆ ~MuonShowerCondition()

MuonShowerCondition::~MuonShowerCondition ( )
override

Definition at line 55 of file MuonShowerCondition.cc.

55  {
56  // empty
57 }

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 - Compare a single particle with a numbered condition.

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

Definition at line 141 of file MuonShowerCondition.cc.

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

143  {
144  // number of objects in condition
145  int nObjInCond = m_gtMuonShowerTemplate->nrObjects();
146 
147  if (iCondition >= nObjInCond || iCondition < 0) {
148  return false;
149  }
150 
152 
153  LogDebug("L1TGlobal") << "\n MuonShowerTemplate::ObjectParameter : " << std::hex << "\n\t MuonShower0 = 0x "
154  << objPar.MuonShower0 << "\n\t MuonShower1 = 0x " << objPar.MuonShower1
155  << "\n\t MuonShowerOutOfTime0 = 0x " << objPar.MuonShowerOutOfTime0
156  << "\n\t MuonShowerOutOfTime1 = 0x " << objPar.MuonShowerOutOfTime1 << std::endl;
157 
158  LogDebug("L1TGlobal") << "\n l1t::MuonShower : "
159  << "\n\t MuonShower0 = 0x " << cand.mus0() << "\n\t MuonShower1 = 0x " << cand.mus1()
160  << "\n\t MuonShowerOutOfTime0 = 0x " << cand.musOutOfTime0()
161  << "\n\t MuonShowerOutOfTime1 = 0x " << cand.musOutOfTime1() << std::dec << std::endl;
162 
163  // check oneNominalInTime
164  if (cand.mus0() != objPar.MuonShower0) {
165  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower0 requirement" << std::endl;
166  return false;
167  }
168  if (cand.mus1() != objPar.MuonShower1) {
169  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower1 requirement" << std::endl;
170  return false;
171  }
172  if (cand.musOutOfTime0() != objPar.MuonShowerOutOfTime0) {
173  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShowerOutOfTime0 requirement" << std::endl;
174  return false;
175  }
176  if (cand.musOutOfTime1() != objPar.MuonShowerOutOfTime1) {
177  LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShowerOutOfTime1 requirement" << std::endl;
178  return false;
179  }
180 
181  return true;
182 }
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 41 of file MuonShowerCondition.cc.

Referenced by MuonShowerCondition().

41  {
42  m_gtMuonShowerTemplate = cp.gtMuonShowerTemplate();
43  m_gtGTL = cp.gtGTL();
44 
45  m_condMaxNumberObjects = cp.condMaxNumberObjects();
46  m_condLastResult = cp.condLastResult();
47  m_combinationsInCond = cp.getCombinationsInCond();
48 
49  m_verbosity = cp.m_verbosity;
50 }
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 74 of file MuonShowerCondition.cc.

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

74  {
75  // number of trigger objects in the condition
76  int nObjInCond = m_gtMuonShowerTemplate->nrObjects();
77 
78  // the candidates
80 
81  // Look at objects in bx = bx + relativeBx
82  int useBx = bxEval + m_gtMuonShowerTemplate->condRelativeBx();
83 
84  // Fail condition if attempting to get Bx outside of range
85  if ((useBx < candVec->getFirstBX()) || (useBx > candVec->getLastBX())) {
86  return false;
87  }
88 
89  // store the indices of the shower objects
90  // from the combination evaluated in the condition
91  SingleCombInCond objectsInComb;
92  objectsInComb.reserve(nObjInCond);
93 
94  // clear the m_combinationsInCond vector
96 
97  // clear the indices in the combination
98  objectsInComb.clear();
99 
100  // If no candidates, no use looking any further.
101  int numberObjects = candVec->size(useBx);
102  if (numberObjects < 1) {
103  return false;
104  }
105 
106  std::vector<int> index(numberObjects);
107 
108  for (int i = 0; i < numberObjects; ++i) {
109  index[i] = i;
110  }
111 
112  bool condResult = false;
113 
114  // index is always zero, as they are global quantities (there is only one object)
115  int indexObj = 0;
116 
117  objectsInComb.push_back(indexObj);
118  (combinationsInCond()).push_back(objectsInComb);
119 
120  // if we get here all checks were successfull for this combination
121  // set the general result for evaluateCondition to "true"
122 
123  condResult = true;
124  return condResult;
125 }
int getLastBX() const
std::vector< int > SingleCombInCond
typedefs
const BXVector< const l1t::MuonShower * > * getCandL1MuShower() const
return global muon trigger candidate
Definition: GlobalBoard.h:153
unsigned size(int bx) 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
void clear(EGIsoObj &c)
Definition: egamma.h:82
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

◆ getCandidate()

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

load muon candidates

Definition at line 128 of file MuonShowerCondition.cc.

References simKBmtfDigis_cfi::bx.

128  {
129  return (m_gtGTL->getCandL1MuShower())->at(bx, indexCand); //BLW Change for BXVector
130 }
const BXVector< const l1t::MuonShower * > * getCandL1MuShower() const
return global muon trigger candidate
Definition: GlobalBoard.h:153
const GlobalBoard * m_gtGTL
pointer to GTL, to be able to get the trigger objects

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

References filterCSVwithJSON::copy.

60  {
61  copy(cp);
62  return *this;
63 }
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 184 of file MuonShowerCondition.cc.

References l1t::ConditionEvaluation::print().

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

184  {
185  m_gtMuonShowerTemplate->print(myCout);
186 
188 }
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 71 of file MuonShowerCondition.cc.

71 { 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 66 of file MuonShowerCondition.cc.

66  {
67  m_gtMuonShowerTemplate = muonTempl;
68 }
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().