ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
AssociationUtils
Root
ObjLinkOverlapTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Local includes
6
#include "
AssociationUtils/ObjLinkOverlapTool.h
"
7
8
namespace
9
{
11
const
float
invGeV
= 0.001;
12
}
13
14
namespace
ORUtils
15
{
16
17
//---------------------------------------------------------------------------
18
// Constructor
19
//---------------------------------------------------------------------------
20
ObjLinkOverlapTool::ObjLinkOverlapTool
(
const
std::string& name)
21
:
BaseOverlapTool
(name)
22
{
23
}
24
25
//---------------------------------------------------------------------------
26
// Initialize
27
//---------------------------------------------------------------------------
28
StatusCode
ObjLinkOverlapTool::initializeDerived
()
29
{
30
return
StatusCode::SUCCESS;
31
}
32
33
//---------------------------------------------------------------------------
34
// Identify overlaps
35
//---------------------------------------------------------------------------
36
StatusCode
ObjLinkOverlapTool::
37
findOverlaps
(
columnar::Particle1Range
cont1,
38
columnar::Particle2Range
cont2,
39
columnar::EventContextId
/*eventContext*/
)
const
40
{
41
ATH_MSG_DEBUG
(
"Removing overlaps"
);
42
43
// Initialize output decoration if necessary
44
initializeDecorations
(cont1);
45
initializeDecorations
(cont2);
46
47
// Loop over surviving input objects in cont1
48
for
(
const
auto
p1 : cont1){
49
if
(
isSurvivingObject
(p1)){
50
51
// Check for existence of an object link
52
auto
linkParticle =
m_objLinkHelper1
->getObjectLink(p1, cont2);
53
if
(linkParticle){
54
55
// See if the link matches a surviving input in cont2. the
56
// above call will have already checked that it is in the
57
// right container
58
if
(
isSurvivingObject
(*linkParticle)){
59
if
constexpr
(
columnar::ColumnarModeDefault::isXAOD
) {
60
ATH_MSG_DEBUG
(
" Found overlap "
<< p1.getXAODObject().type() <<
61
" pt "
<< p1.getXAODObject().pt()*
invGeV
);
62
}
else
{
63
ATH_MSG_DEBUG
(
" Found overlap "
<< p1);
64
}
65
setObjectFail
(p1);
66
}
67
}
68
}
69
}
70
return
StatusCode::SUCCESS;
71
}
72
73
}
// namespace ORUtils
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ObjLinkOverlapTool.h
invGeV
constexpr float invGeV
Definition
PFTrackSelector.cxx:11
ORUtils::BaseOverlapTool::m_objLinkHelper1
std::unique_ptr< OverlapLinkHelper< columnar::Particle1Def > > m_objLinkHelper1
Helper for linking overlap objects.
Definition
BaseOverlapTool.h:132
ORUtils::BaseOverlapTool::initializeDecorations
void initializeDecorations(columnar::Particle1Range container) const
Definition
BaseOverlapTool.h:142
ORUtils::BaseOverlapTool::BaseOverlapTool
BaseOverlapTool(const std::string &name)
Create proper constructor for Athena.
Definition
BaseOverlapTool.cxx:14
ORUtils::BaseOverlapTool::setObjectFail
void setObjectFail(columnar::Particle1Id obj) const
Definition
BaseOverlapTool.h:158
ORUtils::BaseOverlapTool::isSurvivingObject
bool isSurvivingObject(columnar::Particle1Id obj) const
Definition
BaseOverlapTool.h:150
ORUtils::ObjLinkOverlapTool::findOverlaps
virtual StatusCode findOverlaps(columnar::Particle1Range cont1, columnar::Particle2Range cont2, columnar::EventContextId eventContext) const override
Identify overlaps by ElementLink.
Definition
ObjLinkOverlapTool.cxx:37
ORUtils::ObjLinkOverlapTool::ObjLinkOverlapTool
ObjLinkOverlapTool(const std::string &name)
Create proper constructor for Athena.
Definition
ObjLinkOverlapTool.cxx:20
ORUtils::ObjLinkOverlapTool::initializeDerived
virtual StatusCode initializeDerived() override
Initialize the tool.
Definition
ObjLinkOverlapTool.cxx:28
ORUtils
Definition
AltMuJetOverlapTool.h:30
columnar::EventContextId
ObjectId< EventContextDef > EventContextId
Definition
ContainerId.h:212
columnar::Particle2Range
ObjectRange< Particle2Def > Particle2Range
Definition
ParticleDef.h:50
columnar::Particle1Range
ObjectRange< Particle1Def > Particle1Range
Definition
ParticleDef.h:44
columnar::ColumnarModeXAOD::isXAOD
static constexpr bool isXAOD
Whether this is the xAOD mode.
Definition
ColumnarCore/ColumnarCore/ColumnarDef.h:23
Generated on
for ATLAS Offline Software by
1.17.0