ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
ISF::GenParticleInteractingFilter Class Referencefinal

#include <GenParticleInteractingFilter.h>

Inheritance diagram for ISF::GenParticleInteractingFilter:
Collaboration diagram for ISF::GenParticleInteractingFilter:

Public Member Functions

 GenParticleInteractingFilter (const std::string &t, const std::string &n, const IInterface *p)
 Constructor. More...
 
 ~GenParticleInteractingFilter ()
 Destructor. More...
 
virtual StatusCode initialize () override
 Framework methods. More...
 
virtual bool pass (const HepMC::GenParticle &particle) const override
 passes through to the private version More...
 

Public Attributes

std::vector< int > m_additionalInteractingParticleTypes
 Additional PDG codes to classify as interacting. More...
 
std::vector< int > m_additionalNonInteractingParticleTypes
 Additional PDG codes to classify as non-interacting. More...
 

Detailed Description

Stable/Interacting particle filter for HepMC particles to be used in the stack filling process. Checks this particle for interacting (not nu/G/LSP/whatever).

Author
ZLMarshall -at- lbl.gov

Definition at line 33 of file GenParticleInteractingFilter.h.

Constructor & Destructor Documentation

◆ GenParticleInteractingFilter()

ISF::GenParticleInteractingFilter::GenParticleInteractingFilter ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor.

Definition at line 20 of file GenParticleInteractingFilter.cxx.

23  : base_class(t,n,p)
24 {
25  declareProperty("AdditionalInteractingParticleTypes", m_additionalInteractingParticleTypes);
26  declareProperty("AdditionalNonInteractingParticleTypes", m_additionalNonInteractingParticleTypes);
27 }

◆ ~GenParticleInteractingFilter()

ISF::GenParticleInteractingFilter::~GenParticleInteractingFilter ( )
inline

Destructor.

Definition at line 40 of file GenParticleInteractingFilter.h.

40 {}

Member Function Documentation

◆ initialize()

StatusCode ISF::GenParticleInteractingFilter::initialize ( )
overridevirtual

Framework methods.

Definition at line 29 of file GenParticleInteractingFilter.cxx.

30 {
32  ATH_MSG_DEBUG("No additional particle types will be classified as interacting.");
33  }
34  else {
35  ATH_MSG_DEBUG("Will classify particles with the following additional PDG codes as interacting:");
36  for(const auto& pdg_id : m_additionalInteractingParticleTypes) {
37  ATH_MSG_DEBUG(" " << pdg_id);
38  }
39  }
41  ATH_MSG_DEBUG("No additional particle types will be classified as non-interacting.");
42  }
43  else {
44  ATH_MSG_DEBUG("Will classify particles with the following additional PDG codes as non-interacting:");
45  for(const auto& pdg_id : m_additionalNonInteractingParticleTypes) {
46  ATH_MSG_DEBUG(" " << pdg_id);
47  }
48  }
50  //Insanity check
51  bool clash(false);
52  for (const auto& pdg_id : m_additionalInteractingParticleTypes) {
56  {
57  ATH_MSG_ERROR("Particle with PDG code " << pdg_id << " requested to be classified as both interacting and non-interacting.");
58  clash=true;
59  }
60  }
61  if (clash) {
62  ATH_MSG_ERROR("Please check your configuration!");
63  return StatusCode::FAILURE;
64  }
65  }
66 
67  return StatusCode::SUCCESS;
68 }

◆ pass()

bool ISF::GenParticleInteractingFilter::pass ( const HepMC::GenParticle particle) const
overridevirtual

passes through to the private version

passes through to the private version of the filter

Definition at line 75 of file GenParticleInteractingFilter.cxx.

75  {
76  const int pdg_id = particle.pdg_id();
77 #endif
80  pdg_id) != m_additionalInteractingParticleTypes.end();
81  const bool isNonInteracting = find(m_additionalNonInteractingParticleTypes.begin(),
84  return !( !MC::isInteracting( pdg_id ) || isNonInteracting) || isInteracting;
85 }

Member Data Documentation

◆ m_additionalInteractingParticleTypes

std::vector<int> ISF::GenParticleInteractingFilter::m_additionalInteractingParticleTypes

Additional PDG codes to classify as interacting.

Definition at line 54 of file GenParticleInteractingFilter.h.

◆ m_additionalNonInteractingParticleTypes

std::vector<int> ISF::GenParticleInteractingFilter::m_additionalNonInteractingParticleTypes

Additional PDG codes to classify as non-interacting.

Definition at line 57 of file GenParticleInteractingFilter.h.


The documentation for this class was generated from the following files:
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
ISF::GenParticleInteractingFilter::m_additionalNonInteractingParticleTypes
std::vector< int > m_additionalNonInteractingParticleTypes
Additional PDG codes to classify as non-interacting.
Definition: GenParticleInteractingFilter.h:57
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISF::GenParticleInteractingFilter::m_additionalInteractingParticleTypes
std::vector< int > m_additionalInteractingParticleTypes
Additional PDG codes to classify as interacting.
Definition: GenParticleInteractingFilter.h:54
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
MC::isInteracting
bool isInteracting(const T &p)
Identify if the particle with given PDG ID would not interact with the detector, i....
Definition: HepMCHelpers.h:23