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

Apply the cuts relevant for Anti-muon model. More...

#include <IsolationTools.h>

Inheritance diagram for top::AntiMuonIsolation:
Collaboration diagram for top::AntiMuonIsolation:

Public Member Functions

 AntiMuonIsolation (const std::string &workingPoint="AntiMuon_Nominal")
 Applies the cuts to etcone and ptcone like we used to in Run-I. More...
 
virtual bool passSelection (const xAOD::IParticle &p) const override
 Does this particle pass the anti-muon isolation cuts? More...
 
virtual bool passSelectionLoose (const xAOD::IParticle &) const override
 Loose WP not implemented for Anti-muon. More...
 
virtual void print (std::ostream &os) const override
 Come on, you really need me to tell you what this does? More...
 

Protected Attributes

std::string m_workingPoint
 

Detailed Description

Apply the cuts relevant for Anti-muon model.

Definition at line 197 of file IsolationTools.h.

Constructor & Destructor Documentation

◆ AntiMuonIsolation()

top::AntiMuonIsolation::AntiMuonIsolation ( const std::string &  workingPoint = "AntiMuon_Nominal")

Applies the cuts to etcone and ptcone like we used to in Run-I.

This sets up the isolation tool and configures it with the cuts.

Definition at line 109 of file IsolationTools.cxx.

109  :
110  m_workingPoint(workingPoint) {
111  if (m_workingPoint.substr(0,9) != "AntiMuon_") {
112  ATH_MSG_WARNING("Ignoring isolation working point \""
113  << workingPoint
114  << "\" which is not appropriate for AntiMuons.\n"
115  << "Will use \"AntiMuon_nominal\" instead.");
116  m_workingPoint = "AntiMuon_nominal";
117  }
118  else if (m_workingPoint != "AntiMuon_nominal"
119  && m_workingPoint != "AntiMuon_shapeSyst1"
120  && m_workingPoint != "AntiMuon_shapeSyst2") {
121  ATH_MSG_ERROR("Cannot use undefined isolation working point "
122  << workingPoint
123  << " for AntiMuons.\n"
124  << "Should be one of \"AntiMuon_nominal\", \"AntiMuon_shapeSyst1\", \"AntiMuon_shapeSyst2\".");
125  throw std::runtime_error("Attempt to use inappropriate isolation working point for AntiMuons");
126  }
127  }

Member Function Documentation

◆ passSelection()

bool top::AntiMuonIsolation::passSelection ( const xAOD::IParticle p) const
overridevirtual

Does this particle pass the anti-muon isolation cuts?

Parameters
pParticle that we're worried about.
Returns
True if it passes the isolation cuts.

Implements top::IsolationBase.

Definition at line 129 of file IsolationTools.cxx.

129  {
130  //muons
131  if (p.type() != xAOD::Type::Muon) {
132  ATH_MSG_ERROR("Cannot use this function for anything else but muons");
133  throw std::runtime_error("Cannot use this function for anything else but muons");
134  }
135 
136  const xAOD::Muon* mu = dynamic_cast<const xAOD::Muon*>(&p);
137  if (mu == nullptr) {
138  ATH_MSG_ERROR("Impossible to cast pointer to xAOD::IParticle into pointer to xAOD::Muon");
139  throw std::runtime_error("Impossible to cast pointer to xAOD::IParticle into pointer to xAOD::Muon");
140  }
141 
142  if (mu->energyLossType() != xAOD::Muon::NotIsolated) return false;
143 
144  float eloss = 0;
145  bool ok = mu->parameter(eloss, xAOD::Muon::EnergyLoss);
146  if (ok && eloss > 6000) return false;
147 
148  float etcone20 = 0, ptvarcone40 = 0;
149  ok = mu->isolation(etcone20, xAOD::Iso::etcone20);
150  if (ok && etcone20 / mu->pt() < 0.03) return false;
151 
152  ok = mu->isolation(ptvarcone40, xAOD::Iso::ptvarcone40);
153  if (m_workingPoint == "AntiMuon_nominal") {
154  if (ok && ptvarcone40 / mu->pt() > 0.1) return false;
155  }
156  else if (m_workingPoint == "AntiMuon_shapeSyst1") {
157  if (ok && ptvarcone40 / mu->pt() > 0.05) return false;
158  }
159  else if (m_workingPoint == "AntiMuon_shapeSyst2") {
160  if (ok && (ptvarcone40 / mu->pt() <= 0.05 || ptvarcone40 / mu->pt() > 0.1)) return false;
161  }
162 
163  return true;
164  }

◆ passSelectionLoose()

virtual bool top::AntiMuonIsolation::passSelectionLoose ( const xAOD::IParticle ) const
inlineoverridevirtual

Loose WP not implemented for Anti-muon.

Parameters
pParticle that we're worried about.
Returns
Always true.

Implements top::IsolationBase.

Definition at line 220 of file IsolationTools.h.

220 {return true;};

◆ print()

void top::AntiMuonIsolation::print ( std::ostream &  os) const
overridevirtual

Come on, you really need me to tell you what this does?

Implements top::IsolationBase.

Definition at line 166 of file IsolationTools.cxx.

166  {
167  os << " * AntiMuon Isolation : " << m_workingPoint << "\n";
168  os << " * energyLossType : NotIsolated\n";
169  os << " * EnergyLoss <= 6 GeV\n";
170  os << " * etcone20/pT > 0.03\n";
171  if (m_workingPoint == "AntiMuon_nominal") {
172  os << " * ptvarcone40/pT <= 0.1\n";
173  }
174  else if (m_workingPoint == "AntiMuon_shapeSyst1") {
175  os << " * ptvarcone40/pT <= 0.05\n";
176  }
177  else if (m_workingPoint == "AntiMuon_shapeSyst2") {
178  os << " * 0.05 < ptvarcone40/pT <= 0.1\n";
179  }
180  }

Member Data Documentation

◆ m_workingPoint

std::string top::AntiMuonIsolation::m_workingPoint
protected

Definition at line 225 of file IsolationTools.h.


The documentation for this class was generated from the following files:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
top::AntiMuonIsolation::m_workingPoint
std::string m_workingPoint
Definition: IsolationTools.h:225
xAOD::Iso::ptvarcone40
@ ptvarcone40
Definition: IsolationType.h:57
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::Iso::etcone20
@ etcone20
Calorimeter isolation.
Definition: IsolationType.h:32
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
Muon
struct TBPatternUnitContext Muon
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53