ATLAS Offline Software
Loading...
Searching...
No Matches
R3MatchingTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 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"
14
15#include <mutex>
16
17namespace Trig
18{
19 class R3MatchingTool : public asg::AsgTool, virtual public IMatchingTool
20 {
22 public:
23 using multInfo_t = std::vector<std::size_t>;
24 using typeInfo_t = std::vector<xAODType::ObjectType>;
25 using chainInfo_t = std::pair<multInfo_t, typeInfo_t>;
26
27 R3MatchingTool(const std::string &name);
29
30 virtual StatusCode initialize() override;
31
32 virtual bool match(
33 const std::vector<const xAOD::IParticle *> &recoObjects,
34 const std::string &chain,
35 double matchThreshold,
36 bool rerun) const override;
37
38 virtual bool match(
39 const xAOD::IParticle &recoObject,
40 const std::string &chain,
41 double matchThreshold,
42 bool rerun) const override;
43
44 private:
45 ToolHandle<TrigDecisionTool> m_trigDecTool;
46 ToolHandle<Trig::IMatchScoringTool> m_scoreTool{
47 this, "ScoringTool", "Trig::DRScoringTool","Tool to score pairs of particles"};
48 bool matchObjects(
49 const xAOD::IParticle *reco,
51 xAODType::ObjectType onlineType,
52 std::map<std::pair<uint32_t, uint32_t>, bool> &cache,
53 double drThreshold) const;
54
55
56
57 // Keep a cache of the interpreted chain information
58 mutable std::map<std::string, chainInfo_t> m_chainInfoCache ATLAS_THREAD_SAFE;
59 mutable std::mutex m_chainInfoMutex ATLAS_THREAD_SAFE;
60 const chainInfo_t &getChainInfo(const std::string &chain) const;
61
62
63 // Internal functions
65 virtual MatchingImplementation *impl() const override { return nullptr; }
66
67 }; //> end class R3MatchingTool
68} // namespace Trig
69
70#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)
virtual bool match(const std::vector< const xAOD::IParticle * > &recoObjects, const std::string &chain, double matchThreshold, bool rerun) const override
multi-object trigger matching
std::vector< xAODType::ObjectType > typeInfo_t
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