#include <MatacqRawEvent.h>
Classes | |
struct | ChannelData |
struct | field32spec_t |
struct | int16le_t |
struct | uint16le_t |
struct | uint32le_t |
Public Types | |
enum | matacqError_t { errorLengthConsistency = 1 << 0, errorLength = 1 << 1, errorWrongBoe = 1 << 2 } |
Public Member Functions | |
int | getAttenuation_dB () const |
int | getBoe () const |
int | getBxId () const |
int | getChannelCount () const |
const std::vector< ChannelData > & | getChannelData () const |
unsigned | getDaqLen () const |
int | getDccErrors () const |
unsigned | getDccLen () const |
int | getDelayA () const |
int | getEmtcDelay () const |
int | getEmtcPhase () const |
unsigned | getEventId () const |
int | getFedId () const |
int | getFov () const |
int | getFreqGHz () const |
int | getH1Marker () const |
int | getLaserPower () const |
int | getMatacqDataFormatVersion () const |
uint32_t | getOrbitId () const |
int | getParsedLen () |
int | getPostTrig () const |
unsigned | getRunNum () const |
int32_t | getStatus () const |
time_t | getTimeStamp () const |
void | getTimeStamp (struct timeval &t) const |
int | getTriggerType () const |
int | getTrigRec () const |
int | getTTrigPs () const |
std::vector< int > | getVernier () const |
MatacqRawEvent (const unsigned char *dataBuffer, size_t bufferSize) | |
Static Public Member Functions | |
static unsigned | getDccLen (unsigned char *data, size_t size) |
static unsigned | getOrbitId (unsigned char *data, size_t size) |
static unsigned | getRunNum (unsigned char *data, size_t size) |
Private Member Functions | |
void | setRawData (const unsigned char *buffer, size_t bufferSize) |
Static Private Member Functions | |
static int | read32 (const uint32le_t *pData, field32spec_t spec, bool ovfTrans=false) |
Private Attributes | |
int | attenuation_dB |
int | boe |
int | bxId |
int | channelCount |
std::vector< ChannelData > | channelData |
const uint32le_t * | daqHeader |
int | dccErrors |
unsigned | dccLen |
int | delayA |
int | emtcDelay |
int | emtcPhase |
int32_t | error |
unsigned | eventId |
int | fedId |
int | fov |
int | fragLen |
int | freqGHz |
int | h1Marker |
int | laserPower |
int | matacqDataFormatVersion |
uint32_t | orbitId |
int | parsedLen |
int | postTrig |
uint16le_t * | pSamples |
unsigned | runNum |
struct timeval | timeStamp |
int | triggerType |
int | trigRec |
int | tTrigPs |
std::vector< int > | vernier |
Static Private Attributes | |
static const field32spec_t | fov32 = {0, 0x000000F0} |
static const field32spec_t | fedId32 = {0, 0x000FFF00} |
static const field32spec_t | bxId32 = {0, 0xFFF00000} |
static const field32spec_t | lv132 = {1, 0x00FFFFFF} |
static const field32spec_t | triggerType32 = {1, 0x0F000000} |
static const field32spec_t | boeType32 = {1, 0xF0000000} |
static const field32spec_t | dccLen32 = {2, 0x00FFFFFF} |
static const field32spec_t | dccErrors32 = {2, 0xFF000000} |
static const field32spec_t | runNum32 = {3, 0x00FFFFFF} |
static const field32spec_t | h1Marker32 = {3, 0x3F000000} |
static const field32spec_t | formatVersion32 = {4, 0x0000FFFF} |
static const field32spec_t | freqGHz32 = {4, 0x00FF0000} |
static const field32spec_t | channelCount32 = {4, 0xFF000000} |
static const field32spec_t | timeStamp32 = {5, 0xFFFFFFFF} |
static const field32spec_t | tTrigPs32 = {6, 0xFFFFFFFF} |
static const field32spec_t | orbitId32 = {7, 0xFFFFFFFF} |
static const field32spec_t | trigRec32 = {11, 0xFF000000} |
static const field32spec_t | postTrig32 = {11, 0x0000FFFF} |
static const field32spec_t | vernier0_32 = {8, 0x0000FFFF} |
static const field32spec_t | vernier1_32 = {8, 0xFFFF0000} |
static const field32spec_t | vernier2_32 = {9, 0x0000FFFF} |
static const field32spec_t | vernier3_32 = {9, 0xFFFF0000} |
static const field32spec_t | timeStampMicroSec32 = {10, 0xFFFFFFFF} |
static const field32spec_t | laserPower32 = {12, 0x000000FF} |
static const field32spec_t | attenuation_dB32 = {12, 0x00000F00} |
static const field32spec_t | emtcPhase32 = {12, 0x0000F000} |
static const field32spec_t | emtcDelay32 = {12, 0xFFFF0000} |
static const field32spec_t | delayA32 = {13, 0x0000FFFF} |
static const field32spec_t | dccId32 = {13, 0x003F0000} |
static const field32spec_t | color32 = {13, 0x00600000} |
static const field32spec_t | trigType32 = {13, 0x07000000} |
static const field32spec_t | side32 = {13, 0x08000000} |
Wrapper for matacq raw event fragments. This class provides the method to interpret the data.
Definition at line 30 of file MatacqRawEvent.h.
Enumerator | |
---|---|
errorLengthConsistency | Event length is specified both in the data header and the trailer. This flags indicates an inconsitency between the two indications. |
errorLength | Error in data length. |
errorWrongBoe | Wrong Begin of event flag |
Definition at line 33 of file MatacqRawEvent.h.
|
inline |
Constuctor.
dataBuffer | pointer to the raw data. Beware the data are not copied, therefore the data must be kept valid during the lifetime of the constructed object. pData must be aligned at least on 32-bit words. |
bufferSize | size of the buffer pointed by dataBuffer and containing the data. The data themselves are allowed to be smaller than the buffer. |
std::exception | if the data cannot be decoded due to data corruption or truncation. |
Definition at line 154 of file MatacqRawEvent.h.
References setRawData().
|
inline |
Logarithmic attenuator setting in -10dB unit. Between 0 and 5*(-10dB), 0xF if unknown.
Definition at line 345 of file MatacqRawEvent.h.
References attenuation_dB.
Referenced by MatacqDataFormatter::interpretRawData().
|
inline |
Gets the beging of event field contents (BOE). Must be 0x5.
Definition at line 190 of file MatacqRawEvent.h.
References boeType32, daqHeader, and read32().
|
inline |
Gets the bunch crossing id field contents.
Definition at line 175 of file MatacqRawEvent.h.
References bxId32, daqHeader, and read32().
Referenced by MatacqDataFormatter::interpretRawData(), and MatacqDataFormatter::printData().
|
inline |
Gets the matacq channel count field contents.
Definition at line 273 of file MatacqRawEvent.h.
References channelCount.
Referenced by MatacqDataFormatter::printData().
|
inline |
Gets the matacq channel data. Beware that no copy is done and that the returned data will be invalidated if the data contains in the buffer is modified (see constructor and setRawData().
Definition at line 280 of file MatacqRawEvent.h.
References channelData.
Referenced by MatacqDataFormatter::interpretRawData(), and MatacqDataFormatter::printData().
|
inline |
Gets the event length specifies in the DAQ trailer
Definition at line 237 of file MatacqRawEvent.h.
References fragLen.
|
inline |
Gets the contents of the DCC error field. Currently Not used for Matacq.
Definition at line 242 of file MatacqRawEvent.h.
References daqHeader, dccErrors32, and read32().
Referenced by MatacqDataFormatter::printData().
|
inline |
Gets the event length specifies in the "a la DCC" header.
Definition at line 195 of file MatacqRawEvent.h.
References daqHeader, dccLen32, and read32().
Referenced by MatacqProducer::addMatacqData(), MatacqProducer::getMatacqEvent(), MatacqProducer::getOrbitRange(), MatacqProducer::PosEstimator::init(), and MatacqDataFormatter::printData().
|
inlinestatic |
Gets the event length specifies in the DCC-type header of a matacq event.
data | buffer. Needs to contains at least the 3 first 32-bit words of the event. |
buffer | size |
Definition at line 203 of file MatacqRawEvent.h.
References data, dccLen32, MatacqRawEvent::field32spec_t::offset, read32(), and findQualityFiles::size.
|
inline |
"Delay A" setting of laser delay box in ns.
Definition at line 332 of file MatacqRawEvent.h.
References delayA.
Referenced by MatacqDataFormatter::interpretRawData().
|
inline |
WTE-to-Laser delay of EMTC in LHC clock unit.
Definition at line 336 of file MatacqRawEvent.h.
References emtcDelay.
Referenced by MatacqDataFormatter::interpretRawData().
|
inline |
EMTC laser phase in 1/8th LHC clock unit.
Definition at line 340 of file MatacqRawEvent.h.
References emtcPhase.
Referenced by MatacqDataFormatter::interpretRawData().
|
inline |
Gets the LV1 field contents.
Definition at line 180 of file MatacqRawEvent.h.
References daqHeader, lv132, and read32().
Referenced by MatacqDataFormatter::interpretRawData(), and MatacqDataFormatter::printData().
|
inline |
Gets the FED ID field contents. Should be 655.
Definition at line 170 of file MatacqRawEvent.h.
References daqHeader, fedId32, and read32().
Referenced by MatacqDataFormatter::printData().
|
inline |
Gets the Fed event fragment data format (FOV) field content. Currently the FOV is not used for MATACQ. Note that matacq data format has its own internal version. See getMatacqDataFormatVersion()
Definition at line 165 of file MatacqRawEvent.h.
References daqHeader, fov32, and read32().
Referenced by MatacqDataFormatter::printData().
|
inline |
Gets the matacq sampling frequency field contents.
Definition at line 268 of file MatacqRawEvent.h.
References freqGHz.
Referenced by MatacqDataFormatter::interpretRawData(), and MatacqDataFormatter::printData().
|
inline |
Gets the header marker field contents. Must be 1
Definition at line 252 of file MatacqRawEvent.h.
References daqHeader, h1Marker32, and read32().
|
inline |
Laser power in percents (set with the linear attenuator).
Definition at line 349 of file MatacqRawEvent.h.
References laserPower.
Referenced by MatacqDataFormatter::interpretRawData().
|
inline |
Gets the matcq data format version
Definition at line 257 of file MatacqRawEvent.h.
References matacqDataFormatVersion.
Referenced by MatacqDataFormatter::interpretRawData(), and MatacqDataFormatter::printData().
|
inlinestatic |
Gets the orbit id from the header of a matacq event. Data format of the event must be >=3.
data | buffer. Needs to contains at least the 8 first 32-bit words of the event. |
buffer | size |
Definition at line 216 of file MatacqRawEvent.h.
References data, MatacqRawEvent::field32spec_t::offset, orbitId32, read32(), and findQualityFiles::size.
Referenced by MatacqProducer::addMatacqData(), and MatacqDataFormatter::interpretRawData().
|
inline |
Gets the LHC orbit ID of the event Available only for Matacq data format version >=3 and for P5 data.
Definition at line 312 of file MatacqRawEvent.h.
References orbitId.
Referenced by MatacqProducer::getMatacqEvent(), MatacqProducer::getOrbitRange(), and MatacqProducer::PosEstimator::init().
|
inline |
Gets the data length in number of 64-bit words computed by the data parser.
Definition at line 286 of file MatacqRawEvent.h.
References parsedLen.
Referenced by MatacqProducer::addMatacqData().
|
inline |
Posttrig value (see Matacq documentation). Available only for Matacq data format version >=3.
Definition at line 323 of file MatacqRawEvent.h.
References postTrig.
Referenced by MatacqDataFormatter::interpretRawData().
|
inlinestatic |
Gets the run number from the header of a matacq event.
data | buffer. Needs to contains at least the 4 first 32-bit words of the event. |
buffer | size |
Definition at line 228 of file MatacqRawEvent.h.
References data, MatacqRawEvent::field32spec_t::offset, read32(), runNum32, and findQualityFiles::size.
Referenced by MatacqDataFormatter::printData().
|
inline |
Gets the run number field contents.
Definition at line 247 of file MatacqRawEvent.h.
References daqHeader, read32(), and runNum32.
Referenced by MatacqProducer::getMatacqEvent().
|
inline |
Gets the raw data status. Bitwise OR of the error flags defined by matcqError_t
Definition at line 263 of file MatacqRawEvent.h.
References error.
Referenced by MatacqDataFormatter::printData().
|
inline |
Gets the matacq data timestamp field contents:
Definition at line 293 of file MatacqRawEvent.h.
References timeStamp.
Referenced by MatacqDataFormatter::interpretRawData(), MatacqDataFormatter::printData(), and LaserSorter::writeEvent().
|
inline |
Gets the matacq data timestamp with fine granularity (89.1us)
Definition at line 300 of file MatacqRawEvent.h.
References submitPVValidationJobs::t, and timeStamp.
|
inline |
Gets the trigger type field contents.
Definition at line 185 of file MatacqRawEvent.h.
References daqHeader, read32(), and triggerType32.
Referenced by MatacqDataFormatter::interpretRawData(), and MatacqDataFormatter::printData().
|
inline |
Gets the Trig Rec value (see Matacq documentation) Available only for Matacq data format version >=3.
Definition at line 318 of file MatacqRawEvent.h.
References trigRec.
Referenced by MatacqDataFormatter::interpretRawData().
|
inline |
Gets the Matacq trigger time.
Definition at line 306 of file MatacqRawEvent.h.
References tTrigPs.
Referenced by MatacqDataFormatter::interpretRawData().
|
inline |
Vernier values (see Matacq documentation) Available only for Matacq data format version >=3.
Definition at line 328 of file MatacqRawEvent.h.
References vernier.
Referenced by MatacqDataFormatter::interpretRawData().
|
staticprivate |
Help function to decode header content.
data | pointer |
spec | specification of the data field to read |
ovfTrans | switch of overflow translation. If true the MSB of the data field is interpreted as an overflow bit. If it is set, then -1 is returned. |
Definition at line 195 of file MatacqRawEvent.cc.
References MatacqRawEvent::field32spec_t::mask, MatacqRawEvent::field32spec_t::offset, mps_fire::result, and testProducerWithPsetDescEmpty_cfi::x1.
Referenced by getBoe(), getBxId(), getDccErrors(), getDccLen(), getEventId(), getFedId(), getFov(), getH1Marker(), getOrbitId(), getRunNum(), and getTriggerType().
|
private |
Help function to get the maximum value of a data field
spec32 | data field specification |
buffer | new pointer to the data buffer. Must be aligned at least on 32-bit words. |
size | of the data buffer. |
std::exception | if the data cannot be decoded due to data corruption or truncation. |
Definition at line 77 of file MatacqRawEvent.cc.
References relativeConstraints::error, SiStripPI::max, reco_skim_cfg_mod::maxSize, PresampleTask_cfi::nSamples, and throwExcept().
Referenced by MatacqRawEvent().
|
private |
Logarithmic attenuator setting in -10dB unit. Between 0 and 5*(-10dB), 0xF if unknown.
Definition at line 498 of file MatacqRawEvent.h.
Referenced by getAttenuation_dB().
|
staticprivate |
Definition at line 132 of file MatacqRawEvent.h.
|
private |
Begin Of Event marker
Definition at line 381 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 107 of file MatacqRawEvent.h.
Referenced by getBoe().
|
private |
Bunch crossing Id
Definition at line 385 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 104 of file MatacqRawEvent.h.
Referenced by getBxId().
|
private |
Number of matacq channels in the data.
Definition at line 389 of file MatacqRawEvent.h.
Referenced by getChannelCount().
|
staticprivate |
Definition at line 119 of file MatacqRawEvent.h.
|
private |
|
staticprivate |
Definition at line 137 of file MatacqRawEvent.h.
|
private |
Pointer to the standard CMS DAQ header
Definition at line 397 of file MatacqRawEvent.h.
Referenced by getBoe(), getBxId(), getDccErrors(), getDccLen(), getEventId(), getFedId(), getFov(), getH1Marker(), getRunNum(), and getTriggerType().
|
private |
DCC error field content.
Definition at line 401 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 109 of file MatacqRawEvent.h.
Referenced by getDccErrors().
|
staticprivate |
Definition at line 136 of file MatacqRawEvent.h.
|
private |
Event length specified in 'DCC' header
Definition at line 405 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 108 of file MatacqRawEvent.h.
Referenced by getDccLen().
|
private |
"Delay A" setting of laser delay box in ns.
Definition at line 485 of file MatacqRawEvent.h.
Referenced by getDelayA().
|
staticprivate |
Definition at line 135 of file MatacqRawEvent.h.
|
private |
WTE-to-Laser delay of EMTC in LHC clock unit.
Definition at line 489 of file MatacqRawEvent.h.
Referenced by getEmtcDelay().
|
staticprivate |
Definition at line 134 of file MatacqRawEvent.h.
|
private |
EMTC laser phase in 1/8th LHC clock unit.
Definition at line 493 of file MatacqRawEvent.h.
Referenced by getEmtcPhase().
|
staticprivate |
Definition at line 133 of file MatacqRawEvent.h.
|
private |
Error code or 0 if no error.
Definition at line 413 of file MatacqRawEvent.h.
Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag(), and getStatus().
|
private |
Event id. Actually LV1 ID.
Definition at line 409 of file MatacqRawEvent.h.
Referenced by ntupleDataFormat.Event::eventIdStr().
|
private |
FED ID
Definition at line 417 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 103 of file MatacqRawEvent.h.
Referenced by getFedId().
|
staticprivate |
Matacq header field specifications.
Definition at line 117 of file MatacqRawEvent.h.
|
private |
FED data format version
Definition at line 421 of file MatacqRawEvent.h.
|
staticprivate |
DAQ header field specifications.
Definition at line 102 of file MatacqRawEvent.h.
Referenced by getFov().
|
private |
event fragment length as read in the std DAQ trailer. In 64-bit words
Definition at line 425 of file MatacqRawEvent.h.
Referenced by getDaqLen().
|
private |
MATACQ sampling frequency in GHz
Definition at line 429 of file MatacqRawEvent.h.
Referenced by getFreqGHz().
|
staticprivate |
Definition at line 118 of file MatacqRawEvent.h.
|
private |
header marker
Definition at line 433 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 111 of file MatacqRawEvent.h.
Referenced by getH1Marker().
|
private |
Laser power in percents (set with the linear attenuator).
Definition at line 502 of file MatacqRawEvent.h.
Referenced by getLaserPower().
|
staticprivate |
Definition at line 131 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 105 of file MatacqRawEvent.h.
Referenced by getEventId().
|
private |
Matacq header:MATACQ data format internal version
Definition at line 441 of file MatacqRawEvent.h.
Referenced by getMatacqDataFormatVersion().
|
private |
Definition at line 469 of file MatacqRawEvent.h.
Referenced by getOrbitId().
|
staticprivate |
Definition at line 122 of file MatacqRawEvent.h.
Referenced by getOrbitId().
|
private |
event lenght computed by the raw data parser
Definition at line 445 of file MatacqRawEvent.h.
Referenced by getParsedLen().
|
private |
Posttrig value (see Matacq documentation)
Definition at line 477 of file MatacqRawEvent.h.
Referenced by getPostTrig().
|
staticprivate |
Definition at line 124 of file MatacqRawEvent.h.
|
private |
Pointer to MATACQ samples block
Definition at line 449 of file MatacqRawEvent.h.
|
private |
Run number
Definition at line 453 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 110 of file MatacqRawEvent.h.
Referenced by getRunNum().
|
staticprivate |
Definition at line 139 of file MatacqRawEvent.h.
|
private |
Matacq acquisition time stamp
Definition at line 457 of file MatacqRawEvent.h.
Referenced by getTimeStamp().
|
staticprivate |
Definition at line 120 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 129 of file MatacqRawEvent.h.
|
private |
Trigger type
Definition at line 465 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 106 of file MatacqRawEvent.h.
Referenced by getTriggerType().
|
private |
Trig Rec value (see Matacq documentation)
Definition at line 473 of file MatacqRawEvent.h.
Referenced by getTrigRec().
|
staticprivate |
Definition at line 123 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 138 of file MatacqRawEvent.h.
|
private |
MATACQ trigger time position in ps
Definition at line 461 of file MatacqRawEvent.h.
Referenced by getTTrigPs().
|
staticprivate |
Definition at line 121 of file MatacqRawEvent.h.
|
private |
Vernier values (see Matacq documentation)
Definition at line 481 of file MatacqRawEvent.h.
Referenced by getVernier().
|
staticprivate |
Definition at line 125 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 126 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 127 of file MatacqRawEvent.h.
|
staticprivate |
Definition at line 128 of file MatacqRawEvent.h.