ATLAS Offline Software
Loading...
Searching...
No Matches
ViewContainerThinning.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7// ViewContainerThinning.cxx
8// Implementation file for class ViewContainerThinning
9// Author: S.Binet<binet@cern.ch>
11
12// DerivationFrameworkJetEtMiss includes
14
15// STL includes
16
17// FrameWork includes
20
24
25
26
27namespace DerivationFramework {
28
29 template <class T>
31 ViewContainerThinning::doThinningT (const EventContext& ctx,
32 const SG::ThinningHandleKey<T>& key,
33 const SG::ReadHandleKey<T>& viewKey) const
34 {
35
36 SG::ThinningHandle<T> sourceCont (key, ctx);
37 SG::ReadHandle<T> viewCont (viewKey, ctx);
38
39 std::vector<bool> masks;
40 masks.assign( sourceCont->size(), false);
41
42 for( const auto* part: *viewCont){
43 masks[ part->index() ] = true;
44 }
45
46 sourceCont.keep (masks);
47 return StatusCode::SUCCESS;
48 }
49
50
51 // Athena algtool's Hooks
54 {
55 ATH_MSG_INFO ("Initializing " << name() << "...");
56
60
64
65 return StatusCode::SUCCESS;
66 }
67
69 {
70 return StatusCode::SUCCESS;
71 }
72
73
74
75 StatusCode ViewContainerThinning::doThinning(const EventContext& ctx) const
76 {
77
78 if (!m_trackParticleKey.empty()) {
80 }
81
82 if (!m_caloClusterKey.empty()) {
84 }
85
86 if (!m_truthParticleKey.empty()) {
88 }
89 return StatusCode::SUCCESS;
90 }
91
92}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Handle class for reading from StoreGate.
Handle for requesting thinning for a data object.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleViewKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleViewKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterViewKey
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_caloClusterKey
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_truthParticleKey
virtual StatusCode doThinning(const EventContext &ctx) const override
StatusCode doThinningT(const EventContext &ctx, const SG::ThinningHandleKey< T > &key, const SG::ReadHandleKey< T > &viewKey) const
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_trackParticleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
HandleKey object for adding thinning to an object.
Handle for requesting thinning for a data object.
THE reconstruction tool.
::StatusCode StatusCode
StatusCode definition for legacy code.