ATLAS Offline Software
KinematicSimSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // KinematicSimSelector.cxx, (c) ATLAS Detector software
8 
9 // class include
10 #include "KinematicSimSelector.h"
11 
12 #include "HepPDT/ParticleDataTable.hh"
13 #include "HepPDT/ParticleData.hh"
14 
15 
17 ISF::KinematicSimSelector::KinematicSimSelector(const std::string& t, const std::string& n, const IInterface* p)
20  , m_partPropSvc("PartPropSvc", name())
21 {
22  declareProperty("MinPosEta", m_cut_minPosEta , "Minimum Position Pseudorapidity" );
23  declareProperty("MaxPosEta", m_cut_maxPosEta , "Maximum Position Pseudorapidity" );
24  declareProperty("MinMomEta", m_cut_minMomEta , "Minimum Momentum Pseudorapidity" );
25  declareProperty("MaxMomEta", m_cut_maxMomEta , "Maximum Momentum Pseudorapidity" );
26  declareProperty("MinMom", m_cut_minMom2 , "Minimum Particle Momentum" );
27  declareProperty("MaxMom", m_cut_maxMom2 , "Maximum Particle Momentum" );
28  declareProperty("MaxEkin", m_cut_maxEkin , "Maximum Particle Kinetic Energy" );
29  declareProperty("Charge", m_cut_charge , "Particle Charge" );
30  declareProperty("ParticlePDG", m_cut_pdg , "Particle PDG Code" );
31 }
32 
35 {
36 }
37 
38 // Athena algtool's Hooks
40 {
41  ATH_MSG_VERBOSE("Initializing ...");
42  ATH_CHECK(m_partPropSvc.retrieve());
43 
44  HepPDT::ParticleDataTable* particleDataTable;
45  particleDataTable = (HepPDT::ParticleDataTable*) m_partPropSvc->PDT();
46 
47  if(particleDataTable == 0)
48  {
49  ATH_MSG_ERROR("PDG table not found");
50  return StatusCode::FAILURE;
51  }
52 
53  const HepPDT::ParticleData* data = particleDataTable->particle(HepPDT::ParticleID(abs(m_cut_pdg)));
54 
55  double mass = 0;
56  if(data) mass = data->mass().value();
57 
58 
59  // compute and store the square of the momentum cuts (faster comparisons)
60  if ( !(m_cut_minMom2<0.)) m_cut_minMom2 *= m_cut_minMom2;
61  if ( !(m_cut_maxMom2<0.)) m_cut_maxMom2 *= m_cut_maxMom2;
62 
63  // if use kinetic energy
64  if(!(m_cut_maxEkin < 0.)) m_cut_maxMom2 = m_cut_maxEkin * (m_cut_maxEkin + 2 * mass);
65 
66  return StatusCode::SUCCESS;
67 }
68 
69 
71 {
72  ATH_MSG_VERBOSE("Finalizing ...");
73  return StatusCode::SUCCESS;
74 }
75 
77 {
79 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
ISF::ISFParticle
Definition: ISFParticle.h:42
ISF::KinematicSimSelector::passSelectorCuts
virtual bool passSelectorCuts(const ISFParticle &particle) const override
check whether given particle passes all cuts -> will be used for routing decision
Definition: KinematicSimSelector.cxx:76
ISF::KinematicSimSelector::~KinematicSimSelector
~KinematicSimSelector()
Destructor.
Definition: KinematicSimSelector.cxx:34
ISF::KinematicSimSelector::KinematicSimSelector
KinematicSimSelector(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition: KinematicSimSelector.cxx:17
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::BaseSimulationSelector
Definition: BaseSimulationSelector.h:31
ISF::KinematicSimSelector::initialize
virtual StatusCode initialize() override
Definition: KinematicSimSelector.cxx:39
ISF::KinematicParticleCuts::m_cut_charge
float m_cut_charge
particle charge
Definition: KinematicParticleCuts.h:43
ISF::KinematicParticleCuts::m_cut_maxMomEta
float m_cut_maxMomEta
maximum pseudorapidity of particle momentum
Definition: KinematicParticleCuts.h:39
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISF::KinematicParticleCuts::m_cut_minMomEta
float m_cut_minMomEta
minimum pseudorapidity of particle momentum
Definition: KinematicParticleCuts.h:38
ISF::KinematicParticleCuts::pass
bool pass(const ISFParticle &particle) const
check whether the given particle passes all cuts
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ISF::KinematicParticleCuts::m_cut_maxEkin
double m_cut_maxEkin
maximum particle kinetic energy
Definition: KinematicParticleCuts.h:42
ISF::KinematicSimSelector::finalize
virtual StatusCode finalize() override
Definition: KinematicSimSelector.cxx:70
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ISF::KinematicParticleCuts::m_cut_pdg
int m_cut_pdg
particle PDG code
Definition: KinematicParticleCuts.h:44
ISF::KinematicParticleCuts::m_cut_maxPosEta
float m_cut_maxPosEta
maximum pseudorapidity of particle position
Definition: KinematicParticleCuts.h:37
ISF::KinematicParticleCuts::m_cut_minMom2
double m_cut_minMom2
minimum squarde particle momentum magnitude
Definition: KinematicParticleCuts.h:40
ISF::KinematicParticleCuts::m_cut_maxMom2
double m_cut_maxMom2
maximum squared particle momentum magnitude
Definition: KinematicParticleCuts.h:41
KinematicSimSelector.h
ISF::KinematicParticleCuts::m_cut_minPosEta
float m_cut_minPosEta
minimum pseudorapidity of particle position
Definition: KinematicParticleCuts.h:36
ISF::KinematicParticleCuts
Definition: KinematicParticleCuts.h:23