CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
L1GlobalTriggerEvmReadoutRecord Class Reference

#include <L1GlobalTriggerEvmReadoutRecord.h>

Public Member Functions

const bool decision (int bxInEvent) const
 
const bool decision () const
 
const DecisionWord decisionWord (int bxInEvent) const
 
const DecisionWord decisionWord () const
 
const std::vector< L1GtFdlWordgtFdlVector () const
 get the vector of L1GtFdlWord More...
 
std::vector< L1GtFdlWord > & gtFdlVector ()
 
const L1GtFdlWord gtFdlWord (int bxInEvent) const
 get / set FDL word (record) in the GT readout record More...
 
const L1GtFdlWord gtFdlWord () const
 
const L1GtfeExtWord gtfeWord () const
 get / set GTFE word (record) in the GT readout record More...
 
 L1GlobalTriggerEvmReadoutRecord ()
 constructors More...
 
 L1GlobalTriggerEvmReadoutRecord (int NumberBxInEvent)
 
 L1GlobalTriggerEvmReadoutRecord (const int numberBxInEvent, const int numberFdlBoards)
 
 L1GlobalTriggerEvmReadoutRecord (const L1GlobalTriggerEvmReadoutRecord &)
 copy constructor More...
 
bool operator!= (const L1GlobalTriggerEvmReadoutRecord &) const
 unequal operator More...
 
L1GlobalTriggerEvmReadoutRecordoperator= (const L1GlobalTriggerEvmReadoutRecord &)
 assignment operator More...
 
bool operator== (const L1GlobalTriggerEvmReadoutRecord &) const
 equal operator More...
 
void print (std::ostream &myCout) const
 pretty print the content of a L1GlobalTriggerEvmReadoutRecord More...
 
void printGtDecision (std::ostream &myCout, int bxInEventValue) const
 print global decision and algorithm decision word More...
 
void printGtDecision (std::ostream &myCout) const
 
void printTechnicalTrigger (std::ostream &myCout, int bxInEventValue) const
 print technical triggers More...
 
void printTechnicalTrigger (std::ostream &myCout) const
 
void reset ()
 clear the record More...
 
void setDecision (bool t, int bxInEvent)
 set global decision and the decision word More...
 
void setDecision (bool t)
 
void setDecisionWord (const DecisionWord &decisionWordValue, int bxInEvent)
 
void setDecisionWord (const DecisionWord &decisionWordValue)
 
void setGtFdlWord (const L1GtFdlWord &, int bxInEvent)
 
void setGtFdlWord (const L1GtFdlWord &)
 
void setGtfeWord (const L1GtfeExtWord &)
 
void setTcsWord (const L1TcsWord &)
 
const L1TcsWord tcsWord () const
 get / set TCS word (record) in the GT readout record More...
 
virtual ~L1GlobalTriggerEvmReadoutRecord ()
 destructor More...
 

Private Attributes

std::vector< L1GtFdlWordm_gtFdlWord
 
L1GtfeExtWord m_gtfeWord
 
L1TcsWord m_tcsWord
 

Friends

std::ostream & operator<< (std::ostream &, const L1GlobalTriggerEvmReadoutRecord &)
 output stream operator More...
 

Detailed Description

Description: EVM readout record for L1 Global Trigger.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: see header file.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 36 of file L1GlobalTriggerEvmReadoutRecord.h.

Constructor & Destructor Documentation

L1GlobalTriggerEvmReadoutRecord::L1GlobalTriggerEvmReadoutRecord ( )

constructors

Definition at line 29 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

29  {
31  m_tcsWord = L1TcsWord();
32 
33  // reserve just one L1GtFdlWord
34  m_gtFdlWord.reserve(1);
35 }
L1GlobalTriggerEvmReadoutRecord::L1GlobalTriggerEvmReadoutRecord ( int  NumberBxInEvent)

Definition at line 37 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

