ATLAS Offline Software
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  // Create a proper constructor for Athena
42 
43  ModularExampleTool (const std::string& name);
44 
45  virtual StatusCode initialize () override;
46 
47  virtual void callEvents (EventContextRange events) const override;
48 
49 
51  Gaudi::Property<float> m_ptCut {this, "ptCut", 10e3, "pt cut (in MeV)"};
52 
54  Gaudi::Property<float> m_etaCut {this, "etaCut", 2.47, "max eta cut"};
55 
56 
63 
64 
73  ParticleDecorator<char> selectionDec {*this, "selection"};
74 
75 
80  struct SubtoolPt : public ColumnarTool<>
81  {
82  SubtoolPt (float val_cutValue);
83  bool select (ParticleId particle) const;
84 
85  // this accessor isn't actually used, but it needs to be declared
86  // so that in columnar mode the accessors know the name of the
87  // object for each column. it the subtool is connected before the
88  // accessors get connected (i.e. via the base class constructor),
89  // this isn't needed.
91 
93  float m_cutValue = 0;
94  };
95  std::unique_ptr<SubtoolPt> m_subtoolPt;
96 
97 
98 
99 
108  struct SubtoolEta : public ColumnarTool<>
109  {
110  SubtoolEta (ColumnarTool<>* parent, float val_cutValue);
111  bool select (ParticleId particle) const;
112 
114  float m_cutValue = 0;
115  };
116  std::unique_ptr<SubtoolEta> m_subtoolEta;
117  };
118 }
119 
120 #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
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:79
columnar::ModularExampleTool::SubtoolPt::particlesHandle
ParticleAccessor< ObjectColumn > particlesHandle
Definition: ModularExampleTool.h:90
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:92
columnar::ModularExampleTool::SubtoolEta
a simple subobject that does a selection on eta
Definition: ModularExampleTool.h:109
columnar::ModularExampleTool::particlesHandle
ParticleAccessor< ObjectColumn > particlesHandle
the object accessor for the particles
Definition: ModularExampleTool.h:62
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition: IAsgTool.h:41
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:93
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
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:73
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:54
columnar::ModularExampleTool::m_subtoolPt
std::unique_ptr< SubtoolPt > m_subtoolPt
Definition: ModularExampleTool.h:95
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:81
ColumnAccessor.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ObjectColumn.h
ColumnarTool.h
columnar::final
CM final
Definition: ColumnAccessor.h:106
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:51
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::ModularExampleTool::m_subtoolEta
std::unique_ptr< SubtoolEta > m_subtoolEta
Definition: ModularExampleTool.h:116
columnar
Definition: ClusterDef.h:16
columnar::ModularExampleTool::SubtoolEta::m_cutValue
float m_cutValue
Definition: ModularExampleTool.h:114
columnar::ModularExampleTool::SubtoolEta::etaAcc
ParticleAccessor< float > etaAcc
Definition: ModularExampleTool.h:113
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
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