CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
HcalHTRData Class Reference

#include <HcalHTRData.h>

Public Member Functions

void adoptData (const unsigned short *data, int length)
 
void allocate (int version_to_create=0)
 
bool check () const
 Check for a good event Requires a minimum length, matching wordcount and length, not an empty event. More...
 
void dataPointers (const unsigned short **daq_first, const unsigned short **daq_last, const unsigned short **tp_first, const unsigned short **tp_last) const
 Obtain the starting and ending pointers for external unpacking of the data. 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 HTR 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 getFibOrbMsgBCN (int fiber) const
 Get the BCN of the Fiber Orbit Messages. More...
 
int getFirmwareFlavor () const
 Get the HTR firmware flavor. More...
 
unsigned int getFirmwareRevision () const
 Get the HTR 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 bit. More...
 
 HcalHTRData ()
 
 HcalHTRData (int version_to_create)
 
 HcalHTRData (const unsigned short *data, int length)
 
 HcalHTRData (const HcalHTRData &)
 
unsigned int htrSlot () const
 HcalElectronicsId-style HTR slot. More...
 
unsigned int htrTopBottom () const
 HcalElectronicsId-style HTR top/bottom (1=top/0=bottom) More...
 
bool isBusy () const
 
bool isCalibrationStream () const
 Is this event a calibration-stream event? More...
 
bool isEmptyEvent () const
 
bool isHistogramEvent () const
 Is this event a histogram event? (do not call standard unpack in this case!!!!!) More...
 
bool isOverflowWarning () const
 
bool isPatternRAMEvent () const
 Is this event a pattern-ram event? More...
 
bool isUnsuppressed () const
 Is this event an unsuppresed event? More...
 
HcalHTRDataoperator= (const HcalHTRData &)
 
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, int firmwareFlav=0)
 pack header and trailer (call after pack) More...
 
void packUnsuppressed (const bool *mp)
 pack trailer with Mark and Pass bits 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
 Unpack the HTR data into TP and DAQ data sorted by channel. More...
 
bool unpackHistogram (int fiber, int fiberchan, int capid, unsigned short *histogram) const
 Unpack special histogramming mode data. More...
 
bool wasHistogramError (int ifiber) const
 Was there an error on the given fiber for this event (only in histogram mode!) More...
 
bool wasMarkAndPassZS (int fiber, int fiberchan) const
 Was this channel passed as part of Mark&Pass ZS? More...
 
bool wasMarkAndPassZSTP (int slb, int slbchan) const
 Was this channel passed as part of Mark&Pass ZS? More...
 
uint32_t zsBunchMask () const
 ZS Bunch Mask (if available) More...
 
 ~HcalHTRData ()
 

Static Public Member Functions

static bool is_channel_header (unsigned short value)
 check top bit to see if this is a compact format channel header word More...
 
static bool unpack_per_channel_header (unsigned short, int &flav, int &error_flags, int &capid0, int &channelid)
 Unpack a per-channel header word (compact format) More...
 

Static Public Attributes

static const int CHANNELS_PER_SPIGOT = 24
 
static const int FORMAT_VERSION_COMPACT_DATA = 6
 
static const int MAXIMUM_SAMPLES_PER_CHANNEL = 20
 

Protected Member Functions

void determineSectionLengths (int &tpWords, int &daqWords, int &headerWords, int &trailerWords) const
 
void determineStaticLengths (int &headerWords, int &trailerWords) const
 

Protected Attributes

int m_formatVersion
 
unsigned short * m_ownData
 
const unsigned short * m_rawConst
 
int m_rawLength
 

Detailed Description

Interpretive class for HcalHTRData 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.

Author
J. Mans - UMD

Definition at line 16 of file HcalHTRData.h.

Constructor & Destructor Documentation

HcalHTRData::HcalHTRData ( )

Definition at line 15 of file HcalHTRData.cc.

HcalHTRData::~HcalHTRData ( )
inline

Definition at line 23 of file HcalHTRData.h.

HcalHTRData::HcalHTRData ( int  version_to_create)

Definition at line 22 of file HcalHTRData.cc.

HcalHTRData::HcalHTRData ( const unsigned short *  data,
int  length 
)

Definition at line 16 of file HcalHTRData.cc.

HcalHTRData::HcalHTRData ( const HcalHTRData hd)

