ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15// STL includes
16#include <string>
18#include "xAODTruth/TruthParticle.h" // typedef, can't fwd declare
21#include "GaudiKernel/ToolHandle.h"
25
26
28class AthTruthSelectionTool: virtual public IAthSelectionTool, public AthAlgTool {
29public:
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
38 accept(const xAOD::IParticle* particle) const final;
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
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 IntegerProperty m_vetoPdgId{this, "vetoPdgId", -1};
65 BooleanProperty m_grandparent{this, "hasNoGrandparent", false};
66 BooleanProperty m_poselectronfromgamma{this, "poselectronfromgamma", false};
67 std::vector<unsigned int> m_counters{};
68 IntegerArrayProperty m_ancestors{this, "ancestorList", {}};
69
70 /* \defgroup Selection on extrapolated particle to cylinder or disk surface
71 * @{
72 */
73 FloatProperty m_radiusCylinder{this, "radiusCylinder", -1.,
74 "Select truth particle based on extrapolated position on cylinder placed at this radius. Enabled if greater than 0."};
75 FloatProperty m_minZCylinder{this, "minZCylinder", 0.,
76 "Minimum |Z| on cylinder for accepting extrapolated truth particle to surface."};
77 FloatProperty m_maxZCylinder{this, "maxZCylinder", 0.,
78 "Maximum |Z| on cylinder for accepting extrapolated truth particle to surface."};
79 FloatProperty m_zDisc{this, "zDisc", -1.,
80 "Select truth particle based on extrapolated position on disks placed at +/- z positions. Enabled if greater than 0."};
81 FloatProperty m_minRadiusDisc{this, "minRadiusDisc", 0.,
82 "Minimum radius on disk for accepting extrapolated truth particle to surface."};
83 FloatProperty m_maxRadiusDisc{this, "maxRadiusDisc", 0.,
84 "Maximum radius on disk for accepting extrapolated truth particle to surface."};
85
86 //cache surfaces
87 std::unique_ptr<Trk::CylinderSurface> m_cylinder;
88 std::unique_ptr<Trk::DiscSurface> m_disc1;
89 std::unique_ptr<Trk::DiscSurface> m_disc2;
90
91
92 /* @} */
93
95 PublicToolHandle<Trk::IExtrapolator> m_extrapolator
96 {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
97
98};
99
100
101#endif
header file for interface of selection tools in this package
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
std::vector< std::string > names() const final
return the names of the cuts as a vector<string>
std::unique_ptr< Trk::CylinderSurface > m_cylinder
std::vector< unsigned int > m_counters
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
Too handle for truth-track extrapolation.
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.
std::unique_ptr< Trk::DiscSurface > m_disc1
unsigned int nCuts() const final
return the number of cuts.
AthTruthSelectionTool(const std::string &type, const std::string &name, const IInterface *parent)
BooleanProperty m_requireOnlyPrimary
CutList< xAOD::TruthParticle > m_cutList
virtual IAthSelectionTool::CutResult accept(const xAOD::IParticle *particle) const final
The most important method to determine whether the particle is accepted.
BooleanProperty m_poselectronfromgamma
std::unique_ptr< Trk::DiscSurface > m_disc2
IntegerArrayProperty m_ancestors
Templated CutList class to contain a group of cuts.
Definition CutFlow.h:93
IAthSelectionTool is a virtual baseclass for selection methods.
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#define private