ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkTrigger
src
TriggerMatchingTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef DERIVATIONFRAMEWORKTRIGGER_TRIGGERMATCHINGTOOL_H
6
#define DERIVATIONFRAMEWORKTRIGGER_TRIGGERMATCHINGTOOL_H
7
8
#include "
AthenaBaseComps/AthAlgTool.h
"
9
#include "
CxxUtils/checker_macros.h
"
10
#include "
DerivationFrameworkInterfaces/IAugmentationTool.h
"
11
#include "GaudiKernel/ToolHandle.h"
12
#include "
TriggerMatchingTool/IIParticleRetrievalTool.h
"
13
#include "
TriggerMatchingTool/IMatchScoringTool.h
"
14
#include "
TrigDecisionTool/TrigDecisionTool.h
"
15
#include "
xAODBase/IParticle.h
"
16
#include "
xAODBase/IParticleContainer.h
"
17
#include "
xAODTrigger/TrigCompositeContainer.h
"
18
#include "
StoreGate/ReadHandleKey.h
"
19
#include <vector>
20
21
namespace
DerivationFramework
22
{
38
class
TriggerMatchingTool
final :
public
extends<AthAlgTool, IAugmentationTool>
39
{
40
public
:
42
using
particleVec_t
= std::vector<const xAOD::IParticle *>;
44
TriggerMatchingTool
(
45
const
std::string &
type
,
46
const
std::string &name,
47
const
IInterface *pSvcLocator);
48
50
virtual
StatusCode
initialize
()
override
;
51
53
virtual
StatusCode
addBranches
(
const
EventContext& ctx)
const override
;
54
55
private
:
56
// Properties
58
mutable
std::vector<std::string> m_chainNames
ATLAS_THREAD_SAFE
;
59
// This being mutable isn't exactly the greatest thing but we can't check
60
// whether the chains actually exist before the first event. A better
61
// solution would be to filter the chains by what is available in the
62
// input file but I don't know if that's possible.
63
// It is thread-safe because the mutable operation is done as part of a
64
// static const initialization on the first call of addBranches().
65
67
ToolHandle<Trig::IIParticleRetrievalTool>
m_trigParticleTool
{
"Trig::IParticleRetrievalTool/OnlineParticleTool"
};
68
70
std::map<xAOD::Type::ObjectType, SG::ReadHandleKey<xAOD::IParticleContainer>>
m_offlineInputs
;
71
73
float
m_drThreshold
;
74
76
bool
m_rerun
;
77
79
std::string
m_outputPrefix
;
80
83
bool
m_checkEmptyChainGroups
;
84
87
bool
m_inputDependentConfig
;
88
90
ToolHandle<Trig::TrigDecisionTool>
m_tdt
{
"Trig::TrigDecisionTool/TrigDecisionTool"
};
91
93
ToolHandle<Trig::IMatchScoringTool>
m_scoreTool
{
94
this
,
"ScoringTool"
,
"Trig::DRScoringTool"
,
"The pair scoring tool"
};
95
96
// Internal functions
104
StatusCode
createOutputContainer
(
105
xAOD::TrigCompositeContainer
*&container,
106
const
std::string &chain)
const
;
107
114
const
particleVec_t
&
getCandidateMatchesFor
(
115
const
xAOD::IParticle
*part,
116
std::map<xAOD::Type::ObjectType, particleVec_t> &offlineParticles,
117
std::map<const xAOD::IParticle *, particleVec_t> &cache)
const
;
118
122
bool
matchParticles
(
123
const
xAOD::IParticle
*lhs,
124
const
xAOD::IParticle
*rhs)
const
;
125
};
//> end class TriggerMatchingTool
126
}
// namespace DerivationFramework
127
128
#endif
//> ! DERIVATIONFRAMEWORKTRIGGER_TRIGGERMATCHINGTOOL_H
AthAlgTool.h
IParticle.h
IAugmentationTool.h
IIParticleRetrievalTool.h
IMatchScoringTool.h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
TrigCompositeContainer.h
TrigDecisionTool.h
checker_macros.h
Define macros for attributes used to control the static checker.
DerivationFramework::TriggerMatchingTool::m_checkEmptyChainGroups
bool m_checkEmptyChainGroups
If set, discard any triggers with empty chain groups (break the job otherwise).
Definition
TriggerMatchingTool.h:83
DerivationFramework::TriggerMatchingTool::m_offlineInputs
std::map< xAOD::Type::ObjectType, SG::ReadHandleKey< xAOD::IParticleContainer > > m_offlineInputs
The input containers to use. These are keyed by xAOD object type.
Definition
TriggerMatchingTool.h:70
DerivationFramework::TriggerMatchingTool::ATLAS_THREAD_SAFE
std::vector< std::string > m_chainNames ATLAS_THREAD_SAFE
The list of chain names to match.
Definition
TriggerMatchingTool.h:58
DerivationFramework::TriggerMatchingTool::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override
Calculate the matchings.
Definition
TriggerMatchingTool.cxx:95
DerivationFramework::TriggerMatchingTool::matchParticles
bool matchParticles(const xAOD::IParticle *lhs, const xAOD::IParticle *rhs) const
Check if the dR between two particles is below threshold.
Definition
TriggerMatchingTool.cxx:295
DerivationFramework::TriggerMatchingTool::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
TriggerMatchingTool.cxx:78
DerivationFramework::TriggerMatchingTool::getCandidateMatchesFor
const particleVec_t & getCandidateMatchesFor(const xAOD::IParticle *part, std::map< xAOD::Type::ObjectType, particleVec_t > &offlineParticles, std::map< const xAOD::IParticle *, particleVec_t > &cache) const
Get all offline particles that could match a given online one.
Definition
TriggerMatchingTool.cxx:257
DerivationFramework::TriggerMatchingTool::particleVec_t
std::vector< const xAOD::IParticle * > particleVec_t
Helper typedefs.
Definition
TriggerMatchingTool.h:42
DerivationFramework::TriggerMatchingTool::m_outputPrefix
std::string m_outputPrefix
The prefix to place at the beginning of the output containers.
Definition
TriggerMatchingTool.h:79
DerivationFramework::TriggerMatchingTool::m_tdt
ToolHandle< Trig::TrigDecisionTool > m_tdt
The trig decision tool.
Definition
TriggerMatchingTool.h:90
DerivationFramework::TriggerMatchingTool::createOutputContainer
StatusCode createOutputContainer(xAOD::TrigCompositeContainer *&container, const std::string &chain) const
Create an output container for the named chain.
Definition
TriggerMatchingTool.cxx:240
DerivationFramework::TriggerMatchingTool::m_rerun
bool m_rerun
Whether to match in rerun mode or not.
Definition
TriggerMatchingTool.h:76
DerivationFramework::TriggerMatchingTool::m_trigParticleTool
ToolHandle< Trig::IIParticleRetrievalTool > m_trigParticleTool
The tool to retrieve the online candidates.
Definition
TriggerMatchingTool.h:67
DerivationFramework::TriggerMatchingTool::TriggerMatchingTool
TriggerMatchingTool(const std::string &type, const std::string &name, const IInterface *pSvcLocator)
Constructor.
Definition
TriggerMatchingTool.cxx:41
DerivationFramework::TriggerMatchingTool::m_inputDependentConfig
bool m_inputDependentConfig
If using an input-file-dependent config then we warn when triggers are removed.
Definition
TriggerMatchingTool.h:87
DerivationFramework::TriggerMatchingTool::m_drThreshold
float m_drThreshold
The DR threshold to use.
Definition
TriggerMatchingTool.h:73
DerivationFramework::TriggerMatchingTool::m_scoreTool
ToolHandle< Trig::IMatchScoringTool > m_scoreTool
The pair scoring tool.
Definition
TriggerMatchingTool.h:93
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
xAOD::TrigCompositeContainer
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.
Definition
TrigCompositeContainer.h:17
type
IParticleContainer.h
Generated on
for ATLAS Offline Software by
1.17.0