ATLAS Offline Software
Loading...
Searching...
No Matches
R3MatchingTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGGERMATCHINGTOOL_R3MATCHINGTOOL_H
6#define TRIGGERMATCHINGTOOL_R3MATCHINGTOOL_H
7
8#include "AsgTools/AsgTool.h"
10#include "AsgTools/ToolHandle.h"
15
16#include <mutex>
17
18namespace Trig
19{
20 class R3MatchingTool : public asg::AsgTool, virtual public IMatchingTool
21 {
23 public:
24 using multInfo_t = std::vector<std::size_t>;
25 using typeInfo_t = std::vector<xAODType::ObjectType>;
26 using chainInfo_t = std::pair<multInfo_t, typeInfo_t>;
27
28 R3MatchingTool(const std::string &name);
30
31 virtual StatusCode initialize() override;
32
33 virtual bool match(
34 const std::vector<const xAOD::IParticle *> &recoObjects,
35 std::string_view chain,
36 double matchThreshold,
37 bool rerun) const override;
38
39 virtual bool match(
40 const xAOD::IParticle &recoObject,
41 std::string_view chain,
42 double matchThreshold,
43 bool rerun) const override;
44
45 private:
46 ToolHandle<TrigDecisionTool> m_trigDecTool;
47 ToolHandle<Trig::IMatchScoringTool> m_scoreTool{
48 this, "ScoringTool", "Trig::DRScoringTool","Tool to score pairs of particles"};
49 Gaudi::Property<bool> m_includeSubfeatures{
50 this, "IncludeSubfeatures", false,
51 "When true, also retrieve 'subfeature' links (lower-pT objects from Run2->Run3 conversion)"};
52 bool matchObjects(
53 const xAOD::IParticle *reco,
55 xAODType::ObjectType onlineType,
56 std::map<std::pair<uint32_t, uint32_t>, bool> &cache,
57 double drThreshold) const;
58
59
60
61 // Keep a cache of the interpreted chain information
62 mutable std::map<std::string, chainInfo_t> m_chainInfoCache ATLAS_THREAD_SAFE;
63 mutable std::mutex m_chainInfoMutex ATLAS_THREAD_SAFE;
64 const chainInfo_t &getChainInfo(const std::string &chain) const;
65
66
67 // Internal functions
69 virtual MatchingImplementation *impl() const override { return nullptr; }
70
71 }; //> end class R3MatchingTool
72} // namespace Trig
73
74#endif //> !TRIGGERMATCHINGTOOL_R3MATCHINGTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Define macros for attributes used to control the static checker.
ToolHandle< Trig::IMatchScoringTool > m_scoreTool
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
bool matchObjects(const xAOD::IParticle *reco, const ElementLink< xAOD::IParticleContainer > &onlineLink, xAODType::ObjectType onlineType, std::map< std::pair< uint32_t, uint32_t >, bool > &cache, double drThreshold) const
std::map< std::string, chainInfo_t > m_chainInfoCache ATLAS_THREAD_SAFE
virtual MatchingImplementation * impl() const override
Inherited from the interface but does nothing.
ToolHandle< TrigDecisionTool > m_trigDecTool
const chainInfo_t & getChainInfo(const std::string &chain) const
std::vector< std::size_t > multInfo_t
R3MatchingTool(const std::string &name)
std::vector< xAODType::ObjectType > typeInfo_t
virtual bool match(const std::vector< const xAOD::IParticle * > &recoObjects, std::string_view chain, double matchThreshold, bool rerun) const override
multi-object trigger matching
Gaudi::Property< bool > m_includeSubfeatures
std::pair< multInfo_t, typeInfo_t > chainInfo_t
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class providing the definition of the 4-vector interface.
The common trigger namespace for trigger analysis tools.
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32