ATLAS Offline Software
AthTruthSelectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETPHYSVALMONITORING_ATHTRUTHSELECTIONTOOL_H
6 #define INDETPHYSVALMONITORING_ATHTRUTHSELECTIONTOOL_H
7 
15 // STL includes
16 #include <string>
18 #include "xAODTruth/TruthParticle.h" // typedef, can't fwd declare
21 #include "GaudiKernel/ToolHandle.h"
25 
26 
28 class AthTruthSelectionTool: virtual public IAthSelectionTool, public AthAlgTool {
29 public:
30  AthTruthSelectionTool(const std::string& type, const std::string& name, const IInterface* parent);
32  /*nop*/
33  };
34  StatusCode initialize() final;
35  StatusCode finalize() final;
36 
37  virtual IAthSelectionTool::CutResult
39 
40  virtual IAthSelectionTool::CutResult
41  testAllCuts(const xAOD::IParticle * p, std::vector<unsigned int> &counter) const final;
42 
43  unsigned int nCuts() const final {
44  return m_cutList.size();
45  }
46 
47  std::vector<std::string> names() const final;
48 
49 private:
51  // Cut values;
52  float m_maxEta;
53  float m_maxPt;
54  float m_minPt;
60  // max decay radius for secondaries [mm];
61  // set to within (Run2) pixel by default
63  int m_pdgId;
66  std::vector<unsigned int> m_counters;
67  std::vector<int> m_ancestors;
68 
69  /* \defgroup Selection on extrapolated particle to cylinder or disk surface
70  * @{
71  */
75  float m_zDisc;
78 
79  //cache surfaces
80  std::unique_ptr<Trk::CylinderSurface> m_cylinder;
81  std::unique_ptr<Trk::DiscSurface> m_disc1;
82  std::unique_ptr<Trk::DiscSurface> m_disc2;
83 
84 
85  /* @} */
86 
88  PublicToolHandle<Trk::IExtrapolator> m_extrapolator
89  {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
90 
91 };
92 
93 
94 #endif
AthTruthSelectionTool::m_grandparent
bool m_grandparent
Definition: AthTruthSelectionTool.h:64
AthTruthSelectionTool::~AthTruthSelectionTool
virtual ~AthTruthSelectionTool()
Definition: AthTruthSelectionTool.h:31
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
AthTruthSelectionTool::m_cylinder
std::unique_ptr< Trk::CylinderSurface > m_cylinder
Definition: AthTruthSelectionTool.h:80
AthTruthSelectionTool::finalize
StatusCode finalize() final
Definition: AthTruthSelectionTool.cxx:260
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
AthTruthSelectionTool::m_pdgId
int m_pdgId
Definition: AthTruthSelectionTool.h:63
AthTruthSelectionTool::m_radiusCylinder
float m_radiusCylinder
for cylinder topology: radius of cylinder
Definition: AthTruthSelectionTool.h:72
IExtrapolator.h
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
IAthSelectionTool.h
AthTruthSelectionTool::m_requireStable
bool m_requireStable
Definition: AthTruthSelectionTool.h:58
AthTruthSelectionTool::m_requireCharged
bool m_requireCharged
Definition: AthTruthSelectionTool.h:56
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
AthTruthSelectionTool::m_counters
std::vector< unsigned int > m_counters
Definition: AthTruthSelectionTool.h:66
CutList
Templated CutList class to contain a group of cuts.
Definition: CutFlow.h:93
AthTruthSelectionTool::m_minRadiusDisc
float m_minRadiusDisc
for disk topology: minimum radius
Definition: AthTruthSelectionTool.h:76
AthTruthSelectionTool::m_ancestors
std::vector< int > m_ancestors
Definition: AthTruthSelectionTool.h:67
CutFlow.h
AthTruthSelectionTool::m_requireOnlyPrimary
bool m_requireOnlyPrimary
Definition: AthTruthSelectionTool.h:55
AthTruthSelectionTool::m_maxEta
float m_maxEta
Definition: AthTruthSelectionTool.h:52
AthTruthSelectionTool::m_disc1
std::unique_ptr< Trk::DiscSurface > m_disc1
Definition: AthTruthSelectionTool.h:81
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthTruthSelectionTool::nCuts
unsigned int nCuts() const final
return the number of cuts.
Definition: AthTruthSelectionTool.h:43
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
AthTruthSelectionTool::names
std::vector< std::string > names() const final
return the names of the cuts as a vector<string>
Definition: AthTruthSelectionTool.cxx:267
AthAlgTool.h
CylinderSurface.h
AthTruthSelectionTool::initialize
StatusCode initialize() final
Definition: AthTruthSelectionTool.cxx:74
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthTruthSelectionTool::m_poselectronfromgamma
bool m_poselectronfromgamma
Definition: AthTruthSelectionTool.h:65
AthTruthSelectionTool::m_maxProdVertRadius
double m_maxProdVertRadius
Definition: AthTruthSelectionTool.h:62
AthTruthSelectionTool::m_minPt
float m_minPt
Definition: AthTruthSelectionTool.h:54
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
AthTruthSelectionTool::m_selectedCharge
int m_selectedCharge
Definition: AthTruthSelectionTool.h:57
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
AthTruthSelectionTool::m_extrapolator
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
Too handle for truth-track extrapolation.
Definition: AthTruthSelectionTool.h:89
AthTruthSelectionTool::testAllCuts
virtual IAthSelectionTool::CutResult testAllCuts(const xAOD::IParticle *p, std::vector< unsigned int > &counter) const final
The most important method to determine whether the particle is accepted.
Definition: AthTruthSelectionTool.cxx:283
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AthTruthSelectionTool::m_requireSiHit
int m_requireSiHit
Definition: AthTruthSelectionTool.h:59
AthTruthSelectionTool::m_zDisc
float m_zDisc
for disk topology: Z position of disk
Definition: AthTruthSelectionTool.h:75
IAthSelectionTool
IAthSelectionTool is a virtual baseclass for selection methods.
Definition: IAthSelectionTool.h:27
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthTruthSelectionTool::AthTruthSelectionTool
AthTruthSelectionTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AthTruthSelectionTool.cxx:44
DiscSurface.h
AthTruthSelectionTool::m_disc2
std::unique_ptr< Trk::DiscSurface > m_disc2
Definition: AthTruthSelectionTool.h:82
AthTruthSelectionTool::m_maxPt
float m_maxPt
Definition: AthTruthSelectionTool.h:53
AthTruthSelectionTool::m_cutList
CutList< xAOD::TruthParticle > m_cutList
Definition: AthTruthSelectionTool.h:50
AthAlgTool
Definition: AthAlgTool.h:26
AthTruthSelectionTool::m_minZCylinder
float m_minZCylinder
for cylinder topology: minimum |z|
Definition: AthTruthSelectionTool.h:73
TruthParticle.h
test_pyathena.counter
counter
Definition: test_pyathena.py:15
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
AthTruthSelectionTool::accept
virtual IAthSelectionTool::CutResult accept(const xAOD::IParticle *particle) const final
The most important method to determine whether the particle is accepted.
Definition: AthTruthSelectionTool.cxx:272
AthTruthSelectionTool::m_maxRadiusDisc
float m_maxRadiusDisc
for disk topology: maximum radius
Definition: AthTruthSelectionTool.h:77
AthTruthSelectionTool::m_maxZCylinder
float m_maxZCylinder
for cylinder topology: maximum |z|
Definition: AthTruthSelectionTool.h:74
AthTruthSelectionTool
class to apply selection to xAOD::TruthParticles,required by validation
Definition: AthTruthSelectionTool.h:28