ATLAS Offline Software
AntiMuon.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
7 #include "TopEvent/EventTools.h"
8 
9 namespace top {
10  AntiMuon::AntiMuon(const double ptcut, AntiMuonIsolation* isolation) :
11  m_ptcut(ptcut),
12  m_muonSelectionTool("MuonSelectionTool"),
13  m_isolation(isolation) {
14  top::check(m_muonSelectionTool.retrieve(), "Failed to retrieve muonSelectionTool");
15  }
16 
17  bool AntiMuon::passSelection(const xAOD::Muon& mu) const {
18  if (mu.pt() < m_ptcut) return false;
19 
20  if (!m_muonSelectionTool->accept(mu)) return false;
21 
22  return m_isolation->passSelection(mu);
23  }
24 
25  bool AntiMuon::passSelectionLoose(const xAOD::Muon& /*mu*/) const {
26  // code does not compile without this function
27 
28  return true;
29  }
30 
31  void AntiMuon::print(std::ostream& os) const {
32  os << "AntiMuon\n"
33  << " * pT > " << m_ptcut << "\n"
34  << " * Everything else from muon tool - fill this in?\n";
35 
36  if (!m_isolation)
37  os << " * No isolation requirement\n";
38  else
39  m_isolation->print(os);
40  }
41 }
top::AntiMuon::m_ptcut
double m_ptcut
Lower pT threshold to apply to object selection.
Definition: AntiMuon.h:52
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::AntiMuon::passSelection
virtual bool passSelection(const xAOD::Muon &mu) const override
Implements the logic to select good muons.
Definition: AntiMuon.cxx:17
top::AntiMuon::m_muonSelectionTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
Proper tool to select muons.
Definition: AntiMuon.h:55
top::AntiMuon::AntiMuon
AntiMuon(const double ptcut, AntiMuonIsolation *isolation)
Construct the tool to select good muons.
Definition: AntiMuon.cxx:10
Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.ptcut
float ptcut
Definition: Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.py:9
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
top::AntiMuon::passSelectionLoose
virtual bool passSelectionLoose(const xAOD::Muon &mu) const override
The loose selection needed by some background estimates.
Definition: AntiMuon.cxx:25
top::AntiMuonIsolation
Apply the cuts relevant for Anti-muon model.
Definition: IsolationTools.h:197
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::AntiMuon::print
virtual void print(std::ostream &os) const override
Print the cuts to the ostream.
Definition: AntiMuon.cxx:31
AntiMuon.h
top::AntiMuon::m_isolation
std::unique_ptr< top::AntiMuonIsolation > m_isolation
Isolation tool, can be nullptr meaning "no isolation requirement".
Definition: AntiMuon.h:58
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53