ATLAS Offline Software
Classes | Public Member Functions | Private Attributes | List of all members
top::ParticleLevelMuonObjectSelector Class Reference

#include <ParticleLevelMuonObjectSelector.h>

Inheritance diagram for top::ParticleLevelMuonObjectSelector:
Collaboration diagram for top::ParticleLevelMuonObjectSelector:

Classes

struct  Options
 

Public Member Functions

 ParticleLevelMuonObjectSelector (Options opt=Options())
 
virtual bool apply (const xAOD::TruthParticle &truthParticle)
 

Private Attributes

Options m_opt
 

Detailed Description

Definition at line 18 of file ParticleLevelMuonObjectSelector.h.

Constructor & Destructor Documentation

◆ ParticleLevelMuonObjectSelector()

top::ParticleLevelMuonObjectSelector::ParticleLevelMuonObjectSelector ( Options  opt = Options())

Definition at line 16 of file ParticleLevelMuonObjectSelector.cxx.

17  : m_opt(opt) { /* Deliberately Empty */}

Member Function Documentation

◆ apply()

bool top::ParticleLevelMuonObjectSelector::apply ( const xAOD::TruthParticle truthParticle)
virtual

Implements top::ObjectSelectorBase< xAOD::TruthParticle >.

Definition at line 20 of file ParticleLevelMuonObjectSelector.cxx.

20  {
21  // Obtain the particle type and particle origin from the decoration
22  // created by the MCTruthClassifier. For legacy reasons, try both
23  // decoration names.
24  unsigned int type;
25 
26  if (truthParticle.isAvailable<unsigned int>("particleType")) {
27  type = truthParticle.auxdata<unsigned int>("particleType");
28  } else if (truthParticle.isAvailable<unsigned int>("classifierParticleType")) {
29  type = truthParticle.auxdata<unsigned int>("classifierParticleType");
30  } else {
31  throw std::runtime_error("ParticleLevelMuonObjectSelector::apply: "
32  "Could not obtain MCTruthClassifier result decoration.");
33  }
34 
35  // --------------------------------------------------
36  // Accept muons iff they do not come from a hadron
37  using namespace MCTruthPartClassifier;
38  if (m_opt.not_from_hadron &&
40  return false;
41  }
42 
43  // If it is requested that tauons are hadrons, perform a check of the
44  // ancestry: It shall not contain a single tauon.
45  if (m_opt.tau_is_hadron) {
46  auto truthProxy = truthParticle.auxdata<ElementLink<xAOD::TruthParticleContainer> >("originalTruthParticle");
47  if (not truthProxy.isValid()) {
48  throw std::runtime_error("ParticleLevelMuonObjectSelector::apply: "
49  "Could not obtain 'originalTruthParticle' reference.");
50  }
51  if (truth::isLeptonFromTau(*truthProxy)) {
52  return false;
53  }
54  }
55 
56 
57  // --------------------------------------------------
58  // Apply kinematic cut on the dressed pT:
59  // must exceed 25 GeV
60  if (truthParticle.auxdata<float>("pt_dressed") < m_opt.pt_min) {
61  return false;
62  }
63 
64  // --------------------------------------------------
65  // Apply kinematic cut on the dressed eta:
66  // must be less than or equal to 2.5
67  if (std::abs(truthParticle.auxdata<float>("eta_dressed")) > m_opt.eta_max) {
68  return false;
69  }
70 
71 
72  // --------------------------------------------------
73  // Everything that reaches this point has passed the selection
74  return true;
75  }

Member Data Documentation

◆ m_opt

Options top::ParticleLevelMuonObjectSelector::m_opt
private

Definition at line 43 of file ParticleLevelMuonObjectSelector.h.


The documentation for this class was generated from the following files:
top::ParticleLevelMuonObjectSelector::m_opt
Options m_opt
Definition: ParticleLevelMuonObjectSelector.h:43
top::ParticleLevelMuonObjectSelector::Options::not_from_hadron
bool not_from_hadron
Definition: ParticleLevelMuonObjectSelector.h:36
top::ParticleLevelMuonObjectSelector::Options::eta_max
double eta_max
Definition: ParticleLevelMuonObjectSelector.h:35
top::ParticleLevelMuonObjectSelector::Options::pt_min
double pt_min
Definition: ParticleLevelMuonObjectSelector.h:34
IsoMuon
@ IsoMuon
Definition: TruthClasses.h:15
top::ParticleLevelMuonObjectSelector::Options::tau_is_hadron
bool tau_is_hadron
Definition: ParticleLevelMuonObjectSelector.h:37
pmontree.opt
opt
Definition: pmontree.py:16
xAOD::IParticle::isAvailable
bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for reading or not.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:131
top::truth::isLeptonFromTau
bool isLeptonFromTau(const xAOD::TruthParticle *truthParticle)
Function the check if a particle is a lepton which was produced in the decay of a tau lepton.
Definition: TruthTools.cxx:1044
MCTruthPartClassifier
Definition: TruthClassifiers.h:12
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::IParticle::auxdata
T & auxdata(const std::string &name, const std::string &clsname="")
Fetch an aux data variable, as a non-const reference.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:96