37  {
39  m_tcsWord = L1TcsWord();
40 
41  m_gtFdlWord.reserve(NumberBxInEvent);
42  m_gtFdlWord.assign(NumberBxInEvent, L1GtFdlWord());
43 
44  // min value of bxInEvent
45  int minBxInEvent = (NumberBxInEvent + 1) / 2 - NumberBxInEvent;
46  //int maxBxInEvent = (NumberBxInEvent + 1)/2 - 1; // not needed
47 
48  // matrix index [0, NumberBxInEvent) -> bxInEvent [minBxInEvent, maxBxInEvent]
49  // warning: matrix index != bxInEvent
50  for (int iFdl = 0; iFdl < NumberBxInEvent; ++iFdl) {
51  int iBxInEvent = minBxInEvent + iFdl;
52  m_gtFdlWord[iFdl].setBxInEvent(iBxInEvent);
53  }
54 }
L1GlobalTriggerEvmReadoutRecord::L1GlobalTriggerEvmReadoutRecord ( const int  numberBxInEvent,
const int  numberFdlBoards 
)

Definition at line 56 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

56  {
57  // GTFE board
59 
60  // TCS board
61  m_tcsWord = L1TcsWord();
62 
63  // FDL board
64  if (numberFdlBoards > 0) {
65  m_gtFdlWord.reserve(numberBxInEvent);
66  }
67 }
L1GlobalTriggerEvmReadoutRecord::L1GlobalTriggerEvmReadoutRecord ( const L1GlobalTriggerEvmReadoutRecord result)

copy constructor

Definition at line 70 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

L1GlobalTriggerEvmReadoutRecord::~L1GlobalTriggerEvmReadoutRecord ( )
virtual

destructor

Definition at line 77 of file L1GlobalTriggerEvmReadoutRecord.cc.

77  {
78  // empty now
79 }

Member Function Documentation

const bool L1GlobalTriggerEvmReadoutRecord::decision ( int  bxInEvent) const

get Global Trigger decision and the decision word overloaded w.r.t. bxInEvent argument bxInEvent not given: for bunch cross with L1Accept

Definition at line 119 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

119  {
120  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
121  if ((*itBx).bxInEvent() == bxInEventValue) {
122  return (*itBx).finalOR();
123  }
124  }
125 
126  // if bunch cross not found, throw exception (action: SkipEvent)
127 
128  throw cms::Exception("NotFound") << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
129  << "Can not return global decision for this bx!\n"
130  << std::endl;
131 
132  return false;
133 }
const bool L1GlobalTriggerEvmReadoutRecord::decision ( ) const

Definition at line 153 of file L1GlobalTriggerEvmReadoutRecord.cc.

153  {
154  int bxInEventL1Accept = 0;
155  return decision(bxInEventL1Accept);
156 }
const DecisionWord L1GlobalTriggerEvmReadoutRecord::decisionWord ( int  bxInEvent) const

Definition at line 135 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

135  {
136  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
137  if ((*itBx).bxInEvent() == bxInEventValue) {
138  return (*itBx).gtDecisionWord();
139  }
140  }
141 
142  // if bunch cross not found, throw exception (action: SkipEvent)
143 
144  throw cms::Exception("NotFound") << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
145  << "Can not return decision word for this bx!\n"
146  << std::endl;
147 
148  DecisionWord dW; // empty; it does not arrive here
149  return dW;
150 }
std::vector< bool > DecisionWord
typedefs
const DecisionWord L1GlobalTriggerEvmReadoutRecord::decisionWord ( ) const

Definition at line 158 of file L1GlobalTriggerEvmReadoutRecord.cc.

158  {
159  int bxInEventL1Accept = 0;
160  return decisionWord(bxInEventL1Accept);
161 }
const std::vector<L1GtFdlWord> L1GlobalTriggerEvmReadoutRecord::gtFdlVector ( ) const
inline

get the vector of L1GtFdlWord

Definition at line 100 of file L1GlobalTriggerEvmReadoutRecord.h.

