ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPhysValTruthDecoratorAlg.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_INDETPHYSVALTRUTHDECORATORTOOL_H
6#define INDETPHYSVALMONITORING_INDETPHYSVALTRUTHDECORATORTOOL_H
13// STL includes
14#include <string>
17#include "GaudiKernel/ToolHandle.h"
25#include "GaudiKernel/EventContext.h"
29#include <atomic>
30#include <utility>
31#include <vector>
32
33
34// class to decorate xAOD::TruthParticles with additional information required by validation
36public:
37 InDetPhysValTruthDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator);
38 virtual
40 virtual StatusCode initialize();
41 virtual StatusCode finalize();
42 virtual StatusCode execute(const EventContext &ctx) const;
43
44private:
46 bool decorateTruth(const xAOD::TruthParticle& particle,
48 bool > > &float_decor,
49 const Amg::Vector3D& beamPos,
50 const std::vector<std::array<uint16_t, kNClusterTypes> > &counts) const;
51
52 PublicToolHandle<Trk::IExtrapolator> m_extrapolator
53 {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
55 {this, "BeamSpotDecoKeys",
56 {"EventInfo.beamPosX", "EventInfo.beamPosY", "EventInfo.beamPosZ"},
57 "Beamspot position decoration keys"};
58
59 PublicToolHandle<IAthSelectionTool> m_truthSelectionTool
60 {this,"TruthSelectionTool","",""};
61
62 mutable std::mutex m_mutex;
63 mutable CutFlow m_cutFlow ATLAS_THREAD_SAFE; // Guarded by m_mutex
64
65 mutable std::atomic<std::size_t> m_nMissingTruthParticles = 0u;
66 mutable std::atomic<bool> m_errorEmitted{false};
67
70 {this, "TruthParticleContainerName", "TruthParticles", ""};
71
72 Gaudi::Property<std::string> m_prefix
73 {this, "Prefix", "", "Decoration prefix to avoid clashes."};
74
77 {this, "PixelClusterContainerName", "PixelClusters", ""};
78
80 {this, "SCTClusterContainerName", "SCT_Clusters", ""};
81
83 {this, "TruthParticleIndexDecoration", "origTruthIndex", "decoration name for the original truth particle index."};
84
85 // decoration helper
98 std::vector< std::pair<SG::WriteDecorHandleKey<xAOD::TruthParticleContainer>,SG::AuxElement::ConstAccessor<float> > > m_decor;
99};
100#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.
PublicToolHandle< IAthSelectionTool > m_truthSelectionTool
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::TruthParticleContainer > m_truthParticleName
TruthParticle container's name needed to create decorators.
bool decorateTruth(const xAOD::TruthParticle &particle, std::vector< std::pair< SG::WriteDecorHandle< xAOD::TruthParticleContainer, float >, bool > > &float_decor, const Amg::Vector3D &beamPos, const std::vector< std::array< uint16_t, kNClusterTypes > > &counts) const
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
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
TruthParticle_v1 TruthParticle
Typedef to implementation.