ATLAS Offline Software
ParticleLevelTauObjectSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
9 
10 namespace top {
12  : m_opt(opt) { /* Deliberately Empty */}
13 
15  // Obtain the particle type and particle origin from the decoration
16  // created by the MCTruthClassifier. For legacy reasons, try both
17  // decoration names.
18  unsigned int type;
19 
20  if (truthParticle.isAvailable<unsigned int>("particleType")) {
21  type = truthParticle.auxdata<unsigned int>("particleType");
22  } else if (truthParticle.isAvailable<unsigned int>("classifierParticleType")) {
23  type = truthParticle.auxdata<unsigned int>("classifierParticleType");
24  } else {
25  throw std::runtime_error {
26  "Could not obtain MCTruthClassifier result decoration."
27  };
28  }
29 
30  // --------------------------------------------------
31  // Accept muons iff they do not come from a hadron
32  using namespace MCTruthPartClassifier;
33  if (type != ParticleType::IsoTau) {
34  return false;
35  }
36 
37  // --------------------------------------------------
38  // Apply kinematic cut on the dressed pT:
39  // must exceed 25 GeV
40  if (truthParticle.pt() < m_opt.pt_min) {
41  return false;
42  }
43 
44  // --------------------------------------------------
45  // Apply kinematic cut on the dressed eta:
46  // must be less than or equal to 2.5
47  if (std::fabs(truthParticle.eta()) > m_opt.eta_max) {
48  return false;
49  }
50 
51  // --------------------------------------------------
52  // Everything that reaches this point has passed the selection
53  return true;
54  }
55 }
ParticleLevelTauObjectSelector.h
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::ParticleLevelTauObjectSelector::Options
Definition: ParticleLevelTauObjectSelector.h:20
MCTruthClassifierDefs.h
top::ParticleLevelTauObjectSelector::m_opt
Options m_opt
Definition: ParticleLevelTauObjectSelector.h:32
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
IsoTau
@ IsoTau
Definition: TruthClasses.h:19
top::ParticleLevelTauObjectSelector::apply
virtual bool apply(const xAOD::TruthParticle &truthParticle)
Definition: ParticleLevelTauObjectSelector.cxx:14
TruthTools.h
pmontree.opt
opt
Definition: pmontree.py:16
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
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::ParticleLevelTauObjectSelector::Options::eta_max
double eta_max
Definition: ParticleLevelTauObjectSelector.h:26
top::ParticleLevelTauObjectSelector::ParticleLevelTauObjectSelector
ParticleLevelTauObjectSelector(Options opt=Options())
Definition: ParticleLevelTauObjectSelector.cxx:11
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
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
top::ParticleLevelTauObjectSelector::Options::pt_min
double pt_min
Definition: ParticleLevelTauObjectSelector.h:25