ATLAS Offline Software
Loading...
Searching...
No Matches
AsgPtEtaSelectionTool.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
9#ifndef ASG_ANALYSIS_ALGORITHMS__ASG_PT_ETA_SELECTION_TOOL_H
10#define ASG_ANALYSIS_ALGORITHMS__ASG_PT_ETA_SELECTION_TOOL_H
11
12#include <AsgTools/AsgTool.h>
16#include <atomic>
17
18namespace CP
19{
33
35 : public asg::AsgTool, virtual public IAsgSelectionTool
36 {
37 //
38 // public interface
39 //
40
41 // Create a proper constructor for Athena
43
44
45
50 public:
52
53
54 //
55 // inherited interface
56 //
57
58 virtual StatusCode initialize () override;
59
60 virtual const asg::AcceptInfo& getAcceptInfo( ) const override;
61
62 virtual asg::AcceptData accept( const xAOD::IParticle *particle ) const override;
63
64
65
66 //
67 // private interface
68 //
69
72
73 private:
74 Gaudi::Property<float> m_minPt {this, "minPt", 0, "minimum pt to require (or 0 for no pt cut)"};
75 Gaudi::Property<float> m_maxPt {this, "maxPt", 0, "maximum pt to require (or 0 for no pt cut)"};
76 Gaudi::Property<float> m_minEta {this, "minEta", 0, "minimum abs(eta) to allow (or 0 for no eta cut)"};
77 Gaudi::Property<float> m_maxEta {this, "maxEta", 0, "maximum abs(eta) to allow (or 0 for no eta cut)"};
78 Gaudi::Property<float> m_etaGapLow {this, "etaGapLow", 0, "low end of the eta gap"};
79 Gaudi::Property<float> m_etaGapHigh {this, "etaGapHigh", 0, "high end of the eta gap (or 0 for no eta gap)"};
80 Gaudi::Property<float> m_minRapidity {this, "minRapidity", 0, "minimum abs(rapidity) to allow (or 0 for no eta cut)"};
81 Gaudi::Property<float> m_maxRapidity {this, "maxRapidity", 0, "maximum abs(rapidity) to allow (or 0 for no eta cut)"};
82 Gaudi::Property<bool> m_useClusterEta {this, "useClusterEta", false, "whether to use the cluster eta (for electrons only)"};
83 Gaudi::Property<bool> m_useDressedProperties {this, "useDressedProperties", false, "whether to use the dressed kinematic properties (for truth particles only)"};
84 Gaudi::Property<bool> m_useConstituentMomentum {this, "useConstituentMomentum", false, "whether to use the constituent momentum (for jets only) (not for pt)"};
85 Gaudi::Property<bool> m_printCastWarning {this, "printCastWarning", true, "whether to print a warning/error when the cast fails"};
86 Gaudi::Property<bool> m_printClusterWarning {this, "printClusterWarning", true, "whether to print a warning/error when the cluster is missing"};
87
89
91 int m_minPtCutIndex{ -1 };
93 int m_maxPtCutIndex{ -1 };
112
123 private:
124 mutable std::atomic<bool> m_shouldPrintCastWarning {true};
125
136 private:
137 mutable std::atomic<bool> m_shouldPrintClusterWarning {true};
138
140 private:
142
144 private:
145 std::unique_ptr<SG::ConstAccessor<float>> m_dressedPtAccessor{};
146 std::unique_ptr<SG::ConstAccessor<float>> m_dressedEtaAccessor{};
147 };
148}
149
150#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Base class for elements of a container that can have aux data.
an IAsgSelectionTool that performs basic pt and eta cut (with an optional eta gap)
int m_jetCastCutIndex
Index for the jet casting.
Gaudi::Property< float > m_maxPt
int m_etaGapCutIndex
Index for the eta gap selection.
std::unique_ptr< SG::ConstAccessor< float > > m_dressedPtAccessor
dressed pt and eta accessors
int m_egammaCastCutIndex
Index for the e/gamma casting.
Gaudi::Property< float > m_etaGapLow
int m_maxEtaCutIndex
Index for the maximum eta selection.
int m_maxPtCutIndex
Index for the maximum pT selection.
virtual asg::AcceptData accept(const xAOD::IParticle *particle) const override
The main accept method: the actual cuts are applied here.
Gaudi::Property< float > m_minEta
Gaudi::Property< bool > m_printClusterWarning
Gaudi::Property< bool > m_useDressedProperties
Gaudi::Property< float > m_minRapidity
Gaudi::Property< bool > m_printCastWarning
std::unique_ptr< SG::ConstAccessor< float > > m_dressedEtaAccessor
int m_egammaClusterCutIndex
Index for the e/gamma calo-cluster.
int m_minPtCutIndex
Index for the minimum pT selection.
Gaudi::Property< bool > m_useClusterEta
int m_maxRapidityCutIndex
Index for the maximum rapidity selection.
std::atomic< bool > m_shouldPrintClusterWarning
a version of m_printClusterWarning that we modify once we printed the warning
Gaudi::Property< float > m_minPt
tool properties
int m_dressedPropertiesIndex
Index for the existence of dressed properties.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
int m_minRapidityCutIndex
Index for the minimum rapidity selection.
asg::AcceptInfo m_accept
the asg::AcceptInfo we are using
std::atomic< bool > m_shouldPrintCastWarning
a version of m_printCastWarning that we modify once we printed the warning
Gaudi::Property< bool > m_useConstituentMomentum
Gaudi::Property< float > m_maxEta
virtual const asg::AcceptInfo & getAcceptInfo() const override
Declare the interface ID for this pure-virtual interface class to the Athena framework.
Gaudi::Property< float > m_etaGapHigh
int m_minEtaCutIndex
Index for the minimum eta selection.
Gaudi::Property< float > m_maxRapidity
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.