CMS 3D CMS Logo

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

#include <ExternalCondition.h>

Inheritance diagram for l1t::ExternalCondition:
l1t::ConditionEvaluation

Public Member Functions

const bool evaluateCondition (const int bxEval) const override
 the core function to check if the condition matches More...
 
 ExternalCondition ()
 
 ExternalCondition (const GlobalCondition *, const GlobalBoard *)
 from base template condition (from event setup usually) More...
 
 ExternalCondition (const ExternalCondition &)
 
const GlobalBoardgetuGtB () const
 get / set the pointer to uGt GlobalBoard More...
 
const ExternalTemplategtExternalTemplate () const
 get / set the pointer to a L1GtCondition More...
 
ExternalConditionoperator= (const ExternalCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtExternalTemplate (const ExternalTemplate *)
 
void setuGtB (const GlobalBoard *)
 set the pointer to uGT GlobalBoard More...
 
 ~ExternalCondition () 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

void copy (const ExternalCondition &cp)
 copy function for copy constructor and operator= More...
 

Private Attributes

const ExternalTemplatem_gtExternalTemplate
 pointer to a ExternalTemplate More...
 
const GlobalBoardm_uGtB
 pointer to uGt GlobalBoard, to be able to get the trigger objects 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 , class Type2 >
const bool checkCut (const Type1 &cutL, const Type2 &value, bool condGEqValue) const
 
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 37 of file ExternalCondition.h.

Constructor & Destructor Documentation

◆ ExternalCondition() [1/3]

ExternalCondition::ExternalCondition ( )

constructors default

Definition at line 38 of file ExternalCondition.cc.

39  //empty
40 }

◆ ExternalCondition() [2/3]

ExternalCondition::ExternalCondition ( const GlobalCondition eSumTemplate,
const GlobalBoard ptrGTB 
)

from base template condition (from event setup usually)

Definition at line 43 of file ExternalCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

45  m_gtExternalTemplate(static_cast<const ExternalTemplate*>(eSumTemplate)),
46  m_uGtB(ptrGTB)
47 
48 {
49  // maximum number of objects received for the evaluation of the condition
50  // energy sums are global quantities - one object per event
51 
52  m_condMaxNumberObjects = 1; //blw ???
53 }
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

◆ ExternalCondition() [3/3]

ExternalCondition::ExternalCondition ( const ExternalCondition cp)

Definition at line 67 of file ExternalCondition.cc.

References copy().

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

◆ ~ExternalCondition()

ExternalCondition::~ExternalCondition ( )
override

Definition at line 70 of file ExternalCondition.cc.

70  {
71  // empty
72 }

Member Function Documentation

◆ copy()

void ExternalCondition::copy ( const ExternalCondition cp)
private

copy function for copy constructor and operator=

Definition at line 56 of file ExternalCondition.cc.

Referenced by ExternalCondition().

56  {
57  m_gtExternalTemplate = cp.gtExternalTemplate();
58  m_uGtB = cp.getuGtB();
59 
60  m_condMaxNumberObjects = cp.condMaxNumberObjects();
61  m_condLastResult = cp.condLastResult();
62  m_combinationsInCond = cp.getCombinationsInCond();
63 
64  m_verbosity = cp.m_verbosity;
65 }
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
int m_verbosity
verbosity level
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
bool m_condLastResult
the last result of evaluateCondition()

◆ evaluateCondition()

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

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 89 of file ExternalCondition.cc.

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

