Skip to content

Commit 0523a2f

Browse files
shahor02davidrohr
authored andcommitted
MCH MC->raw: start from HBFUtils.FirstSampledTFIR() rather than HBFUtils.orbitFirst
1 parent 426462c commit 0523a2f

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

Detectors/MUON/MCH/Raw/Encoder/Digit/DigitPayloadEncoder.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void DigitPayloadEncoder::encodeDigits(gsl::span<o2::mch::Digit> digits,
5757
int dualSampaChannelId = optElecId.value().second;
5858
// FIXME : what to put as rel time ?
5959
uint10_t ts = 0;
60-
auto firstIR = o2::raw::HBFUtils::Instance().getFirstIR();
60+
auto firstIR = o2::raw::HBFUtils::Instance().getFirstSampledTFIR();
6161
uint20_t bxCount = sampaBunchCrossingCounter(orbit, bc, firstIR.orbit);
6262
auto clusters = {raw::SampaCluster(ts, bxCount, d.getADC(), d.getNofSamples())};
6363
mEncoder.addChannelData(elecId, dualSampaChannelId, clusters);

Detectors/MUON/MCH/Raw/Encoder/Digit/digits-to-raw.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ int main(int argc, char* argv[])
137137

138138
// here we implicitely assume that this digits-to-raw is only called for
139139
// one timeframe so it's easy to detect the TF start...
140-
uint32_t firstOrbitOfRun = o2::raw::HBFUtils::Instance().orbitFirst;
140+
// RS: why do you need such assumption? In general, it is not correct
141+
uint32_t firstOrbitOfRun = o2::raw::HBFUtils::Instance().getFirstSampledTFIR().orbit; // RS note that this is not anymore 1st orbit of the run but of the 1st filled TF
141142
auto dsElecIds = opts.dummyElecMap ? getAllDs<ElectronicMapperDummy>() : getAllDs<ElectronicMapperGenerated>();
142143
dre.addHeartbeats(dsElecIds, firstOrbitOfRun);
143144

Detectors/MUON/MCH/Raw/Encoder/Payload/PayloadEncoderImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ void PayloadEncoderImpl<FORMAT, CHARGESUM, VERSION>::addHeartbeatHeaders(const s
170170
if (dsids.empty()) {
171171
return;
172172
}
173-
// get first orbit of the run
174-
auto firstIR = o2::raw::HBFUtils::Instance().getFirstIR();
173+
// get first orbit of the TF
174+
auto firstIR = o2::raw::HBFUtils::Instance().getFirstSampledTFIR();
175175
auto sampaBXCount = sampaBunchCrossingCounter(firstIR.orbit, firstIR.bc, firstIR.orbit);
176176
for (auto dsElecId : dsids) {
177177
auto solarId = dsElecId.solarId();

Detectors/MUON/MCH/Raw/test/testClosureCoDec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ std::vector<std::byte> createBuffer(gsl::span<std::string> data,
169169
{
170170
const o2::raw::HBFUtils& hbfutils = o2::raw::HBFUtils::Instance();
171171
o2::conf::ConfigurableParam::setValue<uint32_t>("HBFUtils", "orbitFirst", orbit);
172-
172+
o2::conf::ConfigurableParam::setValue<uint32_t>("HBFUtils", "orbitFirstSampled", orbit);
173173
auto encoder = createPayloadEncoder(createSolar2FeeLinkMapper<ELECMAP>(),
174174
isUserLogicFormat<FORMAT>::value,
175175
VERSION,

0 commit comments

Comments
 (0)