Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ModularExampleTool.h
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 #ifndef COLUMNAR_EXAMPLE_TOOLS_MODULAR_EXAMPLE_TOOL_H
9 #define COLUMNAR_EXAMPLE_TOOLS_MODULAR_EXAMPLE_TOOL_H
10 
11 #include <AsgTools/AsgTool.h>
17 
18 namespace columnar
19 {
33 
35  : public asg::AsgTool,
36  public ColumnarTool<>
37  {
38  public:
39 
40  ModularExampleTool (const std::string& name);
41 
42  virtual StatusCode initialize () override;
43 
44  virtual void callEvents (EventContextRange events) const override;
45 
46 
48  Gaudi::Property<float> m_ptCut {this, "ptCut", 10e3, "pt cut (in MeV)"};
49 
51  Gaudi::Property<float> m_etaCut {this, "etaCut", 2.47, "max eta cut"};
52 
53 
60 
61 
70  ParticleDecorator<char> selectionDec {*this, "selection"};
71 
72 
77  struct SubtoolPt : public ColumnarTool<>
78  {
79  SubtoolPt (float val_cutValue);
80  bool select (ParticleId particle) const;
81 
82  // this accessor isn't actually used, but it needs to be declared
83  // so that in columnar mode the accessors know the name of the
84  // object for each column. it the subtool is connected before the
85  // accessors get connected (i.e. via the base class constructor),
86  // this isn't needed.
88 
90  float m_cutValue = 0;
91  };
92  std::unique_ptr<SubtoolPt> m_subtoolPt;
93 
94 
95 
96 
105  struct SubtoolEta : public ColumnarTool<>
106  {
107  SubtoolEta (ColumnarTool<>* parent, float val_cutValue);
108  bool select (ParticleId particle) const;
109 
111  float m_cutValue = 0;
112  };
113  std::unique_ptr<SubtoolEta> m_subtoolEta;
114  };
115 }
116 
117 #endif
columnar::ModularExampleTool::callEvents
virtual void callEvents(EventContextRange events) const override
Definition: ModularExampleTool.cxx:48
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
columnar::ModularExampleTool::SubtoolPt::particlesHandle
ParticleAccessor< ObjectColumn > particlesHandle
Definition: ModularExampleTool.h:87
columnar::ModularExampleTool
an example of a columnar tool with a modular structure
Definition: ModularExampleTool.h:37
columnar::ModularExampleTool::SubtoolPt::ptAcc
ParticleAccessor< float > ptAcc
Definition: ModularExampleTool.h:89
columnar::ModularExampleTool::SubtoolEta
a simple subobject that does a selection on eta
Definition: ModularExampleTool.h:106
columnar::ModularExampleTool::particlesHandle
ParticleAccessor< ObjectColumn > particlesHandle
the object accessor for the particles
Definition: ModularExampleTool.h:59
columnar::ModularExampleTool::ModularExampleTool
ModularExampleTool(const std::string &name)
Definition: ModularExampleTool.cxx:20
columnar::ModularExampleTool::SubtoolPt::select
bool select(ParticleId particle) const
Definition: ModularExampleTool.cxx:75
columnar::ModularExampleTool::SubtoolPt::m_cutValue
float m_cutValue
Definition: ModularExampleTool.h:90
columnar::ObjectRange
a class representing a continuous sequence of objects (a.k.a. a container)
Definition: ObjectRange.h:18
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
columnar::ModularExampleTool::SubtoolEta::SubtoolEta
SubtoolEta(ColumnarTool<> *parent, float val_cutValue)
Definition: ModularExampleTool.cxx:83
columnar::ModularExampleTool::selectionDec
ParticleDecorator< char > selectionDec
the selection decorator for the particles
Definition: ModularExampleTool.h:70
columnar::ModularExampleTool::SubtoolEta::select
bool select(ParticleId particle) const
Definition: ModularExampleTool.cxx:90
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
columnar::ModularExampleTool::m_etaCut
Gaudi::Property< float > m_etaCut
the eta cut to apply
Definition: ModularExampleTool.h:51
columnar::ModularExampleTool::m_subtoolPt
std::unique_ptr< SubtoolPt > m_subtoolPt
Definition: ModularExampleTool.h:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
columnar::ModularExampleTool::SubtoolPt
a simple subobject that does a selection on the pt
Definition: ModularExampleTool.h:78
ColumnAccessor.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ObjectColumn.h
ColumnarTool.h
columnar::ModularExampleTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: ModularExampleTool.cxx:27
columnar::ModularExampleTool::m_ptCut
Gaudi::Property< float > m_ptCut
the pt cut to apply
Definition: ModularExampleTool.h:48
columnar::ObjectId
a class representing a single object (electron, muons, etc.)
Definition: ObjectId.h:18
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
columnar::final
CM final
Definition: ColumnAccessor.h:106
columnar::ModularExampleTool::m_subtoolEta
std::unique_ptr< SubtoolEta > m_subtoolEta
Definition: ModularExampleTool.h:113
columnar
Definition: ClusterDef.h:16
columnar::ModularExampleTool::SubtoolEta::m_cutValue
float m_cutValue
Definition: ModularExampleTool.h:111
columnar::ModularExampleTool::SubtoolEta::etaAcc
ParticleAccessor< float > etaAcc
Definition: ModularExampleTool.h:110
columnar::ModularExampleTool::SubtoolPt::SubtoolPt
SubtoolPt(float val_cutValue)
Definition: ModularExampleTool.cxx:68
columnar::ColumnarTool
the base class for all columnar components
Definition: ColumnAccessorDataArray.h:17
columnar::AccessorTemplate
the raw column accessor template class
Definition: ColumnAccessor.h:81
AsgTool.h
ParticleDef.h