Skip to content

Commit

Permalink
tfbuilder: log stfsender id with merging errors (FLP number)
Browse files Browse the repository at this point in the history
  • Loading branch information
ironMann committed Oct 27, 2021
1 parent 59a7467 commit d0c1d14
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/TfBuilder/TfBuilderInput.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ void TfBuilderInput::StfMergerThread()

// Add the rest of STFs
for (auto lStfIter = std::next(lStfVector.begin()); lStfIter != lStfVector.end(); ++lStfIter) {
lTf->mergeStf(std::move(lStfIter->mStf));
lTf->mergeStf(std::move(lStfIter->mStf), lStfIter->mStfSenderId);
}
lNumBuiltTfs++;

Expand Down
16 changes: 9 additions & 7 deletions src/common/SubTimeFrameDataModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,29 @@ std::vector<EquipmentIdentifier> SubTimeFrame::getEquipmentIdentifiers() const
return lKeys;
}

void SubTimeFrame::mergeStf(std::unique_ptr<SubTimeFrame> pStf)
void SubTimeFrame::mergeStf(std::unique_ptr<SubTimeFrame> pStf, const std::string &mStfSenderId)
{
// make sure header values match
if (mHeader.mOrigin != pStf->header().mOrigin) {
EDDLOG("Merging STFs error: STF origins do not match origin={} new_origin={}",
mHeader.mOrigin, pStf->header().mOrigin);
EDDLOG_RL(1000, "Merging STFs error: STF origins do not match origin={} new_origin={} new_stfs_id={}",
mHeader.mOrigin, pStf->header().mOrigin, mStfSenderId);
}

if (mHeader.mFirstOrbit != pStf->header().mFirstOrbit) {
EDDLOG("Merging STFs error: STF first orbits do not match firstOrbit={} new_firstOrbit={}",
mHeader.mFirstOrbit, pStf->header().mFirstOrbit);
EDDLOG_RL(1000,"Merging STFs error: STF first orbits do not match firstOrbit={} new_firstOrbit={} diff={} new_stfs_id={}",
mHeader.mFirstOrbit, pStf->header().mFirstOrbit, (std::int64_t(pStf->header().mFirstOrbit) - std::int64_t(mHeader.mFirstOrbit)),
mStfSenderId);
}

// make sure data equipment does not repeat
std::set<EquipmentIdentifier> lUnionSet;
for (const auto& lId : getEquipmentIdentifiers())
for (const auto& lId : getEquipmentIdentifiers()) {
lUnionSet.emplace(lId);
}

for (const auto& lId : pStf->getEquipmentIdentifiers()) {
if (lUnionSet.emplace(lId).second == false /* not inserted */) {
EDDLOG_RL(1000, "Merging STFs error: Equipment already present: fee={}", lId.info());
EDDLOG_RL(1000, "Merging STFs error: Equipment already present: fee={} new_stfs_id={}", lId.info(), mStfSenderId);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/SubTimeFrameDataModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class SubTimeFrame : public IDataModelObject
SubTimeFrame& operator=(SubTimeFrame&& a) = default;

// adopt all data from another STF
void mergeStf(std::unique_ptr<SubTimeFrame> pStf);
void mergeStf(std::unique_ptr<SubTimeFrame> pStf, const std::string &mStfSenderId);

// get data size (not including o2 headers)
std::uint64_t getDataSize() const { updateStf(); return mDataSize; }
Expand Down

0 comments on commit d0c1d14

Please sign in to comment.