CMS 3D CMS Logo

L1GtPsbWord Class Reference

Description: PSB block in the L1 GT readout record. More...

#include <DataFormats/L1GlobalTrigger/interface/L1GtPsbWord.h>

List of all members.

Public Member Functions

const boost::uint16_t aData (int iA) const
 get/set A_DATA_CH_IA
const boost::uint16_t bData (int iB) const
 get/set B_DATA_CH_IB
const boost::uint16_t boardId () const
 get/set board ID
const int bxInEvent () const
 get/set bunch cross in the GT event record
const boost::uint16_t bxNr () const
 get/set bunch cross number of the actual bx
const boost::uint32_t eventNr () const
 get/set event number since last L1 reset generated in PSB
const unsigned int getSize () const
 get the size of the PSB block in GT DAQ record (in multiple of 8 bits)
 L1GtPsbWord (boost::uint16_t boardIdValue, int bxInEventValue, boost::uint16_t bxNrValue, boost::uint32_t eventNrValue, boost::uint16_t aDataValue[NumberAData], boost::uint16_t bDataValue[NumberBData], boost::uint16_t localBxNrValue)
 constructor from unpacked values;
 L1GtPsbWord ()
 constructors
const boost::uint16_t localBxNr () const
 get/set local bunch cross number of the actual bx
bool operator!= (const L1GtPsbWord &) const
 unequal operator
bool operator== (const L1GtPsbWord &) const
 equal operator
void print (std::ostream &myCout) const
 pretty print
void reset ()
 reset the content of a L1GtPsbWord
void setAData (const boost::uint64_t &word64, int iWord)
 set the AData value from a 64-bits word, having the index iWord in the GTFE raw record
void setAData (boost::uint16_t aDataVal, int iA)
void setADataWord64 (boost::uint64_t &word64, int iWord)
 set the AData value in a 64-bits word, having the index iWord in the GTFE raw record
void setBData (const boost::uint64_t &word64, int iWord)
 set the BData value from a 64-bits word, having the index iWord in the GTFE raw record
void setBData (boost::uint16_t bDataVal, int iB)
void setBDataWord64 (boost::uint64_t &word64, int iWord)
 set the BData value in a 64-bits word, having the index iWord in the GTFE raw record
void setBoardId (const boost::uint64_t &word64, int iWord)
 set the BoardId value from a 64-bits word, having the index iWord in the GTFE raw record
void setBoardId (boost::uint16_t boardIdValue)
void setBoardIdWord64 (boost::uint64_t &word64, int iWord)
 set the BoardId value in a 64-bits word, having the index iWord in the GTFE raw record
void setBxInEvent (const boost::uint64_t &word64, int iWord)
 set the BxInEvent value from a 64-bits word, having the index iWord in the GTFE raw record
void setBxInEvent (int bxInEventValue)
void setBxInEventWord64 (boost::uint64_t &word64, int iWord)
 set the BxInEvent value in a 64-bits word, having the index iWord in the GTFE raw record
void setBxNr (const boost::uint64_t &word64, int iWord)
 set the BxNr value from a 64-bits word, having the index iWord in the GTFE raw record
void setBxNr (boost::uint16_t bxNrValue)
void setBxNrWord64 (boost::uint64_t &word64, int iWord)
 set the BxNr value in a 64-bits word, having the index iWord in the GTFE raw record
void setEventNr (const boost::uint64_t &word64, int iWord)
 set the EventNr value from a 64-bits word, having the index iWord in the GTFE raw record
void setEventNr (boost::uint32_t eventNrValue)
void setEventNrWord64 (boost::uint64_t &word64, int iWord)
 set the EventNr value in a 64-bits word, having the index iWord in the GTFE raw record
void setLocalBxNr (const boost::uint64_t &word64, int iWord)
 set the local bunch cross number bits from a 64-bits word, having the index iWord in the GTFE raw record
void setLocalBxNr (boost::uint16_t localBxNrValue)
void setLocalBxNrWord64 (boost::uint64_t &word64, int iWord)
 set the local bunch cross number bits in a 64-bits word, having the index iWord in the GTFE raw record
virtual ~L1GtPsbWord ()
 destructor

Static Public Attributes

static const int NumberAData = 8
static const int NumberBData = 8

Private Attributes

boost::uint16_t m_aData [NumberAData]
boost::uint16_t m_bData [NumberBData]
boost::uint16_t m_boardId
int m_bxInEvent
boost::uint16_t m_bxNr
boost::uint32_t m_eventNr
boost::uint16_t m_localBxNr

Static Private Attributes

