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 ExternalCondition &)
 
 ExternalCondition (const GlobalCondition *, const GlobalBoard *)
 from base template condition (from event setup usually) More...
 
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 >
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 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.

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 }

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

◆ ExternalCondition() [3/3]

ExternalCondition::ExternalCondition ( const ExternalCondition cp)

Definition at line 67 of file ExternalCondition.cc.

67 : ConditionEvaluation() { copy(cp); }

References copy().

◆ ~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.

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 }

Referenced by ExternalCondition().

◆ 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.

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 }

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

◆ getuGtB()

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

get / set the pointer to uGt GlobalBoard

Definition at line 69 of file ExternalCondition.h.

69 { return m_uGtB; }

References m_uGtB.

◆ gtExternalTemplate()

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

get / set the pointer to a L1GtCondition

Definition at line 64 of file ExternalCondition.h.

64 { return m_gtExternalTemplate; }

References m_gtExternalTemplate.

◆ operator=()

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

Definition at line 75 of file ExternalCondition.cc.

75  {
76  copy(cp);
77  return *this;
78 }

References filterCSVwithJSON::copy.

◆ print()

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

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 152 of file ExternalCondition.cc.

152  {
153  m_gtExternalTemplate->print(myCout);
155 }

References l1t::ConditionEvaluation::print().

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

◆ setGtExternalTemplate()

void ExternalCondition::setGtExternalTemplate ( const ExternalTemplate eSumTempl)

Definition at line 81 of file ExternalCondition.cc.

81  {
82  m_gtExternalTemplate = eSumTempl;
83 }

◆ 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; }

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().

GlobalCondition::condRelativeBx
const int & condRelativeBx() const
get / set the condition relative bx
Definition: GlobalCondition.h:80
ext
Definition: memstream.h:15
l1t::ExternalCondition::m_gtExternalTemplate
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
Definition: ExternalCondition.h:79
l1t::GlobalBoard::getCandL1External
const BXVector< const GlobalExtBlk * > * getCandL1External() const
pointer to Tau data list
Definition: GlobalBoard.h:153
l1t::ConditionEvaluation::m_combinationsInCond
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
Definition: ConditionEvaluation.h:154
l1t::ConditionEvaluation::combinationsInCond
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
Definition: ConditionEvaluation.h:84
l1t::ConditionEvaluation::print
virtual void print(std::ostream &myCout) const
print condition
Definition: ConditionEvaluation.cc:32
hgcal_conditions::parameters
Definition: HGCConditions.h:86
ExternalTemplate::extChannel
const unsigned int & extChannel() const
get external channel number
Definition: ExternalTemplate.h:55
BXVector< const GlobalExtBlk * >
SingleCombInCond
std::vector< int > SingleCombInCond
typedefs
Definition: L1GlobalTriggerObjectMapFwd.h:29
l1t::ConditionEvaluation::ConditionEvaluation
ConditionEvaluation()
constructor
Definition: ConditionEvaluation.h:42
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
clear
void clear(HadCaloObj &c)
Definition: data.h:124
BXVector::at
const T & at(int bx, unsigned i) const
GlobalExtBlk
Definition: GlobalExtBlk.h:34
l1t::ExternalCondition::copy
void copy(const ExternalCondition &cp)
copy function for copy constructor and operator=
Definition: ExternalCondition.cc:56
GlobalCondition::condName
const std::string & condName() const
get / set condition name
Definition: GlobalCondition.h:50
l1t::ExternalCondition::m_uGtB
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
Definition: ExternalCondition.h:82
ExternalTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: ExternalTemplate.cc:57
l1t::ConditionEvaluation::m_condLastResult
bool m_condLastResult
the last result of evaluateCondition()
Definition: ConditionEvaluation.h:151
BXVector::size
unsigned size(int bx) const
l1t::ConditionEvaluation::m_verbosity
int m_verbosity
verbosity level
Definition: ConditionEvaluation.h:157
l1t::ConditionEvaluation::m_condMaxNumberObjects
int m_condMaxNumberObjects
Definition: ConditionEvaluation.h:148
BXVector::getLastBX
int getLastBX() const