ATLAS Offline Software
PhotonTruthTool.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
18 #ifndef EGAMMAD3PDANALYSIS_PHOTONTRUTHTOOL_H
19 #define EGAMMAD3PDANALYSIS_PHOTONTRUTHTOOL_H
20 
21 
24 #include "GaudiKernel/ToolHandle.h"
25 #include "xAODEgamma/Photon.h"
27 #include "xAODTruth/TruthVertex.h"
28 #include <string>
29 
30 
31 namespace D3PD {
32 
34  : public AthAlgTool
35 {
36 public:
43  PhotonTruthTool (const std::string& type,
44  const std::string& name,
45  const IInterface* parent);
46 
47 
49  virtual StatusCode initialize();
50 
57  const xAOD::TruthParticle*
58  toTruthParticle (const xAOD::Photon& g) const;
59 
60 
68  bool getMCConv (const xAOD::TruthParticle* truePart,
69  float& RconvMC,
70  float& ZconvMC) const;
71 
72 
74  bool isPromptPhotonMC (const xAOD::TruthParticle* truePart) const;
75 
76 
78  bool isPromptParticleMC (const xAOD::TruthParticle* truePart) const;
79 
80 
82  bool isQuarkBremMC (const xAOD::TruthParticle* truePart) const;
83 
84 
85 private:
87  bool isFinalStatePhotonMC (const xAOD::TruthParticle* truePart) const;
88 
89 
91  bool isFinalState(const xAOD::TruthParticle* truePart) const;
92 
93 
95  const xAOD::TruthParticle*
96  getMother(const xAOD::TruthParticle* p) const;
97 
98 
100  const xAOD::TruthVertex*
101  getMotherVert(const xAOD::TruthParticle* p) const;
102 
103 
105  std::vector<const xAOD::TruthParticle*>
106  getMothers(const xAOD::TruthParticle* p) const;
107 
108 
110  ToolHandle<IMCTruthClassifier> m_classifier;
111 
114 
117 
120 };
121 
122 
123 } // namespace D3PD
124 
125 
126 #endif // EGAMMAD3PDANALYSIS_PHOTONTRUTHTOOL_H
D3PD::PhotonTruthTool
Definition: PhotonTruthTool.h:35
D3PD::PhotonTruthTool::getMothers
std::vector< const xAOD::TruthParticle * > getMothers(const xAOD::TruthParticle *p) const
Return list of mother particles of p.
Definition: PhotonTruthTool.cxx:268
D3PD::PhotonTruthTool::getMotherVert
const xAOD::TruthVertex * getMotherVert(const xAOD::TruthParticle *p) const
Get the mother vertex for p.
Definition: PhotonTruthTool.cxx:233
D3PD::PhotonTruthTool::isQuarkBremMC
bool isQuarkBremMC(const xAOD::TruthParticle *truePart) const
Test for a brem.
Definition: PhotonTruthTool.cxx:180
D3PD::PhotonTruthTool::isPromptParticleMC
bool isPromptParticleMC(const xAOD::TruthParticle *truePart) const
Test for a prompt particle.
Definition: PhotonTruthTool.cxx:144
D3PD::PhotonTruthTool::getMother
const xAOD::TruthParticle * getMother(const xAOD::TruthParticle *p) const
Get the (first) mother particle of p.
Definition: PhotonTruthTool.cxx:253
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
IMCTruthClassifier.h
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
Photon.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
AthAlgTool.h
D3PD::PhotonTruthTool::getMCConv
bool getMCConv(const xAOD::TruthParticle *truePart, float &RconvMC, float &ZconvMC) const
Check a truth particle for a conversion.
Definition: PhotonTruthTool.cxx:76
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TruthVertex.h
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
D3PD::PhotonTruthTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition: PhotonTruthTool.cxx:46
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
D3PD::PhotonTruthTool::isFinalState
bool isFinalState(const xAOD::TruthParticle *truePart) const
Test for a final-state particle.
Definition: PhotonTruthTool.cxx:205
xAOD::Photon_v1
Definition: Photon_v1.h:37
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::PhotonTruthTool::m_useG4Particles
bool m_useG4Particles
Property.
Definition: PhotonTruthTool.h:119
D3PD::PhotonTruthTool::m_zTruthConv
float m_zTruthConv
Property: Conversion vertex z cut.
Definition: PhotonTruthTool.h:113
D3PD::PhotonTruthTool::isFinalStatePhotonMC
bool isFinalStatePhotonMC(const xAOD::TruthParticle *truePart) const
Test for a final-state photon.
Definition: PhotonTruthTool.cxx:195
D3PD::PhotonTruthTool::m_classifier
ToolHandle< IMCTruthClassifier > m_classifier
Property: classifier tool.
Definition: PhotonTruthTool.h:110
D3PD::PhotonTruthTool::PhotonTruthTool
PhotonTruthTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: PhotonTruthTool.cxx:30
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h
D3PD::PhotonTruthTool::m_rTruthConv
float m_rTruthConv
Property: Conversion vertex r cut.
Definition: PhotonTruthTool.h:116
D3PD::PhotonTruthTool::toTruthParticle
const xAOD::TruthParticle * toTruthParticle(const xAOD::Photon &g) const
Go from a photon to a matching TruthParticle.
Definition: PhotonTruthTool.cxx:60
D3PD::PhotonTruthTool::isPromptPhotonMC
bool isPromptPhotonMC(const xAOD::TruthParticle *truePart) const
Test for a prompt photon.
Definition: PhotonTruthTool.cxx:134