References m_gtFdlWord.

Referenced by L1GtHwValidation::compareEvmRecord().

100 { return m_gtFdlWord; }
std::vector<L1GtFdlWord>& L1GlobalTriggerEvmReadoutRecord::gtFdlVector ( )
inline

Definition at line 102 of file L1GlobalTriggerEvmReadoutRecord.h.

References gtFdlWord(), m_gtFdlWord, operator<<, print(), reset(), and setGtFdlWord().

102 { return m_gtFdlWord; }
const L1GtFdlWord L1GlobalTriggerEvmReadoutRecord::gtFdlWord ( int  bxInEvent) const

get / set FDL word (record) in the GT readout record

Definition at line 259 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

Referenced by L1TGT::analyze(), and L1GTEvmDigiToRaw::produce().

259  {
260  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
261  if ((*itBx).bxInEvent() == bxInEventValue) {
262  return (*itBx);
263  }
264  }
265 
266  // if bunch cross not found, throw exception (action: SkipEvent)
267 
268  throw cms::Exception("NotFound") << "\nError: requested L1GtFdlWord for bx = " << bxInEventValue
269  << " does not exist.\n"
270  << std::endl;
271 
272  // return empty record - actually does not arrive here
273  return L1GtFdlWord();
274 }
const L1GtFdlWord L1GlobalTriggerEvmReadoutRecord::gtFdlWord ( ) const

Definition at line 276 of file L1GlobalTriggerEvmReadoutRecord.cc.

Referenced by gtFdlVector().

276  {
277  int bxInEventL1Accept = 0;
278  return gtFdlWord(bxInEventL1Accept);
279 }
const L1GtfeExtWord L1GlobalTriggerEvmReadoutRecord::gtfeWord ( ) const
bool L1GlobalTriggerEvmReadoutRecord::operator!= ( const L1GlobalTriggerEvmReadoutRecord result) const

unequal operator

Definition at line 112 of file L1GlobalTriggerEvmReadoutRecord.cc.

112  {
113  return !(result == *this);
114 }
L1GlobalTriggerEvmReadoutRecord & L1GlobalTriggerEvmReadoutRecord::operator= ( const L1GlobalTriggerEvmReadoutRecord result)

assignment operator

Definition at line 82 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

83  {
84  if (this != &result) {
85  m_gtfeWord = result.m_gtfeWord;
86  m_tcsWord = result.m_tcsWord;
87  m_gtFdlWord = result.m_gtFdlWord;
88  }
89 
90  return *this;
91 }
bool L1GlobalTriggerEvmReadoutRecord::operator== ( const L1GlobalTriggerEvmReadoutRecord result) const

equal operator

Definition at line 94 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

94  {
95  if (m_gtfeWord != result.m_gtfeWord) {
96  return false;
97  }
98 
99  if (m_tcsWord != result.m_tcsWord) {
100  return false;
101  }
102 
103  if (m_gtFdlWord != result.m_gtFdlWord) {
104  return false;
105  }
106 
107  // all members identical
108  return true;
109 }
void L1GlobalTriggerEvmReadoutRecord::print ( std::ostream &  myCout) const

pretty print the content of a L1GlobalTriggerEvmReadoutRecord

pretty print the content of a L1GlobalTriggerReadoutRecord

Definition at line 311 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, m_tcsWord, L1GtfeExtWord::print(), and L1TcsWord::print().

Referenced by gtFdlVector(), and L1GTEvmDigiToRaw::produce().

311  {
312  myCout << "\n L1GlobalTriggerEvmReadoutRecord::print \n" << std::endl;
313 
314  m_gtfeWord.print(myCout);
315 
316  m_tcsWord.print(myCout);
317 
318  for (std::vector<L1GtFdlWord>::const_iterator itFdl = m_gtFdlWord.begin(); itFdl != m_gtFdlWord.end(); ++itFdl) {
319  itFdl->print(myCout);
320  }
321 }
void print(std::ostream &myCout) const override
pretty print the content of a L1GtfeExtWord
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:274
void L1GlobalTriggerEvmReadoutRecord::printGtDecision ( std::ostream &  myCout,
int  bxInEventValue 
) const

