2 #ifndef CastorCORData_H 3 #define CastorCORData_H 26 void allocate(
int version_to_create=0);
27 void adoptData(
const unsigned short* data,
int length);
63 void unpack(
unsigned char* daq_lengths,
unsigned short* daq_samples,
64 unsigned char* tp_lengths,
unsigned short* tp_samples)
const;
74 short* histogram)
const;
82 void pack(
unsigned char* daq_lengths,
unsigned short* daq_samples,
83 unsigned char* tp_lengths,
unsigned short* tp_samples,
bool 87 orbitn,
int pipeline,
int ndd,
int nps,
int firmwareRev=0);
218 headerWords,
int& trailerWords,
int& triggerWords)
const;
CastorCORData & operator=(const CastorCORData &)
int getNPS() const
Get the number of presamples in daq data.
unsigned int getExtHdr2() const
bool isCalibrationStream() const
Is this event a calibration-stream event?
unsigned int getExtHdr1() const
Get the COR Ext Header words.
static const int CHANNELS_PER_SPIGOT
void adoptData(const unsigned short *data, int length)
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.
int getNDD() const
Get the number of daq data samples per channel when not zero-suppressed.
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)
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.
unsigned int getFirmwareRevision() const
Get the COR firmware version.
bool unpackHistogram(int fiber, int fiberchan, int capid, unsigned short *histogram) const
Unpack special histogramming mode data.
unsigned int getErrorsWord() const
Get the errors word.
unsigned int getSubmodule() const
Get the HTR submodule number.
unsigned int getFib1OrbMsgBCN() const
Get the BCN of the Fiber Orbit Messages.
unsigned int getOrbitNumber() const
Get the HTR orbit number.
unsigned int getFib7OrbMsgBCN() const
int getNTP() const
Get the number of trigger data samples when not zero-suppressed (not available after FW 4) ...
unsigned int getFib2OrbMsgBCN() const
unsigned int getFib3OrbMsgBCN() const
unsigned int getFib8OrbMsgBCN() const
unsigned int getExtHdr8() const
int getFormatVersion() const
Get the version number of this event.
unsigned int getFib5OrbMsgBCN() const
int getNPrecisionWords() const
Get the total number of precision data 16-bit words.
unsigned int getBunchNumber() const
Get the HTR bunch number.
static const int MAXIMUM_SAMPLES_PER_CHANNEL
bool isUnsuppressed() const
Is this event an unsuppresed event?
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
unsigned int getPipelineLength() const
Get the pipeline length used for this event.
unsigned short * m_ownData
unsigned int htrSlot() const
HcalElectronicsId-style HTR slot.
unsigned int getExtHdr3() const
unsigned short * m_unpackedData
void getHistogramFibers(int &a, int &b) const
Get the fiber numbers for the data present in this event (only in histogram mode!) ...
void allocate(int version_to_create=0)
unsigned int getFib4OrbMsgBCN() const
const int getRawLength() const
Get the length of the raw data.
const unsigned short * getRawData() const
Get a pointer to the raw data.
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
unsigned int getDLLunlock() const
Get DLLunlock bits.
unsigned int getExtHdr4() const
unsigned int getExtHdr5() const
char data[epos_bytes_allocation]
bool wasMarkAndPassZS(int fiber, int fiberchan) const
Was this channel passed as part of Mark&Pass ZS?
unsigned int htrTopBottom() const
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)
bool isPatternRAMEvent() const
Is this event a pattern-ram event?
unsigned int readoutVMECrateId() const
HcalElectronicsId-style VME crate number.
unsigned int getExtHdr7() const
unsigned int getL1ANumber() const
Get the HTR event number.
void determineStaticLengths(int &headerWords, int &trailerWords, int &triggerWords) const
const unsigned short * m_rawConst
unsigned int getFib6OrbMsgBCN() const
unsigned int getTTCready() const
Get TTCready bits.
unsigned int getExtHdr6() const
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!)