Skip to content
Snippets Groups Projects
Commit 757e85b0 authored by Ross John Hunter's avatar Ross John Hunter
Browse files

Dont try to find LHCbIDs of neutral particles

parent 126bdea6
No related branches found
No related tags found
No related merge requests found
Pipeline #3100111 failed
......@@ -70,7 +70,13 @@ void MCTupleToolTOSHLT2::fetchLHCbIDsFromRecoParticle( const LHCb::Particle& par
if ( part.isBasicParticle() ) {
// We can just get the protoparticle and its IDs
bucket_of_ids.emplace_back( part.proto()->track()->lhcbIDs() );
if ( part.proto()->track() == nullptr ){
if ( part.charge() != 0 ) {
error() << "Particle with ID " << part.particleID() << " has charge " << part.charge() << " but no track, therefore cant access LHCbIDs." << endmsg;
} // Dont expect a neutral particle to have a track or hits, so don't look for them
} else {
bucket_of_ids.emplace_back( part.proto()->track()->lhcbIDs() );
}
} else {
const auto& children = part.daughters();
for ( const auto& child : children ) { fetchLHCbIDsFromRecoParticle( *child, bucket_of_ids ); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment