4-nested loop for UTHits
While adapting the PrTrackerDumper to master branch , we realized that the nbUTHits() call does not return the same number of hits which one can count looping through the station/layers/regions/sectors.
Since the boundaries of the loop are hard-coded, it would be better to move the boundaries in a namespace.
We also realized that the PrLHCbID2MCParticle
linker is not using all UT hits to be linked for the PrChecker.
@dovombru is fixing this for the PrTracker Dumper.
@sponce and @decianm , can I ask what is the correct way to loop through all hits in UT ? How many sectors/region/layer stations do we support?
The bit of code i am discussing is in PrLHCbID2MCParticle
is :
const auto* hitHandler = getIfExists<UT::HitHandler>( UT::Info::HitLocation );
if ( hitHandler ) {
for (unsigned int station = 1; station < 3; station++) {
for (unsigned int layer = 1; layer < 3; layer++) {
for (unsigned int region = 1; region < 4; region++) {
for (unsigned int sector = 1; sector < 98; sector++) {
for(const auto& hit : hitHandler->hits(station, layer, region, sector)) {
linkAll( ttLink, lhcbLink, hit.chanID(),
{boost::numeric_cast<unsigned int>(hit.chanID().channelID())});
}
}
}
}
}
} else {
throw std::string("PrLHCbID2MCParticle : could not UTHitHandler");
}
We found that the hitHandler.nbUTHits() matches the counting inside the loop up only if one loops up to sector< 99 instead of 98. Some other piece of code were looping things from 0, triggering seg-faults when used, and we fixed this in PrTrackerDumper, so it may be possible that we have some left-over errors around the code.