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

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 201 of file CTP_Decoder.cxx.

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

◆ getBCID()

uint32_t CTP_BC::getBCID ( ) const

Get BCID as unsigned integer.

Definition at line 294 of file CTP_Decoder.cxx.

295 {
296  return getBCIDBitSet().to_ulong();
297 }

◆ getBCIDBitSet()

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

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

Definition at line 279 of file CTP_Decoder.cxx.

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

◆ getPITWordAux()

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

Get PIT word 5 bitset.

Definition at line 71 of file CTP_Decoder.h.

71  {
72  return m_pitAux;
73  }

◆ getPrescaledClock()

uint32_t CTP_BC::getPrescaledClock ( ) const

Prescaled-clock inputs as uint32_t.

Definition at line 338 of file CTP_Decoder.cxx.

339 {
340  return getPrescaledClockBitSet().to_ulong();
341 }

◆ getPrescaledClockBitSet()

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

Accessor to obtain prescaled-clock input bits.

Definition at line 325 of file CTP_Decoder.cxx.

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

◆ getRandomTrig()

uint32_t CTP_BC::getRandomTrig ( ) const

Random-trigger inputs as uint32_t.

Definition at line 313 of file CTP_Decoder.cxx.

314 {
315  return getRandomTrigBitSet().to_ulong();
316 }

◆ getRandomTrigBitSet()

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

Accessor to obtain random-trigger input bits.

Definition at line 306 of file CTP_Decoder.cxx.

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

◆ getTAP()

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

get bitset of TAP words

Definition at line 105 of file CTP_Decoder.h.

105  {
106  return m_tap;
107  }

◆ getTAV()

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

get bitset of TAV words

Definition at line 114 of file CTP_Decoder.h.

114  {
115  return m_tav;
116  }

◆ getTBP()

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

get bitset of TBP words

Definition at line 92 of file CTP_Decoder.h.

92  {
93  return m_tbp;
94  }

◆ getTIP()

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

get bitset of TIP words

Definition at line 80 of file CTP_Decoder.h.

80  {
81  return m_tip;
82  }

◆ printBCID()

std::string CTP_BC::printBCID ( ) const

Return string with BCID in binary format.

Definition at line 299 of file CTP_Decoder.cxx.

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

◆ printPITWordAux()

std::string CTP_BC::printPITWordAux ( ) const

Get auxiliary PIT word as string in binary format.

Definition at line 350 of file CTP_Decoder.cxx.

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

◆ printPrescaledClock()

std::string CTP_BC::printPrescaledClock ( ) const

Return string with prescaled clock in binary format.

Definition at line 343 of file CTP_Decoder.cxx.

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

◆ printRandomTrig()

std::string CTP_BC::printRandomTrig ( ) const

Return string with random trigger in binary format.

Definition at line 318 of file CTP_Decoder.cxx.

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

◆ printTAP()

std::string CTP_BC::printTAP ( ) const

Obtain TAP bitpattern string (binary format)

Definition at line 427 of file CTP_Decoder.cxx.

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

◆ printTAV()

std::string CTP_BC::printTAV ( ) const

Obtain TAV bitpattern string (binary format)

Definition at line 451 of file CTP_Decoder.cxx.

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

◆ printTBP()

std::string CTP_BC::printTBP ( ) const

Obtain TBP bitpattern string (binary format)

Definition at line 403 of file CTP_Decoder.cxx.

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

◆ printTIP()

std::string CTP_BC::printTIP ( ) const

Obtain TIP bitpattern string (binary format)

Definition at line 377 of file CTP_Decoder.cxx.

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

◆ setCTPVersion()

void CTP_BC::setCTPVersion ( unsigned int  ctpVersionNumber)
inline

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

Definition at line 39 of file CTP_Decoder.h.

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

◆ 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 69 of file CTP_Decoder.h.

69 { m_pitAux = word; }

◆ setTAP()

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

Set TAP (Trigger After Prescales) words.

Definition at line 421 of file CTP_Decoder.cxx.

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

◆ setTAPWord()

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

Set TAP word number 'pos'.

