ATLAS Offline Software
Loading...
Searching...
No Matches
BPhysTrackVertexMapTool.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: $
8#ifndef BPHYSTOOLS_BPHYSTRACKVERTEXMAPTOOL_H
9#define BPHYSTOOLS_BPHYSTRACKVERTEXMAPTOOL_H
10
11// Framework includes
13#include "AsgTools/AsgTool.h"
14
15// System include(s):
16#include <memory>
17
18// EDM includes
21
22namespace xAOD {
48 public asg::AsgTool, virtual public xAOD::IBPhysTrackVertexMapTool {
49
52
53 public:
55 BPhysTrackVertexMapTool(const std::string& name =
56 "BPhysTrackVertexMapTool");
57
59 virtual StatusCode initialize() override;
60
62 virtual StatusCode logEvent() override;
63
65 virtual StatusCode finalize() override;
66
68 virtual bool doLog() const override;
69
71 static std::string wrapLines(const std::string& lines, const std::string& prefix);
72
73 protected:
77 virtual StatusCode cacheEvent() override;
78
80 virtual std::vector<const xAOD::Vertex*>
81 pvsForIDTrack(const xAOD::TrackParticle* track) const override;
82
85 virtual std::vector<const xAOD::Vertex*>
86 refPVsForIDTrack(const xAOD::TrackParticle* track) const override;
87
89 virtual std::vector<const xAOD::Vertex*>
90 svsForIDTrack(const xAOD::TrackParticle* track) const override;
91
92 // track-vertex association related
93 virtual std::string idTrackToString(const xAOD::TrackParticle* track,
94 unsigned int indent=0,
95 bool withPV=false,
96 bool withRefPV=false,
97 bool withSV=false) override;
98
99 virtual std::string pvToString(const xAOD::Vertex* vtx,
100 unsigned int indent=0,
101 bool withTracks=false) override;
102
103 virtual std::string refPVToString(const xAOD::Vertex* vtx,
104 unsigned int indent=0,
105 bool withTracks=false) override;
106 virtual std::string svToString(const xAOD::Vertex* vtx,
107 unsigned int indent=0,
108 bool withTracks=false,
109 bool withMasses=false) override;
110 virtual std::string idTracksToString(const xAOD::TrackParticleContainer*
111 tpc,
112 unsigned int indent=0,
113 bool withPV=false,
114 bool withRefPV=false,
115 bool withSV=false) override;
116
117 virtual std::string pvsToString(const xAOD::VertexContainer* pvc,
118 unsigned int indent=0,
119 bool withTracks=false) override;
120 virtual std::string refPVsToString(const xAOD::VertexContainer* rpvc,
121 unsigned int indent=0,
122 bool withTracks=false) override;
123 virtual std::string svsToString(const xAOD::VertexContainer* svc,
124 unsigned int indent=0,
125 bool withTracks=false,
126 bool withMasses=false) override;
127 virtual std::string summaryToString(std::string prefix) override;
129
130 protected:
131 virtual float getFloat(std::string name, const xAOD::Vertex* b);
132
133 virtual std::vector<std::string> getTokens(std::string input,
134 std::string seperators);
135
136
137 private:
138 // track-vertex association related
139 typedef std::map<const xAOD::TrackParticle*,
140 std::vector<const xAOD::Vertex*> > TrackToVertexMap_t;
141
143 const xAOD::VertexContainer* pvc,
144 const xAOD::VertexContainer* rpvc,
145 const xAOD::VertexContainer* svc);
148 const xAOD::Vertex* vtx);
149 virtual std::string pvName(const xAOD::Vertex* vtx);
150 virtual std::string refPVName(const xAOD::Vertex* vtx);
151 virtual std::string svName(const xAOD::Vertex* vtx);
152 virtual std::string idTrackName(const xAOD::TrackParticle* vtx);
153
154 protected:
155 // job options
158 std::string m_pvContainerName;
161 std::string m_dumpPrefix;
162 std::string m_hypoName;
163
164 // containers
172
173 unsigned int m_nEvtsSeen;
174
177
178 private:
179 // track-vertex association related
180 typedef std::map<const xAOD::Vertex*, std::string> VertexNameMap_t;
184
185 typedef std::map<const xAOD::TrackParticle*, std::string> TrackNameMap_t;
187
191
192 }; // class BPhysTrackVertexMapTool
193
194} // namespace xAOD
195
196#endif // BPHYSTOOLS_BPHYSTRACKVERTEXMAPTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
STL class.
const xAOD::VertexAuxContainer * m_svtxAuxContainer
const xAOD::VertexContainer * m_refPVContainer
virtual StatusCode cacheEvent() override
virtual StatusCode initialize() override
Function initialising the tool.
virtual std::string pvName(const xAOD::Vertex *vtx)
std::map< const xAOD::Vertex *, std::string > VertexNameMap_t
virtual float getFloat(std::string name, const xAOD::Vertex *b)
virtual std::string idTrackName(const xAOD::TrackParticle *vtx)
virtual std::string idTrackToString(const xAOD::TrackParticle *track, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
virtual std::string pvToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
virtual std::string svToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
virtual std::string summaryToString(std::string prefix) override
virtual StatusCode logEvent() override
Function being excuted for each event.
virtual std::string svName(const xAOD::Vertex *vtx)
virtual std::string svsToString(const xAOD::VertexContainer *svc, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
virtual std::string refPVName(const xAOD::Vertex *vtx)
std::map< const xAOD::TrackParticle *, std::vector< const xAOD::Vertex * > > TrackToVertexMap_t
virtual std::vector< std::string > getTokens(std::string input, std::string seperators)
BPhysTrackVertexMapTool(const std::string &name="BPhysTrackVertexMapTool")
Declare the correct constructor for Athena.
static std::string wrapLines(const std::string &lines, const std::string &prefix)
convenience method to wrap output lines by a prefix
const xAOD::VertexContainer * m_svtxContainer
virtual void initTrackVertexMaps(const xAOD::TrackParticleContainer *tpc, const xAOD::VertexContainer *pvc, const xAOD::VertexContainer *rpvc, const xAOD::VertexContainer *svc)
const xAOD::TrackParticleContainer * m_tracks
virtual std::vector< const xAOD::Vertex * > svsForIDTrack(const xAOD::TrackParticle *track) const override
obtain secondary vertices for a given ID track (may return empty vector)
virtual void addVertexToTrackVertexMap(TrackToVertexMap_t &map, const xAOD::TrackParticle *track, const xAOD::Vertex *vtx)
virtual std::vector< const xAOD::Vertex * > pvsForIDTrack(const xAOD::TrackParticle *track) const override
obtain primary vertices for a given ID track (may return empty vector)
virtual std::string pvsToString(const xAOD::VertexContainer *pvc, unsigned int indent=0, bool withTracks=false) override
const xAOD::TrackParticleAuxContainer * m_tracksAux
virtual std::string refPVsToString(const xAOD::VertexContainer *rpvc, unsigned int indent=0, bool withTracks=false) override
const xAOD::VertexAuxContainer * m_refPVAuxContainer
virtual std::string refPVToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
virtual bool doLog() const override
Function indicating whether log counter allows logging of current event.
std::map< const xAOD::TrackParticle *, std::string > TrackNameMap_t
const xAOD::VertexContainer * m_pvtxContainer
virtual std::vector< const xAOD::Vertex * > refPVsForIDTrack(const xAOD::TrackParticle *track) const override
obtain refitted primary vertices for a given ID track (may return empty vector)
virtual StatusCode finalize() override
Function finalizing the tool.
virtual std::string idTracksToString(const xAOD::TrackParticleContainer *tpc, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
Interface for dual-use tool createing a track-to-vertex map from the vertex-to-track information.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.