ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Columnar
ColumnarExampleTools
Root
MomentumAccessorExampleTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
//
8
// includes
9
//
10
11
#include <
ColumnarExampleTools/MomentumAccessorExampleTool.h
>
12
13
//
14
// method implementations
15
//
16
17
namespace
columnar
18
{
19
MomentumAccessorExampleTool ::
20
MomentumAccessorExampleTool (
const
std::string& name)
21
:
AsgTool
(name)
22
{}
23
24
25
26
StatusCode MomentumAccessorExampleTool ::
27
initialize ()
28
{
29
if
(
auto
type
=
objectTypeAcc
.staticType())
30
resetObjectType
(
momAcc
, *
this
, *
type
);
31
else
32
ANA_MSG_INFO
(
"ObjectTypeAccessor: no object type set, using default"
);
33
34
// give the base class a chance to initialize the column accessor
35
// backends
36
ANA_CHECK
(initializeColumns());
37
return
StatusCode::SUCCESS;
38
}
39
40
41
42
void
MomentumAccessorExampleTool ::
43
callSingleEvent (
ParticleRange
particles)
const
44
{
45
for
(
ParticleId
particle : particles)
46
{
47
selectionDec
(particle) =
momAcc
.e(particle) >
m_energyCut
.value();
48
}
49
}
50
51
52
53
void
MomentumAccessorExampleTool ::
54
callEvents (
EventContextRange
events)
const
55
{
56
// loop over all events and particles. note that this is
57
// deliberately looping by value, as the ID classes are very small
58
// and can be copied cheaply. this could have also been written as
59
// a single loop over all particles in the event range, but I chose
60
// to split it up into two loops as most tools will need to do some
61
// per-event things, e.g. retrieve `EventInfo`.
62
for
(
columnar::EventContextId
event : events)
63
{
64
callSingleEvent
(
particlesHandle
(event));
65
}
66
}
67
}
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
MomentumAccessorExampleTool.h
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
columnar::MomentumAccessorExampleTool::m_energyCut
Gaudi::Property< float > m_energyCut
the energy cut to apply
Definition
MomentumAccessorExampleTool.h:48
columnar::MomentumAccessorExampleTool::callSingleEvent
void callSingleEvent(ParticleRange particles) const
Definition
MomentumAccessorExampleTool.cxx:43
columnar::MomentumAccessorExampleTool::particlesHandle
ParticleAccessor< ObjectColumn > particlesHandle
the object accessor for the particles
Definition
MomentumAccessorExampleTool.h:56
columnar::MomentumAccessorExampleTool::selectionDec
ParticleDecorator< char > selectionDec
the selection decorator for the particles
Definition
MomentumAccessorExampleTool.h:89
columnar::MomentumAccessorExampleTool::objectTypeAcc
ObjectTypeAccessor< ParticleDef > objectTypeAcc
the object type accessor for the particle container
Definition
MomentumAccessorExampleTool.h:72
columnar::MomentumAccessorExampleTool::momAcc
MomentumAccessors< ParticleDef > momAcc
the momentum accessors for the particle container
Definition
MomentumAccessorExampleTool.h:64
columnar
Definition
ClusterDef.h:16
columnar::resetObjectType
void resetObjectType(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool, xAODType::ObjectType type)
Definition
MomentumAccessors.h:371
columnar::EventContextRange
ObjectRange< EventContextDef > EventContextRange
Definition
ContainerId.h:211
columnar::EventContextId
ObjectId< EventContextDef > EventContextId
Definition
ContainerId.h:212
columnar::ParticleId
ObjectId< ParticleDef > ParticleId
Definition
ParticleDef.h:33
columnar::ParticleRange
ObjectRange< ParticleDef > ParticleRange
Definition
ParticleDef.h:32
type
Generated on
for ATLAS Offline Software by
1.17.0