ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
egammaD3PDMaker
src
egammaConversion0FillerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id$
12
13
14
#include "
egammaConversion0FillerTool.h
"
15
#include "
xAODTracking/Vertex.h
"
16
#include "
AthenaKernel/errorcheck.h
"
17
18
19
namespace
D3PD
{
20
21
28
egammaConversion0FillerTool::egammaConversion0FillerTool
29
(
const
std::string&
type
,
30
const
std::string& name,
31
const
IInterface* parent)
32
:
BlockFillerTool
<
xAOD
::
Photon
> (
type
, name, parent)
33
{
34
book
().ignore();
// Avoid coverity warnings.
35
}
36
37
41
StatusCode
egammaConversion0FillerTool::book
()
42
{
43
CHECK
(
addVariable
(
"convFlag"
,
m_convFlag
,
44
"Number of tracks for the first conversion candidate; "
45
"0 if no conversion or if there are more than "
46
"two tracks."
) );
47
CHECK
(
addVariable
(
"isConv"
,
m_isConv
,
48
"True if the first conversion candidate has "
49
"1 or 2 tracks."
) );
50
CHECK
(
addVariable
(
"nConv"
,
m_nConv
,
51
"Number of conversion vertices."
) );
52
CHECK
(
addVariable
(
"nSingleTrackConv"
,
m_nSingleTrackConv
,
53
"Number of conversion vertices with exactly one track."
) );
54
CHECK
(
addVariable
(
"nDoubleTrackConv"
,
m_nDoubleTrackConv
,
55
"Number of conversion vertices with exactly two tracks."
) );
56
57
return
StatusCode::SUCCESS;
58
}
59
60
69
StatusCode
egammaConversion0FillerTool::fill
(
const
xAOD::Photon
& p)
70
{
71
const
xAOD::Vertex
* conv = p.vertex();
72
73
if
(conv && conv->nTrackParticles()<=2)
74
*
m_convFlag
= conv->nTrackParticles();
75
else
76
*
m_convFlag
= 0;
77
78
*
m_isConv
= (*
m_convFlag
> 0);
79
80
*
m_nConv
= p.nVertices();
81
for
(
int
i = 0; i < *
m_nConv
; i++) {
82
const
xAOD::Vertex
* conv = p.vertex(i);
83
if
(conv) {
84
int
ntr = conv->nTrackParticles();
85
if
(ntr == 1)
86
++*
m_nSingleTrackConv
;
87
else
if
(ntr == 2)
88
++*
m_nDoubleTrackConv
;
89
}
90
}
91
92
return
StatusCode::SUCCESS;
93
}
94
95
96
}
// namespace D3PD
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Vertex.h
D3PD::BlockFillerTool< xAOD::Photon >::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Definition
AddVariable.cxx:85
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition
BlockFillerTool.h:65
D3PD::egammaConversion0FillerTool::m_nDoubleTrackConv
int * m_nDoubleTrackConv
Variable: Number of conversion vertices with exactly two tracks.
Definition
egammaConversion0FillerTool.h:71
D3PD::egammaConversion0FillerTool::m_nSingleTrackConv
int * m_nSingleTrackConv
Variable: Number of conversion vertices with exactly one track.
Definition
egammaConversion0FillerTool.h:68
D3PD::egammaConversion0FillerTool::m_convFlag
int * m_convFlag
Variable: Conversion flag.
Definition
egammaConversion0FillerTool.h:59
D3PD::egammaConversion0FillerTool::m_isConv
int * m_isConv
Variable: Is there a conversion?
Definition
egammaConversion0FillerTool.h:62
D3PD::egammaConversion0FillerTool::egammaConversion0FillerTool
egammaConversion0FillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
egammaConversion0FillerTool.cxx:29
D3PD::egammaConversion0FillerTool::book
virtual StatusCode book() final
Book variables for this block.
Definition
egammaConversion0FillerTool.cxx:41
D3PD::egammaConversion0FillerTool::m_nConv
int * m_nConv
Variable: Number of conversion vertices.
Definition
egammaConversion0FillerTool.h:65
D3PD::egammaConversion0FillerTool::fill
virtual StatusCode fill(const xAOD::Photon &p) override
Fill one block — type-safe version.
Definition
egammaConversion0FillerTool.cxx:69
Photon
Class describing an photon.
egammaConversion0FillerTool.h
Block filler tool for photon conversion information, for LOD 0.
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
type
Generated on
for ATLAS Offline Software by
1.17.0