Definition at line 409 of file CTP_Decoder.cxx.

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

◆ setTAV()

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

Set TAV (Trigger After Veto) words.

Definition at line 445 of file CTP_Decoder.cxx.

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

◆ setTAVWord()

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

Set TAV word number 'pos'.

Definition at line 433 of file CTP_Decoder.cxx.

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

◆ setTBP()

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

Set TBP (Trigger Before Prescales) words.

Definition at line 398 of file CTP_Decoder.cxx.

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

◆ setTBPWord()

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

Set TBP word number 'pos'.

Definition at line 385 of file CTP_Decoder.cxx.

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

◆ setTIP()

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

Set TIP words.

Definition at line 372 of file CTP_Decoder.cxx.

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

◆ setTIPWord()

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

Set TIP word number 'pos'.

Definition at line 356 of file CTP_Decoder.cxx.

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

Member Data Documentation

◆ m_ctpVersion

CTPdataformatVersion CTP_BC::m_ctpVersion {0}
private

Definition at line 134 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 132 of file CTP_Decoder.h.

◆ m_tap

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

Definition at line 129 of file CTP_Decoder.h.

◆ m_tav

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

Definition at line 130 of file CTP_Decoder.h.

◆ m_tbp

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

Definition at line 128 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 127 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:409
CTP_BC::setTAVWord
void setTAVWord(uint32_t word, uint32_t pos=0)
Set TAV word number 'pos'.
Definition: CTP_Decoder.cxx:433
CTP_BC::getRandomTrigBitSet
std::bitset< 32 > getRandomTrigBitSet() const
Accessor to obtain random-trigger input bits.
Definition: CTP_Decoder.cxx:306
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CTP_BC::m_tbp
std::bitset< 512 > m_tbp
Definition: CTP_Decoder.h:128
CTP_BC::m_tav
std::bitset< 512 > m_tav
Definition: CTP_Decoder.h:130
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:385
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:403
CTP_BC::setTIPWord
void setTIPWord(uint32_t word, uint32_t pos=0)
Set TIP word number 'pos'.
Definition: CTP_Decoder.cxx:356
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:377
CTP_BC::printPrescaledClock
std::string printPrescaledClock() const
Return string with prescaled clock in binary format.
Definition: CTP_Decoder.cxx:343
lumiFormat.i
int i
Definition: lumiFormat.py:85
CTP_BC::printRandomTrig
std::string printRandomTrig() const
Return string with random trigger in binary format.
Definition: CTP_Decoder.cxx:318
CTP_BC::m_tip
std::bitset< 512 > m_tip
Bitsets containing bit-patterns of trigger inputs and trigger.
Definition: CTP_Decoder.h:127
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:69
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:294
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:325
CTP_BC::getPrescaledClock
uint32_t getPrescaledClock() const
Prescaled-clock inputs as uint32_t.
Definition: CTP_Decoder.cxx:338
CTP_BC::m_tap
std::bitset< 512 > m_tap
Definition: CTP_Decoder.h:129
CTP_BC::getBCIDBitSet
std::bitset< 32 > getBCIDBitSet() const
Accessor to obtain std::bitset containing the bunch-crossing.
Definition: CTP_Decoder.cxx:279
CTP_BC::printPITWordAux
std::string printPITWordAux() const
Get auxiliary PIT word as string in binary format.
Definition: CTP_Decoder.cxx:350
CTP_BC::m_pitAux
std::bitset< 32 > m_pitAux
Contains BCID, random trigger and prescaled clock.
Definition: CTP_Decoder.h:132
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:427
CTP_BC::printTAV
std::string printTAV() const
Obtain TAV bitpattern string (binary format)
Definition: CTP_Decoder.cxx:451
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
CTP_BC::m_ctpVersion
CTPdataformatVersion m_ctpVersion
Definition: CTP_Decoder.h:134
checkFileSG.words
words
Definition: checkFileSG.py:76
CTP_BC::getRandomTrig
uint32_t getRandomTrig() const
Random-trigger inputs as uint32_t.
Definition: CTP_Decoder.cxx:313