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  FloatProperty m_maxEta{this, "maxEta", 2.5};
53  FloatProperty m_maxPt{this, "maxPt", -1.};
54  FloatProperty m_minPt{this, "minPt", 400.};
55  BooleanProperty m_requireOnlyPrimary{this, "requireOnlyPrimary", true};
56  BooleanProperty m_requireCharged{this, "requireCharged", true};
57  IntegerProperty m_selectedCharge{this, "selectedCharge", 0};
58  BooleanProperty m_requireStable{this, "requireStable", true};
59  IntegerProperty m_requireSiHit{this, "requireSiHit", 0};
60  // max decay radius for secondaries [mm];
61  // set to within (Run2) pixel by default
62  FloatProperty m_maxProdVertRadius{this, "maxProdVertRadius", 110.};
63  IntegerProperty m_pdgId{this, "pdgId", -1};
64  BooleanProperty m_grandparent{this, "hasNoGrandparent", false};
65  BooleanProperty m_poselectronfromgamma{this, "poselectronfromgamma", false};
66  std::vector<unsigned int> m_counters{};
67  IntegerArrayProperty m_ancestors{this, "ancestorList", {}};
68 
69  /* \defgroup Selection on extrapolated particle to cylinder or disk surface
70  * @{
71  */
72  FloatProperty m_radiusCylinder{this, "radiusCylinder", -1.,
73  "Select truth particle based on extrapolated position on cylinder placed at this radius. Enabled if greater than 0."};
74  FloatProperty m_minZCylinder{this, "minZCylinder", 0.,
75  "Minimum |Z| on cylinder for accepting extrapolated truth particle to surface."};
76  FloatProperty m_maxZCylinder{this, "maxZCylinder", 0.,
77  "Maximum |Z| on cylinder for accepting extrapolated truth particle to surface."};
78  FloatProperty m_zDisc{this, "zDisc", -1.,
79  "Select truth particle based on extrapolated position on disks placed at +/- z positions. Enabled if greater than 0."};
80  FloatProperty m_minRadiusDisc{this, "minRadiusDisc", 0.,
81  "Minimum radius on disk for accepting extrapolated truth particle to surface."};
82  FloatProperty m_maxRadiusDisc{this, "maxRadiusDisc", 0.,
83  "Maximum radius on disk for accepting extrapolated truth particle to surface."};
84 
85  //cache surfaces
86  std::unique_ptr<Trk::CylinderSurface> m_cylinder;
87  std::unique_ptr<Trk::DiscSurface> m_disc1;
88  std::unique_ptr<Trk::DiscSurface> m_disc2;
89 
90 
91  /* @} */
92 
94  PublicToolHandle<Trk::IExtrapolator> m_extrapolator
95  {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
96 
97 };
98 
99 
100 #endif
AthTruthSelectionTool::~AthTruthSelectionTool
virtual ~AthTruthSelectionTool()
Definition: AthTruthSelectionTool.h:31
AthTruthSelectionTool::m_maxRadiusDisc
FloatProperty m_maxRadiusDisc
Definition: AthTruthSelectionTool.h:82
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:86
AthTruthSelectionTool::m_pdgId
IntegerProperty m_pdgId
Definition: AthTruthSelectionTool.h:63
AthTruthSelectionTool::m_radiusCylinder
FloatProperty m_radiusCylinder
Definition: AthTruthSelectionTool.h:72
AthTruthSelectionTool::finalize
StatusCode finalize() final
Definition: AthTruthSelectionTool.cxx:239
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
IExtrapolator.h
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
IAthSelectionTool.h
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_minPt
FloatProperty m_minPt
Definition: AthTruthSelectionTool.h:54
AthTruthSelectionTool::m_maxEta
FloatProperty m_maxEta
Definition: AthTruthSelectionTool.h:52
CutFlow.h
AthTruthSelectionTool::m_requireOnlyPrimary
BooleanProperty m_requireOnlyPrimary
Definition: AthTruthSelectionTool.h:55
AthTruthSelectionTool::m_disc1
std::unique_ptr< Trk::DiscSurface > m_disc1
Definition: AthTruthSelectionTool.h:87
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:246
AthAlgTool.h
CylinderSurface.h
AthTruthSelectionTool::initialize
StatusCode initialize() final
Definition: AthTruthSelectionTool.cxx:53
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthTruthSelectionTool::m_requireSiHit
IntegerProperty m_requireSiHit
Definition: AthTruthSelectionTool.h:59
AthTruthSelectionTool::m_minZCylinder
FloatProperty m_minZCylinder
Definition: AthTruthSelectionTool.h:74
AthTruthSelectionTool::m_ancestors
IntegerArrayProperty m_ancestors
Definition: AthTruthSelectionTool.h:67
AthTruthSelectionTool::m_selectedCharge
IntegerProperty 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:95
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:262
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AthTruthSelectionTool::m_poselectronfromgamma
BooleanProperty m_poselectronfromgamma
Definition: AthTruthSelectionTool.h:65
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
AthTruthSelectionTool::m_requireCharged
BooleanProperty m_requireCharged
Definition: AthTruthSelectionTool.h:56
DiscSurface.h
AthTruthSelectionTool::m_disc2
std::unique_ptr< Trk::DiscSurface > m_disc2
Definition: AthTruthSelectionTool.h:88
AthTruthSelectionTool::m_zDisc
FloatProperty m_zDisc
Definition: AthTruthSelectionTool.h:78
AthTruthSelectionTool::m_minRadiusDisc
FloatProperty m_minRadiusDisc
Definition: AthTruthSelectionTool.h:80
AthTruthSelectionTool::m_cutList
CutList< xAOD::TruthParticle > m_cutList
Definition: AthTruthSelectionTool.h:50
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h
test_pyathena.counter
counter
Definition: test_pyathena.py:15
AthTruthSelectionTool::m_grandparent
BooleanProperty m_grandparent
Definition: AthTruthSelectionTool.h:64
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:251
AthTruthSelectionTool::m_maxProdVertRadius
FloatProperty m_maxProdVertRadius
Definition: AthTruthSelectionTool.h:62
AthTruthSelectionTool::m_maxPt
FloatProperty m_maxPt
Definition: AthTruthSelectionTool.h:53
AthTruthSelectionTool::m_maxZCylinder
FloatProperty m_maxZCylinder
Definition: AthTruthSelectionTool.h:76
AthTruthSelectionTool
class to apply selection to xAOD::TruthParticles,required by validation
Definition: AthTruthSelectionTool.h:28
AthTruthSelectionTool::m_requireStable
BooleanProperty m_requireStable
Definition: AthTruthSelectionTool.h:58