ATLAS Offline Software
Loading...
Searching...
No Matches
ViewContainerThinning.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2020 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#include "GaudiKernel/ThreadLocalContext.h"
21
25
26
27
28namespace DerivationFramework {
29
30 template <class T>
33 const SG::ReadHandleKey<T>& viewKey) const
34 {
35 const EventContext& ctx = Gaudi::Hive::currentContext();
36
37 SG::ThinningHandle<T> sourceCont (key, ctx);
38 SG::ReadHandle<T> viewCont (viewKey, ctx);
39
40 std::vector<bool> masks;
41 masks.assign( sourceCont->size(), false);
42
43 for( const auto* part: *viewCont){
44 masks[ part->index() ] = true;
45 }
46
47 sourceCont.keep (masks);
48 return StatusCode::SUCCESS;
49 }
50
51
52 // Athena algtool's Hooks
55 {
56 ATH_MSG_INFO ("Initializing " << name() << "...");
57
61
65
66 return StatusCode::SUCCESS;
67 }
68
70 {
71 return StatusCode::SUCCESS;
72 }
73
74
75
77 {
78
79 if (!m_trackParticleKey.empty()) {
81 }
82
83 if (!m_caloClusterKey.empty()) {
85 }
86
87 if (!m_truthParticleKey.empty()) {
89 }
90 return StatusCode::SUCCESS;
91 }
92
93}
#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
StatusCode doThinningT(const SG::ThinningHandleKey< T > &key, const SG::ReadHandleKey< T > &viewKey) const
virtual StatusCode doThinning() const override
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.