ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigPartialEventBuilding
src
RoIPEBInfoWriterTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
RoIPEBInfoWriterTool.h
"
6
#include "
CxxUtils/phihelper.h
"
7
#include <algorithm>
8
#include <unordered_map>
9
#include <string_view>
10
#include "
xAODTrigMissingET/TrigMissingETContainer.h
"
11
12
// =============================================================================
13
14
RoIPEBInfoWriterTool::RoIPEBInfoWriterTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
15
:
PEBInfoWriterToolBase
(
type
,name,parent) {}
16
17
// =============================================================================
18
19
StatusCode
RoIPEBInfoWriterTool::initialize
() {
20
ATH_MSG_DEBUG
(
"Initialising RoIPEBInfoWriterTool/"
<< name());
21
22
ATH_CHECK
(
m_regionSelectorTools
.retrieve());
23
24
m_extraPebInfo
.robs.insert(
m_extraROBs
.begin(),
m_extraROBs
.end());
25
m_extraPebInfo
.subdets.insert(
m_extraSubDets
.begin(),
m_extraSubDets
.end());
26
ATH_MSG_DEBUG
(
"Extra PEBInfo attached to every passed event: "
<<
m_extraPebInfo
);
27
28
return
StatusCode::SUCCESS;
29
}
30
31
// =============================================================================
32
33
PEBInfoWriterToolBase::PEBInfo
RoIPEBInfoWriterTool::createPEBInfo
(
const
EventContext& ctx,
const
PEBInfoWriterToolBase::Input
& input)
const
{
34
// Create output PEBInfo starting from the static extra PEBInfo
35
PEBInfo
pebi =
m_extraPebInfo
;
36
37
ATH_MSG_DEBUG
(
"Processing RoI "
<< **(input.roiEL));
38
// Assert we're not being passed a full-scan RoI which makes no sense for RoI-based PEB
39
if
((*input.roiEL)->isFullscan()) {
40
auto
met_feature_vec =
TrigCompositeUtils::findLinks<xAOD::TrigMissingETContainer>
(ctx, input.decision,
TrigCompositeUtils::featureString
(),
TrigDefs::lastFeatureOfType
);
41
if
(not met_feature_vec.empty()) {
42
ATH_MSG_DEBUG
(
"Ignoring MET leg passed to RoIPEBInfoWriterTool"
);
43
return
pebi;
44
}
else
{
45
ATH_MSG_ERROR
(
"Full-scan RoI passed as input to RoIPEBInfoWriterTool"
);
46
return
{};
47
}
48
}
49
50
float
eta
= (*input.roiEL)->
eta
();
51
float
etaMin =
eta
-
m_etaWidth
;
52
float
etaMax =
eta
+
m_etaWidth
;
53
// Stop further execution if RoI is entirely outside the max |eta| range
54
if
(etaMin >
m_etaEdge
|| etaMax < -
m_etaEdge
) {
55
ATH_MSG_DEBUG
(
"The eta range ("
<< etaMin <<
", "
<< etaMax <<
") is outside |eta|<"
<<
m_etaEdge
56
<<
" - skipping this RoI"
);
57
return
pebi;
58
}
59
// Restrict the eta range
60
etaMin = std::max(-
m_etaEdge
.value(), etaMin);
61
etaMax = std::min(
m_etaEdge
.value(), etaMax);
62
63
float
phi
= (*input.roiEL)->
phi
();
64
float
phiMin =
CxxUtils::wrapToPi
(
phi
-
m_phiWidth
);
// range (-pi, pi)
65
float
phiMax =
CxxUtils::wrapToPi
(
phi
+
m_phiWidth
);
// range (-pi, pi)
66
67
TrigRoiDescriptor
roiForPEB(
eta
, etaMin, etaMax,
phi
, phiMin, phiMax);
68
69
for
(
const
auto
& tool :
m_regionSelectorTools
) {
70
std::vector<uint32_t> detROBs;
71
tool->lookup(ctx)->ROBIDList(roiForPEB, detROBs);
72
pebi.
robs
.insert(detROBs.begin(),detROBs.end());
73
}
74
75
ATH_MSG_DEBUG
(
"Created PEBInfo = "
<< pebi);
76
return
pebi;
77
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TrigMissingETContainer.h
RoIPEBInfoWriterTool.h
PEBInfoWriterToolBase::PEBInfoWriterToolBase
PEBInfoWriterToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
PEBInfoWriterToolBase.cxx:22
RoIPEBInfoWriterTool::m_etaWidth
Gaudi::Property< float > m_etaWidth
Definition
RoIPEBInfoWriterTool.h:38
RoIPEBInfoWriterTool::m_extraROBs
Gaudi::Property< std::vector< uint32_t > > m_extraROBs
Definition
RoIPEBInfoWriterTool.h:44
RoIPEBInfoWriterTool::m_extraPebInfo
PEBInfoWriterToolBase::PEBInfo m_extraPebInfo
Static PEB Info which contains ExtraROBs and ExtraSubDets.
Definition
RoIPEBInfoWriterTool.h:54
RoIPEBInfoWriterTool::createPEBInfo
virtual PEBInfoWriterToolBase::PEBInfo createPEBInfo(const EventContext &ctx, const PEBInfoWriterToolBase::Input &input) const override
Implementation of PEBInfoWriterToolBase::createPEBInfo.
Definition
RoIPEBInfoWriterTool.cxx:33
RoIPEBInfoWriterTool::m_extraSubDets
Gaudi::Property< std::vector< uint32_t > > m_extraSubDets
Definition
RoIPEBInfoWriterTool.h:48
RoIPEBInfoWriterTool::m_regionSelectorTools
ToolHandleArray< IRegSelTool > m_regionSelectorTools
Definition
RoIPEBInfoWriterTool.h:30
RoIPEBInfoWriterTool::initialize
virtual StatusCode initialize() override
Implementation of AthAlgTool::initialize().
Definition
RoIPEBInfoWriterTool.cxx:19
RoIPEBInfoWriterTool::m_etaEdge
Gaudi::Property< float > m_etaEdge
Definition
RoIPEBInfoWriterTool.h:35
RoIPEBInfoWriterTool::RoIPEBInfoWriterTool
RoIPEBInfoWriterTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
RoIPEBInfoWriterTool.cxx:14
RoIPEBInfoWriterTool::m_phiWidth
Gaudi::Property< float > m_phiWidth
Definition
RoIPEBInfoWriterTool.h:41
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
Definition
TrigRoiDescriptor.h:48
CxxUtils::wrapToPi
constexpr T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition
phihelper.h:31
TrigCompositeUtils::featureString
const std::string & featureString()
Definition
TrigCompositeUtils.h:422
TrigCompositeUtils::findLinks
void findLinks(const EventContext &ctx, const Decision *start, const std::string &linkName, std::vector< LinkInfo< T > > &links, unsigned int behaviour=TrigDefs::allFeaturesOfType, std::set< const xAOD::TrigComposite * > *fullyExploredFrom=nullptr)
search back the TC links for the object of type T linked to the one of TC (recursively) Populates pro...
TrigDefs::lastFeatureOfType
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:68
phihelper.h
Helper for azimuthal angle calculations.
type
PEBInfoWriterToolBase::Input
Input to the tool's decide method.
Definition
PEBInfoWriterToolBase.h:27
PEBInfoWriterToolBase::PEBInfo
Structure holding the list of ROBs and SubDets.
Definition
PEBInfoWriterToolBase.h:46
PEBInfoWriterToolBase::PEBInfo::robs
std::set< uint32_t > robs
Definition
PEBInfoWriterToolBase.h:47
Generated on
for ATLAS Offline Software by
1.17.0