#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 14 of file CastorCORData.h.
CastorCORData::CastorCORData | ( | ) |
|
inline |
Definition at line 20 of file CastorCORData.h.
References adoptData(), allocate(), CastorCORData(), data, m_ownData, and operator=().
CastorCORData::CastorCORData | ( | int | version_to_create | ) |
CastorCORData::CastorCORData | ( | const unsigned short * | data, |
int | length | ||
) |
Definition at line 21 of file CastorCORData.cc.
References adoptData(), and m_ownData.
CastorCORData::CastorCORData | ( | const CastorCORData & | hd | ) |
Definition at line 25 of file CastorCORData.cc.
void CastorCORData::adoptData | ( | const unsigned short * | data, |
int | length | ||
) |
Definition at line 51 of file CastorCORData.cc.
References data, m_formatVersion, m_rawConst, and m_rawLength.
Referenced by CastorCORData(), CastorCTDCHeader::getSpigotData(), and ~CastorCORData().
void CastorCORData::allocate | ( | int | version_to_create = 0 | ) |
Definition at line 32 of file CastorCORData.cc.
References m_formatVersion, m_ownData, m_rawConst, and m_rawLength.
Referenced by CastorCORData(), CastorCtdcPacker::pack(), and ~CastorCORData().
bool CastorCORData::check | ( | ) | const |
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event.
Definition at line 64 of file CastorCORData.cc.
References determineSectionLengths(), RecoTauValidation_cfi::header, m_rawConst, and m_rawLength.
Referenced by getRawLength(), and CastorCtdcUnpacker::unpack().
|
protected |
Was there an error on the given fiber for this event (only in histogram mode!)
Definition at line 82 of file CastorCORData.cc.
References m_rawConst, and m_rawLength.
Referenced by check(), getExtHdr8(), and unpack().
|
protected |
Definition at line 96 of file CastorCORData.cc.
Referenced by getExtHdr8(), and pack().
|
inline |
Get the HTR bunch number.
Definition at line 97 of file CastorCORData.h.
References a, b, getFirmwareRevision(), getHistogramFibers(), getOrbitNumber(), getPipelineLength(), getSubmodule(), htrSlot(), htrTopBottom(), isCalibrationStream(), isHistogramEvent(), isPatternRAMEvent(), isUnsuppressed(), m_rawConst, readoutVMECrateId(), and wasMarkAndPassZS().
|
inline |
|
inline |
Get the errors word.
Definition at line 131 of file CastorCORData.h.
References getNDD(), getNPrecisionWords(), getNPS(), getNTP(), and m_rawConst.
Referenced by CastorCTDCHeader::copySpigotData().
|
inline |
Get the COR Ext Header words.
Definition at line 181 of file CastorCORData.h.
References m_rawConst.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 188 of file CastorCORData.h.
References determineSectionLengths(), determineStaticLengths(), and m_rawConst.
|
inline |
Get the BCN of the Fiber Orbit Messages.
Definition at line 149 of file CastorCORData.h.
References m_formatVersion, m_rawConst, and m_rawLength.
|
inline |
Definition at line 152 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.
unsigned int CastorCORData::getFirmwareRevision | ( | ) | const |
Get the COR firmware version.
Definition at line 313 of file CastorCORData.cc.
References m_rawConst.
Referenced by getBunchNumber().
|
inline |
Get the version number of this event.
Definition at line 33 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 315 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by getBunchNumber(), and unpackHistogram().
|
inline |
int CastorCORData::getNDD | ( | ) | const |
Get the number of daq data samples per channel when not zero-suppressed.
Definition at line 297 of file CastorCORData.cc.
References m_formatVersion, m_rawConst, and m_rawLength.
Referenced by getErrorsWord().
int CastorCORData::getNPrecisionWords | ( | ) | const |
Get the total number of precision data 16-bit words.
Definition at line 308 of file CastorCORData.cc.
References m_formatVersion, m_rawConst, and m_rawLength.
Referenced by getErrorsWord().
int CastorCORData::getNPS | ( | ) | const |
Get the number of presamples in daq data.
Definition at line 311 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by getErrorsWord(), and 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 300 of file CastorCORData.cc.
References m_formatVersion, m_rawConst, and m_rawLength.
Referenced by getErrorsWord().
unsigned int CastorCORData::getOrbitNumber | ( | ) | const |
Get the HTR orbit number.
Definition at line 267 of file CastorCORData.cc.
References m_rawConst.
Referenced by getBunchNumber().
unsigned int CastorCORData::getPipelineLength | ( | ) | const |
Get the pipeline length used for this event.
Definition at line 312 of file CastorCORData.cc.
References m_rawConst.
Referenced by getBunchNumber().
|
inline |
Get a pointer to the raw data.
Definition at line 36 of file CastorCORData.h.
References m_rawConst.
Referenced by CastorCTDCHeader::copySpigotData().
|
inline |
Get the length of the raw data.
Definition at line 39 of file CastorCORData.h.
References check(), m_rawLength, pack(), packHeaderTrailer(), unpack(), and unpackHistogram().
Referenced by CastorCTDCHeader::copySpigotData(), and CastorCtdcPacker::pack().
unsigned int CastorCORData::getSubmodule | ( | ) | const |
Get the HTR submodule number.
Definition at line 268 of file CastorCORData.cc.
References m_rawConst.
Referenced by getBunchNumber(), htrSlot(), htrTopBottom(), and readoutVMECrateId().
|
inline |
unsigned int CastorCORData::htrSlot | ( | ) | const |
HcalElectronicsId-style HTR slot.
Definition at line 269 of file CastorCORData.cc.
References getSubmodule().
Referenced by getBunchNumber().
unsigned int CastorCORData::htrTopBottom | ( | ) | const |
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)
Definition at line 273 of file CastorCORData.cc.
References getSubmodule().
Referenced by getBunchNumber().
bool CastorCORData::isCalibrationStream | ( | ) | const |
Is this event a calibration-stream event?
Definition at line 281 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by getBunchNumber().
bool CastorCORData::isHistogramEvent | ( | ) | const |
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition at line 294 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by getBunchNumber(), CastorCtdcUnpacker::unpack(), and unpackHistogram().
bool CastorCORData::isPatternRAMEvent | ( | ) | const |
Is this event a pattern-ram event?
Definition at line 293 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by getBunchNumber().
bool CastorCORData::isUnsuppressed | ( | ) | const |
Is this event an unsuppresed event?
Definition at line 282 of file CastorCORData.cc.
References m_formatVersion, and m_rawConst.
Referenced by getBunchNumber(), and wasMarkAndPassZS().
CastorCORData & CastorCORData::operator= | ( | const CastorCORData & | hd | ) |
Definition at line 42 of file CastorCORData.cc.
References m_formatVersion, m_ownData, m_rawConst, and m_rawLength.
Referenced by ~CastorCORData().
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 163 of file CastorCORData.cc.
References determineStaticLengths(), dqmiolumiharvest::j, m_ownData, m_rawLength, MAXIMUM_SAMPLES_PER_CHANNEL, min(), indexGen::s2, and testProducerWithPsetDescEmpty_cfi::x1.
Referenced by getRawLength(), 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 249 of file CastorCORData.cc.
References m_formatVersion, m_ownData, and m_rawLength.
Referenced by getRawLength(), and CastorCtdcPacker::pack().
unsigned int CastorCORData::readoutVMECrateId | ( | ) | const |
HcalElectronicsId-style VME crate number.
Definition at line 277 of file CastorCORData.cc.
References getSubmodule().
Referenced by getBunchNumber().
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(), dqmiolumiharvest::j, m_rawConst, and MAXIMUM_SAMPLES_PER_CHANNEL.
Referenced by getRawLength(), and 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 327 of file CastorCORData.cc.
References getHistogramFibers(), mps_fire::i, isHistogramEvent(), m_formatVersion, m_rawConst, and hltrates_dqm_sourceclient-live_cfg::offset.
Referenced by getRawLength().
bool CastorCORData::wasMarkAndPassZS | ( | int | fiber, |
int | fiberchan | ||
) | const |
Was this channel passed as part of Mark&Pass ZS?
Definition at line 283 of file CastorCORData.cc.
References isUnsuppressed(), m_formatVersion, m_rawConst, m_rawLength, edm::shift, and heppy_batch::val.
Referenced by getBunchNumber().
|
static |
Definition at line 16 of file CastorCORData.h.
Referenced by CastorCtdcPacker::pack(), CastorCtdcUnpacker::unpack(), and unpack().
|
protected |
Definition at line 208 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 211 of file CastorCORData.h.
Referenced by allocate(), CastorCORData(), operator=(), pack(), packHeaderTrailer(), and ~CastorCORData().
|
protected |
Definition at line 210 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 209 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 212 of file CastorCORData.h.
|
static |
Definition at line 17 of file CastorCORData.h.
Referenced by CastorCtdcPacker::pack(), pack(), CastorCtdcUnpacker::unpack(), and unpack().