print global decision and algorithm decision word

Definition at line 205 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord.

Referenced by printGtDecision().

205  {
206  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
207  if ((*itBx).bxInEvent() == bxInEventValue) {
208  myCout << "\nL1 Global Trigger Record: " << std::endl;
209 
210  myCout << "\t Bunch cross " << bxInEventValue << std::endl
211  << "\t Global Decision = " << std::setw(5) << (*itBx).globalDecision() << std::endl
212  << "\t Decision word (bitset style) = ";
213 
214  (*itBx).printGtDecisionWord(myCout);
215  }
216  }
217 
218  myCout << std::endl;
219 }
void L1GlobalTriggerEvmReadoutRecord::printGtDecision ( std::ostream &  myCout) const

Definition at line 221 of file L1GlobalTriggerEvmReadoutRecord.cc.

References printGtDecision().

221  {
222  int bxInEventL1Accept = 0;
223  printGtDecision(myCout, bxInEventL1Accept);
224 }
void printGtDecision(std::ostream &myCout, int bxInEventValue) const
print global decision and algorithm decision word
void L1GlobalTriggerEvmReadoutRecord::printTechnicalTrigger ( std::ostream &  myCout,
int  bxInEventValue 
) const

print technical triggers

Definition at line 227 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord.

Referenced by printTechnicalTrigger().

227  {
228  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
229  if ((*itBx).bxInEvent() == bxInEventValue) {
230  myCout << "\nL1 Global Trigger Record: " << std::endl;
231 
232  myCout << "\t Bunch cross " << bxInEventValue << std::endl << "\t Technical Trigger word (bitset style) = ";
233 
234  (*itBx).printGtTechnicalTriggerWord(myCout);
235  }
236  }
237 
238  myCout << std::endl;
239 }
void L1GlobalTriggerEvmReadoutRecord::printTechnicalTrigger ( std::ostream &  myCout) const

Definition at line 241 of file L1GlobalTriggerEvmReadoutRecord.cc.

References printTechnicalTrigger().

241  {
242  int bxInEventL1Accept = 0;
243  printTechnicalTrigger(myCout, bxInEventL1Accept);
244 }
void printTechnicalTrigger(std::ostream &myCout, int bxInEventValue) const
print technical triggers
void L1GlobalTriggerEvmReadoutRecord::reset ( void  )

clear the record

Definition at line 306 of file L1GlobalTriggerEvmReadoutRecord.cc.

Referenced by gtFdlVector().

306  {
307  // TODO FIXME clear GTFE, TCS, FDL?
308 }
void L1GlobalTriggerEvmReadoutRecord::setDecision ( bool  t,
int  bxInEvent 
)

set global decision and the decision word

Definition at line 165 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

Referenced by setDecision().

165  {
166  for (std::vector<L1GtFdlWord>::iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
167  if ((*itBx).bxInEvent() == bxInEventValue) {
168  (*itBx).setFinalOR(static_cast<uint16_t>(t)); // TODO FIXME when manipulating partitions
169  }
170  }
171 
172  // if bunch cross not found, throw exception (action: SkipEvent)
173 
174  throw cms::Exception("NotFound") << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
175  << "Can not set global decision for this bx!\n"
176  << std::endl;
177 }
void L1GlobalTriggerEvmReadoutRecord::setDecision ( bool  t)

Definition at line 194 of file L1GlobalTriggerEvmReadoutRecord.cc.

References setDecision().

194  {
195  int bxInEventL1Accept = 0;
196  setDecision(t, bxInEventL1Accept);
197 }
void setDecision(bool t, int bxInEvent)
set global decision and the decision word
void L1GlobalTriggerEvmReadoutRecord::setDecisionWord ( const DecisionWord decisionWordValue,
int  bxInEvent 
)

