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-2017 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 
33 
35 static const InterfaceID IID_PhotonTruthTool ("D3PD::PhotonTruthTool", 1, 0);
36 
37 
39  : public AthAlgTool
40 {
41 public:
43  static const InterfaceID& interfaceID() { return IID_PhotonTruthTool; }
44 
51  PhotonTruthTool (const std::string& type,
52  const std::string& name,
53  const IInterface* parent);
54 
55 
57  virtual StatusCode initialize();
58 
59 
61  virtual StatusCode queryInterface( const InterfaceID& riid,
62  void** ppvIf );
63 
64 
71  const xAOD::TruthParticle*
72  toTruthParticle (const xAOD::Photon& g) const;
73 
74 
82  bool getMCConv (const xAOD::TruthParticle* truePart,
83  float& RconvMC,
84  float& ZconvMC) const;
85 
86 
88  bool isPromptPhotonMC (const xAOD::TruthParticle* truePart) const;
89 
90 
92  bool isPromptParticleMC (const xAOD::TruthParticle* truePart) const;
93 
94 
96  bool isQuarkBremMC (const xAOD::TruthParticle* truePart) const;
97 
98 
99 private:
101  bool isFinalStatePhotonMC (const xAOD::TruthParticle* truePart) const;
102 
103 
105  bool isFinalState(const xAOD::TruthParticle* truePart) const;
106 
107 
109  const xAOD::TruthParticle*
110  getMother(const xAOD::TruthParticle* p) const;
111 
112 
114  const xAOD::TruthVertex*
115  getMotherVert(const xAOD::TruthParticle* p) const;
116 
117 
119  std::vector<const xAOD::TruthParticle*>
120  getMothers(const xAOD::TruthParticle* p) const;
121 
122 
124  ToolHandle<IMCTruthClassifier> m_classifier;
125 
128 
131 
134 };
135 
136 
137 } // namespace D3PD
138 
139 
140 #endif // EGAMMAD3PDANALYSIS_PHOTONTRUTHTOOL_H
D3PD::PhotonTruthTool
Definition: PhotonTruthTool.h:40
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
D3PD::PhotonTruthTool::getMothers
std::vector< const xAOD::TruthParticle * > getMothers(const xAOD::TruthParticle *p) const
Return list of mother particles of p.
Definition: PhotonTruthTool.cxx:284
D3PD::PhotonTruthTool::getMotherVert
const xAOD::TruthVertex * getMotherVert(const xAOD::TruthParticle *p) const
Get the mother vertex for p.
Definition: PhotonTruthTool.cxx:249
D3PD::PhotonTruthTool::isQuarkBremMC
bool isQuarkBremMC(const xAOD::TruthParticle *truePart) const
Test for a brem.
Definition: PhotonTruthTool.cxx:196
D3PD::PhotonTruthTool::isPromptParticleMC
bool isPromptParticleMC(const xAOD::TruthParticle *truePart) const
Test for a prompt particle.
Definition: PhotonTruthTool.cxx:160
D3PD::PhotonTruthTool::getMother
const xAOD::TruthParticle * getMother(const xAOD::TruthParticle *p) const
Get the (first) mother particle of p.
Definition: PhotonTruthTool.cxx:269
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
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:41
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:92
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::PhotonTruthTool::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvIf)
Standard Gaudi queryInterface method.
Definition: PhotonTruthTool.cxx:58
TruthVertex.h
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
D3PD::PhotonTruthTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition: PhotonTruthTool.cxx:46
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
D3PD::PhotonTruthTool::isFinalState
bool isFinalState(const xAOD::TruthParticle *truePart) const
Test for a final-state particle.
Definition: PhotonTruthTool.cxx:221
xAOD::Photon_v1
Definition: Photon_v1.h:37
D3PD::PhotonTruthTool::interfaceID
static const InterfaceID & interfaceID()
Gaudi interface definition.
Definition: PhotonTruthTool.h:43
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::PhotonTruthTool::m_useG4Particles
bool m_useG4Particles
Property.
Definition: PhotonTruthTool.h:133
D3PD::PhotonTruthTool::m_zTruthConv
float m_zTruthConv
Property: Conversion vertex z cut.
Definition: PhotonTruthTool.h:127
D3PD::PhotonTruthTool::isFinalStatePhotonMC
bool isFinalStatePhotonMC(const xAOD::TruthParticle *truePart) const
Test for a final-state photon.
Definition: PhotonTruthTool.cxx:211
D3PD::PhotonTruthTool::m_classifier
ToolHandle< IMCTruthClassifier > m_classifier
Property: classifier tool.
Definition: PhotonTruthTool.h:124
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:130
D3PD::PhotonTruthTool::toTruthParticle
const xAOD::TruthParticle * toTruthParticle(const xAOD::Photon &g) const
Go from a photon to a matching TruthParticle.
Definition: PhotonTruthTool.cxx:76
D3PD::PhotonTruthTool::isPromptPhotonMC
bool isPromptPhotonMC(const xAOD::TruthParticle *truePart) const
Test for a prompt photon.
Definition: PhotonTruthTool.cxx:150