|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
   10 #include "CTPfragment/CTPdataformat.h" 
   12 #include "GaudiKernel/MsgStream.h" 
   24    CTPdataformatVersion ctpVersion(ctpVersionNumber);
 
   27    ATH_MSG_DEBUG(
"setRDO> #bunches: " << nBunches << 
", ctp version (found in RDO): " << ctpVersionNumber);
 
   31    m_BCs.resize(nBunches);
 
   33       bc.setCTPVersion(ctpVersionNumber);
 
   38    const std::vector<uint32_t> & TIPs = rdo->
getTIPWords();
 
   39    const std::vector<uint32_t> & TBPs = rdo->
getTBPWords();
 
   40    const std::vector<uint32_t> & TAPs = rdo->
getTAPWords();
 
   41    const std::vector<uint32_t> & TAVs = rdo->
getTAVWords();
 
   43    if( nBunches * ctpVersion.getTIPwords() != TIPs.size() ) {
 
   44      ATH_MSG_FATAL(
"Expected " << nBunches * ctpVersion.getTIPwords() << 
" TIP words, but TIP vector has size " << TIPs.size());
 
   48    if( nBunches * ctpVersion.getTBPwords() != TBPs.size() ) {
 
   49      ATH_MSG_FATAL(nBunches * ctpVersion.getTBPwords() << 
" TBP words, but TBP vector has size " << TBPs.size());
 
   53    if( nBunches * ctpVersion.getTAPwords() != TAPs.size() ) {
 
   54      ATH_MSG_FATAL(nBunches * ctpVersion.getTAPwords() << 
" TAP words, but TAP vector has size " << TAPs.size());
 
   58    if( nBunches * ctpVersion.getTAVwords() != TAVs.size() ) {
 
   59      ATH_MSG_FATAL(nBunches * ctpVersion.getTAVwords() << 
" TAV words, but TAV vector has size " << TAVs.size());
 
   65    for(
unsigned int i = 0 ; 
i < nBunches ; ++
i) {
 
   69       for(
unsigned int tip = 0; tip < ctpVersion.getTIPwords(); ++tip) {
 
   70          unsigned int index = 
i*ctpVersion.getTIPwords() + tip;
 
   71          if(
index >= TIPs.size()) {
 
   78       for(
unsigned int tbp = 0; tbp < ctpVersion.getTBPwords(); ++tbp) {
 
   79          unsigned int index = 
i * ctpVersion.getTBPwords() + tbp;
 
   80          if(
index >= TBPs.size()) {
 
   87       for(
unsigned int tap = 0; 
tap < ctpVersion.getTAPwords(); ++
tap) {
 
   88          unsigned int index = 
i * ctpVersion.getTAPwords() + 
tap;
 
   89          if(
index >= TAPs.size()) {
 
   96       for(
unsigned int tav = 0; tav < ctpVersion.getTAVwords(); ++tav) {
 
   97          unsigned int index = 
i * ctpVersion.getTAVwords() + tav;
 
   98          if(
index >= TAVs.size()) {
 
  110    unsigned int vecSize = 
m_BCs.size();
 
  117    if(nBunches != vecSize) {
 
  118      ATH_MSG_ERROR(
"mismatch: " << nBunches << 
" bunches, but vector size is " << vecSize);
 
  125             << std::setw(10) << std::setiosflags(std::ios_base::right) << std::setfill(
' ')
 
  129             << 
" (BC vector size " << vecSize << 
")" << 
endmsg;
 
  133    for(
unsigned int i = 0; 
i<vecSize; ++
i) {
 
  138    ATH_MSG_DEBUG(
"=================================================");
 
  147                   << 
pos << 
", but in the event are only " << 
m_BCs.size());
 
  152                     << 
", which is more than the maximum : " 
  161                    << 
pos << 
", but in the event are only " << 
m_BCs.size());
 
  166                      << 
", which is more than the maximum : " 
  177                       << 
pos << 
", but in the event are only " << 
m_BCs.size());
 
  178       return std::vector<unsigned int>();
 
  206    msglog << 
MSG::DEBUG << 
"-------------- BC dump for " << 
getBCID() << 
" ------------------------------------" << 
endmsg;
 
  214       std::ostringstream outstream;
 
  215       for(
unsigned int i = 0; 
i<
m_tip.size() ; ++
i) {
 
  217             outstream << std::setw(3) << std::setfill(
'0') << (
i+1) << 
" ";
 
  229       std::ostringstream outstream;
 
  230       for(
unsigned int i = 0; 
i<
m_tbp.size() ; ++
i) {
 
  232             outstream << 
i << 
" ";
 
  244       std::ostringstream outstream;
 
  245       for(
unsigned int i = 0; 
i<
m_tap.size() ; ++
i) {
 
  247             outstream << 
i << 
" ";
 
  259       std::ostringstream outstream;
 
  260       for(
unsigned int i = 0; 
i<
m_tav.size() ; ++
i) {
 
  262             outstream << 
i << 
" ";
 
  271    msglog << 
MSG::VERBOSE << 
"TIP - total size: " << 
m_tip.size() << 
", with input: "  
  303       std::char_traits<char>, std::allocator<char> >();
 
  321    return rnd.to_string<
char, 
 
  322       std::char_traits<char>, std::allocator<char> >();
 
  327    std::bitset<32> prcl;
 
  346    return prcl.to_string<
char, 
 
  347       std::char_traits<char>, std::allocator<char> >();
 
  353       std::char_traits<char>, std::allocator<char> >();
 
  360       log << MSG::ERROR <<
"Invalid TIP position " << 
pos <<
endmsg;
 
  364    std::bitset<512> bs = word;
 
  380   std::char_traits<char>, std::allocator<char> >();
 
  389     log << MSG::ERROR <<
"Invalid TBP position " << 
pos <<
endmsg;
 
  393   std::bitset<512> bs = word;
 
  406   std::char_traits<char>, std::allocator<char> >();
 
  413     log << MSG::ERROR <<
"Invalid TAP position " << 
pos <<
endmsg;
 
  416   std::bitset<512> bs = word;
 
  430   std::char_traits<char>, std::allocator<char> >();
 
  437     log << MSG::ERROR <<
"Invalid TAV position " << 
pos <<
endmsg;
 
  440   std::bitset<512> bs = word;
 
  454   std::char_traits<char>, std::allocator<char> >();
 
  
void dumpData(MsgStream &) const
Helper class to decode the CTP data for one bunch-crossing.
void setTAPWord(uint32_t word, uint32_t pos=0)
Set TAP word number 'pos'.
bool checkTriggerAfterPrescale(unsigned int itemNo, unsigned int bcPos)
Test the LVL1 trigger result after pre-scale factors are applied, before the final trigger decision,...
void setTAVWord(uint32_t word, uint32_t pos=0)
Set TAV word number 'pos'.
singleton-like access to IMessageSvc via open function and helper
std::bitset< 32 > getRandomTrigBitSet() const
Accessor to obtain random-trigger input bits.
void setTBP(const std::vector< uint32_t > &words)
Set TBP (Trigger Before Prescales) words.
const std::bitset< 512 > & getTAV() const
get bitset of TAV words
void setTBPWord(uint32_t word, uint32_t pos=0)
Set TBP word number 'pos'.
static constexpr unsigned int SIZEOF_WORDS
number of bits in one data word (32)
void dumpData() const
Helper to dump data for debugging.
CTP_Decoder()
Helper class to decode the CTP data fragment.
std::string printTBP() const
Obtain TBP bitpattern string (binary format)
unsigned int getCTPVersionNumber() const
#define ATH_MSG_VERBOSE(x)
void setTIPWord(uint32_t word, uint32_t pos=0)
Set TIP word number 'pos'.
std::string printBCID() const
Return string with BCID in binary format.
IMessageSvc * getMessageSvc(bool quiet=false)
uint32_t getNumberOfBunches() const
std::string printTIP() const
Obtain TIP bitpattern string (binary format)
std::string printPrescaledClock() const
Return string with prescaled clock in binary format.
std::vector< unsigned int > getAllTriggers(unsigned int bcPos)
Function to obtain a vector with the numbers of the trigger items that fired for the current event.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
bool checkTrigger(unsigned int itemNo, unsigned int bcPos)
Test the LVL1 trigger result for a certain trigger item.
Some weak symbol referencing magic...
std::string printRandomTrig() const
Return string with random trigger in binary format.
std::bitset< 512 > m_tip
Bitsets containing bit-patterns of trigger inputs and trigger.
void setRDO(const CTP_RDO *rdo)
Set RDO and fill internal variables from the data object.
void setTAP(const std::vector< uint32_t > &words)
Set TAP (Trigger After Prescales) words.
Class to provide easy MsgStream access and capabilities.
void setPITWordAux(uint32_t word)
Set auxiliary PIT word, which is the one containing the 12-bit BCID (bit.
void setTIP(const std::vector< uint32_t > &words)
Set TIP words.
MsgStream & msg() const
The standard message stream.
const std::bitset< 512 > & getTAP() const
get bitset of TAP words
std::vector< CTP_BC > m_BCs
Vector of BCs for the current event.
setEventNumber setTimeStamp bcid
uint32_t getBCID() const
Get BCID as unsigned integer.
const CTP_RDO * m_rdo
The RDO member.
uint32_t getL1AcceptBunchPosition() const
std::bitset< 32 > getPrescaledClockBitSet() const
Accessor to obtain prescaled-clock input bits.
std::vector< uint32_t > getTAVWords() const
std::vector< uint32_t > getTBPWords() const
void setTAV(const std::vector< uint32_t > &words)
Set TAV (Trigger After Veto) words.
#define ATH_MSG_WARNING(x)
uint32_t getPrescaledClock() const
Prescaled-clock inputs as uint32_t.
std::bitset< 32 > getBCIDBitSet() const
Accessor to obtain std::bitset containing the bunch-crossing.
std::string printPITWordAux() const
Get auxiliary PIT word as string in binary format.
std::bitset< 32 > m_pitAux
Contains BCID, random trigger and prescaled clock.
std::string printTAP() const
Obtain TAP bitpattern string (binary format)
const CTP_BC & getBunchCrossing(unsigned int pos)
Get data of a single bunch-crossing.
std::string printTAV() const
Obtain TAV bitpattern string (binary format)
CTPdataformatVersion m_ctpVersion
uint32_t getRandomTrig() const
Random-trigger inputs as uint32_t.
std::vector< uint32_t > getTIPWords() const
uint32_t getTimeNanoSec() const
std::vector< uint32_t > getTAPWords() const
uint32_t getTimeSec() const