test
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 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 30 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

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

Definition at line 41 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

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

Definition at line 63 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

66 {
67 
68  // GTFE board
70 
71  // TCS board
72  m_tcsWord = L1TcsWord();
73 
74  // FDL board
75  if (numberFdlBoards > 0) {
76  m_gtFdlWord.reserve(numberBxInEvent);
77  }
78 
79 }
L1GlobalTriggerEvmReadoutRecord::L1GlobalTriggerEvmReadoutRecord ( const L1GlobalTriggerEvmReadoutRecord result)

copy constructor

Definition at line 83 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

L1GlobalTriggerEvmReadoutRecord::~L1GlobalTriggerEvmReadoutRecord ( )
virtual

destructor

Definition at line 94 of file L1GlobalTriggerEvmReadoutRecord.cc.

95 {
96 
97  // empty now
98 
99 }

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 153 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

154 {
155 
156  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
157  itBx != m_gtFdlWord.end(); ++itBx) {
158 
159  if ( (*itBx).bxInEvent() == bxInEventValue ) {
160  return (*itBx).finalOR();
161  }
162  }
163 
164  // if bunch cross not found, throw exception (action: SkipEvent)
165 
166  throw cms::Exception("NotFound")
167  << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
168  << "Can not return global decision for this bx!\n"
169  << std::endl;
170 
171  return false;
172 }
const bool L1GlobalTriggerEvmReadoutRecord::decision ( ) const

Definition at line 198 of file L1GlobalTriggerEvmReadoutRecord.cc.

199 {
200 
201  int bxInEventL1Accept = 0;
202  return decision(bxInEventL1Accept);
203 }
const DecisionWord L1GlobalTriggerEvmReadoutRecord::decisionWord ( int  bxInEvent) const

Definition at line 174 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

176 {
177 
178  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
179  itBx != m_gtFdlWord.end(); ++itBx) {
180 
181  if ( (*itBx).bxInEvent() == bxInEventValue ) {
182  return (*itBx).gtDecisionWord();
183  }
184  }
185 
186  // if bunch cross not found, throw exception (action: SkipEvent)
187 
188  throw cms::Exception("NotFound")
189  << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
190  << "Can not return decision word for this bx!\n"
191  << std::endl;
192 
193  DecisionWord dW; // empty; it does not arrive here
194  return dW;
195 }
std::vector< bool > DecisionWord
typedefs
const DecisionWord L1GlobalTriggerEvmReadoutRecord::decisionWord ( ) const

Definition at line 206 of file L1GlobalTriggerEvmReadoutRecord.cc.

207 {
208 
209  int bxInEventL1Accept = 0;
210  return decisionWord(bxInEventL1Accept);
211 }
const std::vector<L1GtFdlWord> L1GlobalTriggerEvmReadoutRecord::gtFdlVector ( ) const
inline

get the vector of L1GtFdlWord

Definition at line 105 of file L1GlobalTriggerEvmReadoutRecord.h.

References m_gtFdlWord.

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

Definition at line 110 of file L1GlobalTriggerEvmReadoutRecord.h.

References m_gtFdlWord.

111  {
112  return m_gtFdlWord;
113  }
const L1GtFdlWord L1GlobalTriggerEvmReadoutRecord::gtFdlWord ( int  bxInEvent) const

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

Definition at line 377 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

378 {
379 
380  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
381  itBx != m_gtFdlWord.end(); ++itBx) {
382 
383  if ( (*itBx).bxInEvent() == bxInEventValue ) {
384  return (*itBx);
385  }
386  }
387 
388  // if bunch cross not found, throw exception (action: SkipEvent)
389 
390  throw cms::Exception("NotFound")
391  << "\nError: requested L1GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
392  << std::endl;
393 
394  // return empty record - actually does not arrive here
395  return L1GtFdlWord();
396 
397 }
const L1GtFdlWord L1GlobalTriggerEvmReadoutRecord::gtFdlWord ( ) const

Definition at line 399 of file L1GlobalTriggerEvmReadoutRecord.cc.

400 {
401 
402  int bxInEventL1Accept = 0;
403  return gtFdlWord(bxInEventL1Accept);
404 }
const L1GtfeExtWord L1GlobalTriggerEvmReadoutRecord::gtfeWord ( ) const

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

Definition at line 347 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtfeWord.

Referenced by SiStripMonitorDigi::analyze(), and L1Analysis::L1AnalysisGT::SetEvm().

348 {
349 
350  return m_gtfeWord;
351 
352 }
bool L1GlobalTriggerEvmReadoutRecord::operator!= ( const L1GlobalTriggerEvmReadoutRecord result) const

unequal operator

Definition at line 141 of file L1GlobalTriggerEvmReadoutRecord.cc.

143 {
144 
145  return !( result == *this);
146 
147 }
L1GlobalTriggerEvmReadoutRecord & L1GlobalTriggerEvmReadoutRecord::operator= ( const L1GlobalTriggerEvmReadoutRecord result)

