ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
xAODTestThinJVec.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
12
#include "
xAODTestThinJVec.h
"
13
#include "
StoreGate/ThinningHandle.h
"
14
15
16
namespace
DMTest
{
17
18
22
StatusCode
xAODTestThinJVec::initialize
()
23
{
24
ATH_CHECK
(
m_jvecContainerKey
.initialize (
m_stream
) );
25
return
StatusCode::SUCCESS;
26
}
27
28
32
StatusCode
xAODTestThinJVec::execute
(
const
EventContext& ctx)
const
33
{
34
SG::ThinningHandle<DMTest::JVecContainer>
jvec(
m_jvecContainerKey
, ctx);
35
36
unsigned
int
evt = ctx.evt();
37
38
jvec.
keepAll
();
39
for
(
size_t
i = 0; i < jvec->size(); i++) {
40
if
(((evt ^
m_mask
) & (1 << (i%4))) == 0) {
41
jvec.
thin
(i);
42
}
43
}
44
45
return
StatusCode::SUCCESS;
46
}
47
48
49
}
// namespace DMTest
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ThinningHandle.h
Handle for requesting thinning for a data object.
DMTest::xAODTestThinJVec::m_stream
StringProperty m_stream
Definition
xAODTestThinJVec.h:52
DMTest::xAODTestThinJVec::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
xAODTestThinJVec.cxx:22
DMTest::xAODTestThinJVec::m_mask
UnsignedIntegerProperty m_mask
Definition
xAODTestThinJVec.h:55
DMTest::xAODTestThinJVec::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
xAODTestThinJVec.cxx:32
DMTest::xAODTestThinJVec::m_jvecContainerKey
SG::ThinningHandleKey< DMTest::JVecContainer > m_jvecContainerKey
Definition
xAODTestThinJVec.h:49
SG::ThinningHandleBase::thin
void thin(size_t ndx)
Mark that index ndx in the container should be thinned away.
Definition
ThinningHandleBase.cxx:64
SG::ThinningHandleBase::keepAll
void keepAll()
Mark that all elements should be kept (not thinned).
Definition
ThinningHandleBase.cxx:152
SG::ThinningHandle
Handle for requesting thinning for a data object.
Definition
ThinningHandle.h:84
DMTest
Definition
B.h:23
xAODTestThinJVec.h
Thin JVecContainer objects.
Generated on
for ATLAS Offline Software by
1.17.0