ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CTP_BC Class Reference

#include <CTP_Decoder.h>

Collaboration diagram for CTP_BC:

Public Member Functions

void dumpData (MsgStream &) const
 Helper class to decode the CTP data for one bunch-crossing. More...
 
void setCTPVersion (unsigned int ctpVersionNumber)
 Set the CTP data format version (needed before extracting any information) More...
 
std::bitset< 32 > getBCIDBitSet () const
 Accessor to obtain std::bitset containing the bunch-crossing. More...
 
uint32_t getBCID () const
 Get BCID as unsigned integer. More...
 
std::string printBCID () const
 Return string with BCID in binary format. More...
 
std::bitset< 32 > getRandomTrigBitSet () const
 Accessor to obtain random-trigger input bits. More...
 
uint32_t getRandomTrig () const
 Random-trigger inputs as uint32_t. More...
 
std::string printRandomTrig () const
 Return string with random trigger in binary format. More...
 
std::bitset< 32 > getPrescaledClockBitSet () const
 Accessor to obtain prescaled-clock input bits. More...
 
uint32_t getPrescaledClock () const
 Prescaled-clock inputs as uint32_t. More...
 
std::string printPrescaledClock () const
 Return string with prescaled clock in binary format. More...
 
void setPITWordAux (uint32_t word)
 Set auxiliary PIT word, which is the one containing the 12-bit BCID (bit. More...
 
const std::bitset< 32 > & getPITWordAux () const
 Get PIT word 5 bitset. More...
 
std::string printPITWordAux () const
 Get auxiliary PIT word as string in binary format. More...
 
void setTIP (const std::vector< uint32_t > &words)
 Set TIP words. More...
 
const std::bitset< 512 > & getTIP () const
 get bitset of TIP words More...
 
void setTIPWord (uint32_t word, uint32_t pos=0)
 Set TIP word number 'pos'. More...
 
std::string printTIP () const
 Obtain TIP bitpattern string (binary format) More...
 
void setTBP (const std::vector< uint32_t > &words)
 Set TBP (Trigger Before Prescales) words. More...
 
const std::bitset< 512 > & getTBP () const
 get bitset of TBP words More...
 
void setTBPWord (uint32_t word, uint32_t pos=0)
 Set TBP word number 'pos'. More...
 
std::string printTBP () const
 Obtain TBP bitpattern string (binary format) More...
 
void setTAP (const std::vector< uint32_t > &words)
 Set TAP (Trigger After Prescales) words. More...
 
void setTAPWord (uint32_t word, uint32_t pos=0)
 Set TAP word number 'pos'. More...
 
const std::bitset< 512 > & getTAP () const
 get bitset of TAP words More...
 
std::string printTAP () const
 Obtain TAP bitpattern string (binary format) More...
 
void setTAV (const std::vector< uint32_t > &words)
 Set TAV (Trigger After Veto) words. More...
 
const std::bitset< 512 > & getTAV () const
 get bitset of TAV words More...
 
void setTAVWord (uint32_t word, uint32_t pos=0)
 Set TAV word number 'pos'. More...
 
std::string printTAV () const
 Obtain TAV bitpattern string (binary format) More...
 

Private Attributes

std::bitset< 512 > m_tip
 Bitsets containing bit-patterns of trigger inputs and trigger. More...
 
std::bitset< 512 > m_tbp
 
std::bitset< 512 > m_tap
 
std::bitset< 512 > m_tav
 
std::bitset< 32 > m_pitAux
 Contains BCID, random trigger and prescaled clock. More...
 
CTPdataformatVersion m_ctpVersion {0}
 

Detailed Description

Definition at line 17 of file CTP_Decoder.h.

Member Function Documentation

◆ dumpData()

void CTP_BC::dumpData ( MsgStream &  msglog) const

Helper class to decode the CTP data for one bunch-crossing.

class CTP BC

Date
2007-07-10 14:58:38
See also
CTP_Decoder
CTP_RDO
Author
David Berge berge.nosp@m.@cer.nosp@m.n.ch
Eleanor Dobson elean.nosp@m.or.d.nosp@m.obson.nosp@m.@cer.nosp@m.n.ch
Version
$ $ Helper to dump data for debugging

Definition at line 199 of file CTP_Decoder.cxx.

200 {
201  if( msglog.level() > MSG::DEBUG )
202  return;
203 
204  msglog << MSG::DEBUG << "-------------- BC dump for " << getBCID() << " ------------------------------------" << endmsg;
205  msglog << MSG::DEBUG << "PITWordAux : " << printPITWordAux() << endmsg;
206  msglog << MSG::DEBUG << "BCID : " << getBCID() << endmsg;
207  msglog << MSG::DEBUG << "Random trig : " << getRandomTrig() << " (binary: " << printRandomTrig() << ")" << endmsg;
208  msglog << MSG::DEBUG << "Prescaled clock : " << getPrescaledClock() << " (binary: " << printPrescaledClock() << ")" << endmsg;
209 
210  if(m_tip.any()) {
211  int count(0);
212  std::ostringstream outstream;
213  for(unsigned int i = 0; i<m_tip.size() ; ++i) {
214  if(m_tip.test(i)) {
215  outstream << std::setw(3) << std::setfill('0') << (i+1) << " ";
216  ++count;
217  }
218  }
219  msglog << MSG::DEBUG << "TIP with input (" << count << " items): " << outstream.str() << endmsg;
220  } else {
221  msglog << MSG::DEBUG << "No TIP!" << endmsg;
222  }
223 
224 
225  if(m_tbp.any()) {
226  int count(0);
227  std::ostringstream outstream;
228  for(unsigned int i = 0; i<m_tbp.size() ; ++i) {
229  if(m_tbp.test(i)) {
230  outstream << i << " ";
231  ++count;
232  }
233  }
234  msglog << MSG::DEBUG << "Fired TBP (" << count << " items): " << outstream.str() << endmsg;
235  } else {
236  msglog << MSG::DEBUG << "No TBP fired!" << endmsg;
237  }
238 
239 
240  if(m_tap.any()) {
241  int count(0);
242  std::ostringstream outstream;
243  for(unsigned int i = 0; i<m_tap.size() ; ++i) {
244  if(m_tap.test(i)) {
245  outstream << i << " ";
246  ++count;
247  }
248  }
249  msglog << MSG::DEBUG << "Fired TAP (" << count << " items): " << outstream.str() << endmsg;
250  } else {
251  msglog << MSG::DEBUG << "No TAP fired!" << endmsg;
252  }
253 
254 
255  if(m_tav.any()) {
256  int count(0);
257  std::ostringstream outstream;
258  for(unsigned int i = 0; i<m_tav.size() ; ++i) {
259  if(m_tav.test(i)) {
260  outstream << i << " ";
261  ++count;
262  }
263  }
264  msglog << MSG::DEBUG << "Fired TAV (" << count << " items): " << outstream.str() << endmsg;
265  } else {
266  msglog << MSG::DEBUG << "No TAV fired!" << endmsg;
267  }
268 
269  msglog << MSG::VERBOSE << "TIP - total size: " << m_tip.size() << ", with input: "
270  << m_tip.count() << ", pattern:" << std::endl << printTIP() << endmsg;
271  msglog << MSG::VERBOSE << "TBP " << std::endl << printTBP() << endmsg;
272  msglog << MSG::VERBOSE << "TAP " << std::endl << printTAP() << endmsg;
273  msglog << MSG::VERBOSE << "TAV " << std::endl << printTAV() << endmsg;
274 }

◆ getBCID()

uint32_t CTP_BC::getBCID ( ) const

Get BCID as unsigned integer.

Definition at line 292 of file CTP_Decoder.cxx.

293 {
294  return getBCIDBitSet().to_ulong();
295 }

◆ getBCIDBitSet()

std::bitset< 32 > CTP_BC::getBCIDBitSet ( ) const

Accessor to obtain std::bitset containing the bunch-crossing.

Definition at line 277 of file CTP_Decoder.cxx.

278 {
279  std::bitset<32> bcid = (m_pitAux >> m_ctpVersion.getBcidShift());
280 
281  // the bcid mask is wrong in CTPfragment/CTPdataformatVersion.h (0xF000)
282  // so we set it here
283  uint32_t bcidMask = 0xFFF;
284  if(m_ctpVersion.getVersionNumber()>=1 && m_ctpVersion.getVersionNumber()<=3) {
285  bcidMask = 0xF;
286  }
287  //bcid &= m_ctpVersion.getBcidMask();
288  bcid &= bcidMask;
289  return bcid;
290 }

◆ getPITWordAux()

const std::bitset<32>& CTP_BC::getPITWordAux ( ) const
inline

Get PIT word 5 bitset.

Definition at line 72 of file CTP_Decoder.h.

72  {
73  return m_pitAux;
74  }

◆ getPrescaledClock()

uint32_t CTP_BC::getPrescaledClock ( ) const

Prescaled-clock inputs as uint32_t.

Definition at line 336 of file CTP_Decoder.cxx.

337 {
338  return getPrescaledClockBitSet().to_ulong();
339 }

◆ getPrescaledClockBitSet()

std::bitset< 32 > CTP_BC::getPrescaledClockBitSet ( ) const

Accessor to obtain prescaled-clock input bits.

Definition at line 323 of file CTP_Decoder.cxx.

324 {
325  std::bitset<32> prcl;
326 
327  if (!m_ctpVersion.getNumPrescaledClocks()) {
328  return prcl;
329  }
330 
331  prcl = (m_pitAux >> m_ctpVersion.getPrescaledClockShift());
332  prcl &= m_ctpVersion.getPrescaledClockMask();
333  return prcl;
334 }

◆ getRandomTrig()

uint32_t CTP_BC::getRandomTrig ( ) const

Random-trigger inputs as uint32_t.

Definition at line 311 of file CTP_Decoder.cxx.

312 {
313  return getRandomTrigBitSet().to_ulong();
314 }

◆ getRandomTrigBitSet()

std::bitset< 32 > CTP_BC::getRandomTrigBitSet ( ) const

Accessor to obtain random-trigger input bits.

Definition at line 304 of file CTP_Decoder.cxx.

305 {
306  std::bitset<32> rnd = (m_pitAux >> m_ctpVersion.getRandomTrigShift());
307  rnd &= m_ctpVersion.getRandomTrigMask();
308  return rnd;
309 }

◆ getTAP()

const std::bitset<512>& CTP_BC::getTAP ( ) const
inline

get bitset of TAP words

Definition at line 106 of file CTP_Decoder.h.

106  {
107  return m_tap;
108  }

◆ getTAV()

const std::bitset<512>& CTP_BC::getTAV ( ) const
inline

get bitset of TAV words

Definition at line 115 of file CTP_Decoder.h.

115  {
116  return m_tav;
117  }

◆ getTBP()

const std::bitset<512>& CTP_BC::getTBP ( ) const
inline

get bitset of TBP words

Definition at line 93 of file CTP_Decoder.h.

93  {
94  return m_tbp;
95  }

◆ getTIP()

const std::bitset<512>& CTP_BC::getTIP ( ) const
inline

get bitset of TIP words

Definition at line 81 of file CTP_Decoder.h.

81  {
82  return m_tip;
83  }

◆ printBCID()

std::string CTP_BC::printBCID ( ) const

Return string with BCID in binary format.

Definition at line 297 of file CTP_Decoder.cxx.

298 {
299  std::bitset<32> bcid = getBCIDBitSet();
300  return bcid.to_string<char,
301  std::char_traits<char>, std::allocator<char> >();
302 }

◆ printPITWordAux()

std::string CTP_BC::printPITWordAux ( ) const

Get auxiliary PIT word as string in binary format.

Definition at line 348 of file CTP_Decoder.cxx.

349 {
350  return m_pitAux.to_string<char,
351  std::char_traits<char>, std::allocator<char> >();
352 }

◆ printPrescaledClock()

std::string CTP_BC::printPrescaledClock ( ) const

Return string with prescaled clock in binary format.

Definition at line 341 of file CTP_Decoder.cxx.

342 {
343  std::bitset<32> prcl = getPrescaledClockBitSet();
344  return prcl.to_string<char,
345  std::char_traits<char>, std::allocator<char> >();
346 }

◆ printRandomTrig()

std::string CTP_BC::printRandomTrig ( ) const

Return string with random trigger in binary format.

Definition at line 316 of file CTP_Decoder.cxx.

317 {
318  std::bitset<32> rnd = getRandomTrigBitSet();
319  return rnd.to_string<char,
320  std::char_traits<char>, std::allocator<char> >();
321 }

◆ printTAP()

std::string CTP_BC::printTAP ( ) const

Obtain TAP bitpattern string (binary format)

Definition at line 425 of file CTP_Decoder.cxx.

426 {
427  return m_tap.to_string<char,
428  std::char_traits<char>, std::allocator<char> >();
429 }

◆ printTAV()

std::string CTP_BC::printTAV ( ) const

Obtain TAV bitpattern string (binary format)

Definition at line 449 of file CTP_Decoder.cxx.

450 {
451  return m_tav.to_string<char,
452  std::char_traits<char>, std::allocator<char> >();
453 }

◆ printTBP()

std::string CTP_BC::printTBP ( ) const

Obtain TBP bitpattern string (binary format)

Definition at line 401 of file CTP_Decoder.cxx.

402 {
403  return m_tbp.to_string<char,
404  std::char_traits<char>, std::allocator<char> >();
405 }

◆ printTIP()

std::string CTP_BC::printTIP ( ) const

Obtain TIP bitpattern string (binary format)

Definition at line 375 of file CTP_Decoder.cxx.

376 {
377  return m_tip.to_string<char,
378  std::char_traits<char>, std::allocator<char> >();
379 }

◆ setCTPVersion()

void CTP_BC::setCTPVersion ( unsigned int  ctpVersionNumber)
inline

Set the CTP data format version (needed before extracting any information)

Definition at line 40 of file CTP_Decoder.h.

40  {
41  m_ctpVersion = CTPdataformatVersion(ctpVersionNumber);
42  }

◆ setPITWordAux()

void CTP_BC::setPITWordAux ( uint32_t  word)
inline

Set auxiliary PIT word, which is the one containing the 12-bit BCID (bit.

Definition at line 70 of file CTP_Decoder.h.

70 { m_pitAux = word; }

◆ setTAP()

void CTP_BC::setTAP ( const std::vector< uint32_t > &  words)

Set TAP (Trigger After Prescales) words.

Definition at line 419 of file CTP_Decoder.cxx.

420 {
421  for(uint32_t i = 0; i<words.size();++i)
422  setTAPWord(words[i],i);
423 }

◆ setTAPWord()

void CTP_BC::setTAPWord ( uint32_t  word,
uint32_t  pos = 0 
)

Set TAP word number 'pos'.

Definition at line 407 of file CTP_Decoder.cxx.

408 {
409  if(pos >= m_ctpVersion.getTAPwords()) {
410  MsgStream log(Athena::getMessageSvc(), "CTP_Decoder");
411  log << MSG::ERROR <<"Invalid TAP position " << pos <<endmsg;
412  return;
413  }
414  std::bitset<512> bs = word;
415  bs <<= (pos * CTP_RDO::SIZEOF_WORDS);
416  m_tap |= bs;
417 }

◆ setTAV()

void CTP_BC::setTAV ( const std::vector< uint32_t > &  words)

Set TAV (Trigger After Veto) words.

Definition at line 443 of file CTP_Decoder.cxx.

444 {
445  for(uint32_t i = 0; i<words.size();++i)
446  setTAVWord(words[i],i);
447 }

◆ setTAVWord()

void CTP_BC::setTAVWord ( uint32_t  word,
uint32_t  pos = 0 
)

Set TAV word number 'pos'.

Definition at line 431 of file CTP_Decoder.cxx.

432 {
433  if(pos >= m_ctpVersion.getTAVwords()) {
434  MsgStream log(Athena::getMessageSvc(), "CTP_Decoder");
435  log << MSG::ERROR <<"Invalid TAV position " << pos <<endmsg;
436  return;
437  }
438  std::bitset<512> bs = word;
439  bs <<= (pos * CTP_RDO::SIZEOF_WORDS);
440  m_tav |= bs;
441 }

◆ setTBP()

void CTP_BC::setTBP ( const std::vector< uint32_t > &  words)

Set TBP (Trigger Before Prescales) words.

Definition at line 396 of file CTP_Decoder.cxx.

397 {
398  for(uint32_t i = 0; i<words.size();++i) setTBPWord(words[i],i);
399 }

◆ setTBPWord()

void CTP_BC::setTBPWord ( uint32_t  word,
uint32_t  pos = 0 
)

Set TBP word number 'pos'.

Definition at line 383 of file CTP_Decoder.cxx.

384 {
385  if(pos >= m_ctpVersion.getTBPwords()) {
386  MsgStream log(Athena::getMessageSvc(), "CTP_Decoder");
387  log << MSG::ERROR <<"Invalid TBP position " << pos <<endmsg;
388  return;
389  }
390 
391  std::bitset<512> bs = word;
392  bs <<= (pos * CTP_RDO::SIZEOF_WORDS);
393  m_tbp |= bs;
394 }

◆ setTIP()

void CTP_BC::setTIP ( const std::vector< uint32_t > &  words)

Set TIP words.

Definition at line 370 of file CTP_Decoder.cxx.

371 {
372  for(uint32_t i = 0; i<words.size();++i) setTIPWord(words[i],i);
373 }

◆ setTIPWord()

void CTP_BC::setTIPWord ( uint32_t  word,
uint32_t  pos = 0 
)

Set TIP word number 'pos'.

Definition at line 354 of file CTP_Decoder.cxx.

355 {
356  if(pos >= m_ctpVersion.getTIPwords()) {
357  MsgStream log(Athena::getMessageSvc(), "CTP_Decoder");
358  log << MSG::ERROR <<"Invalid TIP position " << pos <<endmsg;
359  return;
360  }
361 
362  std::bitset<512> bs = word;
363 
364  bs <<= (pos * CTP_RDO::SIZEOF_WORDS);
365 
366  if( pos < (m_ctpVersion.getTIPwords()-1) ) m_tip |= bs;
367  else setPITWordAux(word);
368 }

Member Data Documentation

◆ m_ctpVersion

CTPdataformatVersion CTP_BC::m_ctpVersion {0}
private

Definition at line 135 of file CTP_Decoder.h.

◆ m_pitAux

std::bitset<32> CTP_BC::m_pitAux
private

Contains BCID, random trigger and prescaled clock.

Definition at line 133 of file CTP_Decoder.h.

◆ m_tap

std::bitset<512> CTP_BC::m_tap
private

Definition at line 130 of file CTP_Decoder.h.

◆ m_tav

std::bitset<512> CTP_BC::m_tav
private

Definition at line 131 of file CTP_Decoder.h.

◆ m_tbp

std::bitset<512> CTP_BC::m_tbp
private

Definition at line 129 of file CTP_Decoder.h.

◆ m_tip

std::bitset<512> CTP_BC::m_tip
private

Bitsets containing bit-patterns of trigger inputs and trigger.

Definition at line 128 of file CTP_Decoder.h.


The documentation for this class was generated from the following files:
CTP_BC::setTAPWord
void setTAPWord(uint32_t word, uint32_t pos=0)
Set TAP word number 'pos'.
Definition: CTP_Decoder.cxx:407
CTP_BC::setTAVWord
void setTAVWord(uint32_t word, uint32_t pos=0)
Set TAV word number 'pos'.
Definition: CTP_Decoder.cxx:431
CTP_BC::getRandomTrigBitSet
std::bitset< 32 > getRandomTrigBitSet() const
Accessor to obtain random-trigger input bits.
Definition: CTP_Decoder.cxx:304
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CTP_BC::m_tbp
std::bitset< 512 > m_tbp
Definition: CTP_Decoder.h:129
CTP_BC::m_tav
std::bitset< 512 > m_tav
Definition: CTP_Decoder.h:131
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
CTP_BC::setTBPWord
void setTBPWord(uint32_t word, uint32_t pos=0)
Set TBP word number 'pos'.
Definition: CTP_Decoder.cxx:383
CTP_RDO::SIZEOF_WORDS
static constexpr unsigned int SIZEOF_WORDS
number of bits in one data word (32)
Definition: CTP_RDO.h:90
CTP_BC::printTBP
std::string printTBP() const
Obtain TBP bitpattern string (binary format)
Definition: CTP_Decoder.cxx:401
CTP_BC::setTIPWord
void setTIPWord(uint32_t word, uint32_t pos=0)
Set TIP word number 'pos'.
Definition: CTP_Decoder.cxx:354
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
CTP_BC::printTIP
std::string printTIP() const
Obtain TIP bitpattern string (binary format)
Definition: CTP_Decoder.cxx:375
CTP_BC::printPrescaledClock
std::string printPrescaledClock() const
Return string with prescaled clock in binary format.
Definition: CTP_Decoder.cxx:341
lumiFormat.i
int i
Definition: lumiFormat.py:92
CTP_BC::printRandomTrig
std::string printRandomTrig() const
Return string with random trigger in binary format.
Definition: CTP_Decoder.cxx:316
CTP_BC::m_tip
std::bitset< 512 > m_tip
Bitsets containing bit-patterns of trigger inputs and trigger.
Definition: CTP_Decoder.h:128
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
CTP_BC::setPITWordAux
void setPITWordAux(uint32_t word)
Set auxiliary PIT word, which is the one containing the 12-bit BCID (bit.
Definition: CTP_Decoder.h:70
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
CTP_BC::getBCID
uint32_t getBCID() const
Get BCID as unsigned integer.
Definition: CTP_Decoder.cxx:292
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CTP_BC::getPrescaledClockBitSet
std::bitset< 32 > getPrescaledClockBitSet() const
Accessor to obtain prescaled-clock input bits.
Definition: CTP_Decoder.cxx:323
CTP_BC::getPrescaledClock
uint32_t getPrescaledClock() const
Prescaled-clock inputs as uint32_t.
Definition: CTP_Decoder.cxx:336
CTP_BC::m_tap
std::bitset< 512 > m_tap
Definition: CTP_Decoder.h:130
CTP_BC::getBCIDBitSet
std::bitset< 32 > getBCIDBitSet() const
Accessor to obtain std::bitset containing the bunch-crossing.
Definition: CTP_Decoder.cxx:277
CTP_BC::printPITWordAux
std::string printPITWordAux() const
Get auxiliary PIT word as string in binary format.
Definition: CTP_Decoder.cxx:348
CTP_BC::m_pitAux
std::bitset< 32 > m_pitAux
Contains BCID, random trigger and prescaled clock.
Definition: CTP_Decoder.h:133
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CTP_BC::printTAP
std::string printTAP() const
Obtain TAP bitpattern string (binary format)
Definition: CTP_Decoder.cxx:425
CTP_BC::printTAV
std::string printTAV() const
Obtain TAV bitpattern string (binary format)
Definition: CTP_Decoder.cxx:449
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
CTP_BC::m_ctpVersion
CTPdataformatVersion m_ctpVersion
Definition: CTP_Decoder.h:135
checkFileSG.words
words
Definition: checkFileSG.py:76
CTP_BC::getRandomTrig
uint32_t getRandomTrig() const
Random-trigger inputs as uint32_t.
Definition: CTP_Decoder.cxx:311