ATLAS Offline Software
GenParticleFinalStateFilter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // GenParticleFinalStateFilter.cxx, (c) ATLAS Detector software
8 
9 // class header include
11 
12 // TruthUtils include
14 
15 // HepMC includes
16 #include "AtlasHepMC/GenParticle.h"
17 
18 
21  const std::string& n,
22  const IInterface* p )
23  : base_class(t,n,p),
24  m_checkGenSimStable(true),
25  m_checkGenInteracting(true)
26 {
27  // different options
28  declareProperty("CheckGenSimStable", m_checkGenSimStable);
29  declareProperty("CheckGenInteracting", m_checkGenInteracting);
30 }
31 
32 
33 // Athena algtool's Hooks
35 {
36  ATH_MSG_VERBOSE("Initializing ...");
37  return StatusCode::SUCCESS;
38 }
39 
40 
42 #ifdef HEPMC3
44 {
45  bool passFilter = true;
47  passFilter &= (!m_checkGenSimStable) || MC::isSimStable(particle);
48  passFilter &= (!m_checkGenInteracting) || MC::isSimInteracting(particle);
49  return passFilter;
50 }
51 
52 #else
54 {
55  bool passFilter = true;
57  passFilter &= (!m_checkGenSimStable) || MC::isSimStable(&particle);
58  passFilter &= (!m_checkGenInteracting) || MC::isSimInteracting(&particle);
59 
60  return passFilter;
61 }
62 #endif
63 
64 
66 {
67  ATH_MSG_VERBOSE("Finalizing ...");
68  return StatusCode::SUCCESS;
69 }
70 
ISF::GenParticleFinalStateFilter::finalize
StatusCode finalize()
Definition: GenParticleFinalStateFilter.cxx:65
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ISF::GenParticleFinalStateFilter::initialize
StatusCode initialize()
Athena algtool's Hooks.
Definition: GenParticleFinalStateFilter.cxx:34
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
covarianceTool.passFilter
bool passFilter
Definition: covarianceTool.py:604
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::GenParticleFinalStateFilter::GenParticleFinalStateFilter
GenParticleFinalStateFilter(const std::string &t, const std::string &n, const IInterface *p)
Constructor.
Definition: GenParticleFinalStateFilter.cxx:20
GenParticle.h
ISF::GenParticleFinalStateFilter::pass
bool pass(const HepMC::GenParticle &particle) const
Returns the Particle Stack, should register truth.
Definition: GenParticleFinalStateFilter.cxx:53
ISF::GenParticleFinalStateFilter::m_checkGenInteracting
bool m_checkGenInteracting
boolean switch to check on gen interacting
Definition: GenParticleFinalStateFilter.h:54
MC::isFinalState
bool isFinalState(const T &p)
Definition: HepMCHelpers.h:31
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
ISF::GenParticleFinalStateFilter::m_checkGenSimStable
bool m_checkGenSimStable
boolean switch to check on sim stable
Definition: GenParticleFinalStateFilter.h:53
MC::isSimInteracting
bool isSimInteracting(const T &p)
Identify if the particle could interact with the detector during the simulation, e....
Definition: HepMCHelpers.h:42
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
GenParticleFinalStateFilter.h
MC::isSimStable
bool isSimStable(const T &p)
Identify if the particle is considered stable at the post-detector-sim stage.
Definition: HepMCHelpers.h:39
HepMCHelpers.h
GenParticle
@ GenParticle
Definition: TruthClasses.h:30