#include <DataFormats/L1GlobalTrigger/interface/L1GtfeExtWord.h>
Public Member Functions | |
const boost::uint16_t | beamMode () const |
const boost::uint16_t | beamMomentum () const |
const boost::uint16_t | bst (int iB) const |
get/set BST block for index iB | |
const std::vector < boost::uint16_t > & | bst () const |
get the full BST block | |
const unsigned int | bstLengthBytes () const |
get the size of the BST block | |
const boost::uint16_t | bstMasterStatus () const |
const boost::uint16_t | bstSource () const |
get/set hex message indicating the source of BST message | |
const unsigned int | getSize () const |
get the size of the GTFE block in GT EVM record (in multiple of 8 bits) | |
const boost::uint64_t | gpsTime () const |
LHC-BOB-ES-0001 (EDMS 638899). | |
L1GtfeExtWord (boost::uint16_t boardIdValue, boost::uint16_t recordLengthValue, boost::uint16_t recordLength1Value, boost::uint16_t bxNrValue, boost::uint32_t setupVersionValue, boost::uint16_t activeBoardsValue, boost::uint16_t altNrBxBoardValue, boost::uint32_t totalTriggerNrValue, std::vector< boost::uint16_t > bstValue, boost::uint16_t bstSourceValue) | |
constructor from unpacked values, m_bst size taken from bstValue | |
L1GtfeExtWord (int bstSizeBytes) | |
all members set to zero, m_bst has bstSizeBytes zero elements | |
L1GtfeExtWord () | |
constructors | |
const boost::uint32_t | lhcFillNumber () const |
bool | operator!= (const L1GtfeExtWord &) const |
unequal operator | |
bool | operator== (const L1GtfeExtWord &) const |
equal operator | |
const boost::uint16_t | particleTypeBeam1 () const |
const boost::uint16_t | particleTypeBeam2 () const |
virtual void | print (std::ostream &myCout) const |
pretty print the content of a L1GtfeExtWord | |
void | reset () |
reset the content of a L1GtfeExtWord | |
void | resize (int bstSizeBytes) |
resize the BST vector to get the right size of the block | |
void | setBst (const boost::uint64_t &word64, const int iB) |
set the BST block for index iB from a 64-bits word | |
void | setBst (const boost::uint16_t bstVal, const int iB) |
void | setBstSource (const boost::uint64_t &word64) |
set the hex message indicating the source of BST message from a 64-bits word | |
void | setBstSource (const boost::uint16_t bstSourceVal) |
void | setBstSourceWord64 (boost::uint64_t &word64, const int iWord) |
set hex message indicating the source of BST message in a 64-bits word, having the index iWord in the GTFE raw record | |
void | setBstWord64 (boost::uint64_t &word64, int iB, const int iWord) |
set the BST block in a 64-bits word, having the index iWord in the GTFE raw record | |
void | setGpsTime (const boost::uint64_t) |
const boost::uint32_t | totalIntensityBeam1 () const |
const boost::uint32_t | totalIntensityBeam2 () const |
const boost::uint32_t | turnCountNumber () const |
virtual void | unpack (const unsigned char *gtfePtr) |
unpack GTFE gtfePtr pointer to the beginning of the GTFE block in the raw data | |
virtual | ~L1GtfeExtWord () |
destructor | |
Private Attributes | |
std::vector< boost::uint16_t > | m_bst |
BST message - each byte is an vector element. | |
boost::uint16_t | m_bstSource |
hex message indicating the source of BST message (beam or simulated) | |
Static Private Attributes | |
static const int | BeamModeFirstBlock = 26 |
static const int | BeamModeLastBlock = 27 |
static const int | BeamMomentumFirstBlock = 30 |
static const int | BeamMomentumLastBlock = 31 |
static const int | BstBitSize = 8 |
size in bits for a BST block | |
static const boost::uint64_t | BstBlockMask = 0xFFULL |
BST block mask, correlated with the number of bits of a block 8 bit = 0xFF. | |
static const int | BstFirstWord = 2 |
block description in the raw GT record | |
static const int | BstMasterStatusFirstBlock = 17 |
static const int | BstMasterStatusLastBlock = 17 |
static const boost::uint64_t | BstSourceMask = 0xFFFF000000000000ULL |
static const int | BstSourceShift = 48 |
static const int | GpsTimeFirstBlock = 0 |
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001). | |
static const int | GpsTimeLastBlock = 7 |
static const int | LhcFillNumberFirstBlock = 22 |
static const int | LhcFillNumberLastBlock = 25 |
static const int | ParticleTypeBeam1FirstBlock = 28 |
static const int | ParticleTypeBeam1LastBlock = 28 |
static const int | ParticleTypeBeam2FirstBlock = 29 |
static const int | ParticleTypeBeam2LastBlock = 29 |
static const int | TotalIntensityBeam1FirstBlock = 32 |
static const int | TotalIntensityBeam1LastBlock = 35 |
static const int | TotalIntensityBeam2FirstBlock = 36 |
static const int | TotalIntensityBeam2LastBlock = 39 |
static const int | TurnCountNumberFirstBlock = 18 |
static const int | TurnCountNumberLastBlock = 21 |
Description: L1 Global Trigger - GTFE words in the readout record.
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Definition at line 33 of file L1GtfeExtWord.h.
L1GtfeExtWord::L1GtfeExtWord | ( | ) |
constructors
Definition at line 36 of file L1GtfeExtWord.cc.
00036 : 00037 L1GtfeWord() { 00038 00039 // empty 00040 00041 }
L1GtfeExtWord::L1GtfeExtWord | ( | int | bstSizeBytes | ) |
all members set to zero, m_bst has bstSizeBytes zero elements
Definition at line 44 of file L1GtfeExtWord.cc.
References m_bst.
00044 : 00045 L1GtfeWord() { 00046 00047 m_bst.resize(bstSizeBytes); 00048 00049 }
L1GtfeExtWord::L1GtfeExtWord | ( | boost::uint16_t | boardIdValue, | |
boost::uint16_t | recordLengthValue, | |||
boost::uint16_t | recordLength1Value, | |||
boost::uint16_t | bxNrValue, | |||
boost::uint32_t | setupVersionValue, | |||
boost::uint16_t | activeBoardsValue, | |||
boost::uint16_t | altNrBxBoardValue, | |||
boost::uint32_t | totalTriggerNrValue, | |||
std::vector< boost::uint16_t > | bstValue, | |||
boost::uint16_t | bstSourceValue | |||
) |
constructor from unpacked values, m_bst size taken from bstValue
Definition at line 53 of file L1GtfeExtWord.cc.
00058 : 00059 L1GtfeWord( 00060 boardIdValue, recordLength1Value, recordLengthValue, bxNrValue, setupVersionValue, 00061 activeBoardsValue, altNrBxBoardValue, totalTriggerNrValue), m_bst(bstValue), 00062 m_bstSource(bstSourceValue) 00063 00064 { 00065 00066 // empty 00067 }
L1GtfeExtWord::~L1GtfeExtWord | ( | ) | [virtual] |
const boost::uint16_t L1GtfeExtWord::beamMode | ( | ) | const |
Definition at line 253 of file L1GtfeExtWord.cc.
References BeamModeFirstBlock, BeamModeLastBlock, BstBitSize, and m_bst.
00254 { 00255 00256 boost::uint16_t bm = 0; 00257 00258 // return 0 if BST message too small 00259 int bstSize = m_bst.size(); 00260 if (BeamModeLastBlock >= bstSize) { 00261 return bm; 00262 } 00263 00264 for (int iB = BeamModeFirstBlock; iB <= BeamModeLastBlock; ++iB) { 00265 00266 // keep capitalization for similarity with other functions 00267 const int scaledIB = iB - BeamModeFirstBlock; 00268 const int BstShift = BstBitSize*scaledIB; 00269 00270 bm = bm | ( m_bst[iB] << BstShift ); 00271 00272 } 00273 00274 return bm; 00275 }
const boost::uint16_t L1GtfeExtWord::beamMomentum | ( | ) | const |
Definition at line 326 of file L1GtfeExtWord.cc.
References BeamMomentumFirstBlock, BeamMomentumLastBlock, BstBitSize, and m_bst.
00327 { 00328 00329 boost::uint16_t bm = 0; 00330 00331 // return 0 if BST message too small 00332 int bstSize = m_bst.size(); 00333 if (BeamMomentumLastBlock >= bstSize) { 00334 return bm; 00335 } 00336 00337 for (int iB = BeamMomentumFirstBlock; iB <= BeamMomentumLastBlock; ++iB) { 00338 00339 // keep capitalization for similarity with other functions 00340 const int scaledIB = iB - BeamMomentumFirstBlock; 00341 const int BstShift = BstBitSize*scaledIB; 00342 00343 bm = bm | ( m_bst[iB] << BstShift ); 00344 00345 } 00346 00347 return bm; 00348 }
const uint16_t L1GtfeExtWord::bst | ( | int | iB | ) | const |
get/set BST block for index iB
Definition at line 402 of file L1GtfeExtWord.cc.
References lat::endl(), Exception, and m_bst.
00403 { 00404 00405 int NumberBstBlocks = m_bst.size(); 00406 00407 if (iB < 0 || iB >= NumberBstBlocks) { 00408 throw cms::Exception("BstIndexError") 00409 << "\nError: index for BST array out of range. Allowed range: [0, " 00410 << NumberBstBlocks << ") " << std::endl; 00411 00412 } else { 00413 return m_bst[iB]; 00414 } 00415 00416 }
const std::vector<boost::uint16_t>& L1GtfeExtWord::bst | ( | ) | const [inline] |
get the full BST block
Definition at line 71 of file L1GtfeExtWord.h.
References m_bst.
00071 { 00072 return m_bst; 00073 }
const unsigned int L1GtfeExtWord::bstLengthBytes | ( | ) | const [inline] |
get the size of the BST block
Definition at line 76 of file L1GtfeExtWord.h.
References m_bst.
Referenced by L1GTEvmDigiToRaw::produce().
00076 { 00077 return m_bst.size(); 00078 }
const boost::uint16_t L1GtfeExtWord::bstMasterStatus | ( | ) | const |
Definition at line 178 of file L1GtfeExtWord.cc.
References BstBitSize, BstMasterStatusFirstBlock, BstMasterStatusLastBlock, and m_bst.
00179 { 00180 00181 boost::uint16_t bms = 0; 00182 00183 // return 0 if BST message too small 00184 int bstSize = m_bst.size(); 00185 if (BstMasterStatusLastBlock >= bstSize) { 00186 return bms; 00187 } 00188 00189 for (int iB = BstMasterStatusFirstBlock; iB <= BstMasterStatusLastBlock; ++iB) { 00190 00191 // keep capitalization for similarity with other functions 00192 const int scaledIB = iB - BstMasterStatusFirstBlock; 00193 const int BstShift = BstBitSize*scaledIB; 00194 00195 bms = bms | ( m_bst[iB] << BstShift ); 00196 00197 } 00198 00199 return bms; 00200 }
const boost::uint16_t L1GtfeExtWord::bstSource | ( | ) | const [inline] |
get/set hex message indicating the source of BST message
Definition at line 114 of file L1GtfeExtWord.h.
References m_bstSource.
00114 { 00115 return m_bstSource; 00116 }
const unsigned int L1GtfeExtWord::getSize | ( | ) | const |
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
Reimplemented from L1GtfeWord.
Definition at line 491 of file L1GtfeExtWord.cc.
References L1GtfeWord::getSize(), and m_bst.
Referenced by L1GTEvmDigiToRaw::packGTFE(), L1GTEvmDigiToRaw::produce(), L1GlobalTriggerEvmRawToDigi::produce(), setBstSourceWord64(), and unpack().
00491 { 00492 00493 L1GtfeWord gtfeWord; 00494 unsigned int gtfeSize = gtfeWord.getSize(); 00495 00496 unsigned int gtfeExtSize; 00497 00498 // 2 bytes to write if real BST message or simulated BST message 00499 unsigned int bytesBstWriter = 2; 00500 00501 // size of BST block, using rounded 64-bit words (8 bytes per 64-bit word) 00502 00503 unsigned int bstSize = m_bst.size(); 00504 00505 if ( (bstSize +bytesBstWriter )%8 == 0) { 00506 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter; 00507 } 00508 else { 00509 gtfeExtSize = gtfeSize + bstSize + bytesBstWriter + (8 - (bstSize + bytesBstWriter)%8 ); 00510 } 00511 00512 return gtfeExtSize; 00513 }
const boost::uint64_t L1GtfeExtWord::gpsTime | ( | ) | const |
LHC-BOB-ES-0001 (EDMS 638899).
Definition at line 117 of file L1GtfeExtWord.cc.
References BstBitSize, GpsTimeFirstBlock, GpsTimeLastBlock, and m_bst.
00118 { 00119 00120 boost::uint64_t gpst = 0ULL; 00121 00122 // return 0 if BST message too small 00123 int bstSize = m_bst.size(); 00124 if (GpsTimeLastBlock >= bstSize) { 00125 return gpst; 00126 } 00127 00128 for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) { 00129 00130 // keep capitalization for similarity with other functions 00131 const int scaledIB = iB - GpsTimeFirstBlock; 00132 const int BstShift = BstBitSize*scaledIB; 00133 00134 gpst = gpst | 00135 ( (static_cast<boost::uint64_t> (m_bst[iB])) << BstShift ); 00136 00137 } 00138 00139 return gpst; 00140 }
const boost::uint32_t L1GtfeExtWord::lhcFillNumber | ( | ) | const |
Definition at line 228 of file L1GtfeExtWord.cc.
References BstBitSize, LhcFillNumberFirstBlock, LhcFillNumberLastBlock, and m_bst.
00229 { 00230 00231 boost::uint32_t lhcfn = 0; 00232 00233 // return 0 if BST message too small 00234 int bstSize = m_bst.size(); 00235 if (LhcFillNumberLastBlock >= bstSize) { 00236 return lhcfn; 00237 } 00238 00239 for (int iB = LhcFillNumberFirstBlock; iB <= LhcFillNumberLastBlock; ++iB) { 00240 00241 // keep capitalization for similarity with other functions 00242 const int scaledIB = iB - LhcFillNumberFirstBlock; 00243 const int BstShift = BstBitSize*scaledIB; 00244 00245 lhcfn = lhcfn | 00246 ( (static_cast<boost::uint32_t> (m_bst[iB])) << BstShift ); 00247 00248 } 00249 00250 return lhcfn; 00251 }
bool L1GtfeExtWord::operator!= | ( | const L1GtfeExtWord & | result | ) | const |
bool L1GtfeExtWord::operator== | ( | const L1GtfeExtWord & | result | ) | const |
equal operator
Definition at line 77 of file L1GtfeExtWord.cc.
References m_bst, and m_bstSource.
00078 { 00079 00080 // base class 00081 00082 const L1GtfeWord gtfeResult = result; 00083 const L1GtfeWord gtfeThis = *this; 00084 00085 if (gtfeThis != gtfeResult) { 00086 return false; 00087 } 00088 00089 00090 // 00091 00092 for (unsigned int iB = 0; iB < m_bst.size(); ++iB) { 00093 if(m_bst[iB] != result.m_bst[iB]) { 00094 return false; 00095 } 00096 } 00097 00098 if ( m_bstSource != result.m_bstSource) { 00099 return false; 00100 } 00101 00102 // all members identical 00103 return true; 00104 00105 }
const boost::uint16_t L1GtfeExtWord::particleTypeBeam1 | ( | ) | const |
Definition at line 277 of file L1GtfeExtWord.cc.
References BstBitSize, m_bst, ParticleTypeBeam1FirstBlock, and ParticleTypeBeam1LastBlock.
00278 { 00279 00280 boost::uint16_t ptb = 0; 00281 00282 // return 0 if BST message too small 00283 int bstSize = m_bst.size(); 00284 if (ParticleTypeBeam1LastBlock >= bstSize) { 00285 return ptb; 00286 } 00287 00288 for (int iB = ParticleTypeBeam1FirstBlock; iB <= ParticleTypeBeam1LastBlock; ++iB) { 00289 00290 // keep capitalization for similarity with other functions 00291 const int scaledIB = iB - ParticleTypeBeam1FirstBlock; 00292 const int BstShift = BstBitSize*scaledIB; 00293 00294 ptb = ptb | ( m_bst[iB] << BstShift ); 00295 00296 } 00297 00298 return ptb; 00299 }
const boost::uint16_t L1GtfeExtWord::particleTypeBeam2 | ( | ) | const |
Definition at line 301 of file L1GtfeExtWord.cc.
References BstBitSize, m_bst, ParticleTypeBeam2FirstBlock, and ParticleTypeBeam2LastBlock.
00302 { 00303 00304 boost::uint16_t ptb = 0; 00305 00306 // return 0 if BST message too small 00307 int bstSize = m_bst.size(); 00308 if (ParticleTypeBeam2LastBlock >= bstSize) { 00309 return ptb; 00310 } 00311 00312 for (int iB = ParticleTypeBeam2FirstBlock; iB <= ParticleTypeBeam2LastBlock; ++iB) { 00313 00314 // keep capitalization for similarity with other functions 00315 const int scaledIB = iB - ParticleTypeBeam2FirstBlock; 00316 const int BstShift = BstBitSize*scaledIB; 00317 00318 ptb = ptb | ( m_bst[iB] << BstShift ); 00319 00320 } 00321 00322 return ptb; 00323 00324 }
void L1GtfeExtWord::print | ( | std::ostream & | myCout | ) | const [virtual] |
pretty print the content of a L1GtfeExtWord
Reimplemented from L1GtfeWord.
Definition at line 534 of file L1GtfeExtWord.cc.
References lat::endl(), m_bst, m_bstSource, and L1GtfeWord::print().
Referenced by L1GlobalTriggerEvmReadoutRecord::print(), L1GTEvmDigiToRaw::produce(), and L1GlobalTriggerEvmRawToDigi::produce().
00535 { 00536 00537 myCout << "\n L1GtfeExtWord::print \n" << std::endl; 00538 00539 int sizeW64 = 64; 00540 int dataBlocksPerLine = sizeW64/8; // 8x8 bits per line 00541 00542 L1GtfeWord::print(myCout); 00543 00544 int NumberBstBlocks = m_bst.size(); 00545 00546 myCout << "\n BST "; 00547 for (int iB = 0; iB < NumberBstBlocks; ++iB) { 00548 00549 myCout << "\n" << std::hex << " hex: "; 00550 00551 for (int jB = iB; jB < dataBlocksPerLine + iB; ++jB) { 00552 00553 if (jB >= NumberBstBlocks) { 00554 break; 00555 } 00556 00557 myCout 00558 << std::setw(2) << std::setfill('0') << m_bst[jB] 00559 << " " << std::setfill(' '); 00560 } 00561 00562 myCout << "\n"<< std::dec << " dec: " ; 00563 00564 for (int jB = iB; jB < dataBlocksPerLine + iB; ++jB) { 00565 00566 if (jB >= NumberBstBlocks) { 00567 break; 00568 } 00569 00570 myCout 00571 << std::setw(3) << std::setfill('0') << m_bst[jB] 00572 << " " << std::setfill(' '); 00573 } 00574 00575 myCout << std::endl; 00576 00577 iB += dataBlocksPerLine - 1; 00578 } 00579 00580 myCout << "\n BST source [hex]: " << std::hex << std::setw(4) << std::setfill('0') 00581 << m_bstSource << std::endl; 00582 00583 }
reset the content of a L1GtfeExtWord
Reimplemented from L1GtfeWord.
Definition at line 525 of file L1GtfeExtWord.cc.
References m_bst, and L1GtfeWord::reset().
Referenced by L1GlobalTriggerEvmRawToDigi::produce().
00526 { 00527 00528 L1GtfeWord::reset(); 00529 m_bst.clear(); 00530 00531 }
resize the BST vector to get the right size of the block
Definition at line 518 of file L1GtfeExtWord.cc.
References m_bst.
Referenced by L1GlobalTriggerEvmRawToDigi::produce().
00518 { 00519 00520 m_bst.resize(bstSizeBytes); 00521 00522 }
set the BST block for index iB from a 64-bits word
Definition at line 435 of file L1GtfeExtWord.cc.
References BstBitSize, BstBlockMask, and m_bst.
00436 { 00437 00438 // keep capitalization for similarity with other functions //FIXME check it again 00439 const int scaledIB = iB%(sizeof(word64)*8/BstBitSize); 00440 const int BstShift = BstBitSize*scaledIB; 00441 const boost::uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift); 00442 00443 m_bst[iB] = static_cast<boost::uint16_t> ((word64 & BstMask) >> BstShift); 00444 00445 }
void L1GtfeExtWord::setBstSource | ( | const boost::uint64_t & | word64 | ) |
set the hex message indicating the source of BST message from a 64-bits word
Definition at line 467 of file L1GtfeExtWord.cc.
References BstSourceMask, BstSourceShift, and m_bstSource.
00467 { 00468 00469 m_bstSource = (word64 & BstSourceMask) >> BstSourceShift; 00470 00471 }
void L1GtfeExtWord::setBstSource | ( | const boost::uint16_t | bstSourceVal | ) | [inline] |
Definition at line 118 of file L1GtfeExtWord.h.
References m_bstSource.
Referenced by L1GlobalTrigger::produce().
00118 { 00119 m_bstSource = bstSourceVal; 00120 }
set hex message indicating the source of BST message in a 64-bits word, having the index iWord in the GTFE raw record
Definition at line 475 of file L1GtfeExtWord.cc.
References BstSourceShift, getSize(), and m_bstSource.
00475 { 00476 00477 // BST always in the last word of GTFE extended - size must be correct! 00478 int gtfeSize = this->getSize(); 00479 00480 int BstSourceWord = gtfeSize/8 - 1; // counting starts at 0 00481 00482 if (iWord == BstSourceWord) { 00483 word64 = word64 | (static_cast<boost::uint64_t> (m_bstSource) 00484 << BstSourceShift); 00485 } 00486 00487 }
set the BST block in a 64-bits word, having the index iWord in the GTFE raw record
Definition at line 449 of file L1GtfeExtWord.cc.
References BstBitSize, BstFirstWord, and m_bst.
Referenced by L1GTEvmDigiToRaw::packGTFE().
00450 { 00451 00452 // keep capitalization for similarity with other functions 00453 const int scaledIB = iB%(sizeof(word64)*8/BstBitSize); 00454 const int BstShift = BstBitSize*scaledIB; 00455 const int BstWord = iB/(sizeof(word64)*8/BstBitSize) + BstFirstWord; 00456 00457 if (iWord == BstWord) { 00458 word64 = word64 | 00459 (static_cast<boost::uint64_t> (m_bst[iB]) << BstShift); 00460 } 00461 00462 00463 }
void L1GtfeExtWord::setGpsTime | ( | const boost::uint64_t | gpsTimeValue | ) |
Definition at line 142 of file L1GtfeExtWord.cc.
References BstBitSize, BstBlockMask, lat::endl(), GpsTimeFirstBlock, GpsTimeLastBlock, and m_bst.
Referenced by L1GlobalTrigger::produce().
00142 { 00143 00144 // return if BST message too small 00145 int bstSize = m_bst.size(); 00146 if (GpsTimeLastBlock >= bstSize) { 00147 00148 edm::LogError("L1GtfeExtWord") << "Error: BST message length " 00149 << bstSize << " smaller than the required GpsTimeLastBlock " 00150 << GpsTimeLastBlock << "\n Cannot set GpsTime" << std::endl; 00151 00152 return; 00153 } 00154 00155 for (int iB = GpsTimeFirstBlock; iB <= GpsTimeLastBlock; ++iB) { 00156 00157 // keep capitalization for similarity with other functions 00158 const int scaledIB = iB - GpsTimeFirstBlock; 00159 const int BstShift = BstBitSize*scaledIB; 00160 const boost::uint64_t BstMask = 0x0000000000000000ULL | (BstBlockMask << BstShift); 00161 00162 m_bst[iB] = static_cast<boost::uint16_t> ((gpsTimeValue & BstMask) >> BstShift); 00163 00164 //LogTrace("L1GtfeExtWord") 00165 //<< "BstShift: value [dec] = " << BstShift << "\n" 00166 //<< "BstBlockMask: value [hex] = " << std::hex << BstBlockMask << "\n" 00167 //<< "BstMask: value [hex] = "<< BstMask << std::dec 00168 //<< std::endl; 00169 00170 //LogTrace("L1GtfeExtWord") 00171 //<< "BST block " << iB << ": value [hex] = " << std::hex << m_bst[iB] << std::dec 00172 //<< std::endl; 00173 00174 } 00175 00176 }
const boost::uint32_t L1GtfeExtWord::totalIntensityBeam1 | ( | ) | const |
Definition at line 350 of file L1GtfeExtWord.cc.
References BstBitSize, m_bst, TotalIntensityBeam1FirstBlock, and TotalIntensityBeam1LastBlock.
00351 { 00352 00353 boost::uint32_t tib = 0; 00354 00355 // return 0 if BST message too small 00356 int bstSize = m_bst.size(); 00357 if (TotalIntensityBeam1LastBlock >= bstSize) { 00358 return tib; 00359 } 00360 00361 for (int iB = TotalIntensityBeam1FirstBlock; iB <= TotalIntensityBeam1LastBlock; ++iB) { 00362 00363 // keep capitalization for similarity with other functions 00364 const int scaledIB = iB - TotalIntensityBeam1FirstBlock; 00365 const int BstShift = BstBitSize*scaledIB; 00366 00367 tib = tib | 00368 ( (static_cast<boost::uint32_t> (m_bst[iB])) << BstShift ); 00369 00370 } 00371 00372 return tib; 00373 }
const boost::uint32_t L1GtfeExtWord::totalIntensityBeam2 | ( | ) | const |
Definition at line 375 of file L1GtfeExtWord.cc.
References BstBitSize, m_bst, TotalIntensityBeam2FirstBlock, and TotalIntensityBeam2LastBlock.
00376 { 00377 00378 boost::uint32_t tib = 0; 00379 00380 // return 0 if BST message too small 00381 int bstSize = m_bst.size(); 00382 if (TotalIntensityBeam2LastBlock >= bstSize) { 00383 return tib; 00384 } 00385 00386 for (int iB = TotalIntensityBeam2FirstBlock; iB <= TotalIntensityBeam2LastBlock; ++iB) { 00387 00388 // keep capitalization for similarity with other functions 00389 const int scaledIB = iB - TotalIntensityBeam2FirstBlock; 00390 const int BstShift = BstBitSize*scaledIB; 00391 00392 tib = tib | 00393 ( (static_cast<boost::uint32_t> (m_bst[iB])) << BstShift ); 00394 00395 } 00396 00397 return tib; 00398 }
const boost::uint32_t L1GtfeExtWord::turnCountNumber | ( | ) | const |
Definition at line 203 of file L1GtfeExtWord.cc.
References BstBitSize, m_bst, TurnCountNumberFirstBlock, and TurnCountNumberLastBlock.
00204 { 00205 00206 boost::uint32_t tcn = 0; 00207 00208 // return 0 if BST message too small 00209 int bstSize = m_bst.size(); 00210 if (TurnCountNumberLastBlock >= bstSize) { 00211 return tcn; 00212 } 00213 00214 for (int iB = TurnCountNumberFirstBlock; iB <= TurnCountNumberLastBlock; ++iB) { 00215 00216 // keep capitalization for similarity with other functions 00217 const int scaledIB = iB - TurnCountNumberFirstBlock; 00218 const int BstShift = BstBitSize*scaledIB; 00219 00220 tcn = tcn | 00221 ( (static_cast<boost::uint32_t> (m_bst[iB])) << BstShift ); 00222 00223 } 00224 00225 return tcn; 00226 }
void L1GtfeExtWord::unpack | ( | const unsigned char * | gtfePtr | ) | [virtual] |
unpack GTFE gtfePtr pointer to the beginning of the GTFE block in the raw data
Reimplemented from L1GtfeWord.
Definition at line 585 of file L1GtfeExtWord.cc.
References BstBitSize, BstFirstWord, lat::endl(), getSize(), L1GtfeWord::getSize(), edm::isDebugEnabled(), LogDebug, LogTrace, m_bst, setBst(), and L1GtfeWord::unpack().
Referenced by L1GlobalTriggerEvmRawToDigi::produce().
00586 { 00587 LogDebug("L1GtfeExtWord") 00588 << "\nUnpacking GTFE block.\n" 00589 << std::endl; 00590 00591 L1GtfeWord::unpack(gtfePtr); 00592 00593 // TODO make BlockSize protected & use friends instead of creating L1GtfeWord? 00594 L1GtfeWord gtfeWord; 00595 const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.getSize(); 00596 00597 const boost::uint64_t* payload = 00598 reinterpret_cast<boost::uint64_t*>(const_cast<unsigned char*>(gtfeExtPtr)); 00599 00600 int BlockSizeExt = this->getSize()/8; 00601 int NumberBstBlocks = m_bst.size(); 00602 00603 if (edm::isDebugEnabled() ) { 00604 00605 for (int iWord = BstFirstWord; iWord < BlockSizeExt; ++iWord) { 00606 00607 int jWord = iWord - BstFirstWord; 00608 LogTrace("L1GtfeExtWord") 00609 << std::setw(4) << iWord << " " 00610 << std::hex << std::setfill('0') 00611 << std::setw(16) << payload[jWord] 00612 << std::dec << std::setfill(' ') 00613 << std::endl; 00614 00615 } 00616 } 00617 00618 int blocksPerWord = sizeof(boost::uint64_t)*8/BstBitSize; 00619 00620 for (int iB = 0; iB < NumberBstBlocks; ++iB) { 00621 00622 // keep capitalization for similarity with other functions 00623 int BstWord = iB/blocksPerWord; 00624 00625 setBst(payload[BstWord], iB); 00626 00627 } 00628 00629 }
const int L1GtfeExtWord::BeamModeFirstBlock = 26 [static, private] |
const int L1GtfeExtWord::BeamModeLastBlock = 27 [static, private] |
const int L1GtfeExtWord::BeamMomentumFirstBlock = 30 [static, private] |
const int L1GtfeExtWord::BeamMomentumLastBlock = 31 [static, private] |
const int L1GtfeExtWord::BstBitSize = 8 [static, private] |
size in bits for a BST block
Definition at line 157 of file L1GtfeExtWord.h.
Referenced by beamMode(), beamMomentum(), bstMasterStatus(), gpsTime(), lhcFillNumber(), particleTypeBeam1(), particleTypeBeam2(), setBst(), setBstWord64(), setGpsTime(), totalIntensityBeam1(), totalIntensityBeam2(), turnCountNumber(), and unpack().
const boost::uint64_t L1GtfeExtWord::BstBlockMask = 0xFFULL [static, private] |
BST block mask, correlated with the number of bits of a block 8 bit = 0xFF.
Definition at line 161 of file L1GtfeExtWord.h.
Referenced by setBst(), and setGpsTime().
const int L1GtfeExtWord::BstFirstWord = 2 [static, private] |
block description in the raw GT record
index of first word for BST blocks
Definition at line 154 of file L1GtfeExtWord.h.
Referenced by setBstWord64(), and unpack().
const int L1GtfeExtWord::BstMasterStatusFirstBlock = 17 [static, private] |
const int L1GtfeExtWord::BstMasterStatusLastBlock = 17 [static, private] |
const boost::uint64_t L1GtfeExtWord::BstSourceMask = 0xFFFF000000000000ULL [static, private] |
const int L1GtfeExtWord::BstSourceShift = 48 [static, private] |
Definition at line 198 of file L1GtfeExtWord.h.
Referenced by setBstSource(), and setBstSourceWord64().
const int L1GtfeExtWord::GpsTimeFirstBlock = 0 [static, private] |
BST blocks: conversion to defined quantities (LHC-BOB-ES-0001).
Definition at line 165 of file L1GtfeExtWord.h.
Referenced by gpsTime(), and setGpsTime().
const int L1GtfeExtWord::GpsTimeLastBlock = 7 [static, private] |
const int L1GtfeExtWord::LhcFillNumberFirstBlock = 22 [static, private] |
const int L1GtfeExtWord::LhcFillNumberLastBlock = 25 [static, private] |
std::vector<boost::uint16_t> L1GtfeExtWord::m_bst [private] |
BST message - each byte is an vector element.
Definition at line 205 of file L1GtfeExtWord.h.
Referenced by beamMode(), beamMomentum(), bst(), bstLengthBytes(), bstMasterStatus(), getSize(), gpsTime(), L1GtfeExtWord(), lhcFillNumber(), operator==(), particleTypeBeam1(), particleTypeBeam2(), print(), reset(), resize(), setBst(), setBstWord64(), setGpsTime(), totalIntensityBeam1(), totalIntensityBeam2(), turnCountNumber(), and unpack().
boost::uint16_t L1GtfeExtWord::m_bstSource [private] |
hex message indicating the source of BST message (beam or simulated)
Definition at line 208 of file L1GtfeExtWord.h.
Referenced by bstSource(), operator==(), print(), setBstSource(), and setBstSourceWord64().
const int L1GtfeExtWord::ParticleTypeBeam1FirstBlock = 28 [static, private] |
const int L1GtfeExtWord::ParticleTypeBeam1LastBlock = 28 [static, private] |
const int L1GtfeExtWord::ParticleTypeBeam2FirstBlock = 29 [static, private] |
const int L1GtfeExtWord::ParticleTypeBeam2LastBlock = 29 [static, private] |
const int L1GtfeExtWord::TotalIntensityBeam1FirstBlock = 32 [static, private] |
const int L1GtfeExtWord::TotalIntensityBeam1LastBlock = 35 [static, private] |
const int L1GtfeExtWord::TotalIntensityBeam2FirstBlock = 36 [static, private] |
const int L1GtfeExtWord::TotalIntensityBeam2LastBlock = 39 [static, private] |
const int L1GtfeExtWord::TurnCountNumberFirstBlock = 18 [static, private] |
const int L1GtfeExtWord::TurnCountNumberLastBlock = 21 [static, private] |