Warning, /coresoftware/offline/packages/trackreco/PHActsVertexFinder.h.outdated is written in an unsupported language. File is not indexed.
0001 #ifndef TRACKRECO_PHACTSVERTEXFINDER_H
0002 #define TRACKRECO_PHACTSVERTEXFINDER_H
0003
0004 #include "PHInitVertexing.h"
0005 #include <trackbase/ActsTrackingGeometry.h>
0006
0007 #include <trackbase/TrkrDefs.h>
0008
0009 #include <Acts/Utilities/Result.hpp>
0010 #include <Acts/Vertexing/Vertex.hpp>
0011
0012 #include <ActsExamples/EventData/TrkrClusterMultiTrajectory.hpp>
0013
0014 class PHCompositeNode;
0015 class SvtxTrack;
0016 class SvtxTrackMap;
0017 class SvtxVertexMap;
0018 class SvtxVertex;
0019
0020 namespace Acts
0021 {
0022 class TrackParameters;
0023 }
0024
0025 using Trajectory = ActsExamples::TrkrClusterMultiTrajectory;
0026 using VertexVector = std::vector<Acts::Vertex<Acts::BoundTrackParameters>>;
0027 using TrackPtrVector = std::vector<const Acts::BoundTrackParameters*>;
0028 using VertexMap = std::map<unsigned int,
0029 Acts::Vertex<Acts::BoundTrackParameters>>;
0030
0031 using KeyMap = std::map<const Acts::BoundTrackParameters*, const unsigned int>;
0032
0033 /**
0034 * This class calls the Acts::IterativeVertexFinder which takes a
0035 * list of tracks and returns a list of vertices that are found.
0036 */
0037 class PHActsVertexFinder: public PHInitVertexing
0038 {
0039
0040 public:
0041 PHActsVertexFinder(const std::string &name = "PHActsVertexFinder");
0042
0043 ~PHActsVertexFinder() override {}
0044
0045 void setMaxVertices(int maxVertices)
0046 { m_maxVertices = maxVertices; }
0047
0048 void setFieldMap(const std::string& fieldMap)
0049 { m_fieldMap = fieldMap; }
0050
0051 protected:
0052 int Setup(PHCompositeNode *topNode) override;
0053 int Process(PHCompositeNode *topNode) override;
0054 int ResetEvent(PHCompositeNode *topNode) override;
0055 int End(PHCompositeNode *topNode) override;
0056
0057 private:
0058
0059 int createNodes(PHCompositeNode *topNode);
0060 int getNodes(PHCompositeNode *topNode);
0061
0062 /// Get list of tracks from PHActsTrkFitter to vertex fit
0063 TrackPtrVector getTracks(KeyMap& keyMap);
0064
0065 /// Call acts vertex finder
0066 VertexVector findVertices(TrackPtrVector& tracks);
0067
0068 /// Fill maps with relevant vertex information
0069 void fillVertexMap(VertexVector& vertices,
0070 KeyMap& keyMap);
0071
0072 void updateTrackDCA(const unsigned int trackKey,
0073 const Acts::Vector3D vertex);
0074
0075 void checkTrackVertexAssociation();
0076
0077 /// An Acts vertex object map
0078 VertexMap *m_actsVertexMap;
0079
0080 int m_event = 0;
0081 /// Maximum number of vertices that the Acts finder is allowed
0082 /// to find
0083 int m_maxVertices = 20;
0084
0085 int m_goodFits = 0;
0086 int m_totalFits = 0;
0087 std::string m_fieldMap = "";
0088
0089 SvtxVertexMap *m_svtxVertexMap = nullptr;
0090 SvtxVertexMap *m_svtxVertexMapActs = nullptr;
0091 ActsTrackingGeometry *m_tGeometry = nullptr;
0092 SvtxTrackMap *m_svtxTrackMap = nullptr;
0093 std::map<const unsigned int, Trajectory> *m_trajectories = nullptr;
0094 };
0095
0096 #endif // TRACKRECO_PHACTSVERTEXFINDER_H