14 #include "CLHEP/Geometry/Point3D.h"
15 #include "CLHEP/Units/SystemOfUnits.h"
16 #include "HepPDT/ParticleData.hh"
17 #include "GaudiKernel/IPartPropSvc.h"
25 m_particleDataTable{},
32 declareInterface<IGenParticleSelector>(
this);
36 declareProperty(
"MaxRStartAll", m_maxRStartAll,
"production vtx r for all");
37 declareProperty(
"MaxZStartAll", m_maxZStartAll,
"production vtx z for all");
46 IPartPropSvc* partPropSvc =
nullptr;
47 StatusCode sc = service(
"PartPropSvc", partPropSvc,
true);
49 ATH_MSG_FATAL (
" Could not initialize Particle Properties Service");
50 return StatusCode::FAILURE;
52 m_particleDataTable = partPropSvc->PDT();
55 return StatusCode::SUCCESS;
60 return StatusCode::SUCCESS;
63 std::vector<HepMC::ConstGenParticlePtr>*
66 if (! SimTracks)
return nullptr;
68 std::vector<HepMC::ConstGenParticlePtr>* genSignal =
69 new std::vector<HepMC::ConstGenParticlePtr>;
73 for( ; itCollision != SimTracks->
end(); ++itCollision ) {
74 const HepMC::GenEvent* genEvent = *itCollision;
76 for (
const auto&
particle: *genEvent) {
82 ATH_MSG_WARNING (
"GenParticle without production vertex - simulation corrupt? ");
88 if ( std::fabs(
particle->production_vertex()->position().perp()) > m_maxRStartAll ||
89 std::fabs(
particle->production_vertex()->position().z()) > m_maxZStartAll )
continue;
93 const HepPDT::ParticleData* pd = m_particleDataTable->particle(abs(pdgCode));
103 auto prodVertex =
particle->production_vertex();
104 if ( std::abs(pdgCode) == 11 ) {
105 ATH_MSG_DEBUG (
"Electron/Positron detected -- checking for production process ...");
107 for (
const auto& inParticle: prodVertex->particles_in()) {
109 HepMC::GenVertex::particles_in_const_iterator ItinParticle = prodVertex->particles_in_const_begin();
110 HepMC::GenVertex::particles_out_const_iterator ItinParticleEnd = prodVertex->particles_in_const_end();
111 for ( ; ItinParticle != ItinParticleEnd; ++ItinParticle) {
112 auto inParticle=*ItinParticle;
116 if (std::fabs(
particle->momentum().perp()) > m_minPt && std::fabs(
particle->momentum().pseudoRapidity()) < m_maxEta ) {