89  {
90  LogDebug("L1TGlobal") << "Evaluating External Condition " << m_gtExternalTemplate->condName() << " on Channel "
91  << m_gtExternalTemplate->extChannel() << " relative Bx "
92  << m_gtExternalTemplate->condRelativeBx() << std::endl;
93  // number of trigger objects in the condition
94  // in fact, there is only one object
95  // int iCondition = 0;
96 
97  // condition result condResult set to true if the energy sum
98  // passes all requirements
99  bool condResult = false;
100 
101  // store the indices of the calorimeter objects
102  // from the combination evaluated in the condition
103  SingleCombInCond objectsInComb;
104 
105  // clear the m_combinationsInCond vector
107 
108  // clear the indices in the combination
109  objectsInComb.clear();
110 
112 
113  // Look at objects in bx = bx + relativeBx
114  int useBx = bxEval + m_gtExternalTemplate->condRelativeBx();
115  unsigned int exCondCh = m_gtExternalTemplate->extChannel();
116 
117  // Fail condition if attempting to get Bx outside of range
118  if ((useBx < candVec->getFirstBX()) || (useBx > candVec->getLastBX())) {
119  return false;
120  }
121 
122  int numberObjects = candVec->size(useBx);
123  if (numberObjects < 1) {
124  return false;
125  }
126 
127  //get external block (should only be one for the bx)
128  GlobalExtBlk ext = *(candVec->at(useBx, 0));
129  //ext.print(std::cout);
130 
131  // check external bit
132  if (!ext.getExternalDecision(exCondCh)) {
133  LogDebug("L1TGlobal") << "\t\t External Condition was not set" << std::endl;
134  return false;
135  }
136 
137  // index is always zero, as they are global quantities (there is only one object)
138  int indexObj = 0;
139 
140  //Do we need this?
141  objectsInComb.push_back(indexObj);
142  (combinationsInCond()).push_back(objectsInComb);
143 
144  // if we get here all checks were successfull for this combination
145  // set the general result for evaluateCondition to "true"
146  condResult = true;
147  LogDebug("L1TGlobal") << "\t\t Congrats, External Condition was set!" << std::endl;
148 
149  return condResult;
150 }
int getLastBX() const
std::vector< int > SingleCombInCond
typedefs
const std::string & condName() const
get / set condition name
unsigned size(int bx) const
const unsigned int & extChannel() const
get external channel number
const BXVector< const GlobalExtBlk * > * getCandL1External() const
pointer to External data list
Definition: GlobalBoard.h:173
const T & at(int bx, unsigned i) const
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
const int & condRelativeBx() const
get / set the condition relative bx
void clear(EGIsoObj &c)
Definition: egamma.h:82
Definition: memstream.h:15
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
#define LogDebug(id)

◆ getuGtB()

const GlobalBoard* l1t::ExternalCondition::getuGtB ( ) const
inline

get / set the pointer to uGt GlobalBoard

Definition at line 69 of file ExternalCondition.h.

References m_uGtB.

69 { return m_uGtB; }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

◆ gtExternalTemplate()

const ExternalTemplate* l1t::ExternalCondition::gtExternalTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 64 of file ExternalCondition.h.

References m_gtExternalTemplate.

64 { return m_gtExternalTemplate; }
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate

◆ operator=()

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

Definition at line 75 of file ExternalCondition.cc.

References filterCSVwithJSON::copy.

75  {
76  copy(cp);
77  return *this;
78 }
void copy(const ExternalCondition &cp)
copy function for copy constructor and operator=

◆ print()

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

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 152 of file ExternalCondition.cc.

References l1t::ConditionEvaluation::print().

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

152  {
153  m_gtExternalTemplate->print(myCout);
155 }
void print(std::ostream &myCout) const override
print the condition
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
virtual void print(std::ostream &myCout) const
print condition

◆ setGtExternalTemplate()

void ExternalCondition::setGtExternalTemplate ( const ExternalTemplate eSumTempl)

Definition at line 81 of file ExternalCondition.cc.

81  {
82  m_gtExternalTemplate = eSumTempl;
83 }
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate

◆ setuGtB()

void ExternalCondition::setuGtB ( const GlobalBoard ptrGTB)

set the pointer to uGT GlobalBoard

Definition at line 86 of file ExternalCondition.cc.

86 { m_uGtB = ptrGTB; }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

Member Data Documentation

◆ m_gtExternalTemplate

const ExternalTemplate* l1t::ExternalCondition::m_gtExternalTemplate
private

pointer to a ExternalTemplate

Definition at line 79 of file ExternalCondition.h.

Referenced by gtExternalTemplate().

◆ m_uGtB

const GlobalBoard* l1t::ExternalCondition::m_uGtB
private

pointer to uGt GlobalBoard, to be able to get the trigger objects

Definition at line 82 of file ExternalCondition.h.

Referenced by getuGtB().