static const int ADataCH0Word = 1
static const int ADataCH4Word = 2
static const int BDataCH0Word = 3
static const int BDataCH4Word = 4
static const int BlockSize = 6
static const boost::uint64_t BoardIdMask = 0xFFFF000000000000ULL
static const int BoardIdShift = 48
static const int BoardIdWord = 0
static const boost::uint64_t BxInEventMask = 0x0000F00000000000ULL
static const int BxInEventShift = 44
static const int BxInEventWord = 0
static const boost::uint64_t BxNrMask = 0x00000FFF00000000ULL
static const int BxNrShift = 32
static const int BxNrWord = 0
static const boost::uint64_t DataCHMask = 0x000000000000FFFFULL
static const int DataCHSize = 16
static const boost::uint64_t EventNrMask = 0x0000000000FFFFFFULL
static const int EventNrShift = 0
static const int EventNrWord = 0
static const boost::uint64_t LocalBxNrMask = 0x0000000000000FFFULL
static const int LocalBxNrShift = 0
static const int LocalBxNrWord = 5


Detailed Description

Description: PSB block in the L1 GT readout record.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna
$Date$ $Revision$

Definition at line 31 of file L1GtPsbWord.h.


Constructor & Destructor Documentation

L1GtPsbWord::L1GtPsbWord (  ) 

constructors

Definition at line 30 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, m_localBxNr, NumberAData, and NumberBData.

00031 {
00032 
00033     m_boardId = 0;
00034     m_bxInEvent = 0;
00035     m_bxNr = 0;
00036     m_eventNr = 0;
00037 
00038     for (int iA = 0; iA < NumberAData; ++iA) {
00039         m_aData[iA] = 0;
00040     }
00041 
00042     for (int iB = 0; iB < NumberBData; ++iB) {
00043         m_bData[iB] = 0;
00044     }
00045 
00046     m_localBxNr = 0;
00047 
00048 }

L1GtPsbWord::L1GtPsbWord ( boost::uint16_t  boardIdValue,
int  bxInEventValue,
boost::uint16_t  bxNrValue,
boost::uint32_t  eventNrValue,
boost::uint16_t  aDataValue[NumberAData],
boost::uint16_t  bDataValue[NumberBData],
boost::uint16_t  localBxNrValue 
)

constructor from unpacked values;

Definition at line 51 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, and m_localBxNr.

00060 {
00061 
00062     m_boardId = boardIdValue;
00063     m_bxInEvent = bxInEventValue;
00064     m_bxNr = bxNrValue;
00065     m_eventNr = eventNrValue;
00066 
00067     for (int iA = 0; iA < NumberAData; ++iA) {
00068         m_aData[iA] = aDataValue[iA];
00069     }
00070 
00071     for (int iB = 0; iB < NumberBData; ++iB) {
00072         m_bData[iB] = bDataValue[iB];
00073     }
00074 
00075     m_localBxNr = localBxNrValue;
00076 
00077 }

L1GtPsbWord::~L1GtPsbWord (  )  [virtual]

destructor

Definition at line 80 of file L1GtPsbWord.cc.

00081 {
00082 
00083     // empty now
00084 
00085 }


Member Function Documentation

const boost::uint16_t L1GtPsbWord::aData ( int  iA  )  const

get/set A_DATA_CH_IA

Definition at line 230 of file L1GtPsbWord.cc.

References lat::endl(), Exception, m_aData, and NumberAData.

Referenced by L1GtDataEmulAnalyzer::comparePSB().

00231 {
00232 
00233     if (iA < 0 || iA > NumberAData) {
00234         throw cms::Exception("aDataIndexError")
00235         << "\nError: index for A_DATA array out of range. Allowed range: [0, "
00236         << NumberAData << ") " << std::endl;
00237 
00238     } else {
00239         return m_aData[iA];
00240     }
00241 
00242 }

const boost::uint16_t L1GtPsbWord::bData ( int  iB  )  const

get/set B_DATA_CH_IB

Definition at line 325 of file L1GtPsbWord.cc.

References lat::endl(), Exception, m_bData, and NumberBData.

Referenced by L1GtDataEmulAnalyzer::comparePSB().

00326 {
00327 
00328     if (iB < 0 || iB > NumberBData) {
00329         throw cms::Exception("bDataIndexError")
00330         << "\nError: index for B_DATA array out of range. Allowed range: [0, "
00331         << NumberBData << ") " << std::endl;
00332 
00333     } else {
00334         return m_bData[iB];
00335     }
00336 
00337 }

const boost::uint16_t L1GtPsbWord::boardId (  )  const [inline]

get/set board ID

Definition at line 68 of file L1GtPsbWord.h.

References m_boardId.

Referenced by L1GtPackUnpackAnalyzer::analyzeGT(), L1GtDataEmulAnalyzer::compareDaqRecord(), and L1GtDataEmulAnalyzer::comparePSB().

00069     {
00070         return m_boardId;
00071     }

const int L1GtPsbWord::bxInEvent (  )  const [inline]

get/set bunch cross in the GT event record

Definition at line 89 of file L1GtPsbWord.h.

References m_bxInEvent.

Referenced by L1GtPackUnpackAnalyzer::analyzeGT(), L1GtDataEmulAnalyzer::compareDaqRecord(), and L1GtDataEmulAnalyzer::comparePSB().

