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>
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& beamPos,
52 const std::vector<std::array<uint16_t, kNClusterTypes> > &counts) const;
53 bool decorateTruthTime(std::vector<std::pair<SG::WriteDecorHandle<xAOD::TruthParticleContainer, float>, bool>>& float_decor) const;
54
55 PublicToolHandle<Trk::IExtrapolator> m_extrapolator
56 {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
58 {this, "BeamSpotDecoKeys",
59 {"EventInfo.beamPosX", "EventInfo.beamPosY", "EventInfo.beamPosZ"},
60 "Beamspot position decoration keys"};
61
62 PublicToolHandle<IAthSelectionTool> m_truthSelectionTool
63 {this,"TruthSelectionTool","",""};
64
65 mutable std::mutex m_mutex;
66 mutable CutFlow m_cutFlow ATLAS_THREAD_SAFE; // Guarded by m_mutex
67
68 mutable std::atomic<std::size_t> m_nMissingTruthParticles = 0u;
69 mutable std::atomic<bool> m_errorEmitted{false};
70
73 {this, "TruthParticleContainerName", "TruthParticles", ""};
74
75 Gaudi::Property<std::string> m_prefix
76 {this, "Prefix", "", "Decoration prefix to avoid clashes."};
77
80 {this, "PixelClusterContainerName", "PixelClusters", ""};
81
83 {this, "SCTClusterContainerName", "SCT_Clusters", ""};
84
86 {this, "TruthParticleIndexDecoration", m_truthParticleName, "origTruthIndex", "decoration name for the original truth particle index."};
87
89 {this, "TruthEventContainerName", "TruthEvents", ""};
90
92 {this, "TruthPileupEventContainerName", "TruthPileupEvents", ""};
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
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::TruthPileupEventContainer > m_truthPileupEventName
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.
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:570
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.