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

#include <ParticleLevelElectronObjectSelector.h>

Inheritance diagram for top::ParticleLevelElectronObjectSelector:
Collaboration diagram for top::ParticleLevelElectronObjectSelector:

Classes

struct  Options
 

Public Member Functions

 ParticleLevelElectronObjectSelector (Options cuts=Options())
 
virtual bool apply (const xAOD::TruthParticle &truthParticle)
 

Private Attributes

Options m_opt
 

Detailed Description

Definition at line 18 of file ParticleLevelElectronObjectSelector.h.

Constructor & Destructor Documentation

◆ ParticleLevelElectronObjectSelector()

top::ParticleLevelElectronObjectSelector::ParticleLevelElectronObjectSelector ( Options  cuts = Options())

Definition at line 16 of file ParticleLevelElectronObjectSelector.cxx.

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

Member Function Documentation

◆ apply()

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

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

Definition at line 20 of file ParticleLevelElectronObjectSelector.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("ParticleLevelElectronObjectSelector::apply: "
32  "Could not obtain MCTruthClassifier result decoration.");
33  }
34 
35  // --------------------------------------------------
36  // Accept electrons 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("ParticleLevelElectronObjectSelector::apply: "
49  "Could not obtain 'originalTruthParticle' reference.");
50  }
51  if (truth::isLeptonFromTau(*truthProxy)) {
52  return false;
53  }
54  }
55 
56  // --------------------------------------------------
57  // Apply kinematic cut on the dressed pT:
58  // must exceed 25 GeV
59  if (truthParticle.auxdata<float>("pt_dressed") < m_opt.pt_min) {
60  return false;
61  }
62 
63  // --------------------------------------------------
64  // Apply kinematic cut on the dressed eta:
65  // must be less than or equal to 2.5
66  if (std::abs(truthParticle.auxdata<float>("eta_dressed")) > m_opt.eta_max) {
67  return false;
68  }
69 
70 
71  // --------------------------------------------------
72  // Everything that reaches this point has passed the selection
73  return true;
74  }

Member Data Documentation

◆ m_opt

Options top::ParticleLevelElectronObjectSelector::m_opt
private

Definition at line 43 of file ParticleLevelElectronObjectSelector.h.


The documentation for this class was generated from the following files:
top::ParticleLevelElectronObjectSelector::Options::not_from_hadron
bool not_from_hadron
Definition: ParticleLevelElectronObjectSelector.h:36
IsoElectron
@ IsoElectron
Definition: TruthClasses.h:11
top::ParticleLevelElectronObjectSelector::m_opt
Options m_opt
Definition: ParticleLevelElectronObjectSelector.h:43
top::ParticleLevelElectronObjectSelector::Options::pt_min
double pt_min
Definition: ParticleLevelElectronObjectSelector.h:34
top::ParticleLevelElectronObjectSelector::Options::tau_is_hadron
bool tau_is_hadron
Definition: ParticleLevelElectronObjectSelector.h:37
top::ParticleLevelElectronObjectSelector::Options::eta_max
double eta_max
Definition: ParticleLevelElectronObjectSelector.h:35
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