11#include <framework/core/Module.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/database/DBArray.h>
14#include <framework/database/DBObjPtr.h>
15#include <cdc/dataobjects/CDCHit.h>
16#include <cdc/dataobjects/CDCRawHit.h>
17#include <cdc/dataobjects/CDCRawHitWaveForm.h>
18#include <cdc/dataobjects/WireID.h>
19#include <cdc/dbobjects/CDCChannelMap.h>
20#include <cdc/dbobjects/CDCADCDeltaPedestals.h>
21#include <rawdata/dataobjects/RawCDC.h>
22#include <tracking/trackFindingCDC/topology/CDCWireTopology.h>
64 void event()
override;
82 if ((buf[0] & 0xff000000) == 0x22000000) {
84 }
else if ((buf[0] & 0xff000000) == 0x20000000) {
87 B2ERROR(
"Undefined data type");
CDCUnpackerModule: The CDC Raw Hits Decoder.
StoreArray< RawCDC > m_rawCDCs
Input array for CDC Raw.
bool m_enableDatabase
Enable/Disable to read the channel map from the database.
int m_boardId
Front end board ID.
std::vector< unsigned short > m_buffer
Short ward buffer of CDC event block.
int m_channelTrig
Channel for the trigger.
bool m_dataSizeError
True if data size error between CDCFE and COPPER has been already reported.
std::string m_relCDCRawHitWFToCDCHitName
Relation name between CDCRawHitWaveForm and CDCHit.
int m_triggerTime
Trigger time.
std::string m_rawCDCName
Name of the RawCDC dataobject (suppressed mode).
void initialize() override
Initializes the Module.
DBArray< CDCChannelMap > * m_channelMapFromDB
Channel map retrieved from DB.
StoreArray< CDCRawHitWaveForm > m_CDCRawHitWaveForms
Raw hit waveforms.
std::string m_relCDCRawHitToCDCHitName
Relation name between CDCRawHit and CDCHit.
void printBuffer(int *buf, int nwords)
Print out the CDC data block in hex.
int getTriggerNumber()
Getter for trigger number.
void event() override
Event action (main routine).
StoreArray< CDCRawHit > m_CDCRawHits
Raw hits.
bool m_subtractTrigTiming
Enable/Disable to subtract the trigger timing from TDCs.
bool m_dataLengthError
True if data length error has been already reported.
void endRun() override
End run action.
void terminate() override
Termination action.
int m_fadcThreshold
FADC threshold.
int getTriggerTime()
Getter for trigger time in nsec.
int m_tdcOffset
TDC offset (nsec).
std::string m_xmlMapFileName
Name of the assignment map of FE board channel to the cell.
int m_dataType
Data type of CDC data block.
WireID m_map[300][48]
Assignment map of FE board channel to the cell.
int getDataType()
Getter for CDC data mode.
std::string m_cdcRawHitName
Name of the CDCRawHit dataobject (suppressed mode).
bool m_pedestalSubtraction
Whether pedestal is subtracted (true) or not (false).
void beginRun() override
Begin run action.
bool m_relationRawHits
True if add relation of CDCHits, CDCRawHits, and CDCRawHitWaveForms.
bool m_recoverBoardIdError
Recover boardID error if true, skip information otherwise.
DBObjPtr< CDCADCDeltaPedestals > * m_adcPedestalFromDB
ADC delta pedestal.
int m_boardIDTrig
Board ID for the trigger.
bool m_enableStoreCDCRawHit
Enable/Disable to store CDCRawHit.
int m_tdcAuxOffset
TDC auxiliary offset (nsec).
int getDataLength()
Getter for data length in byte.
int m_dataLength
Data length of the CDC data block (in bytes).
void loadMap()
Load FE channel to cell ID map.
int m_triggerNumber
Trigger number.
WireID getWireID(int iBoard, int iCh) const
Getter of Wire ID.
int m_version
Format version.
CDCUnpackerModule()
Constructor of the module.
bool m_enablePrintOut
Enable/Disable to print out the data to the terminal.
bool isValidBoardChannel(WireID wireId)
Check if the hit wire is valid or not.
std::string m_cdcRawHitWaveFormName
Name of the CDCRawHit dataobject (raw data mode).
void setCDCPacketHeader(const int *buf)
Set CDC Packet header.
virtual ~CDCUnpackerModule()
Destructor of the module.
bool m_enable2ndHit
Enable/Disable to 2nd hit output.
int getBoardId()
Getter for FE board ID.
std::string m_cdcHitName
Tree name of the CDCHit object.
void setADCPedestal()
Set DBobject of ADC delta pedestal.
StoreArray< CDCHit > m_CDCHits
CDC hits.
Class for accessing arrays of objects in the database.
Class for accessing objects in the database.
Accessor to arrays stored in the data store.
Class to identify a wire inside the CDC.
unsigned short getEWire() const
Getter for encoded wire number.
Abstract base class for different kinds of events.