Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:24

0001 /*!
0002  *  \file       PHTruthTrackSeeding.h
0003  *  \brief      Vertexing using truth info
0004  *  \author     Haiwang Yu <yuhw@nmsu.edu>
0005  */
0006 
0007 #ifndef TRACKRECO_PHTRUTHTRACKSEEDING_H
0008 #define TRACKRECO_PHTRUTHTRACKSEEDING_H
0009 
0010 #include "PHTrackSeeding.h"
0011 
0012 #include <trackbase/ActsGeometry.h>
0013 #include <trackbase/TrkrDefs.h>
0014 
0015 #include <gsl/gsl_rng.h>
0016 
0017 #include <memory>
0018 #include <string>  // for string
0019 #include <vector>
0020 
0021 // forward declarations
0022 class PHCompositeNode;
0023 class PHG4TruthInfoContainer;
0024 class PHG4HitContainer;
0025 class TrkrHitTruthAssoc;
0026 class TrkrClusterContainer;
0027 class TrkrClusterCrossingAssoc;
0028 class SvtxClusterEval;
0029 class TrackSeed;
0030 class TrackSeedContainer;
0031 class PHG4Particle;
0032 
0033 /// \class PHTruthTrackSeeding
0034 ///
0035 /// \brief Vertexing using truth info
0036 ///
0037 
0038 class PHTruthTrackSeeding : public PHTrackSeeding
0039 {
0040  public:
0041   PHTruthTrackSeeding(const std::string& name = "PHTruthTrackSeeding");
0042 
0043   unsigned int get_min_clusters_per_track() const
0044   {
0045     return _min_clusters_per_track;
0046   }
0047 
0048   void set_min_clusters_per_track(unsigned int minClustersPerTrack)
0049   {
0050     _min_clusters_per_track = minClustersPerTrack;
0051   }
0052 
0053   void set_min_layer(unsigned int minLayer)
0054   {
0055     _min_layer = minLayer;
0056   }
0057 
0058   void set_max_layer(unsigned int maxLayer)
0059   {
0060     _max_layer = maxLayer;
0061   }
0062 
0063   //! minimal truth momentum cut
0064   double get_min_momentum() const
0065   {
0066     return _min_momentum;
0067   }
0068 
0069   //! minimal truth momentum cut
0070   void set_min_momentum(double m)
0071   {
0072     _min_momentum = m;
0073   }
0074 
0075  protected:
0076   int Setup(PHCompositeNode* topNode) override;
0077 
0078   int Process(PHCompositeNode* topNode) override;
0079 
0080   int End() override;
0081 
0082  private:
0083   /// fetch node pointers
0084   int GetNodes(PHCompositeNode* topNode);
0085   int CreateNodes(PHCompositeNode* topNode);
0086 
0087   void buildTrackSeed(const std::vector<TrkrDefs::cluskey>& clusters,
0088                       PHG4Particle* g4particle, TrackSeedContainer* container);
0089   PHG4TruthInfoContainer* m_g4truth_container = nullptr;
0090 
0091   /// get crossing id from intt clusters associated to track
0092   /* this is a copy of the code in PHTruthSiliconAssociation */
0093   std::set<short int> getInttCrossings(TrackSeed*) const;
0094 
0095   TrkrClusterContainer* m_clusterMap = nullptr;
0096   TrkrClusterCrossingAssoc* m_cluster_crossing_map = nullptr;
0097   PHG4HitContainer* phg4hits_tpc = nullptr;
0098   PHG4HitContainer* phg4hits_intt = nullptr;
0099   PHG4HitContainer* phg4hits_mvtx = nullptr;
0100   PHG4HitContainer* phg4hits_micromegas = nullptr;
0101 
0102   TrkrHitTruthAssoc* hittruthassoc = nullptr;
0103   SvtxClusterEval* _clustereval;
0104 
0105   unsigned int _min_clusters_per_track = 3;
0106   unsigned int _min_layer = 0;
0107   unsigned int _max_layer = 60;
0108 
0109   //! minimal truth momentum cut (GeV)
0110   double _min_momentum = 50e-3;
0111 
0112   TrackSeedContainer* _track_map_silicon = nullptr;
0113   TrackSeedContainer* _track_map_combined = nullptr;
0114 
0115   ActsGeometry* tgeometry = nullptr;
0116 
0117   //  bool _circle_fit_seed = false;
0118 
0119   //! rng de-allocator
0120   class Deleter
0121   {
0122    public:
0123     //! deletion operator
0124     void operator()(gsl_rng* rng) const { gsl_rng_free(rng); }
0125   };
0126 
0127   //! random generator that conform with sPHENIX standard
0128   /*! using a unique_ptr with custom Deleter ensures that the structure is properly freed when parent object is destroyed */
0129   std::unique_ptr<gsl_rng, Deleter> m_rng;
0130 };
0131 
0132 #endif