Definition at line 20 of file HcalHTRData.cc.

Member Function Documentation

void HcalHTRData::adoptData ( const unsigned short *  data,
int  length 
)

Definition at line 47 of file HcalHTRData.cc.

Referenced by HcalDTCHeader::getSlotData(), and HcalDCCHeader::getSpigotData().

void HcalHTRData::allocate ( int  version_to_create = 0)

Definition at line 26 of file HcalHTRData.cc.

Referenced by CastorPacker::pack().

bool HcalHTRData::check ( void  ) const

Check for a good event Requires a minimum length, matching wordcount and length, not an empty event.

Definition at line 62 of file HcalHTRData.cc.

void HcalHTRData::dataPointers ( const unsigned short **  daq_first,
const unsigned short **  daq_last,
const unsigned short **  tp_first,
const unsigned short **  tp_last 
) const

Obtain the starting and ending pointers for external unpacking of the data.

Parameters
daq_firstPointer to a pointer to the start of the DAQ data
daq_lastPointer to a pointer to the end of the DAQ data
tp_firstPointer to a pointer to the start of the TP data
tp_lastPointer to a pointer to the end of the TP data

Definition at line 153 of file HcalHTRData.cc.

Referenced by HcalTTPUnpacker::unpack().

void HcalHTRData::determineSectionLengths ( int &  tpWords,
int &  daqWords,
int &  headerWords,
int &  trailerWords 
) const
protected

Definition at line 125 of file HcalHTRData.cc.

void HcalHTRData::determineStaticLengths ( int &  headerWords,
int &  trailerWords 
) const
protected

Definition at line 140 of file HcalHTRData.cc.

unsigned int HcalHTRData::getBunchNumber ( ) const
inline

Get the HTR bunch number.

Definition at line 115 of file HcalHTRData.h.

unsigned int HcalHTRData::getDLLunlock ( ) const
inline

Get DLLunlock bits.

Definition at line 170 of file HcalHTRData.h.

unsigned int HcalHTRData::getErrorsWord ( ) const
inline

Get the errors word.

Definition at line 157 of file HcalHTRData.h.

Referenced by HcalDCCHeader::copySpigotData().

unsigned int HcalHTRData::getExtHdr1 ( ) const
inline

Get the HTR Ext Header words.

Definition at line 217 of file HcalHTRData.h.

unsigned int HcalHTRData::getExtHdr2 ( ) const
inline

Definition at line 219 of file HcalHTRData.h.

unsigned int HcalHTRData::getExtHdr3 ( ) const
inline

Definition at line 221 of file HcalHTRData.h.

unsigned int HcalHTRData::getExtHdr4 ( ) const
inline

Definition at line 223 of file HcalHTRData.h.

unsigned int HcalHTRData::getExtHdr5 ( ) const
inline

Definition at line 225 of file HcalHTRData.h.

unsigned int HcalHTRData::getExtHdr6 ( ) const
inline

Definition at line 227 of file HcalHTRData.h.

unsigned int HcalHTRData::getExtHdr7 ( ) const
inline

Definition at line 229 of file HcalHTRData.h.

unsigned int HcalHTRData::getExtHdr8 ( ) const
inline

Definition at line 231 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib1OrbMsgBCN ( ) const
inline

Get the BCN of the Fiber Orbit Messages.

Definition at line 183 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib2OrbMsgBCN ( ) const
inline

Definition at line 186 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib3OrbMsgBCN ( ) const
inline

Definition at line 190 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib4OrbMsgBCN ( ) const
inline

Definition at line 194 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib5OrbMsgBCN ( ) const
inline

Definition at line 198 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib6OrbMsgBCN ( ) const
inline

Definition at line 202 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib7OrbMsgBCN ( ) const
inline

Definition at line 206 of file HcalHTRData.h.

unsigned int HcalHTRData::getFib8OrbMsgBCN ( ) const
inline

Definition at line 210 of file HcalHTRData.h.

unsigned int HcalHTRData::getFibOrbMsgBCN ( int  fiber) const
inline

Get the BCN of the Fiber Orbit Messages.

Definition at line 178 of file HcalHTRData.h.

int HcalHTRData::getFirmwareFlavor ( ) const

Get the HTR firmware flavor.

Definition at line 409 of file HcalHTRData.cc.