assignment operator

Definition at line 102 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

104 {
105 
106  if ( this != &result ) {
107 
108  m_gtfeWord = result.m_gtfeWord;
109  m_tcsWord = result.m_tcsWord;
110  m_gtFdlWord = result.m_gtFdlWord;
111 
112  }
113 
114  return *this;
115 
116 }
bool L1GlobalTriggerEvmReadoutRecord::operator== ( const L1GlobalTriggerEvmReadoutRecord result) const

equal operator

Definition at line 119 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, and m_tcsWord.

121 {
122 
123  if (m_gtfeWord != result.m_gtfeWord) {
124  return false;
125  }
126 
127  if (m_tcsWord != result.m_tcsWord) {
128  return false;
129  }
130 
131  if (m_gtFdlWord != result.m_gtFdlWord) {
132  return false;
133  }
134 
135  // all members identical
136  return true;
137 
138 }
void L1GlobalTriggerEvmReadoutRecord::print ( std::ostream &  myCout) const

pretty print the content of a L1GlobalTriggerEvmReadoutRecord

pretty print the content of a L1GlobalTriggerReadoutRecord

Definition at line 452 of file L1GlobalTriggerEvmReadoutRecord.cc.

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

453 {
454 
455  myCout << "\n L1GlobalTriggerEvmReadoutRecord::print \n" << std::endl;
456 
457  m_gtfeWord.print(myCout);
458 
459  m_tcsWord.print(myCout);
460 
461  for (std::vector<L1GtFdlWord>::const_iterator itFdl = m_gtFdlWord.begin();
462  itFdl != m_gtFdlWord.end(); ++itFdl) {
463 
464  itFdl->print(myCout);
465 
466  }
467 
468 }
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:403
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeExtWord
void L1GlobalTriggerEvmReadoutRecord::printGtDecision ( std::ostream &  myCout,
int  bxInEventValue 
) const

print global decision and algorithm decision word

Definition at line 276 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord.

Referenced by printGtDecision().

278 {
279 
280  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
281  itBx != m_gtFdlWord.end(); ++itBx) {
282 
283  if ( (*itBx).bxInEvent() == bxInEventValue ) {
284 
285  myCout << "\nL1 Global Trigger Record: " << std::endl;
286 
287  myCout
288  << "\t Bunch cross " << bxInEventValue
289  << std::endl
290  << "\t Global Decision = " << std::setw(5) << (*itBx).globalDecision()
291  << std::endl
292  << "\t Decision word (bitset style) = ";
293 
294  (*itBx).printGtDecisionWord(myCout);
295  }
296  }
297 
298  myCout << std::endl;
299 
300 }
void L1GlobalTriggerEvmReadoutRecord::printGtDecision ( std::ostream &  myCout) const

Definition at line 302 of file L1GlobalTriggerEvmReadoutRecord.cc.

References printGtDecision().

303 {
304 
305  int bxInEventL1Accept = 0;
306  printGtDecision(myCout, bxInEventL1Accept);
307 
308 }
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 311 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord.

Referenced by printTechnicalTrigger().

314 {
315 
316  for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
317  itBx != m_gtFdlWord.end(); ++itBx) {
318 
319  if ( (*itBx).bxInEvent() == bxInEventValue ) {
320 
321  myCout << "\nL1 Global Trigger Record: " << std::endl;
322 
323  myCout
324  << "\t Bunch cross " << bxInEventValue
325  << std::endl
326  << "\t Technical Trigger word (bitset style) = ";
327 
328  (*itBx).printGtTechnicalTriggerWord(myCout);
329  }
330  }
331 
332  myCout << std::endl;
333 
334 }
void L1GlobalTriggerEvmReadoutRecord::printTechnicalTrigger ( std::ostream &  myCout) const

Definition at line 336 of file L1GlobalTriggerEvmReadoutRecord.cc.

References printTechnicalTrigger().

337 {
338 
339  int bxInEventL1Accept = 0;
340  printTechnicalTrigger(myCout, bxInEventL1Accept);
341 
342 }
void printTechnicalTrigger(std::ostream &myCout, int bxInEventValue) const
print technical triggers
void L1GlobalTriggerEvmReadoutRecord::reset ( void  )

clear the record

Definition at line 444 of file L1GlobalTriggerEvmReadoutRecord.cc.

445 {
446 
447  // TODO FIXME clear GTFE, TCS, FDL?
448 
449 }
void L1GlobalTriggerEvmReadoutRecord::setDecision ( bool  t,
int  bxInEvent 
)

set global decision and the decision word

Definition at line 216 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

Referenced by setDecision().

