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-2026 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// EDM includes
18// System include(s):
19#include <vector>
20#include <string>
21#include <map>
22
23namespace xAOD {
49 public asg::AsgTool, virtual public xAOD::IBPhysTrackVertexMapTool {
50
53
54 public:
56 BPhysTrackVertexMapTool(const std::string& name =
57 "BPhysTrackVertexMapTool");
58
60 virtual StatusCode initialize() override;
61
63 virtual StatusCode logEvent() override;
64
66 virtual StatusCode finalize() override;
67
69 virtual bool doLog() const override;
70
72 static std::string wrapLines(const std::string& lines, const std::string& prefix);
73
74 protected:
78 virtual StatusCode cacheEvent() override;
79
81 virtual std::vector<const xAOD::Vertex*>
82 pvsForIDTrack(const xAOD::TrackParticle* track) const override;
83
86 virtual std::vector<const xAOD::Vertex*>
87 refPVsForIDTrack(const xAOD::TrackParticle* track) const override;
88
90 virtual std::vector<const xAOD::Vertex*>
91 svsForIDTrack(const xAOD::TrackParticle* track) const override;
92
93 // track-vertex association related
94 virtual std::string idTrackToString(const xAOD::TrackParticle* track,
95 unsigned int indent=0,
96 bool withPV=false,
97 bool withRefPV=false,
98 bool withSV=false) override;
99
100 virtual std::string pvToString(const xAOD::Vertex* vtx,
101 unsigned int indent=0,
102 bool withTracks=false) override;
103
104 virtual std::string refPVToString(const xAOD::Vertex* vtx,
105 unsigned int indent=0,
106 bool withTracks=false) override;
107 virtual std::string svToString(const xAOD::Vertex* vtx,
108 unsigned int indent=0,
109 bool withTracks=false,
110 bool withMasses=false) override;
111 virtual std::string idTracksToString(const xAOD::TrackParticleContainer*
112 tpc,
113 unsigned int indent=0,
114 bool withPV=false,
115 bool withRefPV=false,
116 bool withSV=false) override;
117
118 virtual std::string pvsToString(const xAOD::VertexContainer* pvc,
119 unsigned int indent=0,
120 bool withTracks=false) override;
121 virtual std::string refPVsToString(const xAOD::VertexContainer* rpvc,
122 unsigned int indent=0,
123 bool withTracks=false) override;
124 virtual std::string svsToString(const xAOD::VertexContainer* svc,
125 unsigned int indent=0,
126 bool withTracks=false,
127 bool withMasses=false) override;
128 virtual std::string summaryToString(std::string prefix) override;
130
131 protected:
132 virtual float getFloat(std::string name, const xAOD::Vertex* b);
133
134 virtual std::vector<std::string> getTokens(std::string input,
135 std::string seperators);
136
137
138 private:
139 // track-vertex association related
140 typedef std::map<const xAOD::TrackParticle*,
141 std::vector<const xAOD::Vertex*> > TrackToVertexMap_t;
142
144 const xAOD::VertexContainer* pvc,
145 const xAOD::VertexContainer* rpvc,
146 const xAOD::VertexContainer* svc);
149 const xAOD::Vertex* vtx);
150 virtual std::string pvName(const xAOD::Vertex* vtx);
151 virtual std::string refPVName(const xAOD::Vertex* vtx);
152 virtual std::string svName(const xAOD::Vertex* vtx);
153 virtual std::string idTrackName(const xAOD::TrackParticle* vtx);
154
155 protected:
156 // job options
159 std::string m_pvContainerName;
162 std::string m_dumpPrefix;
163 std::string m_hypoName;
164
165 // containers
173
174 unsigned int m_nEvtsSeen;
175
178
179 private:
180 // track-vertex association related
181 typedef std::map<const xAOD::Vertex*, std::string> VertexNameMap_t;
185
186 typedef std::map<const xAOD::TrackParticle*, std::string> TrackNameMap_t;
188
192
193 }; // class BPhysTrackVertexMapTool
194
195} // namespace xAOD
196
197#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.