ATLAS Offline Software
Loading...
Searching...
No Matches
TrackViewMatchingTool.cxx
Go to the documentation of this file.
1
9
11#include "TBestMatch.h"
12#include "OfflineTruthMatcher.h"
13
16// #include "MsgMacros.h"
17
18template<typename T, typename R>
20 const std::string& name,
21 const IInterface* parent )
22 : AthAlgTool( type, name, parent )
23{ }
24
25
26template<typename T, typename R>
28
29 // MY_MSG_DEBUG << "TMatchingTool: type=" << m_matcherType << endmsg;
30
31 if ( m_matcherType == "DeltaR" ) m_matcher = std::make_unique<TDeltaRMatcher<T,R>>( "DeltaRMatcher", require_set(m_dr) );
32 else if ( m_matcherType == "DeltaPhi" ) m_matcher = std::make_unique<TDeltaPhiMatcher<T,R>>( "DeltaPhiMatcher", require_set(m_dphi) );
33 else if ( m_matcherType == "Sigma" ) m_matcher = std::make_unique<TSigmaMatcher<T,R>>( "SigmaMatcher", require_set(m_dsigma) );
34 else if ( m_matcherType == "SecondBestpT" ) m_matcher = std::make_unique<TSecondBestpTMatcher<T,R>>( "SecondBestpTMatcher", require_set(m_dpt) );
35 else if ( m_matcherType == "OfflineTruth" ) m_matcher = std::make_unique<TOfflineTruthMatcher<T,R>>( "OfflineTruthMatcher", require_set(m_prob) );
36 else if ( m_matcherType == "DeltaRZ" ) m_matcher = std::make_unique<TDeltaRZMatcher<T,R>>( "DeltaRZMatcher", require_set(m_deta), require_set(m_dphi), require_set(m_dzed) );
37 else if ( m_matcherType == "DeltaRZSinTheta" ) m_matcher = std::make_unique<TDeltaRZSinThetaMatcher<T,R>>( "DeltaRZSinThetaMatcher", require_set(m_deta), require_set(m_dphi), require_set(m_dzed) );
38 else if ( m_matcherType == "Default" ) {
39 float dr = 0.01;
40 if ( m_dr.isset() ) dr = m_dr;
41 m_matcher = std::make_unique<TDeltaRMatcher<T,R>>( "DeltaRMatcher", dr );
42 }
43 else {
44 // MY_MSG_FATAL << "Unknown matcher type: " << m_matcherType << endmsg;
45 return StatusCode::FAILURE;
46 }
47
48 return StatusCode::SUCCESS;
49}
50
51
52template<typename T, typename R>
53std::unique_ptr<TIDA::Associator<T,R> >
54IDTPM2::TMatchingTool<T,R>::clone() const { return m_matcher->uclone(); }
55
56template<typename T, typename R>
57std::unique_ptr<TIDA::Associator<T,R>>
58IDTPM2::TMatchingTool<T,R>::uclone() const { return m_matcher->uclone(); }
59
60
const T & require_set(const T &t)
Templated Athena tool that creates and owns a single TIDA::Associator matcher.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
ConfiguredValueProperty< float > m_dpt
ConfiguredValueProperty< float > m_dzed
Gaudi::Property< std::string > m_matcherType
ConfiguredValueProperty< float > m_prob
TMatchingTool(const std::string &type, const std::string &name, const IInterface *parent)
in a different merge request, so can uncomment later, once it is in the release to avoid a conflict
ConfiguredValueProperty< float > m_dr
NB: not all these parameters need to be set, only the appropriate ones for the requested matcher.
ConfiguredValueProperty< float > m_deta
ConfiguredValueProperty< float > m_dsigma
virtual StatusCode initialize() override
ConfiguredValueProperty< float > m_dphi
std::unique_ptr< TIDA::Associator< T, R > > clone() const
Return a fresh clone of the template matcher.
std::unique_ptr< TIDA::Associator< T, R > > m_matcher
std::unique_ptr< TIDA::Associator< T, R > > uclone() const