 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "CLHEP/Geometry/Point3D.h"
13 #include "CLHEP/Units/SystemOfUnits.h"
23 m_maxRStartAll ( 800.0*
CLHEP::
mm),
24 m_maxZStartAll (2000.0*
CLHEP::
mm)
27 declareInterface<IGenParticleSelector>(
this);
40 return StatusCode::SUCCESS;
45 return StatusCode::SUCCESS;
48 std::vector<HepMC::ConstGenParticlePtr>*
51 if (! SimTracks)
return nullptr;
53 std::vector<HepMC::ConstGenParticlePtr>* genSignal =
54 new std::vector<HepMC::ConstGenParticlePtr>;
58 for( ; itCollision != SimTracks->
end(); ++itCollision ) {
59 const HepMC::GenEvent* genEvent = *itCollision;
61 for (
const auto&
particle: *genEvent) {
67 ATH_MSG_WARNING (
"GenParticle without production vertex - simulation corrupt? ");
73 if ( std::fabs(
particle->production_vertex()->position().perp()) > m_maxRStartAll ||
74 std::fabs(
particle->production_vertex()->position().z()) > m_maxZStartAll )
continue;
81 auto prodVertex =
particle->production_vertex();
82 if ( std::abs(pdgCode) == 11 ) {
83 ATH_MSG_DEBUG (
"Electron/Positron detected -- checking for production process ...");
85 for (
const auto& inParticle: prodVertex->particles_in()) {
87 HepMC::GenVertex::particles_in_const_iterator ItinParticle = prodVertex->particles_in_const_begin();
88 HepMC::GenVertex::particles_out_const_iterator ItinParticleEnd = prodVertex->particles_in_const_end();
89 for ( ; ItinParticle != ItinParticleEnd; ++ItinParticle) {
90 auto inParticle=*ItinParticle;
94 if (std::fabs(
particle->momentum().perp()) > m_minPt && std::fabs(
particle->momentum().pseudoRapidity()) < m_maxEta ) {
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
float m_maxRStartAll
Max R of start vertex for primaries and secondaries.
InDetPrimaryConversionSelector(const std::string &type, const std::string &name, const IInterface *parent)
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode finalize()
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
float m_maxZStartAll
Max z of start vertex for primaries + sec.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
#define ATH_MSG_WARNING(x)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
virtual std::vector< HepMC::ConstGenParticlePtr > * selectGenSignal(const McEventCollection *) const
main method performing the genparticle selection; it works on the entire collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual StatusCode initialize()
initialize