|
ATLAS Offline Software
|
class to apply selection to xAOD::TruthParticles,required by validation
More...
#include <AthTruthSelectionTool.h>
|
| AthTruthSelectionTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~AthTruthSelectionTool () |
|
StatusCode | initialize () final |
|
StatusCode | finalize () final |
|
virtual IAthSelectionTool::CutResult | accept (const xAOD::IParticle *particle) const final |
| The most important method to determine whether the particle is accepted. More...
|
|
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. More...
|
|
unsigned int | nCuts () const final |
| return the number of cuts. More...
|
|
std::vector< std::string > | names () const final |
| return the names of the cuts as a vector<string> More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
CutList< xAOD::TruthParticle > | m_cutList |
|
FloatProperty | m_maxEta {this, "maxEta", 2.5} |
|
FloatProperty | m_maxPt {this, "maxPt", -1.} |
|
FloatProperty | m_minPt {this, "minPt", 400.} |
|
BooleanProperty | m_requireOnlyPrimary {this, "requireOnlyPrimary", true} |
|
BooleanProperty | m_requireCharged {this, "requireCharged", true} |
|
IntegerProperty | m_selectedCharge {this, "selectedCharge", 0} |
|
BooleanProperty | m_requireStable {this, "requireStable", true} |
|
IntegerProperty | m_requireSiHit {this, "requireSiHit", 0} |
|
FloatProperty | m_maxProdVertRadius {this, "maxProdVertRadius", 110.} |
|
IntegerProperty | m_pdgId {this, "pdgId", -1} |
|
BooleanProperty | m_grandparent {this, "hasNoGrandparent", false} |
|
BooleanProperty | m_poselectronfromgamma {this, "poselectronfromgamma", false} |
|
std::vector< unsigned int > | m_counters {} |
|
IntegerArrayProperty | m_ancestors {this, "ancestorList", {}} |
|
FloatProperty | m_radiusCylinder |
|
FloatProperty | m_minZCylinder |
|
FloatProperty | m_maxZCylinder |
|
FloatProperty | m_zDisc |
|
FloatProperty | m_minRadiusDisc |
|
FloatProperty | m_maxRadiusDisc |
|
std::unique_ptr< Trk::CylinderSurface > | m_cylinder |
|
std::unique_ptr< Trk::DiscSurface > | m_disc1 |
|
std::unique_ptr< Trk::DiscSurface > | m_disc2 |
|
PublicToolHandle< Trk::IExtrapolator > | m_extrapolator {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""} |
| Too handle for truth-track extrapolation. More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
class to apply selection to xAOD::TruthParticles,required by validation
Definition at line 28 of file AthTruthSelectionTool.h.
◆ StoreGateSvc_t
◆ AthTruthSelectionTool()
AthTruthSelectionTool::AthTruthSelectionTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~AthTruthSelectionTool()
virtual AthTruthSelectionTool::~AthTruthSelectionTool |
( |
| ) |
|
|
inlinevirtual |
◆ accept()
The most important method to determine whether the particle is accepted.
- Parameters
-
p | Pointer to particle baseclass, will be cast to truth or track |
- Returns
- the number of cuts which are not passed or tested
Implements IAthSelectionTool.
Definition at line 251 of file AthTruthSelectionTool.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode AthTruthSelectionTool::finalize |
( |
| ) |
|
|
final |
◆ initialize()
StatusCode AthTruthSelectionTool::initialize |
( |
| ) |
|
|
final |
Definition at line 53 of file AthTruthSelectionTool.cxx.
58 const std::vector<Accept_t> filters = {
62 Accept_t([
this](
const P_t&
p) ->
bool {
63 return((
p.pt() > 0.1) ? (std::abs(
p.eta()) <
m_maxEta) :
false);
64 }, std::string(
"eta")),
65 Accept_t([
this](
const P_t&
p) ->
bool {
67 }, std::string(
"min_pt"))
107 return(std::abs(
p.pdgId()) ==
m_pdgId);
112 return((
p.nParents() == 0) || ((
p.nParents() == 1)and((
p.parent(0))->nParents() == 0)));
113 },
"hasNoGrandparent"));
119 if (not pTruth)
return false;
125 return((
p.absPdgId() == electronId)and(
p.nParents() >= 1) and(
p.parent(0)) and(
p.parent(0)->pdgId() == gammaId));
126 },
"poselectronfromgamma"));
136 m_cutList.add(Accept_t([
this](
const P_t&
p) ->
bool {
140 if (ptruthVertex ==
nullptr) {
145 const auto xPos = ptruthVertex->
x();
146 const auto yPos = ptruthVertex->
y();
147 const auto z_truth = ptruthVertex->
z();
159 ATH_MSG_VERBOSE(
"Extrapolated parameters to cylinder: " << *exParameters);
160 const float ex_abs_z = fabs(exParameters->
position().z());
168 },
"SelectCylinder"));
178 m_cutList.add(Accept_t([
this](
const P_t&
p) ->
bool {
182 if (ptruthVertex ==
nullptr) {
187 const auto xPos = ptruthVertex->
x();
188 const auto yPos = ptruthVertex->
y();
189 const auto z_truth = ptruthVertex->
z();
206 ATH_MSG_VERBOSE(
"Strange, extrapolation succeeded but extrapolated position not within disc radius! Test next disc");
219 ATH_MSG_VERBOSE(
"Strange, extrapolation succeeded but extrapolated position not within disc radius! Rejecting");
235 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
const InterfaceID & IAthSelectionTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
interfaceID reimplemented from base
Definition at line 73 of file IAthSelectionTool.h.
74 return IID_IAthSelectionTool;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ names()
std::vector< std::string > AthTruthSelectionTool::names |
( |
| ) |
const |
|
finalvirtual |
◆ nCuts()
unsigned int AthTruthSelectionTool::nCuts |
( |
| ) |
const |
|
inlinefinalvirtual |
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ testAllCuts()
The most important method to determine whether the particle is accepted.
- Parameters
-
p | Pointer to particle baseclass, will be cast to truth or track |
- Returns
- true if particle passes cuts
Implements IAthSelectionTool.
Definition at line 262 of file AthTruthSelectionTool.cxx.
◆ updateVHKA()
◆ m_ancestors
IntegerArrayProperty AthTruthSelectionTool::m_ancestors {this, "ancestorList", {}} |
|
private |
◆ m_counters
std::vector<unsigned int> AthTruthSelectionTool::m_counters {} |
|
private |
◆ m_cutList
◆ m_cylinder
◆ m_detStore
◆ m_disc1
◆ m_disc2
◆ m_evtStore
◆ m_extrapolator
◆ m_grandparent
BooleanProperty AthTruthSelectionTool::m_grandparent {this, "hasNoGrandparent", false} |
|
private |
◆ m_maxEta
FloatProperty AthTruthSelectionTool::m_maxEta {this, "maxEta", 2.5} |
|
private |
◆ m_maxProdVertRadius
FloatProperty AthTruthSelectionTool::m_maxProdVertRadius {this, "maxProdVertRadius", 110.} |
|
private |
◆ m_maxPt
FloatProperty AthTruthSelectionTool::m_maxPt {this, "maxPt", -1.} |
|
private |
◆ m_maxRadiusDisc
FloatProperty AthTruthSelectionTool::m_maxRadiusDisc |
|
private |
Initial value:{this, "maxRadiusDisc", 0.,
"Maximum radius on disk for accepting extrapolated truth particle to surface."}
Definition at line 82 of file AthTruthSelectionTool.h.
◆ m_maxZCylinder
FloatProperty AthTruthSelectionTool::m_maxZCylinder |
|
private |
Initial value:{this, "maxZCylinder", 0.,
"Maximum |Z| on cylinder for accepting extrapolated truth particle to surface."}
Definition at line 76 of file AthTruthSelectionTool.h.
◆ m_minPt
FloatProperty AthTruthSelectionTool::m_minPt {this, "minPt", 400.} |
|
private |
◆ m_minRadiusDisc
FloatProperty AthTruthSelectionTool::m_minRadiusDisc |
|
private |
Initial value:{this, "minRadiusDisc", 0.,
"Minimum radius on disk for accepting extrapolated truth particle to surface."}
Definition at line 80 of file AthTruthSelectionTool.h.
◆ m_minZCylinder
FloatProperty AthTruthSelectionTool::m_minZCylinder |
|
private |
Initial value:{this, "minZCylinder", 0.,
"Minimum |Z| on cylinder for accepting extrapolated truth particle to surface."}
Definition at line 74 of file AthTruthSelectionTool.h.
◆ m_pdgId
IntegerProperty AthTruthSelectionTool::m_pdgId {this, "pdgId", -1} |
|
private |
◆ m_poselectronfromgamma
BooleanProperty AthTruthSelectionTool::m_poselectronfromgamma {this, "poselectronfromgamma", false} |
|
private |
◆ m_radiusCylinder
FloatProperty AthTruthSelectionTool::m_radiusCylinder |
|
private |
Initial value:{this, "radiusCylinder", -1.,
"Select truth particle based on extrapolated position on cylinder placed at this radius. Enabled if greater than 0."}
Definition at line 72 of file AthTruthSelectionTool.h.
◆ m_requireCharged
BooleanProperty AthTruthSelectionTool::m_requireCharged {this, "requireCharged", true} |
|
private |
◆ m_requireOnlyPrimary
BooleanProperty AthTruthSelectionTool::m_requireOnlyPrimary {this, "requireOnlyPrimary", true} |
|
private |
◆ m_requireSiHit
IntegerProperty AthTruthSelectionTool::m_requireSiHit {this, "requireSiHit", 0} |
|
private |
◆ m_requireStable
BooleanProperty AthTruthSelectionTool::m_requireStable {this, "requireStable", true} |
|
private |
◆ m_selectedCharge
IntegerProperty AthTruthSelectionTool::m_selectedCharge {this, "selectedCharge", 0} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_zDisc
FloatProperty AthTruthSelectionTool::m_zDisc |
|
private |
Initial value:{this, "zDisc", -1.,
"Select truth particle based on extrapolated position on disks placed at +/- z positions. Enabled if greater than 0."}
Definition at line 78 of file AthTruthSelectionTool.h.
The documentation for this class was generated from the following files:
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
const Amg::Vector3D & position() const
Access method for the position.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
Templated CutList class to contain a group of cuts.
float y() const
Vertex y displacement.
virtual void setOwner(IDataHandleHolder *o)=0
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Class describing a truth particle in the MC record.
Eigen::Affine3d Transform3D
TruthParticle_v1 TruthParticle
Typedef to implementation.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Class describing a truth vertex in the MC record.
std::string to_string(const DetectorType &type)
Eigen::Matrix< double, 3, 1 > Vector3D
float x() const
Vertex x displacement.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
float z() const
Vertex longitudinal distance along the beam line form the origin.
Eigen::Translation< double, 3 > Translation3D
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Templated class containing a cut, name of cut and description of cut(optional) Typically,...
constexpr int pow(int base, int exp) noexcept
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>