ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPhysValTruthDecoratorAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INDETPHYSVALMONITORING_INDETPHYSVALTRUTHDECORATORTOOL_H
6#define INDETPHYSVALMONITORING_INDETPHYSVALTRUTHDECORATORTOOL_H
13// STL includes
14#include <string>
19#include "GaudiKernel/ToolHandle.h"
27#include "GaudiKernel/EventContext.h"
31#include <atomic>
32#include <utility>
33#include <vector>
34
35
36// class to decorate xAOD::TruthParticles with additional information required by validation
38public:
39 InDetPhysValTruthDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator);
40 virtual
42 virtual StatusCode initialize();
43 virtual StatusCode finalize();
44 virtual StatusCode execute(const EventContext &ctx) const;
45
46private:
48 bool decorateTruth(const xAOD::TruthParticle& particle,
50 bool > > &float_decor,
51 const Amg::Vector3D& perigeePos,
52 const std::vector<std::array<uint16_t, kNClusterTypes> > &counts) const;
53 const xAOD::TruthEvent* getTruthHSEvent() const;
54 bool decorateTruthTime(std::vector<std::pair<SG::WriteDecorHandle<xAOD::TruthParticleContainer, float>, bool>>& float_decor) const;
55
56 PublicToolHandle<Trk::IExtrapolator> m_extrapolator
57 {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
59 {this, "BeamSpotDecoKeys",
60 {"EventInfo.beamPosX", "EventInfo.beamPosY", "EventInfo.beamPosZ"},
61 "Beamspot position decoration keys"};
62
63 mutable std::atomic<std::size_t> m_nMissingTruthParticles = 0u;
64 mutable std::atomic<bool> m_errorEmitted{false};
65
68 {this, "TruthParticleContainerName", "TruthParticles", ""};
69
70 Gaudi::Property<std::string> m_prefix
71 {this, "Prefix", "", "Decoration prefix to avoid clashes."};
72
73 Gaudi::Property<bool> m_decoTime{this, "decorateTime", false};
74
77 {this, "PixelClusterContainerName", "PixelClusters", ""};
78
80 {this, "SCTClusterContainerName", "SCT_Clusters", ""};
81
83 {this, "TruthParticleIndexDecoration", m_truthParticleName, "origTruthIndex", "decoration name for the original truth particle index."};
84
86 {this, "TruthEventContainerName", "TruthEvents", ""};
87
89 {this, "TruthPileupEventContainerName", "TruthPileupEvents", ""};
90
91 Gaudi::Property<bool> m_useTruthPVAsPerigee
92 {this, "UseTruthPVAsPerigee", false, "Use the truth PV to calculate the perigee parameters instead of the BS"};
93
94 // decoration helper
108 std::vector< std::pair<SG::WriteDecorHandleKey<xAOD::TruthParticleContainer>,SG::AuxElement::ConstAccessor<float> > > m_decor;
109};
110#endif
Base class for elements of a container that can have aux data.
header file for interface of selection tools in this package
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
Define macros for attributes used to control the static checker.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventName
bool decorateTruth(const xAOD::TruthParticle &particle, std::vector< std::pair< SG::WriteDecorHandle< xAOD::TruthParticleContainer, float >, bool > > &float_decor, const Amg::Vector3D &perigeePos, const std::vector< std::array< uint16_t, kNClusterTypes > > &counts) const
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_truthParticleIndexDecor
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
std::vector< std::pair< SG::WriteDecorHandleKey< xAOD::TruthParticleContainer >, SG::AuxElement::ConstAccessor< float > > > m_decor
virtual StatusCode execute(const EventContext &ctx) const
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_truthPixelClusterName
TruthPixelClusterContainer and TruthSCTClusterContainer needed for truth silicon hit cut.
std::atomic< std::size_t > m_nMissingTruthParticles
InDetPhysValTruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_truthSCTClusterName
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > m_beamSpotDecoKey
Gaudi::Property< std::string > m_prefix
SG::ReadHandleKey< xAOD::TruthPileupEventContainer > m_truthPileupEventName
const xAOD::TruthEvent * getTruthHSEvent() const
bool decorateTruthTime(std::vector< std::pair< SG::WriteDecorHandle< xAOD::TruthParticleContainer, float >, bool > > &float_decor) const
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleName
TruthParticle container's name needed to create decorators.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for adding a decoration to an object.
Eigen::Matrix< double, 3, 1 > Vector3D
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
TruthEvent_v1 TruthEvent
Typedef to implementation.
Definition TruthEvent.h:17
TruthParticle_v1 TruthParticle
Typedef to implementation.