ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8namespace
9{
11 const float invGeV = 0.001;
12}
13
14namespace ORUtils
15{
16
17 //---------------------------------------------------------------------------
18 // Constructor
19 //---------------------------------------------------------------------------
21 : BaseOverlapTool(name)
22 {
23 }
24
25 //---------------------------------------------------------------------------
26 // Initialize
27 //---------------------------------------------------------------------------
29 {
30 return StatusCode::SUCCESS;
31 }
32
33 //---------------------------------------------------------------------------
34 // Identify overlaps
35 //---------------------------------------------------------------------------
39 columnar::EventContextId /*eventContext*/) const
40 {
41 ATH_MSG_DEBUG("Removing overlaps");
42
43 // Initialize output decoration if necessary
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)){
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
#define ATH_MSG_DEBUG(x)
constexpr float invGeV
void initializeDecorations(columnar::Particle1Range container) const
BaseOverlapTool(const std::string &name)
Create proper constructor for Athena.
void setObjectFail(columnar::Particle1Id obj) const
bool isSurvivingObject(columnar::Particle1Id obj) const
std::unique_ptr< OverlapLinkHelper< columnar::ContainerId::particle1 > > m_objLinkHelper1
Helper for linking overlap objects.
virtual StatusCode findOverlaps(columnar::Particle1Range cont1, columnar::Particle2Range cont2, columnar::EventContextId eventContext) const override
Identify overlaps by ElementLink.
ObjLinkOverlapTool(const std::string &name)
Create proper constructor for Athena.
virtual StatusCode initializeDerived() override
Initialize the tool.
ObjectId< ContainerId::eventContext > EventContextId
ObjectRange< ContainerId::particle2 > Particle2Range
Definition ParticleDef.h:53
ObjectRange< ContainerId::particle1 > Particle1Range
Definition ParticleDef.h:47
static constexpr bool isXAOD
Whether this is the xAOD mode.
Definition ColumnarDef.h:20