ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ORUtils::SlidingDeltaRMatcher Class Reference

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. More...
 
virtual bool objectsMatch (const xAOD::IParticle &p1, const xAOD::IParticle &p2) const override
 Check if particles match in dR. More...
 

Private Attributes

double m_c1
 Sliding dR constant c1. More...
 
double m_c2
 Sliding dR constant c2. More...
 
double m_maxCone
 Maximum sliding cone size. More...
 
bool m_useRapidity
 Toggle rapidity usage. More...
 

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 54 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 34 of file DeltaRMatcher.cxx.

36  : m_c1(c1), m_c2(c2), m_maxCone(maxCone), m_useRapidity(useRapidity)
37  {}

Member Function Documentation

◆ objectsMatch()

bool ORUtils::SlidingDeltaRMatcher::objectsMatch ( const xAOD::IParticle p1,
const xAOD::IParticle p2 
) 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 42 of file DeltaRMatcher.cxx.

44  {
45  // Calculate the dR cone to match with
46  double dR = m_c1 + (m_c2 / p1.pt());
47  // Apply upper limit to the dR match cone
48  dR = std::min(dR, m_maxCone);
50  }

Member Data Documentation

◆ m_c1

double ORUtils::SlidingDeltaRMatcher::m_c1
private

Sliding dR constant c1.

Definition at line 75 of file DeltaRMatcher.h.

◆ m_c2

double ORUtils::SlidingDeltaRMatcher::m_c2
private

Sliding dR constant c2.

Definition at line 77 of file DeltaRMatcher.h.

◆ m_maxCone

double ORUtils::SlidingDeltaRMatcher::m_maxCone
private

Maximum sliding cone size.

Definition at line 79 of file DeltaRMatcher.h.

◆ m_useRapidity

bool ORUtils::SlidingDeltaRMatcher::m_useRapidity
private

Toggle rapidity usage.

Definition at line 82 of file DeltaRMatcher.h.


The documentation for this class was generated from the following files:
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
extractSporadic.c1
c1
Definition: extractSporadic.py:134
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
ORUtils::SlidingDeltaRMatcher::m_useRapidity
bool m_useRapidity
Toggle rapidity usage.
Definition: DeltaRMatcher.h:82
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
ORUtils::SlidingDeltaRMatcher::m_c2
double m_c2
Sliding dR constant c2.
Definition: DeltaRMatcher.h:77
ORUtils::SlidingDeltaRMatcher::m_maxCone
double m_maxCone
Maximum sliding cone size.
Definition: DeltaRMatcher.h:79
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
xAOD::P4Helpers::isInDeltaR
bool isInDeltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2, double dR, bool useRapidity=true)
Check if 2 xAOD::IParticle are in a cone.
Definition: xAODP4Helpers.h:174
ORUtils::SlidingDeltaRMatcher::m_c1
double m_c1
Sliding dR constant c1.
Definition: DeltaRMatcher.h:75