Warning, /coresoftware/offline/packages/trackreco/PHActsVertexFitter.h.outdated is written in an unsupported language. File is not indexed.
0001 #ifndef TRACKRECO_PHACTSVERTEXFITTER_H
0002 #define TRACKRECO_PHACTSVERTEXFITTER_H
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <trackbase/ActsTrackingGeometry.h>
0006
0007 #include <Acts/Vertexing/Vertex.hpp>
0008
0009 #include <ActsExamples/EventData/TrkrClusterMultiTrajectory.hpp>
0010
0011 class PHCompositeNode;
0012 class SvtxTrack;
0013 class SvtxTrackMap;
0014 class SvtxVertex;
0015 class SvtxVertexMap;
0016
0017 namespace Acts
0018 {
0019 class TrackParameters;
0020 }
0021
0022 using Trajectory = ActsExamples::TrkrClusterMultiTrajectory;
0023
0024 using BoundTrackParamVec = std::vector<const Acts::BoundTrackParameters *>;
0025 using VertexTrackMap = std::map<const unsigned int,
0026 BoundTrackParamVec>;
0027
0028 using ActsVertex = const Acts::Vertex<Acts::BoundTrackParameters>;
0029
0030 /**
0031 * This class runs the Acts vertex fitter on the final tracks. It is
0032 * required that the tracks already have an identified vertexId associated
0033 * to them, i.e. that vertex finding has already been performed
0034 */
0035 class PHActsVertexFitter : public SubsysReco
0036 {
0037 public:
0038 PHActsVertexFitter(const std::string &name = "PHActsVertexFitter");
0039 ~PHActsVertexFitter() override {}
0040 int process_event(PHCompositeNode *topNode) override;
0041 int Init(PHCompositeNode *topNode) override;
0042 int InitRun(PHCompositeNode *topNode) override;
0043 int ResetEvent(PHCompositeNode *topNode) override;
0044 int End(PHCompositeNode *topNode) override;
0045
0046 void updateSvtxVertexMap(bool updateSvtxVertexMap)
0047 {
0048 m_updateSvtxVertexMap = updateSvtxVertexMap;
0049 }
0050
0051 private:
0052 int getNodes(PHCompositeNode *topNode);
0053 int createNodes(PHCompositeNode *topNode);
0054
0055 /// Get the tracks with their associated vertex Ids
0056 VertexTrackMap getTracks();
0057
0058 /// Turn the SvtxTrack object into an Acts::TrackParameters object
0059 const Acts::BoundTrackParameters *makeTrackParam(const SvtxTrack *track) const;
0060
0061 /// Run the Acts vertex fitter
0062 ActsVertex fitVertex(BoundTrackParamVec tracks,
0063 Acts::Logging::Level logLevel) const;
0064
0065 /// Runs Acts vertex fitter
0066 void fitVertices(std::vector<const Acts::BoundTrackParameters *> tracks);
0067
0068 /// Update SvtxVertex or create new SvtxVertexMap
0069 void createActsSvtxVertex(const unsigned int,
0070 ActsVertex vertex);
0071 void updateSvtxVertex(const unsigned int,
0072 ActsVertex vertex);
0073
0074 int m_event = 0;
0075
0076 std::map<const unsigned int, Trajectory> *m_actsFitResults;
0077 ActsTrackingGeometry *m_tGeometry;
0078 SvtxTrackMap *m_trackMap = nullptr;
0079 SvtxVertexMap *m_vertexMap = nullptr;
0080 SvtxVertexMap *m_actsVertexMap = nullptr;
0081
0082 /// Option to update the default SvtxVertexMap. A new SvtxVertexMap
0083 /// called SvtxVertexMapActs is created by default in the module
0084 bool m_updateSvtxVertexMap = false;
0085 };
0086
0087 #endif //TRACKRECO_PHACTSVERTEXFITTER_H