sphenix-tracking-l AT lists.bnl.gov
Subject: sPHENIX tracking discussion
List archive
[Sphenix-tracking-l] Cluster Container Key Addresses Bug (?)
- From: "Osborn, Joseph" <josborn1 AT bnl.gov>
- To: Anthony Frawley via sPHENIX-tracking-l <sphenix-tracking-l AT lists.bnl.gov>
- Subject: [Sphenix-tracking-l] Cluster Container Key Addresses Bug (?)
- Date: Wed, 30 Nov 2022 18:36:59 +0000
Hi all,
As discussed in the tracking meeting yesterday, I have been struggling to identify a bug in some code related to the way Acts looks up our TrkrCluster object. In the track fitting module, we create a map of Acts::Trajectories which are the Acts track object
and stick it on the node tree. The trajectory object has the ability to iterate through the states and source links, which are the Kalman filter fit states and measurement objects. If I do this iteration in the track fitting module where the Acts::Trajectory
is created, I get the exact same cluster keys back as I put in at their creation from the source link object. However, if I do the same thing in a different fun4all module right after the track fitting module, the cluster keys returned are not the correct
ones. The addresses that Acts stores are the same though. After discussion with the Acts developers, I learned that Acts only stores the address of the source link information for performance reasons. So Acts is looking in the right place and finding the wrong
cluster key.
As it turns out, I can reproduce this behavior with the following block of code:
auto cluscontainer = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
for(const auto hskey : { TrkrDefs::TrkrId::mvtxId, TrkrDefs::TrkrId::inttId, TrkrDefs::TrkrId::tpcId, TrkrDefs::TrkrId::micromegasId})
{
for(const auto& hitsetkey:cluscontainer->getHitSetKeys(hskey))
{
auto range = cluscontainer->getClusters(hitsetkey);
for( auto clusIter = range.first; clusIter != range.second; ++clusIter )
{
const TrkrDefs::cluskey cluskey = clusIter->first;
std::cout << "container key "<< cluskey << " and address " << &cluskey << std::endl;
}
}
}
If I run this same block of code in two different modules, the same cluster key values return different addresses. So, the reason that Acts can't find the key is because the content that an address is holding has changed.
Is this expected behavior? Is this a result of our change to vectorized containers?
___________________________
Joe Osborn, Ph.D
Physics Department
Brookhaven National Laboratory
josborn1 AT bnl.gov
- [Sphenix-tracking-l] Cluster Container Key Addresses Bug (?), Osborn, Joseph, 11/30/2022
Archive powered by MHonArc 2.6.24.