ATLAS Offline Software
Loading...
Searching...
No Matches
ORUtils::SlidingDeltaRMatcher Class Referencefinal

DR matching strategy where cone decreases with pt. More...

#include <DeltaRMatcher.h>

Inheritance diagram for ORUtils::SlidingDeltaRMatcher:
Collaboration diagram for ORUtils::SlidingDeltaRMatcher:

Public Member Functions

 SlidingDeltaRMatcher (double c1, double c2, double maxCone=std::numeric_limits< double >::max(), bool useRapidity=true)
 Constructor.
virtual StatusCode setObjectTypes (xAODType::ObjectType type1, xAODType::ObjectType type2) override
 Set the object types to be used in the association.
virtual bool objectsMatch (columnar::Particle1Id p1, columnar::Particle2Id p2, bool swapArgs=false) const override
 Check if particles match in dR.
bool objectsMatch (columnar::Particle2Id p2, columnar::Particle1Id p1) const

Private Attributes

double m_c1
 Sliding dR constant c1.
double m_c2
 Sliding dR constant c2.
double m_maxCone
 Maximum sliding cone size.
bool m_useRapidity
 Toggle rapidity usage.
columnar::MomentumAccessors< columnar::ContainerId::particle1m_momAcc1
 Columnar accessors.
columnar::MomentumAccessors< columnar::ContainerId::particle2m_momAcc2

Detailed Description

DR matching strategy where cone decreases with pt.

Calculates the dR cone w.r.t. the pt of the first argument as: dR = c1 + (c2/pt) Assumes that you're only using rapidity (for now).

Author
Steve Farrell Steve.nosp@m.n.Fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch

Definition at line 67 of file DeltaRMatcher.h.

Constructor & Destructor Documentation

◆ SlidingDeltaRMatcher()

ORUtils::SlidingDeltaRMatcher::SlidingDeltaRMatcher ( double c1,
double c2,
double maxCone = std::numeric_limits<double>::max(),
bool useRapidity = true )

Constructor.

Parameters
[in]c1The offset constant (dimensionless).
[in]c2The pt factor constant (MeV).
[in]maxConeCone size upper limit.

Definition at line 43 of file DeltaRMatcher.cxx.

45 : m_c1(c1), m_c2(c2), m_maxCone(maxCone), m_useRapidity(useRapidity)
46 {}
double m_c1
Sliding dR constant c1.
double m_c2
Sliding dR constant c2.
bool m_useRapidity
Toggle rapidity usage.
double m_maxCone
Maximum sliding cone size.

Member Function Documentation

◆ objectsMatch() [1/2]

bool ORUtils::IParticleAssociator::objectsMatch ( columnar::Particle2Id p2,
columnar::Particle1Id p1 ) const
inlineinherited

Definition at line 37 of file IObjectAssociator.h.

39 { return objectsMatch(p1, p2, true); }
virtual bool objectsMatch(columnar::Particle1Id p1, columnar::Particle2Id p2, bool swapArgs=false) const =0
Test association between two IParticles.

◆ objectsMatch() [2/2]

bool ORUtils::SlidingDeltaRMatcher::objectsMatch ( columnar::Particle1Id p1,
columnar::Particle2Id p2,
bool swapArgs = false ) const
overridevirtual

Check if particles match in dR.

The dR cone is calculated as dR = c1 + (c2/p1.pt())

Implements ORUtils::IParticleAssociator.

Definition at line 59 of file DeltaRMatcher.cxx.

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);
69 }
columnar::MomentumAccessors< columnar::ContainerId::particle1 > m_momAcc1
Columnar accessors.
columnar::MomentumAccessors< columnar::ContainerId::particle2 > m_momAcc2
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.

◆ setObjectTypes()

StatusCode ORUtils::SlidingDeltaRMatcher::setObjectTypes ( xAODType::ObjectType type1,
xAODType::ObjectType type2 )
overridevirtual

Set the object types to be used in the association.

Implements ORUtils::IParticleAssociator.

Definition at line 48 of file DeltaRMatcher.cxx.

50 {
53 return StatusCode::SUCCESS;
54 }
void resetObjectType(MomentumAccessors< CI, CM > &accessors, ColumnarTool< CM > &columnarTool, xAODType::ObjectType type)

Member Data Documentation

◆ m_c1

double ORUtils::SlidingDeltaRMatcher::m_c1
private

Sliding dR constant c1.

Definition at line 92 of file DeltaRMatcher.h.

◆ m_c2

double ORUtils::SlidingDeltaRMatcher::m_c2
private

Sliding dR constant c2.

Definition at line 94 of file DeltaRMatcher.h.

◆ m_maxCone

double ORUtils::SlidingDeltaRMatcher::m_maxCone
private

Maximum sliding cone size.

Definition at line 96 of file DeltaRMatcher.h.

◆ m_momAcc1

columnar::MomentumAccessors<columnar::ContainerId::particle1> ORUtils::SlidingDeltaRMatcher::m_momAcc1
private

Columnar accessors.

Definition at line 102 of file DeltaRMatcher.h.

◆ m_momAcc2

columnar::MomentumAccessors<columnar::ContainerId::particle2> ORUtils::SlidingDeltaRMatcher::m_momAcc2
private

Definition at line 103 of file DeltaRMatcher.h.

◆ m_useRapidity

bool ORUtils::SlidingDeltaRMatcher::m_useRapidity
private

Toggle rapidity usage.

Definition at line 99 of file DeltaRMatcher.h.


The documentation for this class was generated from the following files: