ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetPhysValMonitoring
src
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>
15
#include "
xAODTruth/TruthParticleContainer.h
"
16
#include "
xAODTruth/TruthEventContainer.h
"
17
#include "
xAODTruth/TruthPileupEventContainer.h
"
18
#include "
AthenaBaseComps/AthReentrantAlgorithm.h
"
19
#include "GaudiKernel/ToolHandle.h"
20
#include "
TrkExInterfaces/IExtrapolator.h
"
21
#include "
StoreGate/ReadDecorHandleKeyArray.h
"
22
#include "
StoreGate/WriteDecorHandleKey.h
"
23
#include "
StoreGate/WriteDecorHandle.h
"
24
#include "
AthContainers/AuxElement.h
"
25
#include "
xAODEventInfo/EventInfo.h
"
26
#include "
xAODTracking/TrackMeasurementValidationContainer.h
"
27
#include "GaudiKernel/EventContext.h"
28
#include "
TrkTruthTrackInterfaces/IAthSelectionTool.h
"
29
#include "
InDetPhysValMonitoring/CutFlow.h
"
30
#include "
CxxUtils/checker_macros.h
"
31
#include <atomic>
32
#include <utility>
33
#include <vector>
34
35
36
// class to decorate xAOD::TruthParticles with additional information required by validation
37
class
InDetPhysValTruthDecoratorAlg
:
public
AthReentrantAlgorithm
{
38
public
:
39
InDetPhysValTruthDecoratorAlg
(
const
std::string& name, ISvcLocator* pSvcLocator);
40
virtual
41
~InDetPhysValTruthDecoratorAlg
();
42
virtual
StatusCode
initialize
();
43
virtual
StatusCode
finalize
();
44
virtual
StatusCode
execute
(
const
EventContext &ctx)
const
;
45
46
private
:
47
enum
{
kPixel
,
kSCT
,
kNClusterTypes
};
48
bool
decorateTruth
(
const
xAOD::TruthParticle
& particle,
49
std::vector< std::pair<
SG::WriteDecorHandle<xAOD::TruthParticleContainer,float>
,
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"
,
""
};
57
SG::ReadDecorHandleKeyArray<xAOD::EventInfo>
m_beamSpotDecoKey
58
{
this
,
"BeamSpotDecoKeys"
,
59
{
"EventInfo.beamPosX"
,
"EventInfo.beamPosY"
,
"EventInfo.beamPosZ"
},
60
"Beamspot position decoration keys"
};
61
62
mutable
std::atomic<std::size_t>
m_nMissingTruthParticles
= 0u;
63
mutable
std::atomic<bool>
m_errorEmitted
{
false
};
64
66
SG::ReadHandleKey<xAOD::TruthParticleContainer>
m_truthParticleName
67
{
this
,
"TruthParticleContainerName"
,
"TruthParticles"
,
""
};
68
69
Gaudi::Property<std::string>
m_prefix
70
{
this
,
"Prefix"
,
""
,
"Decoration prefix to avoid clashes."
};
71
72
Gaudi::Property<bool>
m_decoTime
{
this
,
"decorateTime"
,
false
};
73
75
SG::ReadHandleKey<xAOD::TrackMeasurementValidationContainer>
m_truthPixelClusterName
76
{
this
,
"PixelClusterContainerName"
,
"PixelClusters"
,
""
};
77
78
SG::ReadHandleKey<xAOD::TrackMeasurementValidationContainer>
m_truthSCTClusterName
79
{
this
,
"SCTClusterContainerName"
,
"SCT_Clusters"
,
""
};
80
81
SG::ReadDecorHandleKey<xAOD::TruthParticleContainer>
m_truthParticleIndexDecor
82
{
this
,
"TruthParticleIndexDecoration"
,
m_truthParticleName
,
"origTruthIndex"
,
"decoration name for the original truth particle index."
};
83
84
SG::ReadHandleKey<xAOD::TruthEventContainer>
m_truthEventName
85
{
this
,
"TruthEventContainerName"
,
"TruthEvents"
,
""
};
86
87
SG::ReadHandleKey<xAOD::TruthPileupEventContainer>
m_truthPileupEventName
88
{
this
,
"TruthPileupEventContainerName"
,
"TruthPileupEvents"
,
""
};
89
90
// decoration helper
91
enum
EDecorations
{
92
kDecorD0
,
93
kDecorZ0
,
94
kDecorPhi
,
95
kDecorTheta
,
96
kDecorZ0st
,
97
kDecorQOverP
,
98
kDecorProdR
,
99
kDecorProdZ
,
100
kDecorNSilHits
,
101
kDecorTime
,
102
kNDecorators
103
};
104
std::vector< std::pair<SG::WriteDecorHandleKey<xAOD::TruthParticleContainer>,SG::AuxElement::ConstAccessor<float> > >
m_decor
;
105
};
106
#endif
AthReentrantAlgorithm.h
AuxElement.h
Base class for elements of a container that can have aux data.
CutFlow.h
TruthParticleContainer.h
IAthSelectionTool.h
header file for interface of selection tools in this package
IExtrapolator.h
ReadDecorHandleKeyArray.h
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
WriteDecorHandle.h
Handle class for adding a decoration to an object.
TrackMeasurementValidationContainer.h
TruthEventContainer.h
TruthPileupEventContainer.h
checker_macros.h
Define macros for attributes used to control the static checker.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
InDetPhysValTruthDecoratorAlg::m_truthEventName
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventName
Definition
InDetPhysValTruthDecoratorAlg.h:85
InDetPhysValTruthDecoratorAlg::finalize
virtual StatusCode finalize()
Definition
InDetPhysValTruthDecoratorAlg.cxx:66
InDetPhysValTruthDecoratorAlg::m_errorEmitted
std::atomic< bool > m_errorEmitted
Definition
InDetPhysValTruthDecoratorAlg.h:63
InDetPhysValTruthDecoratorAlg::~InDetPhysValTruthDecoratorAlg
virtual ~InDetPhysValTruthDecoratorAlg()
Definition
InDetPhysValTruthDecoratorAlg.cxx:31
InDetPhysValTruthDecoratorAlg::m_truthParticleIndexDecor
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_truthParticleIndexDecor
Definition
InDetPhysValTruthDecoratorAlg.h:82
InDetPhysValTruthDecoratorAlg::m_extrapolator
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
Definition
InDetPhysValTruthDecoratorAlg.h:56
InDetPhysValTruthDecoratorAlg::m_decor
std::vector< std::pair< SG::WriteDecorHandleKey< xAOD::TruthParticleContainer >, SG::AuxElement::ConstAccessor< float > > > m_decor
Definition
InDetPhysValTruthDecoratorAlg.h:104
InDetPhysValTruthDecoratorAlg::initialize
virtual StatusCode initialize()
Definition
InDetPhysValTruthDecoratorAlg.cxx:36
InDetPhysValTruthDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const
Definition
InDetPhysValTruthDecoratorAlg.cxx:74
InDetPhysValTruthDecoratorAlg::m_truthPixelClusterName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_truthPixelClusterName
TruthPixelClusterContainer and TruthSCTClusterContainer needed for truth silicon hit cut.
Definition
InDetPhysValTruthDecoratorAlg.h:76
InDetPhysValTruthDecoratorAlg::m_nMissingTruthParticles
std::atomic< std::size_t > m_nMissingTruthParticles
Definition
InDetPhysValTruthDecoratorAlg.h:62
InDetPhysValTruthDecoratorAlg::InDetPhysValTruthDecoratorAlg
InDetPhysValTruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
InDetPhysValTruthDecoratorAlg.cxx:26
InDetPhysValTruthDecoratorAlg::m_truthSCTClusterName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_truthSCTClusterName
Definition
InDetPhysValTruthDecoratorAlg.h:79
InDetPhysValTruthDecoratorAlg::m_beamSpotDecoKey
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > m_beamSpotDecoKey
Definition
InDetPhysValTruthDecoratorAlg.h:58
InDetPhysValTruthDecoratorAlg::EDecorations
EDecorations
Definition
InDetPhysValTruthDecoratorAlg.h:91
InDetPhysValTruthDecoratorAlg::kDecorProdZ
@ kDecorProdZ
Definition
InDetPhysValTruthDecoratorAlg.h:99
InDetPhysValTruthDecoratorAlg::kDecorQOverP
@ kDecorQOverP
Definition
InDetPhysValTruthDecoratorAlg.h:97
InDetPhysValTruthDecoratorAlg::kDecorProdR
@ kDecorProdR
Definition
InDetPhysValTruthDecoratorAlg.h:98
InDetPhysValTruthDecoratorAlg::kDecorZ0st
@ kDecorZ0st
Definition
InDetPhysValTruthDecoratorAlg.h:96
InDetPhysValTruthDecoratorAlg::kDecorTime
@ kDecorTime
Definition
InDetPhysValTruthDecoratorAlg.h:101
InDetPhysValTruthDecoratorAlg::kDecorPhi
@ kDecorPhi
Definition
InDetPhysValTruthDecoratorAlg.h:94
InDetPhysValTruthDecoratorAlg::kNDecorators
@ kNDecorators
Definition
InDetPhysValTruthDecoratorAlg.h:102
InDetPhysValTruthDecoratorAlg::kDecorZ0
@ kDecorZ0
Definition
InDetPhysValTruthDecoratorAlg.h:93
InDetPhysValTruthDecoratorAlg::kDecorTheta
@ kDecorTheta
Definition
InDetPhysValTruthDecoratorAlg.h:95
InDetPhysValTruthDecoratorAlg::kDecorNSilHits
@ kDecorNSilHits
Definition
InDetPhysValTruthDecoratorAlg.h:100
InDetPhysValTruthDecoratorAlg::kDecorD0
@ kDecorD0
Definition
InDetPhysValTruthDecoratorAlg.h:92
InDetPhysValTruthDecoratorAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition
InDetPhysValTruthDecoratorAlg.h:70
InDetPhysValTruthDecoratorAlg::m_truthPileupEventName
SG::ReadHandleKey< xAOD::TruthPileupEventContainer > m_truthPileupEventName
Definition
InDetPhysValTruthDecoratorAlg.h:88
InDetPhysValTruthDecoratorAlg::decorateTruthTime
bool decorateTruthTime(std::vector< std::pair< SG::WriteDecorHandle< xAOD::TruthParticleContainer, float >, bool > > &float_decor) const
Definition
InDetPhysValTruthDecoratorAlg.cxx:255
InDetPhysValTruthDecoratorAlg::m_decoTime
Gaudi::Property< bool > m_decoTime
Definition
InDetPhysValTruthDecoratorAlg.h:72
InDetPhysValTruthDecoratorAlg::m_truthParticleName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleName
TruthParticle container's name needed to create decorators.
Definition
InDetPhysValTruthDecoratorAlg.h:67
InDetPhysValTruthDecoratorAlg::kNClusterTypes
@ kNClusterTypes
Definition
InDetPhysValTruthDecoratorAlg.h:47
InDetPhysValTruthDecoratorAlg::kPixel
@ kPixel
Definition
InDetPhysValTruthDecoratorAlg.h:47
InDetPhysValTruthDecoratorAlg::kSCT
@ kSCT
Definition
InDetPhysValTruthDecoratorAlg.h:47
InDetPhysValTruthDecoratorAlg::decorateTruth
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
Definition
InDetPhysValTruthDecoratorAlg.cxx:178
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition
StoreGate/StoreGate/ReadDecorHandleKey.h:86
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
SG::ReadDecorHandleKeyArray
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
Definition
StoreGate/StoreGate/ReadDecorHandleKeyArray.h:35
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0