00090     {
00091         return m_bxInEvent;
00092     }

const boost::uint16_t L1GtPsbWord::bxNr (  )  const [inline]

get/set bunch cross number of the actual bx

Definition at line 110 of file L1GtPsbWord.h.

References m_bxNr.

Referenced by L1TGT::analyze(), and L1GtDataEmulAnalyzer::comparePSB().

00111     {
00112         return m_bxNr;
00113     }

const boost::uint32_t L1GtPsbWord::eventNr (  )  const [inline]

get/set event number since last L1 reset generated in PSB

Definition at line 131 of file L1GtPsbWord.h.

References m_eventNr.

Referenced by L1GtDataEmulAnalyzer::comparePSB().

00132     {
00133         return m_eventNr;
00134     }

const unsigned int L1GtPsbWord::getSize (  )  const [inline]

get the size of the PSB block in GT DAQ record (in multiple of 8 bits)

Definition at line 200 of file L1GtPsbWord.h.

References BlockSize, and L1GlobalTriggerReadoutSetup::UnitLength.

Referenced by L1GTDigiToRaw::packPSB(), L1GTDigiToRaw::produce(), L1GlobalTriggerRawToDigi::produce(), and L1GlobalTriggerRawToDigi::unpackPSB().

00201     {
00202         int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
00203 
00204         return BlockSize*unitLengthBits;
00205     }

const boost::uint16_t L1GtPsbWord::localBxNr (  )  const [inline]

get/set local bunch cross number of the actual bx

Definition at line 180 of file L1GtPsbWord.h.

References m_localBxNr.

Referenced by L1TGT::analyze(), and L1GtDataEmulAnalyzer::comparePSB().

00181     {
00182         return m_localBxNr;
00183     }

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

unequal operator

Definition at line 126 of file L1GtPsbWord.cc.

00127 {
00128 
00129     return !( result == *this);
00130 
00131 }

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

equal operator

Definition at line 88 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, m_localBxNr, NumberAData, and NumberBData.

00089 {
00090 
00091     if (m_boardId != result.m_boardId) {
00092         return false;
00093     }
00094     if (m_bxInEvent != result.m_bxInEvent) {
00095         return false;
00096     }
00097     if (m_bxNr != result.m_bxNr) {
00098         return false;
00099     }
00100     if (m_eventNr != result.m_eventNr) {
00101         return false;
00102     }
00103 
00104     for (int iA = 0; iA < NumberAData; ++iA) {        
00105         if (m_aData[iA] != result.m_aData[iA]) {
00106             return false;
00107         }    
00108     }
00109 
00110     for (int iB = 0; iB < NumberBData; ++iB) {
00111         if (m_bData[iB] != result.m_bData[iB]) {
00112             return false;
00113         }
00114     }
00115     
00116     if (m_localBxNr != result.m_localBxNr) {
00117         return false;
00118     }
00119 
00120     // all members identical
00121     return true;
00122 
00123 }

void L1GtPsbWord::print ( std::ostream &  myCout  )  const

pretty print

Definition at line 455 of file L1GtPsbWord.cc.

References DataCHSize, lat::endl(), i, m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, and m_localBxNr.

Referenced by L1GtPackUnpackAnalyzer::analyzeGT(), L1GtDataEmulAnalyzer::comparePSB(), L1GTDigiToRaw::produce(), and L1GlobalTriggerRawToDigi::produce().

