12#include "CLHEP/Units/SystemOfUnits.h"
18 const IInterface* parent)
29 declareInterface<IGenParticleSelector>(
this);
45 return StatusCode::SUCCESS;
50 return StatusCode::SUCCESS;
53std::vector<HepMC::ConstGenParticlePtr>*
56 if (! SimTracks)
return nullptr;
58 std::vector<HepMC::ConstGenParticlePtr>* genSignal =
59 new std::vector<HepMC::ConstGenParticlePtr>;
64 for( ; itCollision != SimTracks->
end(); ++itCollision ) {
65 const HepMC::GenEvent* genEvent = *itCollision;
67 for (
const auto& particle: *genEvent) {
73 if(particle->production_vertex() ==
nullptr) {
74 ATH_MSG_WARNING (
"GenParticle without production vertex - simulation corrupt? ");
80 if ( std::abs(particle->production_vertex()->position().perp()) >
m_maxRStartAll ||
81 std::abs(particle->production_vertex()->position().z()) >
m_maxZStartAll )
continue;
86 std::abs(particle->production_vertex()->position().z()) >
m_maxZStartPrimary ) )
continue;
88 int pdgCode = particle->pdg_id();
91 if (std::abs(
charge)<0.5)
continue;
93 if (std::abs(particle->momentum().perp()) >
m_minPt && std::abs(particle->momentum().pseudoRapidity()) <
m_maxEta ) {
94 genSignal->push_back(particle);
#define ATH_MSG_WARNING(x)
double charge(const T &p)
ATLAS-specific HepMC functions.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
InDetReconstructableSelector(const std::string &type, const std::string &name, const IInterface *parent)
bool m_selectPrimariesOnly
float m_maxZStartPrimary
Max Z of start vertex to be considered primary.
virtual StatusCode initialize()
initialize
virtual std::vector< HepMC::ConstGenParticlePtr > * selectGenSignal(const McEventCollection *) const
main method performing the genparticle selection; it works on the entire collection.
virtual StatusCode finalize()
float m_maxZStartAll
Max z of start vertex for primaries + sec.
float m_maxRStartAll
Max R of start vertex for primaries and secondaries.
float m_maxRStartPrimary
Max R of start vertex to be considered primary.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
double charge(const T &p)
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.