Referenced by HLTHcalNZSFilter::hltFilter(), and HcalTTPUnpacker::unpack().

unsigned int HcalHTRData::getFirmwareRevision ( ) const

Get the HTR firmware version.

Definition at line 406 of file HcalHTRData.cc.

Referenced by HcalTTPUnpacker::unpack().

int HcalHTRData::getFormatVersion ( ) const
inline

Get the version number of this event.

Definition at line 33 of file HcalHTRData.h.

void HcalHTRData::getHistogramFibers ( int &  a,
int &  b 
) const

Get the fiber numbers for the data present in this event (only in histogram mode!)

Definition at line 413 of file HcalHTRData.cc.

unsigned int HcalHTRData::getL1ANumber ( ) const
inline

Get the HTR event number.

Definition at line 111 of file HcalHTRData.h.

int HcalHTRData::getNDD ( ) const

Get the number of daq data samples per channel when not zero-suppressed.

Definition at line 388 of file HcalHTRData.cc.

Referenced by HcalTTPUnpacker::unpack().

int HcalHTRData::getNPrecisionWords ( ) const

Get the total number of precision data 16-bit words.

Definition at line 397 of file HcalHTRData.cc.

int HcalHTRData::getNPS ( ) const

Get the number of presamples in daq data.

Definition at line 400 of file HcalHTRData.cc.

Referenced by HcalTTPUnpacker::unpack().

int HcalHTRData::getNTP ( ) const

Get the number of trigger data samples when not zero-suppressed (not available after FW 4)

Definition at line 391 of file HcalHTRData.cc.

unsigned int HcalHTRData::getOrbitNumber ( ) const

Get the HTR orbit number.

Definition at line 324 of file HcalHTRData.cc.

unsigned int HcalHTRData::getPipelineLength ( ) const

Get the pipeline length used for this event.

Definition at line 403 of file HcalHTRData.cc.

Referenced by HcalTTPUnpacker::unpack().

const unsigned short* HcalHTRData::getRawData ( ) const
inline

Get a pointer to the raw data.

Definition at line 36 of file HcalHTRData.h.

Referenced by HcalDTCHeader::copySlotData(), and HcalDCCHeader::copySpigotData().

const int HcalHTRData::getRawLength ( ) const
inline

Get the length of the raw data.

Definition at line 39 of file HcalHTRData.h.

Referenced by HcalDTCHeader::copySlotData(), HcalDCCHeader::copySpigotData(), and CastorPacker::pack().

unsigned int HcalHTRData::getSubmodule ( ) const

Get the HTR submodule number.

Definition at line 331 of file HcalHTRData.cc.

Referenced by HcalTTPUnpacker::unpack().

unsigned int HcalHTRData::getTTCready ( ) const
inline

Get TTCready bit.

Definition at line 174 of file HcalHTRData.h.

unsigned int HcalHTRData::htrSlot ( ) const

HcalElectronicsId-style HTR slot.

Definition at line 338 of file HcalHTRData.cc.

unsigned int HcalHTRData::htrTopBottom ( ) const

HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)

Definition at line 342 of file HcalHTRData.cc.

static bool HcalHTRData::is_channel_header ( unsigned short  value)
inlinestatic

check top bit to see if this is a compact format channel header word

Definition at line 90 of file HcalHTRData.h.

bool HcalHTRData::isBusy ( ) const

Definition at line 117 of file HcalHTRData.cc.

bool HcalHTRData::isCalibrationStream ( ) const

Is this event a calibration-stream event?

Definition at line 350 of file HcalHTRData.cc.

bool HcalHTRData::isEmptyEvent ( ) const

Definition at line 100 of file HcalHTRData.cc.

Referenced by HcalEmptyEventFilter::filter().

bool HcalHTRData::isHistogramEvent ( ) const

Is this event a histogram event? (do not call standard unpack in this case!!!!!)

Definition at line 385 of file HcalHTRData.cc.

bool HcalHTRData::isOverflowWarning ( ) const

Definition at line 109 of file HcalHTRData.cc.

bool HcalHTRData::isPatternRAMEvent ( ) const

Is this event a pattern-ram event?

Definition at line 382 of file HcalHTRData.cc.

bool HcalHTRData::isUnsuppressed ( ) const

Is this event an unsuppresed event?

