Skip to content

Commit be413cd

Browse files
committed
Demo/test to control completeness of TF and HBF open/close pairing
1 parent c9c1884 commit be413cd

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Common/Utils/test/testHBFUtils.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,27 @@ BOOST_AUTO_TEST_CASE(HBFUtils)
118118
BOOST_CHECK(false); // lost closing RDH?
119119
}
120120

121+
// the TF must be completed, generate HBF till the end of the current TF
122+
int tf = sampler.getTF(irs.back());
123+
auto lastHBIR = sampler.getIRTF(tf + 1) - 1; // last IR of the current TF
124+
sampler.fillHBIRvector(HBIRVec, irs.back(), lastHBIR);
125+
for (const auto& ir : HBIRVec) {
126+
rdh = sampler.createRDH<RDH>(rdhIR);
127+
// dress rdh with cruID/FEE/Link ID ...
128+
rdh.packetCounter = packetCounter++;
129+
rdh.memorySize = sizeof(rdh);
130+
rdh.offsetToNext = sizeof(rdh);
131+
132+
flushRDH(); // open empty HBH
133+
rdh.stop = 0x1;
134+
rdh.pageCnt++;
135+
flushRDH(); // close empty HBF
136+
}
137+
121138
printf("\nN_TF=%d, N_HBF=%d (%d empty), Opened %d / Closed %d\n", nTF, nHBF, nHBFEmpty, nHBFOpen, nHBFClose);
122139
BOOST_CHECK(nHBF > nHBFEmpty);
123140
BOOST_CHECK(nTF > 0);
124141
BOOST_CHECK(nHBFOpen == nHBFClose);
142+
BOOST_CHECK(nHBF == nTF * sampler.getNOrbitsPerTF()); // make sure all TFs are complete
125143
}
126144
} // namespace o2

0 commit comments

Comments
 (0)