14 #include <trg/cdc/modules/trgcdcetfUnpacker/TRGCDCETFUnpackerModule.h>
18 using namespace TRGCDCETFUNPACKERSPACE;
23 string TRGCDCETFUnpackerModule::version()
const
25 return string(
"1.00");
28 TRGCDCETFUnpackerModule::TRGCDCETFUnpackerModule()
32 string desc =
"TRGCDCETFUnpackerModule(" +
version() +
")";
34 B2INFO(
"TRGCDCETFUnpacker: Constructor done.");
62 for (
int i = 0; i < raw_trgarray.
getEntries(); i++) {
63 for (
int j = 0; j < raw_trgarray[i]->GetNumEntries(); j++) {
64 if (raw_trgarray[i]->GetNodeID(j) == 0x15000001) {
65 if (raw_trgarray[i]->GetDetectorNwords(j, 1) > 0) {
76 const unsigned nword_header = 3;
79 for (
int clk = 0; clk < nClks; clk++) {
82 int ntups =
m_store.getEntries() - 1;
83 int* bitArray[nLeafs + nLeafsExtra];
84 setLeafPointersArray(
m_store[ntups], bitArray);
85 for (
int l = 0; l < nLeafs + nLeafsExtra; l++) *bitArray[l] = 0;
89 m_store[ntups]->m_firmid = buf[0];
90 m_store[ntups]->m_firmvers = buf[1];
114 for (
unsigned _wd = 0; _wd < nBits / 32; _wd++) {
115 int wd = buf[clk * (nBits / 32) + _wd + nword_header];
116 for (
int bb = 0; bb < 32; bb++) {
117 if ((wd >> (31 - bb)) & 1) {
118 int bitPosition = (nBits - 1) - _wd * 32 - bb;
120 leaf < nLeafs; leaf++) {
121 int bitMaxOfTheLeaf = BitMap[leaf][0];
122 int bitWidOfTheLeaf = BitMap[leaf][1];
123 int bitMinOfTheLeaf = bitMaxOfTheLeaf - bitWidOfTheLeaf;
124 if (bitMinOfTheLeaf <= bitPosition && bitPosition <= bitMaxOfTheLeaf) {
125 *bitArray[leaf] |= (1 << (bitPosition - bitMinOfTheLeaf));