#include <CastorCORData.h>
Public Member Functions | |
void | adoptData (const unsigned short *data, int length) |
void | allocate (int version_to_create=0) |
CastorCORData () | |
CastorCORData (int version_to_create) | |
CastorCORData (const unsigned short *data, int length) | |
CastorCORData (const CastorCORData &) | |
bool | check () const |
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event. More... | |
unsigned int | getBunchNumber () const |
Get the HTR bunch number. More... | |
unsigned int | getDLLunlock () const |
Get DLLunlock bits. More... | |
unsigned int | getErrorsWord () const |
Get the errors word. More... | |
unsigned int | getExtHdr1 () const |
Get the COR Ext Header words. More... | |
unsigned int | getExtHdr2 () const |
unsigned int | getExtHdr3 () const |
unsigned int | getExtHdr4 () const |
unsigned int | getExtHdr5 () const |
unsigned int | getExtHdr6 () const |
unsigned int | getExtHdr7 () const |
unsigned int | getExtHdr8 () const |
unsigned int | getFib1OrbMsgBCN () const |
Get the BCN of the Fiber Orbit Messages. More... | |
unsigned int | getFib2OrbMsgBCN () const |
unsigned int | getFib3OrbMsgBCN () const |
unsigned int | getFib4OrbMsgBCN () const |
unsigned int | getFib5OrbMsgBCN () const |
unsigned int | getFib6OrbMsgBCN () const |
unsigned int | getFib7OrbMsgBCN () const |
unsigned int | getFib8OrbMsgBCN () const |
unsigned int | getFirmwareRevision () const |
Get the COR firmware version. More... | |
int | getFormatVersion () const |
Get the version number of this event. More... | |
void | getHistogramFibers (int &a, int &b) const |
Get the fiber numbers for the data present in this event (only in histogram mode!) More... | |
unsigned int | getL1ANumber () const |
Get the HTR event number. More... | |
int | getNDD () const |
Get the number of daq data samples per channel when not zero-suppressed. More... | |
int | getNPrecisionWords () const |
Get the total number of precision data 16-bit words. More... | |
int | getNPS () const |
Get the number of presamples in daq data. More... | |
int | getNTP () const |
Get the number of trigger data samples when not zero-suppressed (not available after FW 4) More... | |
unsigned int | getOrbitNumber () const |
Get the HTR orbit number. More... | |
unsigned int | getPipelineLength () const |
Get the pipeline length used for this event. More... | |
const unsigned short * | getRawData () const |
Get a pointer to the raw data. More... | |
const int | getRawLength () const |
Get the length of the raw data. More... | |
unsigned int | getSubmodule () const |
Get the HTR submodule number. More... | |
unsigned int | getTTCready () const |
Get TTCready bits. More... | |
unsigned int | htrSlot () const |
HcalElectronicsId-style HTR slot. More... | |
unsigned int | htrTopBottom () const |
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom) More... | |
bool | isCalibrationStream () const |
Is this event a calibration-stream event? More... | |
bool | isHistogramEvent () const |
Is this event a histogram event? (do not call standard unpack in this case!!!!!) More... | |
bool | isPatternRAMEvent () const |
Is this event a pattern-ram event? More... | |
bool | isUnsuppressed () const |
Is this event an unsuppresed event? More... | |
CastorCORData & | operator= (const CastorCORData &) |
void | pack (unsigned char *daq_lengths, unsigned short *daq_samples, unsigned char *tp_lengths, unsigned short *tp_samples, bool do_capid=false) |
Unpack the HTR data into TP and DAQ data sorted by channel. More... | |
void | packHeaderTrailer (int L1Anumber, int bcn, int submodule, int orbitn, int pipeline, int ndd, int nps, int firmwareRev=0) |
pack header and trailer (call after pack) More... | |
unsigned int | readoutVMECrateId () const |
HcalElectronicsId-style VME crate number. More... | |
void | unpack (unsigned char *daq_lengths, unsigned short *daq_samples, unsigned char *tp_lengths, unsigned short *tp_samples) const |
Obtain the starting and ending pointers for external unpacking of the data. More... | |
bool | unpackHistogram (int fiber, int fiberchan, int capid, unsigned short *histogram) const |
Unpack special histogramming mode data. More... | |
bool | wasMarkAndPassZS (int fiber, int fiberchan) const |
Was this channel passed as part of Mark&Pass ZS? More... | |
~CastorCORData () | |
Static Public Attributes | |
static const int | CHANNELS_PER_SPIGOT = 36 |
static const int | MAXIMUM_SAMPLES_PER_CHANNEL = 20 |
Protected Member Functions | |
void | determineSectionLengths (int &tpWords, int &daqWords, int &headerWords, int &trailerWords, int &triggerWords) const |
Was there an error on the given fiber for this event (only in histogram mode!) More... | |
void | determineStaticLengths (int &headerWords, int &trailerWords, int &triggerWords) const |
Protected Attributes | |
int | m_formatVersion |
unsigned short * | m_ownData |
const unsigned short * | m_rawConst |
int | m_rawLength |
unsigned short * | m_unpackedData |
Interpretive class for CastorCORDat Since this class requires external specification of the length of the data, it is implemented as an interpreter, rather than a cast-able header class.
Definition at line 16 of file CastorCORData.h.
CastorCORData::CastorCORData | ( | ) |
Definition at line 22 of file CastorCORData.cc.
|
inline |
CastorCORData::CastorCORData | ( | int | version_to_create | ) |
CastorCORData::CastorCORData | ( | const unsigned short * | data, |
int | length | ||
) |
Definition at line 23 of file CastorCORData.cc.
References adoptData(), and m_ownData.
CastorCORData::CastorCORData | ( | const CastorCORData & | hd | ) |
Definition at line 27 of file CastorCORData.cc.
void CastorCORData::adoptData | ( | const unsigned short * | data, |
int | length | ||
) |
Definition at line 52 of file CastorCORData.cc.
References data, m_formatVersion, m_rawConst, and m_rawLength.
Referenced by CastorCORData(), and CastorCTDCHeader::getSpigotData().
void CastorCORData::allocate | ( | int | version_to_create = 0 | ) |
Definition at line 33 of file CastorCORData.cc.
References m_formatVersion, m_ownData, m_rawConst, and m_rawLength.
Referenced by CastorCORData(), and CastorCtdcPacker::pack().
bool CastorCORData::check | ( | ) | const |
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event.
Definition at line 65 of file CastorCORData.cc.
References determineSectionLengths(), m_rawConst, and m_rawLength.
Referenced by CastorCtdcUnpacker::unpack().
|
protected |
Was there an error on the given fiber for this event (only in histogram mode!)
Definition at line 80 of file CastorCORData.cc.
References m_rawConst, and m_rawLength.
Referenced by check(), and unpack().
|
protected |
Definition at line 94 of file CastorCORData.cc.
Referenced by pack().
|
inline |
|
inline |
|
inline |
Get the errors word.
Definition at line 132 of file CastorCORData.h.
References m_rawConst.
Referenced by CastorCTDCHeader::copySpigotData().
|
inline |
Get the COR Ext Header words.
Definition at line 187 of file CastorCORData.h.
References m_rawConst.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the BCN of the Fiber Orbit Messages.
Definition at line 153 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 156 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 160 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 164 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 168 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 172 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 176 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 180 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
unsigned int CastorCORData::getFirmwareRevision | ( | ) | const |
Get the COR firmware version.
Definition at line 318 of file CastorCORData.cc.
References m_rawConst.
|
inline |
Get the version number of this event.
Definition at line 32 of file CastorCORData.h.
References m_formatVersion.
void CastorCORData::getHistogramFibers | ( | int & | a, |
int & | b | ||
) | const |
Get the fiber numbers for the data present in this event (only in histogram mode!)
Definition at line 322 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by unpackHistogram().
|
inline |
int CastorCORData::getNDD | ( | ) | const |
Get the number of daq data samples per channel when not zero-suppressed.
Definition at line 300 of file CastorCORData.cc.
References m_formatVersion, m_rawConst, and m_rawLength.
int CastorCORData::getNPrecisionWords | ( | ) | const |
Get the total number of precision data 16-bit words.
Definition at line 309 of file CastorCORData.cc.
References m_formatVersion, m_rawConst, and m_rawLength.
int CastorCORData::getNPS | ( | ) | const |
Get the number of presamples in daq data.
Definition at line 312 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by CastorCtdcUnpacker::unpack().
int CastorCORData::getNTP | ( | ) | const |
Get the number of trigger data samples when not zero-suppressed (not available after FW 4)
Definition at line 303 of file CastorCORData.cc.
References m_formatVersion, m_rawConst, and m_rawLength.
unsigned int CastorCORData::getOrbitNumber | ( | ) | const |
unsigned int CastorCORData::getPipelineLength | ( | ) | const |
Get the pipeline length used for this event.
Definition at line 315 of file CastorCORData.cc.
References m_rawConst.
|
inline |
Get a pointer to the raw data.
Definition at line 35 of file CastorCORData.h.
References m_rawConst.
Referenced by CastorCTDCHeader::copySpigotData().
|
inline |
Get the length of the raw data.
Definition at line 38 of file CastorCORData.h.
References m_rawLength.
Referenced by CastorCTDCHeader::copySpigotData(), and CastorCtdcPacker::pack().
unsigned int CastorCORData::getSubmodule | ( | ) | const |
Get the HTR submodule number.
Definition at line 265 of file CastorCORData.cc.
References m_rawConst.
Referenced by htrSlot(), htrTopBottom(), and readoutVMECrateId().
|
inline |
unsigned int CastorCORData::htrSlot | ( | ) | const |
HcalElectronicsId-style HTR slot.
Definition at line 268 of file CastorCORData.cc.
References getSubmodule().
unsigned int CastorCORData::htrTopBottom | ( | ) | const |
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)
Definition at line 272 of file CastorCORData.cc.
References getSubmodule().
bool CastorCORData::isCalibrationStream | ( | ) | const |
Is this event a calibration-stream event?
Definition at line 280 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
bool CastorCORData::isHistogramEvent | ( | ) | const |
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition at line 297 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by CastorCtdcUnpacker::unpack(), and unpackHistogram().
bool CastorCORData::isPatternRAMEvent | ( | ) | const |
Is this event a pattern-ram event?
Definition at line 294 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
bool CastorCORData::isUnsuppressed | ( | ) | const |
Is this event an unsuppresed event?
Definition at line 283 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by wasMarkAndPassZS().
CastorCORData & CastorCORData::operator= | ( | const CastorCORData & | hd | ) |
Definition at line 43 of file CastorCORData.cc.
References m_formatVersion, m_ownData, m_rawConst, and m_rawLength.
void CastorCORData::pack | ( | unsigned char * | daq_lengths, |
unsigned short * | daq_samples, | ||
unsigned char * | tp_lengths, | ||
unsigned short * | tp_samples, | ||
bool | do_capid = false |
||
) |
Unpack the HTR data into TP and DAQ data sorted by channel.
daq_lengths | unsigned char[24] of lengths |
daq_samples | unsigned short [24*20] of data |
tp_lengths | unsigned char[24] of lengths |
tp_samples | unsigned short [24*20] of data |
Definition at line 157 of file CastorCORData.cc.
References determineStaticLengths(), j, m_ownData, m_rawLength, MAXIMUM_SAMPLES_PER_CHANNEL, min, and indexGen::s2.
Referenced by pyrootRender.interactiveRender::draw(), and CastorCtdcPacker::pack().
void CastorCORData::packHeaderTrailer | ( | int | L1Anumber, |
int | bcn, | ||
int | submodule, | ||
int | orbitn, | ||
int | pipeline, | ||
int | ndd, | ||
int | nps, | ||
int | firmwareRev = 0 |
||
) |
pack header and trailer (call after pack)
Definition at line 245 of file CastorCORData.cc.
References m_formatVersion, m_ownData, and m_rawLength.
Referenced by CastorCtdcPacker::pack().
unsigned int CastorCORData::readoutVMECrateId | ( | ) | const |
HcalElectronicsId-style VME crate number.
Definition at line 276 of file CastorCORData.cc.
References getSubmodule().
void CastorCORData::unpack | ( | unsigned char * | daq_lengths, |
unsigned short * | daq_samples, | ||
unsigned char * | tp_lengths, | ||
unsigned short * | tp_samples | ||
) | const |
Obtain the starting and ending pointers for external unpacking of the data.
daq_first | Pointer to a pointer to the start of the DAQ data |
daq_last | Pointer to a pointer to the end of the DAQ data |
tp_first | Pointer to a pointer to the start of the TP data |
tp_last | Pointer to a pointer to the end of the TP dataUnpack the HTR data into TP and DAQ data sorted by channel |
daq_lengths | unsigned char[24] of lengths. High bit set indicates error with this channel |
daq_samples | unsigned short [24*20] of data |
tp_lengths | unsigned char[24] of lengths |
tp_samples | unsigned short [24*20] of data |
Definition at line 102 of file CastorCORData.cc.
References CHANNELS_PER_SPIGOT, determineSectionLengths(), j, m_rawConst, and MAXIMUM_SAMPLES_PER_CHANNEL.
Referenced by CastorCtdcUnpacker::unpack().
bool CastorCORData::unpackHistogram | ( | int | fiber, |
int | fiberchan, | ||
int | capid, | ||
unsigned short * | histogram | ||
) | const |
Unpack special histogramming mode data.
fiber | |
fiberchan | |
capid | Capacitor id for which to extract a histogram |
histogram | unsigned int[32] into which the data should be deposited |
Definition at line 334 of file CastorCORData.cc.
References getHistogramFibers(), i, isHistogramEvent(), m_formatVersion, m_rawConst, and evf::evtn::offset().
bool CastorCORData::wasMarkAndPassZS | ( | int | fiber, |
int | fiberchan | ||
) | const |
Was this channel passed as part of Mark&Pass ZS?
Definition at line 286 of file CastorCORData.cc.
References isUnsuppressed(), m_formatVersion, m_rawConst, m_rawLength, and edm::shift.
|
static |
Definition at line 18 of file CastorCORData.h.
Referenced by CastorCtdcPacker::pack(), CastorCtdcUnpacker::unpack(), and unpack().
|
protected |
Definition at line 222 of file CastorCORData.h.
Referenced by adoptData(), allocate(), getFib1OrbMsgBCN(), getFib2OrbMsgBCN(), getFib3OrbMsgBCN(), getFib4OrbMsgBCN(), getFib5OrbMsgBCN(), getFib6OrbMsgBCN(), getFib7OrbMsgBCN(), getFib8OrbMsgBCN(), getFormatVersion(), getHistogramFibers(), getNDD(), getNPrecisionWords(), getNPS(), getNTP(), isCalibrationStream(), isHistogramEvent(), isPatternRAMEvent(), isUnsuppressed(), operator=(), packHeaderTrailer(), unpackHistogram(), and wasMarkAndPassZS().
|
protected |
Definition at line 225 of file CastorCORData.h.
Referenced by allocate(), CastorCORData(), operator=(), pack(), packHeaderTrailer(), and ~CastorCORData().
|
protected |
Definition at line 224 of file CastorCORData.h.
Referenced by adoptData(), allocate(), check(), determineSectionLengths(), getBunchNumber(), getDLLunlock(), getErrorsWord(), getExtHdr1(), getExtHdr2(), getExtHdr3(), getExtHdr4(), getExtHdr5(), getExtHdr6(), getExtHdr7(), getExtHdr8(), getFib1OrbMsgBCN(), getFib2OrbMsgBCN(), getFib3OrbMsgBCN(), getFib4OrbMsgBCN(), getFib5OrbMsgBCN(), getFib6OrbMsgBCN(), getFib7OrbMsgBCN(), getFib8OrbMsgBCN(), getFirmwareRevision(), getHistogramFibers(), getL1ANumber(), getNDD(), getNPrecisionWords(), getNPS(), getNTP(), getOrbitNumber(), getPipelineLength(), getRawData(), getSubmodule(), getTTCready(), isCalibrationStream(), isHistogramEvent(), isPatternRAMEvent(), isUnsuppressed(), operator=(), unpack(), unpackHistogram(), and wasMarkAndPassZS().
|
protected |
Definition at line 223 of file CastorCORData.h.
Referenced by adoptData(), allocate(), check(), determineSectionLengths(), getFib1OrbMsgBCN(), getFib2OrbMsgBCN(), getFib3OrbMsgBCN(), getFib4OrbMsgBCN(), getFib5OrbMsgBCN(), getFib6OrbMsgBCN(), getFib7OrbMsgBCN(), getFib8OrbMsgBCN(), getNDD(), getNPrecisionWords(), getNTP(), getRawLength(), operator=(), pack(), packHeaderTrailer(), and wasMarkAndPassZS().
|
protected |
Definition at line 226 of file CastorCORData.h.
|
static |
Definition at line 19 of file CastorCORData.h.
Referenced by CastorCtdcPacker::pack(), pack(), CastorCtdcUnpacker::unpack(), and unpack().