ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Columnar
ColumnarExampleTools
Root
ConfigurableColumnExampleTool.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/ConfigurableColumnExampleTool.h
>
12
13
//
14
// method implementations
15
//
16
17
namespace
columnar
18
{
19
ConfigurableColumnExampleTool ::
20
ConfigurableColumnExampleTool (
const
std::string& name)
21
:
AsgTool
(name)
22
{}
23
24
25
26
StatusCode ConfigurableColumnExampleTool ::
27
initialize ()
28
{
29
if
(
m_ptVar
.empty())
30
{
31
ATH_MSG_ERROR
(
"no pt variable specified"
);
32
return
StatusCode::FAILURE;
33
}
34
// set the accessor for the pt variable the user configured
35
resetAccessor
(
ptAcc
, *
this
,
m_ptVar
.value());
36
37
// give the base class a chance to initialize the column accessor
38
// backends
39
ANA_CHECK
(initializeColumns());
40
return
StatusCode::SUCCESS;
41
}
42
43
44
45
void
ConfigurableColumnExampleTool ::
46
callEvents (
EventContextRange
events)
const
47
{
48
// loop over all events and particles. note that this is
49
// deliberately looping by value, as the ID classes are very small
50
// and can be copied cheaply. this could have also been written as
51
// a single loop over all particles in the event range, but I chose
52
// to split it up into two loops as most tools will need to do some
53
// per-event things, e.g. retrieve `EventInfo`.
54
for
(
columnar::EventContextId
event : events)
55
{
56
for
(
columnar::ParticleId
particle :
particlesHandle
(event))
57
{
58
selectionDec
(particle) = (
ptAcc
(particle) >
m_ptCut
.value());
59
}
60
}
61
}
62
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ConfigurableColumnExampleTool.h
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
columnar::ConfigurableColumnExampleTool::m_ptCut
Gaudi::Property< float > m_ptCut
the pt cut to apply
Definition
ConfigurableColumnExampleTool.h:46
columnar::ConfigurableColumnExampleTool::ptAcc
ParticleAccessor< float > ptAcc
the pt accessor for the particle container
Definition
ConfigurableColumnExampleTool.h:62
columnar::ConfigurableColumnExampleTool::particlesHandle
ParticleAccessor< ObjectColumn > particlesHandle
the object accessor for the particles
Definition
ConfigurableColumnExampleTool.h:54
columnar::ConfigurableColumnExampleTool::selectionDec
ParticleDecorator< char > selectionDec
the selection decorator for the particles
Definition
ConfigurableColumnExampleTool.h:73
columnar::ConfigurableColumnExampleTool::m_ptVar
Gaudi::Property< std::string > m_ptVar
the pt variable to use
Definition
ConfigurableColumnExampleTool.h:43
columnar
Definition
ClusterDef.h:16
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::resetAccessor
void resetAccessor(AccessorTemplate< CI, CT, CAM, CM > &accessor, ColumnarTool< CM > &columnBase, const std::string &name, ColumnAccessorOptions &&options={})
reset a column accessor to point to a new column
Definition
ColumnAccessor.h:265
Generated on
for ATLAS Offline Software by
1.17.0