Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef TRACKRECO_PHMICROMEGASTPCTRACKMATCHING_H
0004 #define TRACKRECO_PHMICROMEGASTPCTRACKMATCHING_H
0005 
0006 #include <tpc/TpcGlobalPositionWrapper.h>
0007 
0008 #include <trackbase/TrkrDefs.h>
0009 
0010 #include <fun4all/SubsysReco.h>
0011 
0012 #include <array>
0013 #include <string>
0014 #include <vector>
0015 
0016 class ActsGeometry;
0017 class TrkrClusterContainer;
0018 class TrkrClusterIterationMapv1;
0019 class TrackSeedContainer;
0020 class PHCompositeNode;
0021 class PHG4CylinderGeomContainer;
0022 class TrackSeed;
0023 class TrkrCluster;
0024 class TF1;
0025 class TH1;
0026 
0027 class PHMicromegasTpcTrackMatching : public SubsysReco
0028 {
0029  public:
0030   PHMicromegasTpcTrackMatching(const std::string& name = "PHMicromegasTpcTrackMatching");
0031   ~PHMicromegasTpcTrackMatching() override = default;
0032 
0033   void set_rphi_search_window_lyr1(const double win) { _rphi_search_win[0] = win; }
0034   void set_z_search_window_lyr1(const double win) { _z_search_win[0] = win; }
0035   void set_rphi_search_window_lyr2(const double win) { _rphi_search_win[1] = win; }
0036   void set_z_search_window_lyr2(const double win) { _z_search_win[1] = win; }
0037   void set_min_tpc_layer(const unsigned int layer) { _min_tpc_layer = layer; }
0038   void set_max_tpc_layer(const unsigned int layer) { _max_tpc_layer = layer; }
0039   void set_test_windows_printout(const bool test) { _test_windows = test; }
0040   void set_pp_mode(const bool mode) { _pp_mode = mode; }
0041   void set_use_silicon( const bool value ) { _use_silicon = value; }
0042   void SetIteration(int iter) { _n_iteration = iter; }
0043 
0044   void zeroField(const bool flag) { _zero_field = flag; }
0045   int Init(PHCompositeNode* topNode) override;
0046   int InitRun(PHCompositeNode* topNode) override;
0047   int process_event(PHCompositeNode*) override;
0048   int End(PHCompositeNode*) override;
0049 
0050   // deprecated calls
0051   inline void set_sc_calib_mode(const bool) {}
0052   inline void set_collision_rate(const double) {}
0053 
0054  private:
0055   //! load nodes relevant for the analysis
0056   int GetNodes(PHCompositeNode* topNode);
0057 
0058   void copyMicromegasClustersToCorrectedMap();
0059 
0060   //! number of layers in the micromegas
0061   static constexpr unsigned int _n_mm_layers{2};
0062 
0063   bool _use_truth_clusters = false;
0064 
0065   //! if true, use straight fit instead of helical to extrapolate to TPOT
0066   bool _zero_field = false;
0067 
0068   //! if true, use silicon clusters instead of TPC to extrapolate to TPOT
0069   bool _use_silicon = false;
0070 
0071   // range of TPC layers to use in projection to micromegas
0072   unsigned int _min_tpc_layer = 39;
0073 
0074   // range of TPC layers to use in projection to micromegas
0075   unsigned int _max_tpc_layer = 55;
0076 
0077   TrkrClusterContainer* _cluster_map{nullptr};
0078   TrkrClusterContainer* _corrected_cluster_map{nullptr};
0079 
0080   TrackSeedContainer* _svtx_seed_map{nullptr};
0081   TrackSeedContainer* _tpc_track_map{nullptr};
0082   TrackSeedContainer* _si_track_map{nullptr};
0083 
0084   //! default rphi search window for each layer
0085   std::array<double, _n_mm_layers> _rphi_search_win{0.25, 13.0};
0086 
0087   //! default z search window for each layer
0088   std::array<double, _n_mm_layers> _z_search_win{26.0, 0.25};
0089 
0090   // get the cluster list for zeroField
0091   std::vector<TrkrDefs::cluskey> getTrackletClusterList(TrackSeed* tracklet);
0092 
0093   /// first micromegas layer
0094   /** it is reset in ::Setup using actual micromegas geometry */
0095   unsigned int _min_mm_layer{55};
0096 
0097   //! internal event number
0098   int _event{-1};
0099 
0100   //! micomegas geometry
0101   PHG4CylinderGeomContainer* _geomContainerMicromegas{nullptr};
0102   TrkrClusterIterationMapv1* _iteration_map{nullptr};
0103   int _n_iteration{0};
0104 
0105   //! acts geometry
0106   ActsGeometry* _tGeometry{nullptr};
0107 
0108   //! tpc global position wrapper
0109   TpcGlobalPositionWrapper m_globalPositionWrapper;
0110 
0111   //! true to printout actual residuals for testing
0112   bool _test_windows{false};
0113 
0114   bool _pp_mode{false};
0115 };
0116 
0117 #endif  // TRACKRECO_PHMICROMEGASTPCTRACKMATCHING_H