ATLAS Offline Software
Loading...
Searching...
No Matches
AsgNumDecorationSelectionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ASG_ANALYSIS_ALGORITHMS__ASG_NUM_DECORATION_SELECTION_TOOL_H
6#define ASG_ANALYSIS_ALGORITHMS__ASG_NUM_DECORATION_SELECTION_TOOL_H
7
8#include <AsgTools/AsgTool.h>
13#include <memory>
14#include <typeinfo>
15
16#include <xAODBase/IParticle.h>
17
18namespace CP
19{
22
23 template <typename T>
25 : public asg::AsgTool, public virtual IAsgSelectionTool
26 {
27 public:
28 #ifndef XAOD_STANDALONE
29 AsgNumDecorationSelectionTool(const std::string& type,
30 const std::string& myname,
31 const IInterface* parent);
33 #else
34 AsgNumDecorationSelectionTool(const std::string& myname);
35 #endif
36
37 virtual StatusCode initialize() override;
38 virtual const asg::AcceptInfo& getAcceptInfo() const override;
39 virtual asg::AcceptData accept(const xAOD::IParticle *particle) const override;
40
41 private:
42 // Helper function to generate type-dependent default name
43 static std::string getDefaultDecorationName() {
44 std::string typeName = typeid(T).name();
45 return "dummy_" + typeName;
46 }
47
48 Gaudi::Property<std::string> m_name {this, "decorationName", getDefaultDecorationName(), "name of the decoration on which the cuts are applied"};
49 Gaudi::Property<bool> m_doEqual {this, "doEqual", false, "require to equal a value"};
50 Gaudi::Property<bool> m_doMin {this, "doMin", false, "require a min value"};
51 Gaudi::Property<bool> m_doMax {this, "doMax", false, "require a max value"};
52 Gaudi::Property<float> m_equal {this, "equal", 0.0f, "equal value to require"};
53 Gaudi::Property<float> m_min {this, "min", 0.0f, "minimum value to require"};
54 Gaudi::Property<float> m_max {this, "max", 0.0f, "maximum value to require"};
55
56 int m_equalCutIndex{ -1 };
57 int m_minCutIndex{ -1 };
58 int m_maxCutIndex{ -1 };
59
60 std::unique_ptr<SG::ConstAccessor<T>> m_accessor;
61
63 };
64
67 {
68 public:
69 #ifndef XAOD_STANDALONE
70 AsgNumDecorationSelectionToolInt(const std::string& type,
71 const std::string& myname,
72 const IInterface* parent);
73 #else
74 AsgNumDecorationSelectionToolInt(const std::string& myname);
75 #endif
76 };
77
79 : public AsgNumDecorationSelectionTool<uint8_t>
80 {
81 public:
82 #ifndef XAOD_STANDALONE
84 const std::string& myname,
85 const IInterface* parent);
86 #else
87 AsgNumDecorationSelectionToolUInt8(const std::string& myname);
88 #endif
89 };
90}
91
92#endif
Base class for elements of a container that can have aux data.
AsgNumDecorationSelectionToolInt(const std::string &type, const std::string &myname, const IInterface *parent)
AsgNumDecorationSelectionToolUInt8(const std::string &type, const std::string &myname, const IInterface *parent)
virtual const asg::AcceptInfo & getAcceptInfo() const override
Declare the interface ID for this pure-virtual interface class to the Athena framework.
virtual asg::AcceptData accept(const xAOD::IParticle *particle) const override
The main accept method: the actual cuts are applied here.
AsgNumDecorationSelectionTool(const std::string &type, const std::string &myname, const IInterface *parent)
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
std::unique_ptr< SG::ConstAccessor< T > > m_accessor
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.