FTLiteCluster's 'equals' operator does not check full cluster content
During the development and discussion on the cluster saving, it was noted that the FTLiteCluster's operator==
only checks the cluster's channelID content, and not the other bits: https://gitlab.cern.ch/lhcb/LHCb/-/blob/master/Event/FTEvent/include/Event/FTLiteCluster.h#L52
If this was done for a reason @lohenry , we probably should see why. If it's OK, it would be better to move this to a full comparison (lhs.m_liteCluster == rhs.m_liteCluster
).
If that is fixed we can also simplify some code in the cluster selection / persistence.
The following discussion from !3708 should be addressed:
-
@graven started a discussion: (+2 comments) shouldn't this be a hidden
friend
defined inside the scope ofFTLiteCluster
? It isn't specific to this bit of code, and its correctness is better verifiable when it lives in the same header asFTLiteCluster
-- and at that point, it should just befriend bool operator==(FTLiteCluster const&, FTLiteCluster const&)
(or, in C++20, it should be a member functionbool operator==(FTliteCluster const&) const
ofFTLiteCluster
to allow for the automatic generation of!=
)