ATLAS Offline Software
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
7 
8 // Local includes
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  //---------------------------------------------------------------------------
23  // Check if particles match in dR
24  //---------------------------------------------------------------------------
26  const xAOD::IParticle& p2) const
27  {
29  }
30 
31  //---------------------------------------------------------------------------
32  // SlidingDeltaRMatcher constructor
33  //---------------------------------------------------------------------------
35  double maxCone, bool useRapidity)
36  : m_c1(c1), m_c2(c2), m_maxCone(maxCone), m_useRapidity(useRapidity)
37  {}
38 
39  //---------------------------------------------------------------------------
40  // Check if particles match in sliding dR
41  //---------------------------------------------------------------------------
43  const xAOD::IParticle& p2) const
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);
49  return xAOD::P4Helpers::isInDeltaR(p1, p2, dR, m_useRapidity);
50  }
51 
52 } // namespace ORUtils
ORUtils::DeltaRMatcher::objectsMatch
virtual bool objectsMatch(const xAOD::IParticle &p1, const xAOD::IParticle &p2) const override
Check if particles match in dR.
Definition: DeltaRMatcher.cxx:25
xAODP4Helpers.h
extractSporadic.c1
c1
Definition: extractSporadic.py:134
ORUtils::SlidingDeltaRMatcher::m_useRapidity
bool m_useRapidity
Toggle rapidity usage.
Definition: DeltaRMatcher.h:82
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
ORUtils
Definition: AltMuJetOverlapTool.h:20
ORUtils::SlidingDeltaRMatcher::m_c2
double m_c2
Sliding dR constant c2.
Definition: DeltaRMatcher.h:77
ORUtils::SlidingDeltaRMatcher::SlidingDeltaRMatcher
SlidingDeltaRMatcher(double c1, double c2, double maxCone=std::numeric_limits< double >::max(), bool useRapidity=true)
Constructor.
Definition: DeltaRMatcher.cxx:34
ORUtils::SlidingDeltaRMatcher::m_maxCone
double m_maxCone
Maximum sliding cone size.
Definition: DeltaRMatcher.h:79
ORUtils::DeltaRMatcher::DeltaRMatcher
DeltaRMatcher(double dR, bool useRapidity=true)
Constructor.
Definition: DeltaRMatcher.cxx:17
min
#define min(a, b)
Definition: cfImp.cxx:40
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
ORUtils::DeltaRMatcher::m_dR
double m_dR
Definition: DeltaRMatcher.h:40
ORUtils::DeltaRMatcher::m_useRapidity
bool m_useRapidity
Definition: DeltaRMatcher.h:41
compileRPVLLRates.c2
c2
Definition: compileRPVLLRates.py:361
DeltaRMatcher.h
ORUtils::SlidingDeltaRMatcher::objectsMatch
virtual bool objectsMatch(const xAOD::IParticle &p1, const xAOD::IParticle &p2) const override
Check if particles match in dR.
Definition: DeltaRMatcher.cxx:42
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