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 GtCondition *, const GtBoard *)
 from base template condition (from event setup usually) More...
 
 ExternalCondition (const ExternalCondition &)
 
const GtBoardgetuGtB () const
 get / set the pointer to uGt GtBoard 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 GtBoard *)
 set the pointer to uGT GtBoard 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 GtBoardm_uGtB
 pointer to uGt GtBoard, 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 40 of file ExternalCondition.cc.

40  :
42 
43  //empty
44 
45 }
ExternalCondition::ExternalCondition ( const GtCondition eSumTemplate,
const GtBoard ptrGTB 
)

from base template condition (from event setup usually)

Definition at line 48 of file ExternalCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

48  :
50  m_gtExternalTemplate(static_cast<const ExternalTemplate*>(eSumTemplate)),
51  m_uGtB(ptrGTB)
52 
53 {
54 
55  // maximum number of objects received for the evaluation of the condition
56  // energy sums are global quantities - one object per event
57 
58  m_condMaxNumberObjects = 1; //blw ???
59 
60 }
const GtBoard * m_uGtB
pointer to uGt GtBoard, to be able to get the trigger objects
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
ExternalCondition::ExternalCondition ( const ExternalCondition cp)

Definition at line 76 of file ExternalCondition.cc.

References copy().

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

Definition at line 84 of file ExternalCondition.cc.

84  {
85 
86  // empty
87 
88 }

Member Function Documentation

void ExternalCondition::copy ( const ExternalCondition cp)
private

copy function for copy constructor and operator=

Definition at line 63 of file ExternalCondition.cc.

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

Referenced by ExternalCondition().

63  {
64 
65  m_gtExternalTemplate = cp.gtExternalTemplate();
66  m_uGtB = cp.getuGtB();
67 
68  m_condMaxNumberObjects = cp.condMaxNumberObjects();
69  m_condLastResult = cp.condLastResult();
70  m_combinationsInCond = cp.getCombinationsInCond();
71 
72  m_verbosity = cp.m_verbosity;
73 
74 }
const GtBoard * m_uGtB
pointer to uGt GtBoard, to be able to get the trigger objects
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
bool m_condLastResult
the last result of evaluateCondition()
const bool ExternalCondition::evaluateCondition ( const int  bxEval) const
virtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 112 of file ExternalCondition.cc.

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

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

get / set the pointer to uGt GtBoard

Definition at line 76 of file ExternalCondition.h.

References m_uGtB.

Referenced by copy().

76  {
77  return m_uGtB;
78  }
const GtBoard * m_uGtB
pointer to uGt GtBoard, 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 91 of file ExternalCondition.cc.

References filterCSVwithJSON::copy.

92 {
93  copy(cp);
94  return *this;
95 }
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 181 of file ExternalCondition.cc.

References l1t::ConditionEvaluation::print().

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

181  {
182 
183  m_gtExternalTemplate->print(myCout);
185 
186 }
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 98 of file ExternalCondition.cc.

98  {
99 
100  m_gtExternalTemplate = eSumTempl;
101 
102 }
const ExternalTemplate * m_gtExternalTemplate
pointer to a ExternalTemplate
void ExternalCondition::setuGtB ( const GtBoard ptrGTB)

set the pointer to uGT GtBoard

Definition at line 105 of file ExternalCondition.cc.

105  {
106 
107  m_uGtB = ptrGTB;
108 
109 }
const GtBoard * m_uGtB
pointer to uGt GtBoard, 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 GtBoard* l1t::ExternalCondition::m_uGtB
private

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

Definition at line 93 of file ExternalCondition.h.

Referenced by getuGtB().