ATLAS Offline Software
Loading...
Searching...
No Matches
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
15#include "xAODTracking/Vertex.h"
17
18
19namespace D3PD {
20
21
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
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
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)
87 else if (ntr == 2)
89 }
90 }
91
92 return StatusCode::SUCCESS;
93}
94
95
96} // namespace D3PD
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Type-safe wrapper for block filler tools.
int * m_nDoubleTrackConv
Variable: Number of conversion vertices with exactly two tracks.
int * m_nSingleTrackConv
Variable: Number of conversion vertices with exactly one track.
int * m_convFlag
Variable: Conversion flag.
int * m_isConv
Variable: Is there a conversion?
egammaConversion0FillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
virtual StatusCode book() final
Book variables for this block.
int * m_nConv
Variable: Number of conversion vertices.
virtual StatusCode fill(const xAOD::Photon &p) override
Fill one block — type-safe version.
Class describing an photon.
Block filler tool for photon conversion information, for LOD 0.
Block filler tool for noisy FEB information.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Vertex_v1 Vertex
Define the latest version of the vertex class.
Photon_v1 Photon
Definition of the current "egamma version".