 |
Belle II Software
release-05-02-19
|
13 #include <framework/core/Module.h>
14 #include <top/geometry/TOPGeometryPar.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <rawdata/dataobjects/RawTOP.h>
17 #include <top/RawDataTypes.h>
18 #include <top/dataobjects/TOPDigit.h>
19 #include <top/dataobjects/TOPRawWaveform.h>
20 #include <top/dataobjects/TOPRawDigit.h>
21 #include <top/dataobjects/TOPSlowData.h>
22 #include <top/dataobjects/TOPInterimFEInfo.h>
23 #include <top/dataobjects/TOPTemplateFitResult.h>
24 #include <top/dataobjects/TOPProductionEventDebug.h>
25 #include <top/dataobjects/TOPProductionHitDebug.h>
50 DataArray(
const int* data,
int size,
bool swap =
false)
73 B2ERROR(
"Bug in data format: DataArray - index out of range");
127 while ((chk >> 16) > 0) {
128 chk = (chk & 0xFFFF) + (chk >> 16);
150 return (((x << 24) & 0xFF000000) |
151 ((x << 8) & 0x00FF0000) |
152 ((x >> 8) & 0x0000FF00) |
153 ((x >> 24) & 0x000000FF));
202 virtual void event()
override;
208 virtual void endRun()
override;
223 unsigned short signBit = x & 0x1000;
224 return ((x & 0x1FFF) | signBit << 1 | signBit << 2 | signBit << 3);
231 unsigned short sumShorts(
unsigned int x)
const
233 return x + (x >> 16);
278 int unpackProdDebug(
const int* buffer,
int bufferSize, TOP::RawDataType dataFormat,
bool pedestalSubtracted);
virtual ~TOPUnpackerModule()
Destructor.
short expand13to16bits(unsigned short x) const
Expand 13-bit signed-word to 16-bit signed-word.
const int * m_data
buffer data
std::string m_templateFitResultName
name of TOPTemplateFitResult store array
unsigned short sumShorts(unsigned int x) const
sum both 16-bit words of 32-bit integer
StoreArray< TOPSlowData > m_slowData
collection of slow data
TOPUnpackerModule()
Constructor.
StoreArray< TOPInterimFEInfo > m_interimFEInfos
collection of interim informations
bool m_swap
if true, swap bytes
std::string m_outputDigitsName
name of TOPDigit store array
DataArray(const int *data, int size, bool swap=false)
Constructor.
virtual void event() override
Event processor.
virtual void terminate() override
Termination action.
StoreArray< TOPProductionHitDebug > m_productionHitDebugs
collection of hit debug data
int unpackInterimFEVer01(const int *buffer, int bufferSize, bool pedestalSubtracted)
Unpack raw data given in feature-extraction interim format.
virtual void beginRun() override
Called when entering a new run.
std::string m_outputWaveformsName
name of TOPRawWaveform store array
bool unpackHeadersInterimFEVer01(const int *buffer, int bufferSize, bool swapBytes)
Tries to unpack raw data assuming it is in feature-extraction interim format.
std::map< int, int > m_channelStatistics
counts how many different channels have been parsed in a given SCROD packet
StoreArray< TOPDigit > m_digits
collection of digits
unsigned int getIndex() const
Returns index of last returned data word.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
std::string m_outputRawDigitsName
name of TOPRawDigit store array
StoreArray< TOPRawWaveform > m_waveforms
collection of waveforms
virtual void endRun() override
End-of-run action.
Abstract base class for different kinds of events.
int unpackProdDebug(const int *buffer, int bufferSize, TOP::RawDataType dataFormat, bool pedestalSubtracted)
Unpack raw data given in production debugging format.
StoreArray< RawTOP > m_rawData
collection of raw data
unsigned int m_checksumCounter
check sum counter
bool m_swapBytes
if true, swap bytes
int peekWord()
Returns next data word without incrementing the memory pointer and without modifying the checksum cou...
StoreArray< TOPRawDigit > m_rawDigits
collection of raw digits
bool validateChecksum()
Validates current checksum counter status.
int m_dataFormat
data format
int getLastWord()
Returns last data word.
virtual void initialize() override
Initialize the Module.
void unpackProductionDraft(const int *buffer, int bufferSize)
Unpack raw data given in a tentative production format (will vanish in future)
int getWord()
Returns consecutive data word Updates internal checksum counter for each extracted word.
std::string m_inputRawDataName
name of RawTOP store array
StoreArray< TOPProductionEventDebug > m_productionEventDebugs
collection of event debug data
void resetChecksum()
Resets internal checksum counter.
Accessor to arrays stored in the data store.
TOP::TOPGeometryPar * m_topgp
geometry param
void unpackType0Ver16(const int *buffer, int bufferSize)
Unpack raw data given in feature-extraction production format.
Singleton class for TOP Geometry Parameters.
StoreArray< TOPTemplateFitResult > m_templateFitResults
collection of template fit results
int swap32(int x)
Swap bytes of a 32-bit integer.
int getRemainingWords() const
Returns number of remaining words in the buffer.
unsigned int foldChecksum()
Performs folding of carry bits into checksum until only 16 LSBs are populated.