Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef PHTRUTHSILICONASSOCIATION_H
0004 #define PHTRUTHSILICONASSOCIATION_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 #include <trackbase/TrkrDefs.h>
0008 
0009 #include <gsl/gsl_rng.h>
0010 #include <memory>
0011 #include <set>
0012 #include <string>
0013 #include <vector>
0014 
0015 class PHCompositeNode;
0016 class TrackSeedContainer;
0017 class TrackSeed;
0018 class SvtxVertexMap;
0019 class TrkrClusterContainer;
0020 class TrkrClusterHitAssoc;
0021 class TrkrHitTruthAssoc;
0022 class PHG4TruthInfoContainer;
0023 class PHG4HitContainer;
0024 class PHG4Particle;
0025 class TrkrClusterCrossingAssoc;
0026 class ActsGeometry;
0027 
0028 class PHTruthSiliconAssociation : public SubsysReco
0029 {
0030  public:
0031   PHTruthSiliconAssociation(const std::string &name = "PHTruthSiliconAssociation");
0032 
0033   int Init(PHCompositeNode *topNode) override;
0034 
0035   int InitRun(PHCompositeNode *topNode) override;
0036 
0037   int process_event(PHCompositeNode *topNode) override;
0038 
0039   /// Clean up internals after each event.
0040   int ResetEvent(PHCompositeNode *topNode) override;
0041 
0042   /// Called at the end of each run.
0043   int EndRun(const int runnumber) override;
0044 
0045   /// Called at the end of all processing.
0046   int End(PHCompositeNode *topNode) override;
0047 
0048   /// Reset
0049   int Reset(PHCompositeNode * /*topNode*/) override;
0050 
0051   void Print(const std::string &what = "ALL") const override;
0052 
0053  private:
0054   int GetNodes(PHCompositeNode *topNode);
0055   //  void copySiliconClustersToCorrectedMap( );
0056   // void makeSvtxSeedMap();
0057 
0058   unsigned int buildTrackSeed(const std::set<TrkrDefs::cluskey> &clusters, PHG4Particle *g4particle, TrackSeedContainer *container);
0059 
0060   std::vector<PHG4Particle *> getG4PrimaryParticle(TrackSeed *track);
0061   std::set<TrkrDefs::cluskey> getSiliconClustersFromParticle(PHG4Particle *g4particle);
0062   std::set<short int> getInttCrossings(TrackSeed *si_track) const;
0063 
0064   PHG4TruthInfoContainer *_g4truth_container{nullptr};
0065   PHG4HitContainer *_g4hits_tpc{nullptr};
0066   PHG4HitContainer *_g4hits_mvtx{nullptr};
0067   PHG4HitContainer *_g4hits_intt{nullptr};
0068 
0069   TrkrClusterContainer *_cluster_map{nullptr};
0070   //  TrkrClusterContainer *_corrected_cluster_map{nullptr};
0071   TrkrClusterHitAssoc *_cluster_hit_map{nullptr};
0072   TrkrHitTruthAssoc *_hit_truth_map{nullptr};
0073   TrackSeedContainer *_tpc_track_map{nullptr};
0074   TrackSeedContainer *_silicon_track_map{nullptr};
0075   TrackSeedContainer *_svtx_seed_map{nullptr};
0076   TrackSeed *_tracklet{nullptr};
0077   //  SvtxVertexMap * _vertex_map{nullptr};
0078   TrkrClusterCrossingAssoc *_cluster_crossing_map{nullptr};
0079   ActsGeometry *_tgeometry{nullptr};
0080 
0081   //! rng de-allocator
0082   class Deleter
0083   {
0084    public:
0085     //! deletion operator
0086     void operator()(gsl_rng *rng) const { gsl_rng_free(rng); }
0087   };
0088 
0089   //! random generator that conform with sPHENIX standard
0090   /*! using a unique_ptr with custom Deleter ensures that the structure is properly freed when parent object is destroyed */
0091   std::unique_ptr<gsl_rng, Deleter> m_rng;
0092 };
0093 
0094 #endif  // PHTRUTHSILICONASSOCIATION_H