ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
top::Muon Class Reference

Select muons based on some early suggestions. More...

#include <Muon.h>

Inheritance diagram for top::Muon:
Collaboration diagram for top::Muon:

Public Member Functions

 Muon (const double ptcut, IsolationBase *isolation)
 Construct the tool to select good muons. More...
 
 Muon (const double ptcut, IsolationBase *isolation, const bool applyTTVACut)
 
 Muon (const double ptcut, IsolationBase *isolation, const double d0SigCut, const double delta_z0, const bool applyTTVACut=true)
 
virtual ~Muon ()
 
virtual bool passSelection (const xAOD::Muon &mu) const override
 Implements the logic to select good muons. More...
 
virtual bool passSelectionLoose (const xAOD::Muon &mu) const override
 The loose selection needed by some background estimates. More...
 
virtual bool passTTVACuts (const xAOD::Muon &mu) const
 The track-to-vertex association (TTVA) cuts. More...
 
virtual void print (std::ostream &os) const override
 Because everybody likes to know what object definitions they ran with. More...
 

Protected Attributes

double m_ptcut
 
double m_d0SigCut
 
double m_delta_z0
 
ToolHandle< CP::IMuonSelectionToolm_muonSelectionTool
 
ToolHandle< CP::IMuonSelectionToolm_muonSelectionToolLoose
 
std::unique_ptr< top::IsolationBasem_isolation
 
bool m_applyTTVACut
 

Detailed Description

Select muons based on some early suggestions.

Definition at line 18 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h.

Constructor & Destructor Documentation

◆ Muon() [1/3]

top::Muon::Muon ( const double  ptcut,
IsolationBase isolation 
)

Construct the tool to select good muons.

Parameters
ptcutThe minimum pT cut for good muons.
isolationThe isolation the user wants to apply. Don't want any isolation to be applied? Then leave this as a nullptr.
d0SigCutThe maximum d0 significance cut
delta_z0The maximum |delta z0 sin(theta)| cut
applyTTVACutWhether to apply cuts on d0 and z0

Definition at line 30 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx.

31  : Muon::Muon(ptcut, isolation, 3.0, 0.5, true) {}

◆ Muon() [2/3]

top::Muon::Muon ( const double  ptcut,
IsolationBase isolation,
const bool  applyTTVACut 
)

Definition at line 27 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx.

28  : Muon::Muon(ptcut, isolation, 3.0, 0.5, applyTTVACut) {}

◆ Muon() [3/3]

top::Muon::Muon ( const double  ptcut,
IsolationBase isolation,
const double  d0SigCut,
const double  delta_z0,
const bool  applyTTVACut = true 
)

Definition at line 13 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx.

15  :
16  m_ptcut(ptcut),
17  m_d0SigCut(d0SigCut),
18  m_delta_z0(delta_z0_sintheta),
19  m_muonSelectionTool("MuonSelectionTool"),
20  m_muonSelectionToolLoose("MuonSelectionToolLoose"),
21  m_isolation(isolation),
22  m_applyTTVACut(applyTTVACut) {
23  top::check(m_muonSelectionTool.retrieve(), "Failed to retrieve muonSelectionTool");
24  top::check(m_muonSelectionToolLoose.retrieve(), "Failed to retrieve muonSelectionToolLoose");
25  }

◆ ~Muon()

virtual top::Muon::~Muon ( )
inlinevirtual

Member Function Documentation

◆ passSelection()

bool top::Muon::passSelection ( const xAOD::Muon mu) const
overridevirtual

Implements the logic to select good muons.

Parameters
muThe muon that we want to check.
Returns
True if the muon is good, false otherwise.

Implements top::MuonSelectionBase.

Definition at line 33 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx.

33  {
34  if (mu.pt() < m_ptcut) return false;
35 
36  if (!m_muonSelectionTool->accept(mu)) return false;
37 
38  //isolation, if m_isolation != nullptr
39  if (m_isolation && !m_isolation->passSelection(mu)) return false;
40 
41  // Track-to-vertex association
42  if (m_applyTTVACut) {
43  if (!passTTVACuts(mu)) return false;
44  }
45 
46  return true;
47  }

