CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 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
 print condition More...
 
void setGtExternalTemplate (const ExternalTemplate *)
 
void setuGtB (const GlobalBoard *)
 set the pointer to uGT GlobalBoard More...
 
virtual ~ExternalCondition ()
 
- 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 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
 
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::ExternalCondition ( )

constructors default

Definition at line 38 of file ExternalCondition.cc.

38  :
40 
41  //empty
42 
43 }
ExternalCondition::ExternalCondition ( const GlobalCondition eSumTemplate,
const GlobalBoard ptrGTB 
)

from base template condition (from event setup usually)

Definition at line 46 of file ExternalCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

46  :
48  m_gtExternalTemplate(static_cast<const ExternalTemplate*>(eSumTemplate)),
49  m_uGtB(ptrGTB)
50 
51 {
52 
53  // maximum number of objects received for the evaluation of the condition
54  // energy sums are global quantities - one object per event
55 
56  m_condMaxNumberObjects = 1; //blw ???
57 
58 }
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::ExternalCondition ( const ExternalCondition cp)

Definition at line 74 of file ExternalCondition.cc.

References copy().

74  :
76 
77  copy(cp);
78 
79 }
void copy(const ExternalCondition &cp)
copy function for copy constructor and operator=
ExternalCondition::~ExternalCondition ( )
virtual

Definition at line 82 of file ExternalCondition.cc.

82  {
83 
84  // empty
85 
86 }

Member Function Documentation

void ExternalCondition::copy ( const ExternalCondition cp)
private

copy function for copy constructor and operator=

Definition at line 61 of file ExternalCondition.cc.

References l1t::ConditionEvaluation::condLastResult(), l1t::ConditionEvaluation::condMaxNumberObjects(), l1t::ConditionEvaluation::getCombinationsInCond(), getuGtB(), gtExternalTemplate(), and l1t::ConditionEvaluation::m_verbosity.

Referenced by ExternalCondition().

61  {
62 
64  m_uGtB = cp.getuGtB();
65 
69 
71 
72 }
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
bool condLastResult() const
get the latest result for the condition
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 ExternalTemplate * gtExternalTemplate() const
get / set the pointer to a L1GtCondition
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
bool m_condLastResult
the last result of evaluateCondition()
const GlobalBoard * getuGtB() const
get / set the pointer to uGt GlobalBoard
const bool ExternalCondition::evaluateCondition ( const int  bxEval) const
virtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 110 of file ExternalCondition.cc.

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

110  {
111 
112 
113 
114  LogDebug("L1TGlobal") << "Evaluating External Condition "
116  << " on Channel " << m_gtExternalTemplate->extChannel()
117  << " relative Bx " << m_gtExternalTemplate->condRelativeBx() << std::endl;
118  // number of trigger objects in the condition
119  // in fact, there is only one object
120 // int iCondition = 0;
121 
122  // condition result condResult set to true if the energy sum
123  // passes all requirements
124  bool condResult = false;
125 
126  // store the indices of the calorimeter objects
127  // from the combination evaluated in the condition
128  SingleCombInCond objectsInComb;
129 
130  // clear the m_combinationsInCond vector
132 
133  // clear the indices in the combination
134  objectsInComb.clear();
135 
137 
138  // Look at objects in bx = bx + relativeBx
139  int useBx = bxEval + m_gtExternalTemplate->condRelativeBx();
140  unsigned int exCondCh = m_gtExternalTemplate->extChannel();
141 
142  // Fail condition if attempting to get Bx outside of range
143  if( ( useBx < candVec->getFirstBX() ) ||
144  ( useBx > candVec->getLastBX() ) ) {
145  return false;
146  }
147 
148  int numberObjects = candVec->size(useBx);
149  if (numberObjects < 1) {
150  return false;
151  }
152 
153  //get external block (should only be one for the bx)
154  GlobalExtBlk ext = *(candVec->at(useBx,0));
155  //ext.print(std::cout);
156 
157  // check external bit
158  if ( !ext.getExternalDecision(exCondCh) ) {
159  LogDebug("L1TGlobal") << "\t\t External Condition was not set" << std::endl;
160  return false;
161  }
162 
163  // index is always zero, as they are global quantities (there is only one object)
164  int indexObj = 0;
165 
166  //Do we need this?
167  objectsInComb.push_back(indexObj);
168  (combinationsInCond()).push_back(objectsInComb);
169 
170  // if we get here all checks were successfull for this combination
171  // set the general result for evaluateCondition to "true"
172  condResult = true;
173  LogDebug("L1TGlobal") << "\t\t Congrats, External Condition was set!" << std::endl;
174 
175  return condResult;
176 
177 }
#define LogDebug(id)
const BXVector< const GlobalExtBlk * > * getCandL1External() const
pointer to Tau data list
Definition: GlobalBoard.h:174
unsigned size(int bx) const
std::vector< int > SingleCombInCond
typedefs
const int & condRelativeBx() const
get / set the condition relative bx
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
const std::string & condName() const
get / set condition name
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
bool getExternalDecision(unsigned int bit) const
Get decision bits.
Definition: GlobalExtBlk.cc:67
int getLastBX() const
const unsigned int & extChannel() const
get external channel number
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const T & at(int bx, unsigned i) const
const GlobalBoard* l1t::ExternalCondition::getuGtB ( ) const
inline

get / set the pointer to uGt GlobalBoard

Definition at line 76 of file ExternalCondition.h.

References m_uGtB.

Referenced by copy().

76  {
77  return m_uGtB;
78  }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
const ExternalTemplate* l1t::ExternalCondition::gtExternalTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 69 of file ExternalCondition.h.

References m_gtExternalTemplate.

Referenced by copy().

69  {
70  return m_gtExternalTemplate;
71  }
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
l1t::ExternalCondition & ExternalCondition::operator= ( const ExternalCondition cp)

Definition at line 89 of file ExternalCondition.cc.

References filterCSVwithJSON::copy.

90 {
91  copy(cp);
92  return *this;
93 }
void copy(const ExternalCondition &cp)
copy function for copy constructor and operator=
void ExternalCondition::print ( std::ostream &  myCout) const
virtual

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 179 of file ExternalCondition.cc.

References l1t::ConditionEvaluation::print().

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

179  {
180 
181  m_gtExternalTemplate->print(myCout);
183 
184 }
virtual void print(std::ostream &myCout) const
print condition
virtual void print(std::ostream &myCout) const
print the condition
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
void ExternalCondition::setGtExternalTemplate ( const ExternalTemplate eSumTempl)

Definition at line 96 of file ExternalCondition.cc.

96  {
97 
98  m_gtExternalTemplate = eSumTempl;
99 
100 }
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
void ExternalCondition::setuGtB ( const GlobalBoard ptrGTB)

set the pointer to uGT GlobalBoard

Definition at line 103 of file ExternalCondition.cc.

103  {
104 
105  m_uGtB = ptrGTB;
106 
107 }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

Member Data Documentation

const ExternalTemplate* l1t::ExternalCondition::m_gtExternalTemplate
private

pointer to a ExternalTemplate

Definition at line 90 of file ExternalCondition.h.

Referenced by gtExternalTemplate().

const GlobalBoard* l1t::ExternalCondition::m_uGtB
private

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

Definition at line 93 of file ExternalCondition.h.

Referenced by getuGtB().