CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalExtBlk.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 
19 // system include files
20 
21 
22 // user include files
23 
26 
27 // constructors
28 
29 // empty constructor, all members set to zero;
30 GlobalExtBlk::GlobalExtBlk(int orbitNr, int bxNr, int bxInEvent):
31  m_orbitNr(orbitNr), m_bxNr(bxNr), m_bxInEvent(bxInEvent)
32 {
33 
34  //Clear out the header data
35  m_finalOR=0;
36 
37  // Reserve/Clear out the decision words
40 
41 }
42 
43 
44 // empty constructor, all members set to zero;
46 {
47 
48  //Clear out the header data
49  m_orbitNr=0;
50  m_bxNr=0;
51  m_bxInEvent=0;
52  m_finalOR=0;
53 
54  // Reserve/Clear out the decision words
57 
58 }
59 
60 
61 
62 // destructor
64 {
65 
66  // empty now
67 }
68 
69 
71 void GlobalExtBlk::setExternalDecision(int bit, bool val)
72 {
73 // if(bit < m_algoDecision.size()) {
74 
75  m_extDecision.at(bit) = val;
76 
77 // }
78  // Need some erorr checking here.
79 
80 }
81 
82 
84 bool GlobalExtBlk::getExternalDecision(unsigned int bit) const
85 {
86  if(bit>=m_extDecision.size()) return false;
87  return m_extDecision.at(bit);
88 }
89 
90 
91 // reset the content of a GlobalExtBlk
93 {
94 
95  //Clear out the header data
96  m_orbitNr=0;
97  m_bxNr=0;
98  m_bxInEvent=0;
99  m_finalOR=0;
100 
101  // Clear out the decision words
102  // but leave the vector intact
104 
105 
106 }
107 
108 // pretty print the content of a GlobalExtBlk
109 void GlobalExtBlk::print(std::ostream& myCout) const
110 {
111 
112  myCout << " GlobalExtBlk " << std::endl;
113 
114  myCout << " Orbit Number (hex): 0x" << std::hex << std::setw(8) << std::setfill('0') << m_orbitNr << std::endl;
115 
116  myCout << " Bx Number (hex): 0x" << std::hex << std::setw(4) << std::setfill('0') << m_bxNr << std::endl;
117 
118  myCout << " Local Bx (hex): 0x" << std::hex << std::setw(1) << std::setfill('0') << m_bxInEvent << std::endl;
119 
120  // Loop through bits to create a hex word of algorithm bits.
121  int lengthWd = m_extDecision.size();
122  myCout << " External Condition 0x" << std::hex;
123  int digit = 0;
124  for(int i=lengthWd-1; i>-1; i--) {
125  if(m_extDecision.at(i)) digit |= (1 << (i%4));
126  if((i%4) == 0){
127  myCout << std::hex << std::setw(1) << digit;
128  digit = 0;
129  }
130  } //end loop over algorithm bits
131  myCout << std::endl;
132 
133 }
134 
135 
int i
Definition: DBlmapReader.cc:9
void print(std::ostream &myCout) const
pretty print the content of a GlobalExtBlk
void reset()
reset the content of a GlobalExtBlk
Definition: GlobalExtBlk.cc:92
virtual ~GlobalExtBlk()
destructor
Definition: GlobalExtBlk.cc:63
static const unsigned int NumberPhysTriggers
int m_bxInEvent
bunch cross in the GT event record (E,F,0,1,2)
Definition: GlobalExtBlk.h:84
void setExternalDecision(int bit, bool val)
Set decision bits.
Definition: GlobalExtBlk.cc:71
bool getExternalDecision(unsigned int bit) const
Get decision bits.
Definition: GlobalExtBlk.cc:84
int m_bxNr
bunch cross number of the actual bx
Definition: GlobalExtBlk.h:81
GlobalExtBlk()
constructors
Definition: GlobalExtBlk.cc:45
std::vector< bool > m_extDecision
Definition: GlobalExtBlk.h:90
int m_orbitNr
orbit number
Definition: GlobalExtBlk.h:78