ATLAS Offline Software
Loading...
Searching...
No Matches
MatchFromCompositeTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2015 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TriggerMatchingTool_MatchFromCompositeTool_H
6#define TriggerMatchingTool_MatchFromCompositeTool_H
7
8// Framework includes
9#include "AsgTools/AsgTool.h"
11#include "AthLinks/ElementLink.h"
14#include "SGCore/sgkey_t.h"
15
16// Package includes
18
19
20namespace Trig {
26 class MatchFromCompositeTool final : public virtual IMatchingTool,
27 public asg::AsgTool
28 {
30 public:
32 MatchFromCompositeTool(const std::string& name);
33
35 ~MatchFromCompositeTool() override;
36
38 StatusCode initialize() override;
39
50 bool match(
51 const xAOD::IParticle& recoObject,
52 const std::string& chain,
53 double=0.1, bool=false) const override;
54
65 bool match(
66 const std::vector<const xAOD::IParticle*>& recoObject,
67 const std::string& chain,
68 double=0.1, bool=false) const override;
69
70 protected:
72 template <typename T>
74 template <typename T>
76 template <typename T>
77 using vecLink_t = std::vector<ElementLink<T>>;
78
79 // Properties
81 bool m_matchShallow = true;
82
85 float m_drThreshold = -1;
86
88 std::string m_inputPrefix;
89
90#ifdef XAOD_STANDALONE
92 bool m_remapBrokenLinks = false;
93
95 std::vector<std::string> m_remapContainers{
96 "Electrons", "Photons", "Muons", "TauJets"};
98 std::vector<CLID> m_remapCLIDs{
99 1087532415, 1105575213, 1178459224, 1177172564};
100#endif
101
102 // Internal functions
104 virtual MatchingImplementation* impl() const override { return nullptr; }
105
112 bool testCombination(
113 const vecLink_t<xAOD::IParticleContainer>& onlineLinks,
114 const std::vector<const xAOD::IParticle*>& offline) const;
115
117 bool areTheSame(
118 const xAOD::IParticle& lhs,
119 const xAOD::IParticle& rhs) const;
120
121 std::map<SG::sgkey_t, SG::sgkey_t> m_keyRemap;
122 }; //> end class MatchFromCompositeTool
123} //> end namespace Trig
124
125#endif //> TriggerMatchingTool_MatchFromCompositeTool_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Base class for elements of a container that can have aux data.
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
std::map< SG::sgkey_t, SG::sgkey_t > m_keyRemap
~MatchFromCompositeTool() override
Default destructor.
MatchFromCompositeTool(const std::string &name)
Standard constructor.
bool match(const xAOD::IParticle &recoObject, const std::string &chain, double=0.1, bool=false) const override
Match a single object.
SG::AuxElement::Decorator< T > dec_t
float m_drThreshold
If greater than 0 then will skip the above check and just check that DR between the two particles is ...
std::vector< ElementLink< T > > vecLink_t
StatusCode initialize() override
Initialise the tool.
bool testCombination(const vecLink_t< xAOD::IParticleContainer > &onlineLinks, const std::vector< const xAOD::IParticle * > &offline) const
Test a combination of offline objects against a combination of online objects.
SG::AuxElement::ConstAccessor< T > constAcc_t
Helper typedefs for accessors/decorators, vectors of ele links.
bool areTheSame(const xAOD::IParticle &lhs, const xAOD::IParticle &rhs) const
Check if two particles are the same.
std::string m_inputPrefix
The prefix to expect at the front of the trig composite container name.
bool m_matchShallow
Allow matching shallow copy to shallow copy.
virtual MatchingImplementation * impl() const override
Inherited from the interface but does nothing.
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.