ATLAS Offline Software
Loading...
Searching...
No Matches
StringExampleTool.h File Reference
Include dependency graph for StringExampleTool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

namespace ADD_CMODE (columnar)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( columnar )
Author
Nils Krumnack

an example of a columnar tool that reads a vector column

This illustrates how to read vector columns in a tool. The actual example is a bit arcane, but it hopefully illustrates how to read vector columns.

the pt cut to apply

the object accessor for the met map

This is equivalent to a ReadHandleKey in the xAOD world. It is used to access the met range/container for a given event.

a string column accessor

There is essentially just a single string column in PHYSLITE, so I'm going with that.

the selection decorator for the met terms

This is the equivalent to an AuxElement::Decorator in the xAOD world. One thing to note is that the tools generally run on many objects, not a a single object. So the tool doesn't have the option to return individual output values. Instead it needs to provide an output value per object, which in the columnar world is done by filling a column.

Definition at line 1 of file StringExampleTool.h.

20{
26
27 class StringExampleTool final
28 : public asg::AsgTool,
30 {
31 public:
32
33 // Create a proper constructor for Athena
34 ASG_TOOL_CLASS( StringExampleTool, asg::IAsgTool )
35
36 StringExampleTool (const std::string& name);
37
38 virtual StatusCode initialize () override;
39
40 virtual void callEvents (columnar::EventContextRange events) const override;
41
42
44 Gaudi::Property<float> m_ptCut {this, "ptCut", 10e3, "pt cut (in MeV)"};
45
46
53
54
59 columnar::MetAccessor<std::string> nameAcc {*this, "name"};
60
61
70 columnar::MetDecorator<char> selectionDec {*this, "selection"};
71 };
72}
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition AsgTool.h:133
the base class for all columnar components
::StatusCode StatusCode
StatusCode definition for legacy code.
ObjectRange< EventContextDef > EventContextRange
AccessorTemplate< MetDef, CT, ColumnAccessMode::input, CM > MetAccessor
Definition MetDef.h:49
AccessorTemplate< MetDef, CT, ColumnAccessMode::output, CM > MetDecorator
Definition MetDef.h:50