![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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 |
|
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 |
|
) |
| |
Definition at line 43 of file AthTruthSelectionTool.cxx.
49 declareInterface<IAthSelectionTool>(
this);
64 declareProperty(
"radiusCylinder",
m_radiusCylinder=-1,
"Select truth particle based on extrapolated position on cylinder placed at this radius. Enabled if greater than 0.");
67 declareProperty(
"zDisc",
m_zDisc=-1.0,
"Select truth particle based on extrapolated position on disks placed at +/- z positions. Enabled if greater than 0.");
◆ ~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 271 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);
◆ 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.
◆ 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.
◆ 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 73 of file AthTruthSelectionTool.cxx.
78 const std::vector<Accept_t> filters = {
82 Accept_t([
this](
const P_t&
p) ->
bool {
83 return((
p.pt() > 0.1) ? (std::abs(
p.eta()) <
m_maxEta) :
false);
84 }, std::string(
"eta")),
85 Accept_t([
this](
const P_t&
p) ->
bool {
87 }, std::string(
"min_pt"))
122 return(
p.status() == 1);
127 return(std::abs(
p.pdgId()) ==
m_pdgId);
132 return((
p.nParents() == 0) || ((
p.nParents() == 1)and((
p.parent(0))->nParents() == 0)));
133 },
"hasNoGrandparent"));
139 if (not pTruth)
return false;
145 return((
p.absPdgId() == electronId)and(
p.nParents() >= 1) and(
p.parent(0)) and(
p.parent(0)->pdgId() == gammaId));
146 },
"poselectronfromgamma"));
156 m_cutList.add(Accept_t([
this](
const P_t&
p) ->
bool {
160 if (ptruthVertex ==
nullptr) {
165 const auto xPos = ptruthVertex->
x();
166 const auto yPos = ptruthVertex->
y();
167 const auto z_truth = ptruthVertex->
z();
179 ATH_MSG_VERBOSE(
"Extrapolated parameters to cylinder: " << *exParameters);
180 const float ex_abs_z = fabs(exParameters->
position().z());
188 },
"SelectCylinder"));
198 m_cutList.add(Accept_t([
this](
const P_t&
p) ->
bool {
202 if (ptruthVertex ==
nullptr) {
207 const auto xPos = ptruthVertex->
x();
208 const auto yPos = ptruthVertex->
y();
209 const auto z_truth = ptruthVertex->
z();
226 ATH_MSG_VERBOSE(
"Strange, extrapolation succeeded but extrapolated position not within disc radius! Test next disc");
239 ATH_MSG_VERBOSE(
"Strange, extrapolation succeeded but extrapolated position not within disc radius! Rejecting");
255 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 282 of file AthTruthSelectionTool.cxx.
◆ updateVHKA()
◆ m_ancestors
std::vector<int> AthTruthSelectionTool::m_ancestors |
|
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
bool AthTruthSelectionTool::m_grandparent |
|
private |
◆ m_maxEta
float AthTruthSelectionTool::m_maxEta |
|
private |
◆ m_maxProdVertRadius
double AthTruthSelectionTool::m_maxProdVertRadius |
|
private |
◆ m_maxPt
float AthTruthSelectionTool::m_maxPt |
|
private |
◆ m_maxRadiusDisc
float AthTruthSelectionTool::m_maxRadiusDisc |
|
private |
◆ m_maxZCylinder
float AthTruthSelectionTool::m_maxZCylinder |
|
private |
◆ m_minPt
float AthTruthSelectionTool::m_minPt |
|
private |
◆ m_minRadiusDisc
float AthTruthSelectionTool::m_minRadiusDisc |
|
private |
◆ m_minZCylinder
float AthTruthSelectionTool::m_minZCylinder |
|
private |
◆ m_pdgId
int AthTruthSelectionTool::m_pdgId |
|
private |
◆ m_poselectronfromgamma
bool AthTruthSelectionTool::m_poselectronfromgamma |
|
private |
◆ m_radiusCylinder
float AthTruthSelectionTool::m_radiusCylinder |
|
private |
◆ m_requireCharged
bool AthTruthSelectionTool::m_requireCharged |
|
private |
◆ m_requireOnlyPrimary
bool AthTruthSelectionTool::m_requireOnlyPrimary |
|
private |
◆ m_requireSiHit
int AthTruthSelectionTool::m_requireSiHit |
|
private |
◆ m_requireStatus1
bool AthTruthSelectionTool::m_requireStatus1 |
|
private |
◆ m_selectedCharge
int AthTruthSelectionTool::m_selectedCharge |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_zDisc
float AthTruthSelectionTool::m_zDisc |
|
private |
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.
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,...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>