00456 {
00457 
00458     myCout << "\n L1GtPsbWord::print \n" << std::endl;
00459 
00460     myCout << "  Board Id:  "
00461     << std::hex << " hex:     " << std::setw(4) << std::setfill('0') << m_boardId
00462     << std::setfill(' ')
00463     << std::dec << " dec: " << m_boardId
00464     << std::endl;
00465 
00466     int baseValue = 16; // using hexadecimal values;
00467     int hexBxInEvent = (m_bxInEvent + baseValue)%baseValue;
00468 
00469     myCout << "  BxInEvent: "
00470     << std::hex << " hex:     " << "   " << std::setw(1) << hexBxInEvent
00471     << std::dec << " dec: " << m_bxInEvent
00472     << std::endl;
00473 
00474     myCout << "  BxNr:      "
00475     << std::hex << " hex:     "  << " " << std::setw(3) << std::setfill('0') << m_bxNr
00476     << std::setfill(' ')
00477     << std::dec << " dec: " << m_bxNr
00478     << std::endl;
00479 
00480 
00481     myCout << "  EventNr:   "
00482     << std::hex << " hex: " << "  " << std::setw(6) << std::setfill('0') << m_eventNr
00483     << std::setfill(' ')
00484     << std::dec << " dec: " << m_eventNr
00485     << std::endl;
00486 
00487     int sizeW64 = 64;
00488     int dataBlocksPerLine = sizeW64/DataCHSize; // 4x16 bits per line
00489 
00490     myCout << "\n        "
00491     << "A_Data_CH3 "
00492     << "A_Data_CH2 "
00493     << "A_Data_CH1 "
00494     << "A_Data_CH0 " << "\n"
00495     << std::hex << "  hex:  " << std::setfill('0');
00496 
00497     for (int i = 0; i < dataBlocksPerLine; ++i) {
00498 
00499         int iCh = dataBlocksPerLine - (i + 1); // reverse
00500         myCout << std::setw(4) <<  m_aData[iCh] << "       ";
00501 
00502     }
00503 
00504     myCout << "\n"
00505     << std::dec << "  dec:  ";
00506 
00507     for (int i = 0; i < dataBlocksPerLine; ++i) {
00508 
00509         int iCh = dataBlocksPerLine - (i + 1); // reverse
00510         myCout << std::setw(5) <<  m_aData[iCh] << "      ";
00511 
00512     }
00513 
00514     myCout << "\n\n        "
00515     << "A_Data_CH7 "
00516     << "A_Data_CH6 "
00517     << "A_Data_CH5 "
00518     << "A_Data_CH4 " << "\n"
00519     << std::hex << "  hex:  " << std::setfill('0');
00520 
00521     for (int i = 0; i < dataBlocksPerLine; ++i) {
00522 
00523         int iCh = dataBlocksPerLine - (i + 1); // reverse
00524         myCout << std::setw(4) <<  m_aData[iCh + dataBlocksPerLine] << "       ";
00525 
00526     }
00527 
00528     myCout << "\n"
00529     << std::dec << "  dec:  ";
00530 
00531     for (int i = 0; i < dataBlocksPerLine; ++i) {
00532 
00533         int iCh = dataBlocksPerLine - (i + 1); // reverse
00534         myCout << std::setw(5) <<  m_aData[iCh + dataBlocksPerLine] << "      ";
00535 
00536     }
00537 
00538     myCout << std::endl;
00539 
00540     myCout << "\n        "
00541     << "B_Data_CH3 "
00542     << "B_Data_CH2 "
00543     << "B_Data_CH1 "
00544     << "B_Data_CH0 " << "\n"
00545     << std::hex << "  hex:  " << std::setfill('0');
00546 
00547     for (int i = 0; i < dataBlocksPerLine; ++i) {
00548 
00549         int iCh = dataBlocksPerLine - (i + 1); // reverse
00550         myCout << std::setw(4) <<  m_bData[iCh] << "       ";
00551 
00552     }
00553 
00554     myCout << "\n"
00555     << std::dec << "  dec:  ";
00556 
00557     for (int i = 0; i < dataBlocksPerLine; ++i) {
00558 
00559         int iCh = dataBlocksPerLine - (i + 1); // reverse
00560         myCout << std::setw(5) <<  m_bData[iCh] << "      ";
00561 
00562     }
00563 
00564     myCout << "\n\n        "
00565     << "B_Data_CH7 "
00566     << "B_Data_CH6 "
00567     << "B_Data_CH5 "
00568     << "B_Data_CH4 " << "\n"
00569     << std::hex << "  hex:  " << std::setfill('0');
00570 
00571     for (int i = 0; i < dataBlocksPerLine; ++i) {
00572 
00573         int iCh = dataBlocksPerLine - (i + 1); // reverse
00574         myCout << std::setw(4) <<  m_bData[iCh + dataBlocksPerLine] << "       ";
00575 
00576     }
00577 
00578     myCout << "\n"
00579     << std::dec << "  dec:  ";
00580 
00581     for (int i = 0; i < dataBlocksPerLine; ++i) {
00582 
00583         int iCh = dataBlocksPerLine - (i + 1); // reverse
00584         myCout << std::setw(5) <<  m_bData[iCh + dataBlocksPerLine] << "      ";
00585 
00586     }
00587 
00588     myCout << "\n" << std::endl;
00589 
00590     myCout << "  LocalBxNr: "
00591     << std::hex << " hex:     "  << " " << std::setw(3) << std::setfill('0') << m_localBxNr
00592     << std::setfill(' ')
00593     << std::dec << " dec: " << m_localBxNr
00594     << std::endl;
00595 
00596 }

void L1GtPsbWord::reset ( void   ) 

reset the content of a L1GtPsbWord

Definition at line 434 of file L1GtPsbWord.cc.

References m_aData, m_bData, m_boardId, m_bxInEvent, m_bxNr, m_eventNr, m_localBxNr, NumberAData, and NumberBData.

Referenced by L1GlobalTriggerRawToDigi::produce().

00435 {
00436 
00437     m_boardId = 0;
00438     m_bxInEvent = 0;
00439     m_bxNr = 0;
00440     m_eventNr = 0;
00441 
00442     for (int iA = 0; iA < NumberAData; ++iA) {
00443         m_aData[iA] = 0;
00444     }
00445 
00446     for (int iB = 0; iB < NumberBData; ++iB) {
00447         m_bData[iB] = 0;
00448     }
00449 
00450     m_localBxNr = 0;
00451 
00452 }

