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() [1/4]

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() [2/4]

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() [3/4]

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() [4/4]

L1GlobalTriggerEvmReadoutRecord::L1GlobalTriggerEvmReadoutRecord ( const L1GlobalTriggerEvmReadoutRecord result)

copy constructor

Definition at line 70 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, m_tcsWord, and mps_fire::result.

70  {
71  m_gtfeWord = result.m_gtfeWord;
72  m_tcsWord = result.m_tcsWord;
73  m_gtFdlWord = result.m_gtFdlWord;
74 }

◆ ~L1GlobalTriggerEvmReadoutRecord()

L1GlobalTriggerEvmReadoutRecord::~L1GlobalTriggerEvmReadoutRecord ( )
virtual

destructor

Definition at line 77 of file L1GlobalTriggerEvmReadoutRecord.cc.

77  {
78  // empty now
79 }

Member Function Documentation

◆ decision() [1/2]

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 }

◆ decision() [2/2]

const bool L1GlobalTriggerEvmReadoutRecord::decision ( ) const

Definition at line 153 of file L1GlobalTriggerEvmReadoutRecord.cc.

153  {
154  int bxInEventL1Accept = 0;
155  return decision(bxInEventL1Accept);
156 }

◆ decisionWord() [1/2]

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

◆ decisionWord() [2/2]

const DecisionWord L1GlobalTriggerEvmReadoutRecord::decisionWord ( ) const

Definition at line 158 of file L1GlobalTriggerEvmReadoutRecord.cc.

158  {
159  int bxInEventL1Accept = 0;
160  return decisionWord(bxInEventL1Accept);
161 }

◆ gtFdlVector() [1/2]

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; }

◆ gtFdlVector() [2/2]

std::vector<L1GtFdlWord>& L1GlobalTriggerEvmReadoutRecord::gtFdlVector ( )
inline

Definition at line 102 of file L1GlobalTriggerEvmReadoutRecord.h.

References m_gtFdlWord.

102 { return m_gtFdlWord; }

◆ gtFdlWord() [1/2]

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 }

◆ gtFdlWord() [2/2]

const L1GtFdlWord L1GlobalTriggerEvmReadoutRecord::gtFdlWord ( ) const

Definition at line 276 of file L1GlobalTriggerEvmReadoutRecord.cc.

276  {
277  int bxInEventL1Accept = 0;
278  return gtFdlWord(bxInEventL1Accept);
279 }

◆ gtfeWord()

const L1GtfeExtWord L1GlobalTriggerEvmReadoutRecord::gtfeWord ( ) const

◆ operator!=()

bool L1GlobalTriggerEvmReadoutRecord::operator!= ( const L1GlobalTriggerEvmReadoutRecord result) const

unequal operator

Definition at line 112 of file L1GlobalTriggerEvmReadoutRecord.cc.

References mps_fire::result.

112  {
113  return !(result == *this);
114 }

◆ operator=()

L1GlobalTriggerEvmReadoutRecord & L1GlobalTriggerEvmReadoutRecord::operator= ( const L1GlobalTriggerEvmReadoutRecord result)

assignment operator

Definition at line 82 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, m_tcsWord, and mps_fire::result.

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 }

◆ operator==()

bool L1GlobalTriggerEvmReadoutRecord::operator== ( const L1GlobalTriggerEvmReadoutRecord result) const

equal operator

Definition at line 94 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtFdlWord, m_gtfeWord, m_tcsWord, and mps_fire::result.

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 }

◆ print()

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 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

◆ printGtDecision() [1/2]

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 }

◆ printGtDecision() [2/2]

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

◆ printTechnicalTrigger() [1/2]

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 }

◆ printTechnicalTrigger() [2/2]

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

◆ reset()

void L1GlobalTriggerEvmReadoutRecord::reset ( void  )

clear the record

Definition at line 306 of file L1GlobalTriggerEvmReadoutRecord.cc.

306  {
307  // TODO FIXME clear GTFE, TCS, FDL?
308 }

◆ setDecision() [1/2]

void L1GlobalTriggerEvmReadoutRecord::setDecision ( bool  t,
int  bxInEvent 
)

set global decision and the decision word

Definition at line 165 of file L1GlobalTriggerEvmReadoutRecord.cc.

References Exception, m_gtFdlWord, and submitPVValidationJobs::t.

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 }

◆ setDecision() [2/2]

void L1GlobalTriggerEvmReadoutRecord::setDecision ( bool  t)

Definition at line 194 of file L1GlobalTriggerEvmReadoutRecord.cc.

References setDecision(), and submitPVValidationJobs::t.

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

◆ setDecisionWord() [1/2]

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 }

◆ setDecisionWord() [2/2]

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)

◆ setGtFdlWord() [1/2]

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().

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)

◆ setGtFdlWord() [2/2]

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 }

◆ setGtfeWord()

void L1GlobalTriggerEvmReadoutRecord::setGtfeWord ( const L1GtfeExtWord gtfeWordValue)

Definition at line 251 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_gtfeWord.

251 { m_gtfeWord = gtfeWordValue; }

◆ setTcsWord()

void L1GlobalTriggerEvmReadoutRecord::setTcsWord ( const L1TcsWord tcsWordValue)

Definition at line 256 of file L1GlobalTriggerEvmReadoutRecord.cc.

References m_tcsWord.

◆ 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

◆ operator<<

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

output stream operator

Definition at line 324 of file L1GlobalTriggerEvmReadoutRecord.cc.

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

Member Data Documentation

◆ m_gtFdlWord

std::vector<L1GtFdlWord> L1GlobalTriggerEvmReadoutRecord::m_gtFdlWord
private

◆ m_gtfeWord

L1GtfeExtWord L1GlobalTriggerEvmReadoutRecord::m_gtfeWord
private

◆ m_tcsWord

L1TcsWord L1GlobalTriggerEvmReadoutRecord::m_tcsWord
private