diff --git a/Phys/DecayTreeTuple/src/MCTupleToolTOSHLT2.cpp b/Phys/DecayTreeTuple/src/MCTupleToolTOSHLT2.cpp index b62c82f98c67a6034d9ec0091f2742d25a716eab..970f20bbb2ff248de27b0cb3ae5ac91f77d59b9a 100644 --- a/Phys/DecayTreeTuple/src/MCTupleToolTOSHLT2.cpp +++ b/Phys/DecayTreeTuple/src/MCTupleToolTOSHLT2.cpp @@ -70,7 +70,14 @@ 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.charge() == 0 ) { + warning() << "Particle with ID " << part.particleID() + << " is neutral, so has no track. Adding empty container of LHCbIDs to this candidate for this track." + << endmsg; + bucket_of_ids.emplace_back(); + } 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 ); }