void L1GtPsbWord::setAData ( const boost::uint64_t &  word64,
int  iWord 
)

set the AData value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 260 of file L1GtPsbWord.cc.

References ADataCH0Word, ADataCH4Word, DataCHSize, i, and m_aData.

00261 {
00262 
00263     int sizeW64 = sizeof(word64)*8;
00264     int nSubWords = sizeW64/DataCHSize;
00265 
00266     if (iWord == ADataCH0Word) {
00267 
00268         for (int i = 0; i < nSubWords; ++i) {
00269             int dataShift = i*DataCHSize;
00270             m_aData[i] = (word64 & (DataCHMask << dataShift)) >> dataShift;
00271 
00272             //            LogTrace("L1GtPsbWord")
00273             //            << "\n  A_Data_CH" << i << " = "
00274             //            << m_aData[i]
00275             //            << std::endl;
00276 
00277         }
00278 
00279     } else if (iWord == ADataCH4Word) {
00280 
00281         for (int i = 0; i < nSubWords; ++i) {
00282             int dataShift = i*DataCHSize;
00283             m_aData[i + nSubWords] = (word64 & (DataCHMask << dataShift)) >> dataShift;
00284 
00285             //            LogTrace("L1GtPsbWord")
00286             //            << "\n  A_Data_CH" << i + nSubWords << " = "
00287             //            << m_aData[i]
00288             //            << std::endl;
00289         }
00290 
00291     }
00292 
00293 }

void L1GtPsbWord::setAData ( boost::uint16_t  aDataVal,
int  iA 
)

Definition at line 244 of file L1GtPsbWord.cc.

References lat::endl(), Exception, m_aData, and NumberAData.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

00245 {
00246 
00247     if (iA < 0 || iA > NumberAData) {
00248         throw cms::Exception("aDataIndexError")
00249         << "\nError: index for A_DATA array out of range. Allowed range: [0, "
00250         << NumberAData << ") " << std::endl;
00251 
00252     } else {
00253         m_aData[iA] = aDataVal;
00254     }
00255 
00256 }

void L1GtPsbWord::setADataWord64 ( boost::uint64_t &  word64,
int  iWord 
)

set the AData value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 297 of file L1GtPsbWord.cc.

References ADataCH0Word, ADataCH4Word, DataCHSize, i, and m_aData.

Referenced by L1GTDigiToRaw::packPSB().

00298 {
00299 
00300     int sizeW64 = sizeof(word64)*8;
00301     int nSubWords = sizeW64/DataCHSize;
00302 
00303     if (iWord == ADataCH0Word) {
00304 
00305         for (int i = 0; i < nSubWords; ++i) {
00306             int dataShift = i*DataCHSize;
00307             word64 = word64 | (static_cast<boost::uint64_t> (m_aData[i]) << dataShift);
00308         }
00309 
00310     }
00311     else if (iWord == ADataCH4Word) {
00312 
00313         for (int i = 0; i < nSubWords; ++i) {
00314             int dataShift = i*DataCHSize;
00315             word64 = word64 |
00316                      (static_cast<boost::uint64_t> (m_aData[i + nSubWords]) << dataShift);
00317         }
00318 
00319     }
00320 
00321 }

void L1GtPsbWord::setBData ( const boost::uint64_t &  word64,
int  iWord 
)

set the BData value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 355 of file L1GtPsbWord.cc.

References BDataCH0Word, BDataCH4Word, DataCHSize, i, and m_bData.

00356 {
00357 
00358     int sizeW64 = sizeof(word64)*8;
00359     int nSubWords = sizeW64/DataCHSize;
00360 
00361     if (iWord == BDataCH0Word) {
00362 
00363         for (int i = 0; i < nSubWords; ++i) {
00364             int dataShift = i*DataCHSize;
00365             m_bData[i] = (word64 & (DataCHMask << dataShift)) >> dataShift;
00366         }
00367 
00368     } else if (iWord == BDataCH4Word) {
00369 
00370         for (int i = 0; i < nSubWords; ++i) {
00371             int dataShift = i*DataCHSize;
00372             m_bData[i + nSubWords] = (word64 & (DataCHMask << dataShift)) >> dataShift;
00373         }
00374 
00375     }
00376 
00377 }

void L1GtPsbWord::setBData ( boost::uint16_t  bDataVal,
int  iB 
)

Definition at line 339 of file L1GtPsbWord.cc.

References lat::endl(), Exception, m_bData, and NumberBData.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

00340 {
00341 
00342     if (iB < 0 || iB > NumberBData) {
00343         throw cms::Exception("bDataIndexError")
00344         << "\nError: index for B_DATA array out of range. Allowed range: [0, "
00345         << NumberBData << ") " << std::endl;
00346 
00347     } else {
00348         m_bData[iB] = bDataVal;
00349     }
00350 
00351 }

void L1GtPsbWord::setBDataWord64 ( boost::uint64_t &  word64,
int  iWord 
)

set the BData value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 381 of file L1GtPsbWord.cc.

References BDataCH0Word, BDataCH4Word, DataCHSize, i, and m_bData.

Referenced by L1GTDigiToRaw::packPSB().

00382 {
00383 
00384     int sizeW64 = sizeof(word64)*8;
00385     int nSubWords = sizeW64/DataCHSize;
00386 
00387     if (iWord == BDataCH0Word) {
00388 
00389         for (int i = 0; i < nSubWords; ++i) {
00390             int dataShift = i*DataCHSize;
00391             word64 = word64 | (static_cast<boost::uint64_t> (m_bData[i]) << dataShift);
00392         }
00393 
00394     }
00395     else if (iWord == BDataCH4Word) {
00396 
00397         for (int i = 0; i < nSubWords; ++i) {
00398             int dataShift = i*DataCHSize;
00399             word64 = word64 |
00400                      (static_cast<boost::uint64_t> (m_bData[i + nSubWords]) << dataShift);
00401         }
00402 
00403     }
00404 
00405 }

void L1GtPsbWord::setBoardId ( const boost::uint64_t &  word64,
int  iWord 
)

set the BoardId value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 138 of file L1GtPsbWord.cc.

References BoardIdMask, BoardIdShift, BoardIdWord, and m_boardId.

00139 {
00140     if (iWord == BoardIdWord) {
00141         m_boardId = (word64 & BoardIdMask) >> BoardIdShift;
00142     }
00143 
00144 }

void L1GtPsbWord::setBoardId ( boost::uint16_t  boardIdValue  )  [inline]

Definition at line 73 of file L1GtPsbWord.h.

References m_boardId.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

00074     {
00075         m_boardId = boardIdValue;
00076     }

void L1GtPsbWord::setBoardIdWord64 ( boost::uint64_t &  word64,
int  iWord 
)

set the BoardId value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 148 of file L1GtPsbWord.cc.

References BoardIdShift, BoardIdWord, and m_boardId.

Referenced by L1GTDigiToRaw::packPSB().

00149 {
00150 
00151     if (iWord == BoardIdWord) {
00152         word64 = word64 | (static_cast<boost::uint64_t> (m_boardId) << BoardIdShift);
00153     }
00154 
00155 }

void L1GtPsbWord::setBxInEvent ( const boost::uint64_t &  word64,
int  iWord 
)

set the BxInEvent value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 160 of file L1GtPsbWord.cc.

References BxInEventMask, BxInEventShift, BxInEventWord, and m_bxInEvent.

00161 {
00162     if (iWord == BxInEventWord) {
00163         int baseValue = 16; // using hexadecimal values;
00164         int hexBxInEvent = (word64 & BxInEventMask) >> BxInEventShift;
00165         m_bxInEvent = (hexBxInEvent + baseValue/2)%baseValue - baseValue/2;
00166     }
00167 
00168 }

void L1GtPsbWord::setBxInEvent ( int  bxInEventValue  )  [inline]

Definition at line 94 of file L1GtPsbWord.h.

References m_bxInEvent.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

00095     {
00096         m_bxInEvent = bxInEventValue;
00097     }

void L1GtPsbWord::setBxInEventWord64 ( boost::uint64_t &  word64,
int  iWord 
)

set the BxInEvent value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 172 of file L1GtPsbWord.cc.

References BxInEventShift, BxInEventWord, and m_bxInEvent.

Referenced by L1GTDigiToRaw::packPSB().

00173 {
00174 
00175     if (iWord == BxInEventWord) {
00176         int baseValue = 16; // using hexadecimal values;
00177         int hexBxInEvent = (m_bxInEvent + baseValue)%baseValue;
00178         word64 = word64 | (static_cast<boost::uint64_t> (hexBxInEvent)
00179                            << BxInEventShift);
00180     }
00181 
00182 }

void L1GtPsbWord::setBxNr ( const boost::uint64_t &  word64,
int  iWord 
)

set the BxNr value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 186 of file L1GtPsbWord.cc.

References BxNrMask, BxNrShift, BxNrWord, and m_bxNr.

00187 {
00188 
00189     if (iWord == BxNrWord) {
00190         m_bxNr = (word64 & BxNrMask) >> BxNrShift;
00191     }
00192 
00193 }

void L1GtPsbWord::setBxNr ( boost::uint16_t  bxNrValue  )  [inline]

Definition at line 115 of file L1GtPsbWord.h.

References m_bxNr.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

00116     {
00117         m_bxNr = bxNrValue;
00118     }

void L1GtPsbWord::setBxNrWord64 ( boost::uint64_t &  word64,
int  iWord 
)

set the BxNr value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 197 of file L1GtPsbWord.cc.