Definition at line 353 of file HcalHTRData.cc.

Referenced by HLTHcalNZSFilter::hltFilter().

HcalHTRData & HcalHTRData::operator= ( const HcalHTRData hd)

Definition at line 38 of file HcalHTRData.cc.

void HcalHTRData::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.

Parameters
daq_lengthsunsigned char[24] of lengths
daq_samplesunsigned short [24*20] of data
tp_lengthsunsigned char[24] of lengths
tp_samplesunsigned short [24*20] of data

Definition at line 224 of file HcalHTRData.cc.

Referenced by pyrootRender.interactiveRender::draw(), and CastorPacker::pack().

void HcalHTRData::packHeaderTrailer ( int  L1Anumber,
int  bcn,
int  submodule,
int  orbitn,
int  pipeline,
int  ndd,
int  nps,
int  firmwareRev = 0,
int  firmwareFlav = 0 
)

pack header and trailer (call after pack)

Definition at line 283 of file HcalHTRData.cc.

Referenced by CastorPacker::pack().

void HcalHTRData::packUnsuppressed ( const bool *  mp)

pack trailer with Mark and Pass bits

Definition at line 308 of file HcalHTRData.cc.

unsigned int HcalHTRData::readoutVMECrateId ( ) const

HcalElectronicsId-style VME crate number.

Definition at line 346 of file HcalHTRData.cc.

void HcalHTRData::unpack ( unsigned char *  daq_lengths,
unsigned short *  daq_samples,
unsigned char *  tp_lengths,
unsigned short *  tp_samples 
) const

Unpack the HTR data into TP and DAQ data sorted by channel.

Parameters
daq_lengthsunsigned char[24] of lengths. High bit set indicates error with this channel
daq_samplesunsigned short [24*20] of data
tp_lengthsunsigned char[24] of lengths
tp_samplesunsigned short [24*20] of data

Definition at line 172 of file HcalHTRData.cc.

bool HcalHTRData::unpack_per_channel_header ( unsigned short  header,
int &  flav,
int &  error_flags,
int &  capid0,
int &  channelid 
)
static

Unpack a per-channel header word (compact format)

Definition at line 433 of file HcalHTRData.cc.

bool HcalHTRData::unpackHistogram ( int  fiber,
int  fiberchan,
int  capid,
unsigned short *  histogram 
) const

Unpack special histogramming mode data.

Parameters
fiber
fiberchan
capidCapacitor id for which to extract a histogram
histogramunsigned int[32] into which the data should be deposited

Definition at line 441 of file HcalHTRData.cc.

bool HcalHTRData::wasHistogramError ( int  ifiber) const

Was there an error on the given fiber for this event (only in histogram mode!)

Definition at line 425 of file HcalHTRData.cc.

bool HcalHTRData::wasMarkAndPassZS ( int  fiber,
int  fiberchan 
) const

Was this channel passed as part of Mark&Pass ZS?

Definition at line 356 of file HcalHTRData.cc.

bool HcalHTRData::wasMarkAndPassZSTP ( int  slb,
int  slbchan 
) const

Was this channel passed as part of Mark&Pass ZS?

Definition at line 364 of file HcalHTRData.cc.

uint32_t HcalHTRData::zsBunchMask ( ) const

ZS Bunch Mask (if available)

Definition at line 373 of file HcalHTRData.cc.

Member Data Documentation

const int HcalHTRData::CHANNELS_PER_SPIGOT = 24
static

Definition at line 18 of file HcalHTRData.h.

Referenced by CastorPacker::pack().

const int HcalHTRData::FORMAT_VERSION_COMPACT_DATA = 6
static

Definition at line 20 of file HcalHTRData.h.

int HcalHTRData::m_formatVersion
protected

Definition at line 252 of file HcalHTRData.h.

unsigned short* HcalHTRData::m_ownData
protected

Definition at line 255 of file HcalHTRData.h.

const unsigned short* HcalHTRData::m_rawConst
protected

Definition at line 254 of file HcalHTRData.h.

int HcalHTRData::m_rawLength
protected

Definition at line 253 of file HcalHTRData.h.

const int HcalHTRData::MAXIMUM_SAMPLES_PER_CHANNEL = 20
static

Definition at line 19 of file HcalHTRData.h.

Referenced by CastorPacker::pack().