CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
GlobalExtBlk Class Reference

#include <GlobalExtBlk.h>

Public Member Functions

bool getExternalDecision (unsigned int bit) const
 Get decision bits. More...
 
 GlobalExtBlk ()
 constructors More...
 
void print (std::ostream &myCout) const
 pretty print the content of a GlobalExtBlk More...
 
void reset ()
 reset the content of a GlobalExtBlk More...
 
void setExternalDecision (unsigned int bit, bool val)
 Set decision bits. More...
 
virtual ~GlobalExtBlk ()
 destructor More...
 

Static Public Attributes

const static unsigned int maxExternalConditions = 256
 

Private Attributes

std::vector< bool > m_extDecision
 

Detailed Description

Description: L1 micro Global Trigger - Block holding Algorithm Information

Implementation: <TODO: enter implementation details>

Author
: Brian Winer - Ohio State

Description: see header file.

Implementation: <TODO: enter implementation details>

Author
: Brian Winer – Ohio State

Definition at line 34 of file GlobalExtBlk.h.

Constructor & Destructor Documentation

◆ GlobalExtBlk()

GlobalExtBlk::GlobalExtBlk ( )

constructors

Definition at line 28 of file GlobalExtBlk.cc.

28  {
29  // Reserve/Clear out the decision words
31  m_extDecision.assign(maxExternalConditions, false);
32 }

References m_extDecision, and maxExternalConditions.

◆ ~GlobalExtBlk()

GlobalExtBlk::~GlobalExtBlk ( )
virtual

destructor

Definition at line 35 of file GlobalExtBlk.cc.

35  {
36  // empty now
37 }

Member Function Documentation

◆ getExternalDecision()

bool GlobalExtBlk::getExternalDecision ( unsigned int  bit) const

Get decision bits.

Definition at line 51 of file GlobalExtBlk.cc.

51  {
52  if (bit >= m_extDecision.size())
53  return false;
54  return m_extDecision.at(bit);
55 }

References m_extDecision.

◆ print()

void GlobalExtBlk::print ( std::ostream &  myCout) const

pretty print the content of a GlobalExtBlk

Definition at line 65 of file GlobalExtBlk.cc.

65  {
66  myCout << " GlobalExtBlk " << std::endl;
67 
68  // Loop through bits to create a hex word of algorithm bits.
69  int lengthWd = m_extDecision.size();
70  myCout << " External Conditions 0x" << std::hex;
71  int digit = 0;
72  bool firstNonZero = false;
73  for (int i = lengthWd - 1; i > -1; i--) {
74  if (m_extDecision.at(i))
75  digit |= (1 << (i % 4));
76  if (digit > 0)
77  firstNonZero = true;
78  if ((i % 4) == 0 && firstNonZero) {
79  myCout << std::hex << std::setw(1) << digit;
80  digit = 0;
81  if (i % 32 == 0 && i < lengthWd - 1)
82  myCout << " ";
83  }
84  } //end loop over algorithm bits
85  if (!firstNonZero)
86  myCout << "0";
87  myCout << std::endl;
88 }

References mps_fire::i, and m_extDecision.

◆ reset()

void GlobalExtBlk::reset ( void  )

reset the content of a GlobalExtBlk

Definition at line 58 of file GlobalExtBlk.cc.

58  {
59  // Clear out the decision words
60  // but leave the vector intact
61  m_extDecision.assign(maxExternalConditions, false);
62 }

References m_extDecision, and maxExternalConditions.

Referenced by l1t::GenToInputProducer::produce().

◆ setExternalDecision()

void GlobalExtBlk::setExternalDecision ( unsigned int  bit,
bool  val 
)

Set decision bits.

Definition at line 40 of file GlobalExtBlk.cc.

40  {
41  if (bit < m_extDecision.size()) {
42  m_extDecision.at(bit) = val;
43 
44  } else {
45  // Need some erorr checking here.
46  LogTrace("L1TGlobal") << "Attempting to set a external bit " << bit << " beyond limit " << m_extDecision.size();
47  }
48 }

References LogTrace, m_extDecision, and heppy_batch::val.

Referenced by L1TExtCondProducer::produce(), L1TExtCondLegacyToStage2::produce(), and l1t::GenToInputProducer::produce().

Member Data Documentation

◆ m_extDecision

std::vector<bool> GlobalExtBlk::m_extDecision
private

Definition at line 58 of file GlobalExtBlk.h.

Referenced by getExternalDecision(), GlobalExtBlk(), print(), reset(), and setExternalDecision().

◆ maxExternalConditions

const static unsigned int GlobalExtBlk::maxExternalConditions = 256
static
mps_fire.i
i
Definition: mps_fire.py:428
GlobalExtBlk::maxExternalConditions
const static unsigned int maxExternalConditions
Definition: GlobalExtBlk.h:43
GlobalExtBlk::m_extDecision
std::vector< bool > m_extDecision
Definition: GlobalExtBlk.h:58
heppy_batch.val
val
Definition: heppy_batch.py:351
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234