Definition at line 179 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

Referenced by setDecisionWord().

179  {
180  for (std::vector<L1GtFdlWord>::iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
181  if ((*itBx).bxInEvent() == bxInEventValue) {
182  (*itBx).setGtDecisionWord(decisionWordValue);
183  }
184  }
185 
186  // if bunch cross not found, throw exception (action: SkipEvent)
187 
188  throw cms::Exception("NotFound") << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
189  << "Can not set decision word for this bx!\n"
190  << std::endl;
191 }
void L1GlobalTriggerEvmReadoutRecord::setDecisionWord ( const DecisionWord decisionWordValue)

Definition at line 199 of file L1GlobalTriggerEvmReadoutRecord.cc.

References setDecisionWord().

199  {
200  int bxInEventL1Accept = 0;
201  setDecisionWord(decisionWordValue, bxInEventL1Accept);
202 }
void setDecisionWord(const DecisionWord &decisionWordValue, int bxInEvent)
void L1GlobalTriggerEvmReadoutRecord::setGtFdlWord ( const L1GtFdlWord gtFdlWordValue,
int  bxInEvent 
)

Definition at line 281 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, LogDebug, and m_gtFdlWord.

Referenced by L1GlobalTriggerFDL::fillEvmFdlBlock(), and gtFdlVector().

281  {
282  // if a L1GtFdlWord exists for bxInEventValue, replace it
283  for (std::vector<L1GtFdlWord>::iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
284  if ((*itBx).bxInEvent() == bxInEventValue) {
285  *itBx = gtFdlWordValue;
286  LogDebug("L1GlobalTriggerEvmReadoutRecord") << "Replacing L1GtFdlWord for bunch bx = " << bxInEventValue << "\n"
287  << std::endl;
288  return;
289  }
290  }
291 
292  // if bunch cross not found, throw exception (action: SkipEvent)
293  // all L1GtFdlWord are created in the record constructor for allowed bunch crosses
294 
295  throw cms::Exception("NotFound") << "\nError: Cannot set L1GtFdlWord for bx = " << bxInEventValue << std::endl;
296 }
#define LogDebug(id)
void L1GlobalTriggerEvmReadoutRecord::setGtFdlWord ( const L1GtFdlWord gtFdlWordValue)

Definition at line 298 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord.

298  {
299  // just push back the new FDL block
300  m_gtFdlWord.push_back(gtFdlWordValue);
301 }
void L1GlobalTriggerEvmReadoutRecord::setGtfeWord ( const L1GtfeExtWord gtfeWordValue)

Definition at line 251 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtfeWord.

251 { m_gtfeWord = gtfeWordValue; }
void L1GlobalTriggerEvmReadoutRecord::setTcsWord ( const L1TcsWord tcsWordValue)

Definition at line 256 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_tcsWord.

const L1TcsWord L1GlobalTriggerEvmReadoutRecord::tcsWord ( ) const

get / set TCS word (record) in the GT readout record

Definition at line 254 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_tcsWord.

Referenced by L1TGT::analyze(), L1GTEvmDigiToRaw::produce(), and L1Analysis::L1AnalysisGT::SetEvm().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const L1GlobalTriggerEvmReadoutRecord result 
)
friend

output stream operator

Definition at line 324 of file L1GlobalTriggerEvmReadoutRecord.cc.

Referenced by gtFdlVector().

324  {
325  // TODO FIXME put together all prints
326  s << "Not available yet - sorry";
327 
328  return s;
329 }

Member Data Documentation

std::vector<L1GtFdlWord> L1GlobalTriggerEvmReadoutRecord::m_gtFdlWord
private
L1GtfeExtWord L1GlobalTriggerEvmReadoutRecord::m_gtfeWord
private
L1TcsWord L1GlobalTriggerEvmReadoutRecord::m_tcsWord
private