9 #include "Gaudi/Property.h"
31 ATH_CHECK(m_filterParams.initialize(
false));
32 ATH_MSG_VERBOSE (
"--------------------------------------------------------" );
35 if (!m_genParticleCommonFilters.empty())
ATH_CHECK(m_genParticleCommonFilters.retrieve());
36 if (!m_genParticleOldFilters.empty() )
ATH_CHECK(m_genParticleOldFilters.retrieve());
37 if (!m_genParticleNewFilters.empty() )
ATH_CHECK(m_genParticleNewFilters.retrieve());
39 ATH_CHECK( m_inputHardScatterEvgenKey.initialize() );
42 return StatusCode::SUCCESS;
50 ATH_MSG_VERBOSE(
" =====================================================================");
52 return StatusCode::SUCCESS;
63 for (
const auto&
filter : filters ) {
72 :
"false, will remove particle."));
86 if (!inputHardScatterEvgen.
isValid()) {
87 ATH_MSG_FATAL(
"Unable to read input GenEvent collection '" << inputHardScatterEvgen.
key() <<
"'");
88 return StatusCode::FAILURE;
93 for (
const HepMC::GenEvent* eventPtr : *inputHardScatterEvgen ) {
95 if (eventPtr ==
nullptr) {
continue; }
99 " and event_number=" << eventPtr->event_number() );
100 for (
auto p : *eventPtr) {
103 bool b_common = passesFilters(
p,m_genParticleCommonFilters);
105 bool b_old = passesFilters(
p,m_genParticleOldFilters);
107 bool b_new = passesFilters(
p,m_genParticleNewFilters);
109 if ( b_common && (b_old!=b_new) ) {
112 if ( b_common && m_genParticleOldFilters.empty() && m_genParticleNewFilters.empty()) {
116 ATH_MSG_DEBUG(
"Different result for particle "<<
p<<
" common="<<b_common<<
" old="<<b_old<<
" new="<<b_new);
117 if (
p->production_vertex ()) {
120 if (
p->end_vertex ()) {
124 for (
const auto&
filter : m_genParticleCommonFilters ) {
133 :
"false, will remove particle."));
135 for (
const auto&
filter : m_genParticleOldFilters ) {
144 :
"false, will remove particle."));
146 for (
const auto&
filter : m_genParticleNewFilters ) {
155 :
"false, will remove particle."));
163 ATH_MSG_DEBUG (
"End SimEventFilter, difference in filters: "<<(pass ?
"found" :
"not found")<<
"="<<pass<<
", invert="<<m_invertfilter);
165 if (m_invertfilter) {
171 return StatusCode::SUCCESS;
173 #endif // SimEventFilter currently will not compile in the AthSimulation Project