ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
AssociationUtils
Root
DeltaRMatcher.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Framework includes
6
#include "
ColumnarCore/MomentumHelpers.h
"
7
8
// Local includes
9
#include "
AssociationUtils/DeltaRMatcher.h
"
10
11
namespace
ORUtils
12
{
13
14
//---------------------------------------------------------------------------
15
// DeltaRMatcher constructor
16
//---------------------------------------------------------------------------
17
DeltaRMatcher::DeltaRMatcher
(
double
dR,
bool
useRapidity)
18
:
m_dR
(dR),
19
m_useRapidity
(useRapidity)
20
{}
21
22
StatusCode
DeltaRMatcher::setObjectTypes
(
xAODType::ObjectType
type1,
23
xAODType::ObjectType
type2)
24
{
25
columnar::resetObjectType
(
m_momAcc1
, *
this
, type1);
26
columnar::resetObjectType
(
m_momAcc2
, *
this
, type2);
27
return
StatusCode::SUCCESS;
28
}
29
30
//---------------------------------------------------------------------------
31
// Check if particles match in dR
32
//---------------------------------------------------------------------------
33
bool
DeltaRMatcher::objectsMatch
(
columnar::Particle1Id
p1,
34
columnar::Particle2Id
p2,
35
bool
/*swapArgs*/
)
const
36
{
37
return
columnar::isInDeltaR
(
m_momAcc1
, p1,
m_momAcc2
, p2,
m_dR
,
m_useRapidity
);
38
}
39
40
//---------------------------------------------------------------------------
41
// SlidingDeltaRMatcher constructor
42
//---------------------------------------------------------------------------
43
SlidingDeltaRMatcher::SlidingDeltaRMatcher
(
double
c1,
double
c2,
44
double
maxCone,
bool
useRapidity)
45
:
m_c1
(c1),
m_c2
(c2),
m_maxCone
(maxCone),
m_useRapidity
(useRapidity)
46
{}
47
48
StatusCode
SlidingDeltaRMatcher::setObjectTypes
(
xAODType::ObjectType
type1,
49
xAODType::ObjectType
type2)
50
{
51
columnar::resetObjectType
(
m_momAcc1
, *
this
, type1);
52
columnar::resetObjectType
(
m_momAcc2
, *
this
, type2);
53
return
StatusCode::SUCCESS;
54
}
55
56
//---------------------------------------------------------------------------
57
// Check if particles match in sliding dR
58
//---------------------------------------------------------------------------
59
bool
SlidingDeltaRMatcher::objectsMatch
(
columnar::Particle1Id
p1,
60
columnar::Particle2Id
p2,
61
bool
swapArgs)
const
62
{
63
// Calculate the dR cone to match with
64
double
pt1 = swapArgs ?
m_momAcc2
.pt(p2) :
m_momAcc1
.pt(p1);
65
double
dR =
m_c1
+ (
m_c2
/ pt1);
66
// Apply upper limit to the dR match cone
67
dR = std::min(dR,
m_maxCone
);
68
return
columnar::isInDeltaR
(
m_momAcc1
, p1,
m_momAcc2
, p2, dR,
m_useRapidity
);
69
}
70
71
}
// namespace ORUtils
DeltaRMatcher.h
MomentumHelpers.h
ORUtils::DeltaRMatcher::m_momAcc2
columnar::MomentumAccessors< columnar::Particle2Def > m_momAcc2
Definition
DeltaRMatcher.h:54
ORUtils::DeltaRMatcher::setObjectTypes
virtual StatusCode setObjectTypes(xAODType::ObjectType type1, xAODType::ObjectType type2) override
Set the object types to be used in the association.
Definition
DeltaRMatcher.cxx:22
ORUtils::DeltaRMatcher::DeltaRMatcher
DeltaRMatcher(double dR, bool useRapidity=true)
Constructor.
Definition
DeltaRMatcher.cxx:17
ORUtils::DeltaRMatcher::objectsMatch
virtual bool objectsMatch(columnar::Particle1Id p1, columnar::Particle2Id p2, bool swapArgs=false) const override
Check if particles match in dR.
Definition
DeltaRMatcher.cxx:33
ORUtils::DeltaRMatcher::m_momAcc1
columnar::MomentumAccessors< columnar::Particle1Def > m_momAcc1
Columnar accessors.
Definition
DeltaRMatcher.h:53
ORUtils::DeltaRMatcher::m_useRapidity
bool m_useRapidity
Definition
DeltaRMatcher.h:50
ORUtils::DeltaRMatcher::m_dR
double m_dR
Definition
DeltaRMatcher.h:49
ORUtils::SlidingDeltaRMatcher::m_c1
double m_c1
Sliding dR constant c1.
Definition
DeltaRMatcher.h:92
ORUtils::SlidingDeltaRMatcher::m_momAcc1
columnar::MomentumAccessors< columnar::Particle1Def > m_momAcc1
Columnar accessors.
Definition
DeltaRMatcher.h:102
ORUtils::SlidingDeltaRMatcher::m_c2
double m_c2
Sliding dR constant c2.
Definition
DeltaRMatcher.h:94
ORUtils::SlidingDeltaRMatcher::m_useRapidity
bool m_useRapidity
Toggle rapidity usage.
Definition
DeltaRMatcher.h:99
ORUtils::SlidingDeltaRMatcher::SlidingDeltaRMatcher
SlidingDeltaRMatcher(double c1, double c2, double maxCone=std::numeric_limits< double >::max(), bool useRapidity=true)
Constructor.
Definition
DeltaRMatcher.cxx:43
ORUtils::SlidingDeltaRMatcher::m_maxCone
double m_maxCone
Maximum sliding cone size.
Definition
DeltaRMatcher.h:96
ORUtils::SlidingDeltaRMatcher::m_momAcc2
columnar::MomentumAccessors< columnar::Particle2Def > m_momAcc2
Definition
DeltaRMatcher.h:103
ORUtils::SlidingDeltaRMatcher::setObjectTypes
virtual StatusCode setObjectTypes(xAODType::ObjectType type1, xAODType::ObjectType type2) override
Set the object types to be used in the association.
Definition
DeltaRMatcher.cxx:48
ORUtils::SlidingDeltaRMatcher::objectsMatch
virtual bool objectsMatch(columnar::Particle1Id p1, columnar::Particle2Id p2, bool swapArgs=false) const override
Check if particles match in dR.
Definition
DeltaRMatcher.cxx:59
ORUtils
Definition
AltMuJetOverlapTool.h:30
columnar::resetObjectType
void resetObjectType(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool, xAODType::ObjectType type)
Definition
MomentumAccessors.h:371
columnar::isInDeltaR
bool isInDeltaR(const MomentumAccessors< CI1, CM > &momAcc1, ObjectId< CI1, CM > p1, const MomentumAccessors< CI2, CM > &momAcc2, ObjectId< CI2, CM > p2, double dR, bool useRapidity=true)
Check if 2 particles are in a cone.
Definition
MomentumHelpers.h:46
columnar::Particle1Id
ObjectId< Particle1Def > Particle1Id
Definition
ParticleDef.h:45
columnar::Particle2Id
ObjectId< Particle2Def > Particle2Id
Definition
ParticleDef.h:51
xAODType::ObjectType
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition
ObjectType.h:32
Generated on
for ATLAS Offline Software by
1.17.0