◆ passSelectionLoose()

bool top::Muon::passSelectionLoose ( const xAOD::Muon mu) const
overridevirtual

The loose selection needed by some background estimates.

Parameters
mu
Returns

Implements top::MuonSelectionBase.

Definition at line 49 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx.

49  {
50  if (mu.pt() < m_ptcut) return false;
51 
52  if (!m_muonSelectionToolLoose->accept(mu)) return false;
53 
54  //isolation, if m_isolation != nullptr
55  if (m_isolation && !m_isolation->passSelectionLoose(mu)) return false;
56 
57  // Track-to-vertex association
58  if (m_applyTTVACut) {
59  if (!passTTVACuts(mu)) return false;
60  }
61 
62  return true;
63  }

◆ passTTVACuts()

bool top::Muon::passTTVACuts ( const xAOD::Muon mu) const
virtual

The track-to-vertex association (TTVA) cuts.

Parameters
mu
Returns
True if passes, false otherwise

Definition at line 65 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx.

65  {
66  // TTVA:
67  // see https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TrackingCPEOYE2015#Track_to_Vertex_Association
68  if (!mu.isAvailable<float>("d0sig")) {
69  ATH_MSG_WARNING("d0 significance not found for muon. "
70  << "Maybe no primary vertex? Won't accept.");
71  return false;
72  }
73 
74  float d0sig = mu.auxdataConst<float>("d0sig");
75  if (std::abs(d0sig) >= 3) return false;
76 
77  if (!mu.isAvailable<float>("delta_z0_sintheta")) {
78  ATH_MSG_WARNING("delta z0*sin(theta) not found for muon. "
79  << "Maybe no primary vertex? Won't accept.");
80  return false;
81  }
82 
83  float delta_z0_sintheta = mu.auxdataConst<float>("delta_z0_sintheta");
84  if (std::abs(delta_z0_sintheta) >= 0.5) return false;
85 
86  return true;
87  }

◆ print()

void top::Muon::print ( std::ostream &  ) const
overridevirtual

Because everybody likes to know what object definitions they ran with.

Implements top::MuonSelectionBase.

Definition at line 89 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx.

89  {
90  os << "Muon\n"
91  << " * pT > " << m_ptcut << "\n"
92  << " * Everything else from muon tool - fill this in?\n";
93 
94  if (!m_isolation) os << " * No isolation requirement\n";
95  else m_isolation->print(os);
96  }

Member Data Documentation

◆ m_applyTTVACut

bool top::Muon::m_applyTTVACut
protected

◆ m_d0SigCut

double top::Muon::m_d0SigCut
protected

◆ m_delta_z0

double top::Muon::m_delta_z0
protected

◆ m_isolation

std::unique_ptr<top::IsolationBase> top::Muon::m_isolation
protected

◆ m_muonSelectionTool

ToolHandle<CP::IMuonSelectionTool> top::Muon::m_muonSelectionTool
protected

◆ m_muonSelectionToolLoose

ToolHandle<CP::IMuonSelectionTool> top::Muon::m_muonSelectionToolLoose
protected

◆ m_ptcut

double top::Muon::m_ptcut
protected

The documentation for this class was generated from the following files:
top::Muon::passTTVACuts
virtual bool passTTVACuts(const xAOD::Muon &mu) const
The track-to-vertex association (TTVA) cuts.
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx:65
top::Muon::m_delta_z0
double m_delta_z0
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h:78
top::Muon::m_d0SigCut
double m_d0SigCut
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h:77
Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.ptcut
float ptcut
Definition: Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.py:9
top::Muon::m_isolation
std::unique_ptr< top::IsolationBase > m_isolation
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h:85
top::Muon::m_muonSelectionTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h:81
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
top::Muon::m_muonSelectionToolLoose
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionToolLoose
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h:82
top::Muon::Muon
Muon(const double ptcut, IsolationBase *isolation)
Construct the tool to select good muons.
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Muon.cxx:30
top::Muon::m_applyTTVACut
bool m_applyTTVACut
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h:88
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
top::Muon::m_ptcut
double m_ptcut
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Muon.h:74
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53