ATLAS Offline Software
PhysicsAnalysis
Columnar
ColumnarExampleTools
Root
OptionalColumnExampleTool.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/OptionalColumnExampleTool.h
>
12
13
//
14
// method implementations
15
//
16
17
namespace
columnar
18
{
19
OptionalColumnExampleTool ::
20
OptionalColumnExampleTool
(
const
std::string&
name
)
21
: AsgTool (
name
)
22
{}
23
24
25
26
StatusCode
OptionalColumnExampleTool ::
27
initialize
()
28
{
29
// give the base class a chance to initialize the column accessor
30
// backends
31
ANA_CHECK
(initializeColumns());
32
return
StatusCode::SUCCESS;
33
}
34
35
36
37
void
OptionalColumnExampleTool ::
38
callEvents
(
EventContextRange
events
)
const
39
{
40
// loop over all events and particles. note that this is
41
// deliberately looping by value, as the ID classes are very small
42
// and can be copied cheaply. this could have also been written as
43
// a single loop over all particles in the event range, but I chose
44
// to split it up into two loops as most tools will need to do some
45
// per-event things, e.g. retrieve `EventInfo`.
46
for
(
columnar::EventContextId
event
:
events
)
47
{
48
for
(
columnar::ParticleId
particle
:
particlesHandle
(
event
))
49
{
50
// check if the corrected pt is available, and use it if it is
51
// and the default pt otherwise
52
if
(
ptCorrAcc
.isAvailable(
particle
))
53
selectionDec
(
particle
) = (
ptCorrAcc
(
particle
) >
m_ptCut
.value());
54
else
55
selectionDec
(
particle
) = (
ptAcc
(
particle
) >
m_ptCut
.value());
56
}
57
}
58
}
59
}
columnar::OptionalColumnExampleTool::callEvents
virtual void callEvents(EventContextRange events) const override
Definition:
OptionalColumnExampleTool.cxx:38
columnar::OptionalColumnExampleTool::ptCorrAcc
ParticleAccessor< float > ptCorrAcc
an accessor for an optional corrected pt
Definition:
OptionalColumnExampleTool.h:67
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition:
ParticleHypothesis.h:79
columnar::OptionalColumnExampleTool::particlesHandle
ParticleAccessor< ObjectColumn > particlesHandle
the object accessor for the particles
Definition:
OptionalColumnExampleTool.h:50
columnar::OptionalColumnExampleTool::m_ptCut
Gaudi::Property< float > m_ptCut
the pt cut to apply
Definition:
OptionalColumnExampleTool.h:42
columnar::OptionalColumnExampleTool::selectionDec
ParticleDecorator< char > selectionDec
the selection decorator for the particles
Definition:
OptionalColumnExampleTool.h:78
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition:
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
columnar::ObjectRange
a class representing a continuous sequence of objects (a.k.a. a container)
Definition:
ContainerId.h:177
python.DataFormatRates.events
events
Definition:
DataFormatRates.py:105
OptionalColumnExampleTool.h
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
columnar::OptionalColumnExampleTool::OptionalColumnExampleTool
OptionalColumnExampleTool(const std::string &name)
Definition:
OptionalColumnExampleTool.cxx:20
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
columnar::ObjectId
a class representing a single object (electron, muons, etc.)
Definition:
ContainerId.h:178
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:240
columnar
Definition:
ClusterDef.h:16
columnar::OptionalColumnExampleTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition:
OptionalColumnExampleTool.cxx:27
columnar::OptionalColumnExampleTool::ptAcc
ParticleAccessor< float > ptAcc
the pt accessor for the particle container
Definition:
OptionalColumnExampleTool.h:58
Generated on Mon Sep 29 2025 21:16:13 for ATLAS Offline Software by
1.8.18