Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef PHSILICONCOSMICSEEDING_H
0004 #define PHSILICONCOSMICSEEDING_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 #include <trackbase/ActsGeometry.h>
0008 #include <trackbase/TrkrDefs.h>
0009 
0010 #include <map>
0011 #include <set>
0012 #include <string>
0013 #include <vector>
0014 
0015 class PHCompositeNode;
0016 class TrkrClusterContainer;
0017 class ActsGeometry;
0018 class TrackSeedContainer;
0019 class PHSiliconCosmicSeeding : public SubsysReco
0020 {
0021  public:
0022   using PositionMap = std::map<TrkrDefs::cluskey, Acts::Vector3>;
0023   struct seed
0024   {
0025     float xyslope = std::numeric_limits<float>::quiet_NaN();
0026     float xyintercept = std::numeric_limits<float>::quiet_NaN();
0027     float rzslope = std::numeric_limits<float>::quiet_NaN();
0028     float rzintercept = std::numeric_limits<float>::quiet_NaN();
0029     std::set<TrkrDefs::cluskey> ckeys;
0030   };
0031   using SeedVector = std::vector<seed>;
0032   PHSiliconCosmicSeeding(const std::string &name = "PHSiliconCosmicSeeding");
0033 
0034   ~PHSiliconCosmicSeeding() override;
0035 
0036   int Init(PHCompositeNode *topNode) override;
0037   int InitRun(PHCompositeNode *topNode) override;
0038   int process_event(PHCompositeNode *topNode) override;
0039   /// Called at the end of all processing.
0040   int End(PHCompositeNode *topNode) override;
0041 
0042  private:
0043   int getNodes(PHCompositeNode *topNode);
0044   int createNodes(PHCompositeNode *topNode);
0045   SeedVector makeDoublets(PositionMap &clusterPositions);
0046   SeedVector addClustersOnLine(SeedVector &doublets, PositionMap &clusterPositions);
0047   SeedVector combineSeeds(SeedVector &doublets);
0048   void pruneSeeds(SeedVector &doublets, PositionMap &clusterPositions);
0049   TrkrClusterContainer *m_clusterContainer = nullptr;
0050   ActsGeometry *m_tGeometry = nullptr;
0051   TrackSeedContainer *m_seedContainer = nullptr;
0052   float m_maxDoubletDistance = 6.;  // cm
0053   std::string m_trackMapName = "SiliconTrackSeedContainer";
0054 };
0055 
0056 #endif  // PHSILICONCOSMICSEEDING_H