217 {
218 
219  for (std::vector<L1GtFdlWord>::iterator itBx = m_gtFdlWord.begin();
220  itBx != m_gtFdlWord.end(); ++itBx) {
221 
222  if ( (*itBx).bxInEvent() == bxInEventValue ) {
223  (*itBx).setFinalOR(static_cast<uint16_t> (t)); // TODO FIXME when manipulating partitions
224  }
225  }
226 
227  // if bunch cross not found, throw exception (action: SkipEvent)
228 
229  throw cms::Exception("NotFound")
230  << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
231  << "Can not set global decision for this bx!\n"
232  << std::endl;
233 
234 }
void L1GlobalTriggerEvmReadoutRecord::setDecision ( bool  t)

Definition at line 259 of file L1GlobalTriggerEvmReadoutRecord.cc.

References setDecision().

260 {
261 
262  int bxInEventL1Accept = 0;
263  setDecision(t, bxInEventL1Accept);
264 }
void setDecision(bool t, int bxInEvent)
set global decision and the decision word
void L1GlobalTriggerEvmReadoutRecord::setDecisionWord ( const DecisionWord decisionWordValue,
int  bxInEvent 
)

Definition at line 236 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, and m_gtFdlWord.

Referenced by setDecisionWord().

239 {
240 
241  for (std::vector<L1GtFdlWord>::iterator itBx = m_gtFdlWord.begin();
242  itBx != m_gtFdlWord.end(); ++itBx) {
243 
244  if ( (*itBx).bxInEvent() == bxInEventValue ) {
245  (*itBx).setGtDecisionWord (decisionWordValue);
246  }
247  }
248 
249  // if bunch cross not found, throw exception (action: SkipEvent)
250 
251  throw cms::Exception("NotFound")
252  << "\nError: requested GtFdlWord for bx = " << bxInEventValue << " does not exist.\n"
253  << "Can not set decision word for this bx!\n"
254  << std::endl;
255 
256 }
void L1GlobalTriggerEvmReadoutRecord::setDecisionWord ( const DecisionWord decisionWordValue)

Definition at line 266 of file L1GlobalTriggerEvmReadoutRecord.cc.

References setDecisionWord().

268 {
269 
270  int bxInEventL1Accept = 0;
271  setDecisionWord(decisionWordValue, bxInEventL1Accept);
272 
273 }
void setDecisionWord(const DecisionWord &decisionWordValue, int bxInEvent)
void L1GlobalTriggerEvmReadoutRecord::setGtFdlWord ( const L1GtFdlWord gtFdlWordValue,
int  bxInEvent 
)

Definition at line 406 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, LogDebug, and m_gtFdlWord.

Referenced by L1GlobalTriggerFDL::fillEvmFdlBlock().

408 {
409 
410  // if a L1GtFdlWord exists for bxInEventValue, replace it
411  for (std::vector<L1GtFdlWord>::iterator itBx = m_gtFdlWord.begin();
412  itBx != m_gtFdlWord.end(); ++itBx) {
413 
414  if ( (*itBx).bxInEvent() == bxInEventValue ) {
415  *itBx = gtFdlWordValue;
416  LogDebug("L1GlobalTriggerEvmReadoutRecord")
417  << "Replacing L1GtFdlWord for bunch bx = " << bxInEventValue << "\n"
418  << std::endl;
419  return;
420  }
421  }
422 
423  // if bunch cross not found, throw exception (action: SkipEvent)
424  // all L1GtFdlWord are created in the record constructor for allowed bunch crosses
425 
426  throw cms::Exception("NotFound")
427  << "\nError: Cannot set L1GtFdlWord for bx = " << bxInEventValue
428  << std::endl;
429 
430 }
#define LogDebug(id)
void L1GlobalTriggerEvmReadoutRecord::setGtFdlWord ( const L1GtFdlWord gtFdlWordValue)

Definition at line 432 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord.

433 {
434 
435  // just push back the new FDL block
436  m_gtFdlWord.push_back(gtFdlWordValue);
437 
438 }
void L1GlobalTriggerEvmReadoutRecord::setGtfeWord ( const L1GtfeExtWord gtfeWordValue)

Definition at line 354 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtfeWord.

355 {
356 
357  m_gtfeWord = gtfeWordValue;
358 
359 }
void L1GlobalTriggerEvmReadoutRecord::setTcsWord ( const L1TcsWord tcsWordValue)

Definition at line 369 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_tcsWord.

370 {
371 
372  m_tcsWord = tcsWordValue;
373 
374 }
const L1TcsWord L1GlobalTriggerEvmReadoutRecord::tcsWord ( ) const

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

Definition at line 362 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_tcsWord.

Referenced by L1Analysis::L1AnalysisGT::SetEvm().

363 {
364 
365  return m_tcsWord;
366 
367 }

Friends And Related Function Documentation

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

output stream operator

Definition at line 472 of file L1GlobalTriggerEvmReadoutRecord.cc.

473 {
474  // TODO FIXME put together all prints
475  s << "Not available yet - sorry";
476 
477  return s;
478 
479 }

Member Data Documentation

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