Skip to content
Snippets Groups Projects
Commit 97690ba8 authored by Simone Capelli's avatar Simone Capelli Committed by Miroslav Saur
Browse files

Changes to MCParticle pointer handling and new Charge() method

parent 50d471b7
No related branches found
No related tags found
2 merge requests!4679Synchronize master branch with 2024-patches,!4383Changes to MCParticle pointer handling and new Charge() method
......@@ -274,6 +274,16 @@ namespace LHCb::Event {
return pid( *item );
}
template <typename T>
auto charge( T const& item ) -> decltype( item.charge() ) {
return item.charge();
}
template <typename T>
auto charge( T const& item ) -> details::require_pointer_t<T, decltype( charge( *item ) )> {
details::check_null_pointer( item, __PRETTY_FUNCTION__ );
return charge( *item );
}
template <typename T>
auto decayProducts( T const& item ) -> decltype( item.decayProducts() ) {
// return a 'range' of decay products, i.e. something
......
......@@ -269,6 +269,8 @@ namespace LHCb {
friend auto pid( const MCParticle& p ) { return p.particleID().pid(); }
friend auto charge( const MCParticle& p ) { return p.particleID().threeCharge() / 3; };
private:
Gaudi::LorentzVector m_momentum{0.0, 0.0, 0.0, -1 * Gaudi::Units::GeV}; ///< 4-momentum-vector
LHCb::ParticleID m_particleID{0}; ///< Particle ID
......
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