11#include <framework/core/Module.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/datastore/StoreObjPtr.h>
14#include <framework/database/DBObjPtr.h>
15#include <framework/database/PayloadFile.h>
16#include <framework/dbobjects/HardwareClockSettings.h>
18#include <svd/geometry/SensorInfo.h>
19#include <vxd/dataobjects/VxdID.h>
20#include <rawdata/dataobjects/RawSVD.h>
21#include <svd/dataobjects/SVDShaperDigit.h>
22#include <svd/dataobjects/SVDTransparentDigit.h>
23#include <svd/dataobjects/SVDDAQDiagnostic.h>
24#include <svd/dataobjects/SVDEventInfo.h>
25#include <svd/dataobjects/SVDTriggerType.h>
26#include <svd/dbobjects/SVDGlobalConfigParameters.h>
27#include <svd/online/SVDOnlineToOfflineMap.h>
28#include <svd/online/SVDStripNoiseMap.h>
29#include <framework/dataobjects/EventMetaData.h>
57 virtual void event()
override;
58 virtual void endRun()
override;
74 std::unordered_multimap<unsigned char, unsigned char>*
APVmap;
77 std::unique_ptr<SVDOnlineToOfflineMap>
m_map;
92 void printB2Debug(uint32_t* data32, uint32_t* data32_min, uint32_t* data32_max,
int nWords);
230 std::map<std::pair<unsigned short, unsigned short>, std::pair<std::size_t, std::size_t> >
m_missingAPVs;
233 std::map<std::pair<unsigned short, unsigned short>, std::pair<std::size_t, std::size_t> >
m_upsetAPVs;
Class for accessing objects in the database.
Class to store SVD mode information.
Class to store Trigger Type information.
SVDUnpackerModule: The SVD Raw Hits Decoder.
int m_wrongFTBcrc
FTB CRC no-Match counter.
StoreArray< SVDDAQDiagnostic > m_storeDAQDiagnostics
SVDDAQDiagnostic array.
virtual ~SVDUnpackerModule()
Destructor of the module.
unsigned short seenHeadersAndTrailers
this 4-bits value should be 1111 if no headers/trailers are missing
int m_shutUpFTBError
regulates the number of "Event number mismatch" errors reported
MainHeader m_MainHeader
Implementation of FADC Header.
StoreArray< RawSVD > m_rawSVD
output for RawSVD
FADCTrailer m_FADCTrailer
Implementation of FADC Trailer.
StoreObjPtr< SVDEventInfo > m_svdEventInfoPtr
SVDEventInfo output per event.
virtual void initialize() override
Initializes the Module.
StoreArray< SVDShaperDigit > m_storeShaperDigits
SVDShaperDigit array.
virtual void event() override
event
SVDUnpackerModule()
Constructor of the module.
int nAPVErrors
counter of APV errors
FTBHeader m_FTBHeader
Implementation of FTB Header.
virtual void endRun() override
end run
std::string m_rawSVDListName
RawSVD StoreArray name.
DBObjPtr< PayloadFile > m_mapping
pointer to the payload with the mapping
int nFADCMatchErrors
counter of FADC boards =/= n of RawData objects errors
bool m_killUpsetDigits
Optionally, we can kill digits coming from upset APVs right in the unpacker.
data_B m_data_B
Implementation of 2nd data word.
int m_FADCTriggerNumberOffset
FADC Trigger Offset.
std::map< std::pair< unsigned short, unsigned short >, std::pair< std::size_t, std::size_t > > m_missingAPVs
Map to store a list of missing APVs.
int nMissingAPVsErrors
counter of missing APVs errors
static std::string m_xmlFileName
XML filename.
int nEventMatchErrors
counter of Event match errors
FTBTrailer m_FTBTrailer
Implementation of FTB Trailer.
int m_errorRate
The parameter that indicates what fraction of B2ERRORs messages should be suppressed to not overload ...
APVHeader m_APVHeader
Implementation of APV Header.
int nUpsetAPVsErrors
counter of upset APV errors
void printB2Debug(uint32_t *data32, uint32_t *data32_min, uint32_t *data32_max, int nWords)
additional function that prints raw data words
virtual void beginRun() override
begin run
std::string m_svdShaperDigitListName
SVDShaperDigit StoreArray name.
DBObjPtr< HardwareClockSettings > m_hwClock
system clock
std::string m_svdEventInfoName
SVDEventInfo name.
DBObjPtr< SVDGlobalConfigParameters > m_svdGlobalConfig
SVDGlobal Configuration payload.
bool m_printRaw
Optionally we can get printout of Raw Data words.
int nEventInfoMatchErrors
counter of inconsistencies in SVDEventInfo within an event
bool m_badMappingFatal
Optionally we can stop the unpacking if there is a missing APV/FADC combination in the mapping -> wro...
int nErrorFieldErrors
counter of event mismatch errors in FTB's ErrorField
data_A m_data_A
Implementation of 1st data word.
uint32_t m_data32
Input 32-bit data word.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
Required input for EventMetaData.
bool m_silentAppend
Silently append new SVDShaperDigits to a pre-existing non-empty SVDShaperDigits storeArray.
std::unordered_multimap< unsigned char, unsigned char > * APVmap
pointer to APVforFADCmap filled by mapping procedure
SVDTriggerType m_SVDTriggerType
SVDTriggerType object.
SVDModeByte m_SVDModeByte
instance of SVDModeByte for the event
std::unique_ptr< SVDOnlineToOfflineMap > m_map
Pointer to online-to-offline map.
int m_relativeTimeShift
latency difference between the 3- and 6-sample acquired events in usint of APV clock / 4,...
std::map< std::pair< unsigned short, unsigned short >, std::pair< std::size_t, std::size_t > > m_upsetAPVs
Map to store a list of upset APVs.
int nFTBFlagsErrors
counter of errors in FTBFlags variable
bool m_emulatePipelineAddress
Software emulation of pipeline address This is a replacement of hardware pipeline address emulation.
std::string m_svdDAQDiagnosticsListName
SVDDAQDiagnostic StoreArray name.
int nTriggerMatchErrors
counters for specific ERRORS produced by the Unpacker
unsigned short nFADCboards
how many FADCs we have
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
Namespace to encapsulate code needed for simulation and reconstrucion of the SVD.
implementation of FADC Trailer
unsigned int apvErrOR
APV Errors Field OR.
unsigned int check
MSB "1110" - for FADC Trailer identification.
unsigned int nullDigits
"0000000"
unsigned int FTBFlags
FTB Flags Field.
unsigned int dataSizeCut
APV data-size cut flag
implementation of FTB Trailer
unsigned int controlWord
MSB "ff55" - FADC Trailer ID.
unsigned int crc16
FTB CRC16 Checksum
implementation of FADC Header
unsigned int DAQType
(from 2020c) Event type(0): "0"…3 or …6 acquisition mode, "1"…3-mixed-6 acquisition mode
unsigned int runType
Run Type.
unsigned int FADCnum
FADC number.
unsigned int xTalk
cross talk tag
unsigned int check
MSB "110" - for FADC Header identification.
unsigned int trgNumber
Trigger Number.
unsigned int trgTiming
Trigger Timing.
unsigned int DAQMode
Event type(2:1): "00"…1-sample, "01"…3-sample, "10"…6-sample.
unsigned int trgType
Trigger Type.
implementation of the first data word
unsigned int sample3
3rd data sample
unsigned int stripNum
Strip number.
unsigned int sample2
2nd data sample
unsigned int check
MSB "1" - for Data word identification.
unsigned int sample1
1st data sample
implementation of the second data word
unsigned int sample6
6th data sample
unsigned int stripNum
Strip number.
unsigned int check
MSB "1" - for Data word identification.
unsigned int sample4
4th data sample
unsigned int sample5
5th data sample