References BxNrShift, BxNrWord, and m_bxNr.

Referenced by L1GTDigiToRaw::packPSB().

00198 {
00199 
00200     if (iWord == BxNrWord) {
00201         word64 = word64 | (static_cast<boost::uint64_t> (m_bxNr) << BxNrShift);
00202     }
00203 
00204 }

void L1GtPsbWord::setEventNr ( const boost::uint64_t &  word64,
int  iWord 
)

set the EventNr value from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 208 of file L1GtPsbWord.cc.

References EventNrMask, EventNrShift, EventNrWord, and m_eventNr.

00209 {
00210     if (iWord == EventNrWord) {
00211         m_eventNr = (word64 & EventNrMask) >> EventNrShift;
00212     }
00213 
00214 }

void L1GtPsbWord::setEventNr ( boost::uint32_t  eventNrValue  )  [inline]

Definition at line 136 of file L1GtPsbWord.h.

References m_eventNr.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

00137     {
00138         m_eventNr = eventNrValue;
00139     }

void L1GtPsbWord::setEventNrWord64 ( boost::uint64_t &  word64,
int  iWord 
)

set the EventNr value in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 218 of file L1GtPsbWord.cc.

References EventNrShift, EventNrWord, and m_eventNr.

Referenced by L1GTDigiToRaw::packPSB().

00219 {
00220 
00221     if (iWord == EventNrWord) {
00222         word64 = word64 | (static_cast<boost::uint64_t> (m_eventNr) << EventNrShift);
00223     }
00224 
00225 }

void L1GtPsbWord::setLocalBxNr ( const boost::uint64_t &  word64,
int  iWord 
)

set the local bunch cross number bits from a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 410 of file L1GtPsbWord.cc.

References LocalBxNrMask, LocalBxNrShift, LocalBxNrWord, and m_localBxNr.

00411 {
00412     if (iWord == LocalBxNrWord) {
00413         m_localBxNr = (word64 & LocalBxNrMask) >> LocalBxNrShift;
00414     }
00415 
00416 }

void L1GtPsbWord::setLocalBxNr ( boost::uint16_t  localBxNrValue  )  [inline]

Definition at line 185 of file L1GtPsbWord.h.

References m_localBxNr.

Referenced by L1GlobalTriggerPSB::fillPsbBlock(), and L1GlobalTriggerRawToDigi::unpackPSB().

00186     {
00187         m_localBxNr = localBxNrValue;
00188     }

void L1GtPsbWord::setLocalBxNrWord64 ( boost::uint64_t &  word64,
int  iWord 
)

set the local bunch cross number bits in a 64-bits word, having the index iWord in the GTFE raw record

Definition at line 420 of file L1GtPsbWord.cc.

References LocalBxNrShift, LocalBxNrWord, and m_localBxNr.

Referenced by L1GTDigiToRaw::packPSB().

00421 {
00422 
00423     if (iWord == LocalBxNrWord) {
00424         word64 = word64 | (static_cast<boost::uint64_t> (m_localBxNr)
00425                            << LocalBxNrShift);
00426     }
00427 
00428 }


Member Data Documentation

const int L1GtPsbWord::ADataCH0Word = 1 [static, private]

Definition at line 248 of file L1GtPsbWord.h.

Referenced by setAData(), and setADataWord64().

const int L1GtPsbWord::ADataCH4Word = 2 [static, private]

Definition at line 251 of file L1GtPsbWord.h.

Referenced by setAData(), and setADataWord64().

const int L1GtPsbWord::BDataCH0Word = 3 [static, private]

Definition at line 254 of file L1GtPsbWord.h.

Referenced by setBData(), and setBDataWord64().

const int L1GtPsbWord::BDataCH4Word = 4 [static, private]

Definition at line 257 of file L1GtPsbWord.h.

Referenced by setBData(), and setBDataWord64().

const int L1GtPsbWord::BlockSize = 6 [static, private]

Definition at line 221 of file L1GtPsbWord.h.

Referenced by getSize().

const boost::uint64_t L1GtPsbWord::BoardIdMask = 0xFFFF000000000000ULL [static, private]

Definition at line 232 of file L1GtPsbWord.h.

Referenced by setBoardId().

const int L1GtPsbWord::BoardIdShift = 48 [static, private]

Definition at line 238 of file L1GtPsbWord.h.

Referenced by setBoardId(), and setBoardIdWord64().

const int L1GtPsbWord::BoardIdWord = 0 [static, private]

Definition at line 226 of file L1GtPsbWord.h.

Referenced by setBoardId(), and setBoardIdWord64().

const boost::uint64_t L1GtPsbWord::BxInEventMask = 0x0000F00000000000ULL [static, private]

Definition at line 233 of file L1GtPsbWord.h.

Referenced by setBxInEvent().

const int L1GtPsbWord::BxInEventShift = 44 [static, private]

