ATLAS Offline Software
Loading...
Searching...
No Matches
SimpleSelectorExampleTool.cxx File Reference
Include dependency graph for SimpleSelectorExampleTool.cxx:

Go to the source code of this file.

Functions

namespace ADD_CMODE (columnar)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( columnar )
Author
Nils Krumnack

Definition at line 1 of file SimpleSelectorExampleTool.cxx.

18{
19 SimpleSelectorExampleTool ::
20 SimpleSelectorExampleTool (const std::string& name)
21 : AsgTool (name)
22 {}
23
24
25
26 StatusCode SimpleSelectorExampleTool ::
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 SimpleSelectorExampleTool ::
38 callSingleEvent (columnar::ParticleRange particles) const
39 {
40 for (columnar::ParticleId particle : particles)
41 {
42 selectionDec(particle) = ptAcc(particle) > m_ptCut.value();
43 }
44 }
45
46
47
48 void SimpleSelectorExampleTool ::
49 callEvents (columnar::EventContextRange events) const
50 {
51 // loop over all events and particles. note that this is
52 // deliberately looping by value, as the ID classes are very small
53 // and can be copied cheaply. this could have also been written as
54 // a single loop over all particles in the event range, but I chose
55 // to split it up into two loops as most tools will need to do some
56 // per-event things, e.g. retrieve `EventInfo`.
57 for (columnar::EventContextId event : events)
58 {
59 callSingleEvent (particlesHandle(event));
60 }
61 }
62}
#define ANA_CHECK(EXP)
check whether the given expression was successful
::StatusCode StatusCode
StatusCode definition for legacy code.
ObjectRange< EventContextDef > EventContextRange
ObjectId< EventContextDef > EventContextId
ObjectId< ParticleDef > ParticleId
Definition ParticleDef.h:33
ObjectRange< ParticleDef > ParticleRange
Definition ParticleDef.h:32