Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:25

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef PHACTSGSF_H
0004 #define PHACTSGSF_H
0005 
0006 #include "ActsEvaluator.h"
0007 
0008 #include <fun4all/SubsysReco.h>
0009 
0010 #include <tpc/TpcGlobalPositionWrapper.h>
0011 
0012 #include <trackbase/ActsSourceLink.h>
0013 #include <trackbase/ActsTrackFittingAlgorithm.h>
0014 #include <trackbase/Calibrator.h>
0015 #include <trackbase/ClusterErrorPara.h>
0016 
0017 #include <Acts/Definitions/Algebra.hpp>
0018 #include <Acts/EventData/VectorMultiTrajectory.hpp>
0019 #include <Acts/Geometry/TrackingGeometry.hpp>
0020 #include <Acts/MagneticField/MagneticFieldContext.hpp>
0021 #include <Acts/Utilities/BinnedArray.hpp>
0022 #include <Acts/Utilities/CalibrationContext.hpp>
0023 #include <Acts/Utilities/Logger.hpp>
0024 
0025 #include <ActsExamples/EventData/Trajectories.hpp>
0026 
0027 
0028 #include <string>
0029 
0030 class PHCompositeNode;
0031 class ActsGeometry;
0032 class TrkrClusterContainer;
0033 class SvtxTrackMap;
0034 class SvtxVertexMap;
0035 class SvtxTrack;
0036 
0037 using SourceLink = ActsSourceLink;
0038 using FitResult = ActsTrackFittingAlgorithm::TrackFitterResult;
0039 using Trajectory = ActsExamples::Trajectories;
0040 using Measurement = Acts::Measurement<Acts::BoundIndices, 2>;
0041 using SurfacePtrVec = std::vector<const Acts::Surface*>;
0042 using SourceLinkVec = std::vector<Acts::SourceLink>;
0043 
0044 class PHActsGSF : public SubsysReco
0045 {
0046  public:
0047 
0048   //! constructor
0049   PHActsGSF(const std::string& name = "PHActsGSF");
0050 
0051   int InitRun(PHCompositeNode* topNode) override;
0052   int process_event(PHCompositeNode* topNode) override;
0053   int End(PHCompositeNode* topNode) override;
0054 
0055   void set_pp_mode(bool mode) {m_pp_mode = mode;}
0056 
0057   void useActsEvaluator(bool actsEvaluator)
0058   {
0059     m_actsEvaluator = actsEvaluator;
0060   }
0061 
0062  private:
0063   int getNodes(PHCompositeNode* topNode);
0064   std::shared_ptr<Acts::PerigeeSurface> makePerigee(SvtxTrack* track) const;
0065   ActsTrackFittingAlgorithm::TrackParameters makeSeed(
0066       SvtxTrack* track,
0067       const std::shared_ptr<Acts::PerigeeSurface>& psurf) const;
0068   //  SourceLinkVec getSourceLinks(TrackSeed* track,
0069   //                         ActsTrackFittingAlgorithm::MeasurementContainer& measurements,
0070   //                         const short int& crossing);
0071   ActsTrackFittingAlgorithm::TrackFitterResult fitTrack(
0072       const std::vector<Acts::SourceLink>& sourceLinks,
0073       const ActsTrackFittingAlgorithm::TrackParameters& seed,
0074       const ActsTrackFittingAlgorithm::GeneralFitterOptions& options,
0075       const CalibratorAdapter& calibrator,
0076       ActsTrackFittingAlgorithm::TrackContainer& tracks);
0077 
0078   void updateTrack(FitResult& result, SvtxTrack* track,
0079                    ActsTrackFittingAlgorithm::TrackContainer& tracks,
0080                    const TrackSeed* seed, const ActsTrackFittingAlgorithm::MeasurementContainer& measurements);
0081   void updateSvtxTrack(std::vector<Acts::MultiTrajectoryTraits::IndexType>& tips,
0082                        Trajectory::IndexedParameters& paramsMap,
0083                        ActsTrackFittingAlgorithm::TrackContainer& tracks,
0084                        SvtxTrack* track);
0085   std::vector<TrkrDefs::cluskey> get_cluster_keys(SvtxTrack* track);
0086 
0087   ActsGeometry* m_tGeometry = nullptr;
0088   TrkrClusterContainer* m_clusterContainer = nullptr;
0089   SvtxTrackMap* m_trackMap = nullptr;
0090   SvtxVertexMap* m_vertexMap = nullptr;
0091 
0092 //  alignmentTransformationContainer* m_alignmentTransformationMap = nullptr;  // added for testing purposes
0093   alignmentTransformationContainer* m_alignmentTransformationMapTransient = nullptr;
0094   std::set< Acts::GeometryIdentifier> m_transient_id_set;
0095   Acts::GeometryContext m_transient_geocontext;
0096 
0097   // Tpc Global position wrapper
0098   TpcGlobalPositionWrapper m_globalPositionWrapper;
0099 
0100   std::string m_trackMapName = "SvtxTrackMap";
0101   std::string _seed_track_map_name = "SeedTrackMap";
0102 //  unsigned int m_pHypothesis = 11;
0103 
0104   bool m_pp_mode = false;
0105 
0106   bool m_actsEvaluator = false;
0107   std::unique_ptr<ActsEvaluator> m_evaluator = nullptr;
0108   std::string m_evalname = "ActsEvaluator.root";
0109 
0110   SvtxTrackMap* m_seedTracks = nullptr;
0111 
0112   ClusterErrorPara _ClusErrPara;
0113 
0114   ActsTrackFittingAlgorithm::Config m_fitCfg;
0115 };
0116 
0117 #endif  // PHACTSGSF_H