Definition at line 239 of file L1GtPsbWord.h.

Referenced by setBxInEvent(), and setBxInEventWord64().

const int L1GtPsbWord::BxInEventWord = 0 [static, private]

Definition at line 227 of file L1GtPsbWord.h.

Referenced by setBxInEvent(), and setBxInEventWord64().

const boost::uint64_t L1GtPsbWord::BxNrMask = 0x00000FFF00000000ULL [static, private]

Definition at line 234 of file L1GtPsbWord.h.

Referenced by setBxNr().

const int L1GtPsbWord::BxNrShift = 32 [static, private]

Definition at line 240 of file L1GtPsbWord.h.

Referenced by setBxNr(), and setBxNrWord64().

const int L1GtPsbWord::BxNrWord = 0 [static, private]

Definition at line 228 of file L1GtPsbWord.h.

Referenced by setBxNr(), and setBxNrWord64().

const boost::uint64_t L1GtPsbWord::DataCHMask = 0x000000000000FFFFULL [static, private]

Definition at line 245 of file L1GtPsbWord.h.

const int L1GtPsbWord::DataCHSize = 16 [static, private]

Definition at line 244 of file L1GtPsbWord.h.

Referenced by print(), setAData(), setADataWord64(), setBData(), and setBDataWord64().

const boost::uint64_t L1GtPsbWord::EventNrMask = 0x0000000000FFFFFFULL [static, private]

Definition at line 235 of file L1GtPsbWord.h.

Referenced by setEventNr().

const int L1GtPsbWord::EventNrShift = 0 [static, private]

Definition at line 241 of file L1GtPsbWord.h.

Referenced by setEventNr(), and setEventNrWord64().

const int L1GtPsbWord::EventNrWord = 0 [static, private]

Definition at line 229 of file L1GtPsbWord.h.

Referenced by setEventNr(), and setEventNrWord64().

const boost::uint64_t L1GtPsbWord::LocalBxNrMask = 0x0000000000000FFFULL [static, private]

Definition at line 261 of file L1GtPsbWord.h.

Referenced by setLocalBxNr().

const int L1GtPsbWord::LocalBxNrShift = 0 [static, private]

Definition at line 262 of file L1GtPsbWord.h.

Referenced by setLocalBxNr(), and setLocalBxNrWord64().

const int L1GtPsbWord::LocalBxNrWord = 5 [static, private]

Definition at line 260 of file L1GtPsbWord.h.

Referenced by setLocalBxNr(), and setLocalBxNrWord64().

boost::uint16_t L1GtPsbWord::m_aData[NumberAData] [private]

Definition at line 281 of file L1GtPsbWord.h.

Referenced by aData(), L1GtPsbWord(), operator==(), print(), reset(), setAData(), and setADataWord64().

boost::uint16_t L1GtPsbWord::m_bData[NumberBData] [private]

Definition at line 283 of file L1GtPsbWord.h.

Referenced by bData(), L1GtPsbWord(), operator==(), print(), reset(), setBData(), and setBDataWord64().

boost::uint16_t L1GtPsbWord::m_boardId [private]

Definition at line 272 of file L1GtPsbWord.h.

Referenced by boardId(), L1GtPsbWord(), operator==(), print(), reset(), setBoardId(), and setBoardIdWord64().

int L1GtPsbWord::m_bxInEvent [private]

Definition at line 274 of file L1GtPsbWord.h.

Referenced by bxInEvent(), L1GtPsbWord(), operator==(), print(), reset(), setBxInEvent(), and setBxInEventWord64().

boost::uint16_t L1GtPsbWord::m_bxNr [private]

Definition at line 278 of file L1GtPsbWord.h.

Referenced by bxNr(), L1GtPsbWord(), operator==(), print(), reset(), setBxNr(), and setBxNrWord64().

boost::uint32_t L1GtPsbWord::m_eventNr [private]

Definition at line 279 of file L1GtPsbWord.h.

Referenced by eventNr(), L1GtPsbWord(), operator==(), print(), reset(), setEventNr(), and setEventNrWord64().

boost::uint16_t L1GtPsbWord::m_localBxNr [private]

Definition at line 285 of file L1GtPsbWord.h.

Referenced by L1GtPsbWord(), localBxNr(), operator==(), print(), reset(), setLocalBxNr(), and setLocalBxNrWord64().

const int L1GtPsbWord::NumberAData = 8 [static]

Definition at line 36 of file L1GtPsbWord.h.

Referenced by aData(), L1GtDataEmulAnalyzer::comparePSB(), L1GtPsbWord(), operator==(), reset(), and setAData().

const int L1GtPsbWord::NumberBData = 8 [static]

Definition at line 37 of file L1GtPsbWord.h.

Referenced by bData(), L1GtDataEmulAnalyzer::comparePSB(), L1GtPsbWord(), operator==(), reset(), and setBData().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:45 2009 for CMSSW by  doxygen 1.5.4