Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 // This file is really -*- C++ -*-.
0003 #ifndef G4INTT_PHG4INTTHITRECO_H
0004 #define G4INTT_PHG4INTTHITRECO_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 #include <gsl/gsl_vector.h>  // for gsl_vector
0008 #include <phparameter/PHParameterInterface.h>
0009 #include <trackbase/TrkrDefs.h>
0010 
0011 #include <map>
0012 #include <set>
0013 #include <string>
0014 
0015 #include <intt/InttMapping.h>
0016 
0017 class PHCompositeNode;
0018 
0019 class ClusHitsVerbosev1;
0020 class PHG4Hit;
0021 class PHG4TruthInfoContainer;
0022 class TrkrClusterContainer;
0023 class TrkrHitSetContainer;
0024 class TrkrTruthTrack;
0025 class TrkrTruthTrackContainer;
0026 
0027 class PHG4InttHitReco : public SubsysReco, public PHParameterInterface
0028 {
0029  public:
0030   PHG4InttHitReco(const std::string& name = "PHG4InttHitReco");
0031 
0032   ~PHG4InttHitReco() override;
0033   //! module initialization
0034   int InitRun(PHCompositeNode* topNode) override;
0035 
0036   //! event processing
0037   int process_event(PHCompositeNode* topNode) override;
0038 
0039   //! set default parameter values
0040   void SetDefaultParameters() override;
0041 
0042   void Detector(const std::string& d) { m_Detector = d; }
0043 
0044   void setHotStripMaskFile(const std::string& name) { m_hotStripFileName = name; }
0045 
0046   void setLocalHotStripMaskFile(const std::string& name) { m_localHotStripFileName = name; }
0047 
0048  protected:
0049   std::string m_Detector = "INTT";
0050   std::string m_HitNodeName;
0051   std::string m_CellNodeName;
0052   std::string m_GeoNodeName;
0053 
0054   double m_Tmin;
0055   double m_Tmax;
0056   double m_crossingPeriod;
0057 
0058   gsl_vector* m_LocalOutVec = nullptr;
0059   gsl_vector* m_PathVec = nullptr;
0060   gsl_vector* m_SegmentVec = nullptr;
0061 
0062   // needed for clustering truth tracks
0063  private:
0064   TrkrTruthTrackContainer* m_truthtracks{nullptr};  // output truth tracks
0065   TrkrClusterContainer* m_truthclusters{nullptr};   // output clusters indexed to TrkrDefs::cluskeys in m_truthtracks
0066   PHG4TruthInfoContainer* m_truthinfo{nullptr};
0067   int m_trkid{-1};
0068   bool m_is_emb{false};
0069   TrkrTruthTrack* m_current_track{nullptr};
0070   const int m_cluster_version{4};
0071   TrkrHitSetContainer* m_truth_hits;                              // generate and delete a container for each truth track
0072   std::map<TrkrDefs::hitsetkey, unsigned int> m_hitsetkey_cnt{};  // counter for making ckeys form hitsetkeys
0073 
0074   std::string m_hotStripFileName = "INTT_HotMap";
0075   std::string m_localHotStripFileName = ""; // default to empty: only use local file for testing purpose; if empty, use CDB file
0076   typedef std::set<InttNameSpace::RawData_s> Set_t;
0077   Set_t m_HotChannelSet;
0078 
0079   PHG4Hit* prior_g4hit{nullptr};  // used to check for jumps in g4hits for loopers;
0080   void truthcheck_g4hit(PHG4Hit*, PHCompositeNode* topNode);
0081   void addtruthhitset(TrkrDefs::hitsetkey, TrkrDefs::hitkey, float neffelectrons);
0082   void cluster_truthhits(PHCompositeNode* topNode);
0083   void end_event_truthcluster(PHCompositeNode* topNode);
0084 
0085   double m_pixel_thresholdrat{0.01};
0086   float max_g4hitstep{2.0};
0087   bool record_ClusHitsVerbose{false};
0088 
0089  public:
0090   void set_pixel_thresholdrat(double val) { m_pixel_thresholdrat = val; };
0091   void set_max_g4hitstep(float _) { max_g4hitstep = _; };
0092 
0093   void set_ClusHitsVerbose(bool set = true) { record_ClusHitsVerbose = set; };
0094   ClusHitsVerbosev1* mClusHitsVerbose{nullptr};
0095 };
0096 
0097 #endif