20#include <framework/datastore/StoreObjPtr.h>
21#include <framework/datastore/StoreArray.h>
23#include <mdst/dataobjects/TRGSummary.h>
24#include <trg/gdl/dataobjects/TRGGDLDST.h>
25#include <trg/gdl/modules/trggdlDST/trggdlDSTModule.h>
26#include <trg/gdl/modules/trggdlUnpacker/trggdlUnpackerModule.h>
50 for (
int i = 0; i < 320; i++) {
51 LeafBitMap[i] = m_unpacker->getLeafMap(i);
53 for (
int i = 0; i < 320; i++) {
54 strcpy(LeafNames[i], m_unpacker->getLeafnames(i));
65 for (
int i = 0; i < 320; i++) {
66 if (strcmp(LeafNames[i],
"timtype") == 0) _e_timtype = LeafBitMap[i];
67 if (strcmp(LeafNames[i],
"gdll1rvc") == 0) _e_gdll1rvc = LeafBitMap[i];
68 if (strcmp(LeafNames[i],
"coml1rvc") == 0) _e_coml1rvc = LeafBitMap[i];
69 if (strcmp(LeafNames[i],
"toprvc") == 0) _e_toprvc = LeafBitMap[i];
70 if (strcmp(LeafNames[i],
"eclrvc") == 0) _e_eclrvc = LeafBitMap[i];
71 if (strcmp(LeafNames[i],
"cdcrvc") == 0) _e_cdcrvc = LeafBitMap[i];
72 if (strcmp(LeafNames[i],
"toptiming") == 0) _e_toptiming = LeafBitMap[i];
73 if (strcmp(LeafNames[i],
"ecltiming") == 0) _e_ecltiming = LeafBitMap[i];
74 if (strcmp(LeafNames[i],
"cdctiming") == 0) _e_cdctiming = LeafBitMap[i];
82 n_leafs = m_unpacker->getnLeafs();
84 n_leafsExtra = m_unpacker->getnLeafsExtra();
85 int n_clocks = m_unpacker->getnClks();
94 for (
int i = 0; i < 320; i++) {
95 if (strcmp(entAry[0]->m_unpackername[i],
"clk") == 0) clk_map = i;
98 std::vector<std::vector<int> > _data(n_leafs + n_leafsExtra);
99 for (
int leaf = 0; leaf < n_leafs + n_leafsExtra; leaf++) {
100 std::vector<int> _v(n_clocks);
105 for (
int ii = 0; ii < entAry.
getEntries(); ii++) {
106 std::vector<int*> Bits(n_leafs + n_leafsExtra);
108 for (
int i = 0; i < 320; i++) {
109 if (LeafBitMap[i] != -1) {
110 Bits[LeafBitMap[i]] = &(entAry[ii]->m_unpacker[i]);
113 for (
int leaf = 0; leaf < n_leafs + n_leafsExtra; leaf++) {
114 _data[leaf][entAry[ii]->m_unpacker[clk_map]] = *Bits[leaf];
120 GDLResult->setGdlL1Time(_data[_e_gdll1rvc][n_clocks - 1]);
121 GDLResult->setComL1Time(_data[_e_coml1rvc][n_clocks - 1]);
122 GDLResult->setTimsrcGdlTime(_data[_e_toprvc][n_clocks - 1],
123 _data[_e_eclrvc][n_clocks - 1],
124 _data[_e_cdcrvc][n_clocks - 1]);
125 GDLResult->setT0(_data[_e_toptiming][n_clocks - 1],
126 _data[_e_ecltiming][n_clocks - 1],
127 _data[_e_cdctiming][n_clocks - 1]);
130 GDL::EGDLTimingType gtt = (GDL::EGDLTimingType)_data[_e_timtype][0];
132 if (gtt == GDL::e_tt_cdc) {
134 }
else if (gtt == GDL::e_tt_ecl) {
136 }
else if (gtt == GDL::e_tt_top) {
138 }
else if (gtt == GDL::e_tt_dphy) {
140 }
else if (gtt == GDL::e_tt_rand) {
142 }
else if (gtt == GDL::e_tt_psnm) {
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
virtual void initialize() override
initialize
virtual void event() override
Event.
StoreObjPtr< TRGGDLDST > GDLResult
output for TRGDST
TRGGDLDSTModule()
Costructor.
ETimingType
types of trigger timing source defined in b2tt firmware
@ TTYP_DPHY
delayed physics events for background
@ TTYP_SELF
events triggered by self trigger
@ TTYP_NONE
reserved (not defined yet)
@ TTYP_TOP
events triggered by TOP timing
@ TTYP_CDC
events triggered by CDC timing
@ TTYP_ECL
events triggered by ECL timing
@ TTYP_RAND
random trigger events
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.