Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef TPC_TPCCLUSTERIZER_H
0002 #define TPC_TPCCLUSTERIZER_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <trackbase/ActsGeometry.h>
0006 #include <trackbase/TrkrCluster.h>
0007 
0008 #include <map>
0009 #include <string>
0010 #include <vector>
0011 
0012 class ClusHitsVerbosev1;
0013 class PHCompositeNode;
0014 class TrkrHitSet;
0015 class TrkrHitSetContainer;
0016 class TrkrClusterContainer;
0017 class TrkrClusterHitAssoc;
0018 class TrainingHitsContainer;
0019 class PHG4TpcCylinderGeom;
0020 class PHG4TpcCylinderGeomContainer;
0021 class RawHitSetContainer;
0022 class RawHitSet;
0023 class TpcClusterizer : public SubsysReco
0024 {
0025 public:
0026   typedef std::pair<unsigned short, unsigned short> iphiz;
0027   typedef std::pair<unsigned short, iphiz> ihit;
0028 
0029   TpcClusterizer(const std::string &name = "TpcClusterizer");
0030   ~TpcClusterizer() override = default;
0031 
0032   int InitRun(PHCompositeNode *topNode) override;
0033   int process_event(PHCompositeNode *topNode) override;
0034   int End(PHCompositeNode *topNode) override;
0035 
0036   void set_sector_fiducial_cut(const double cut) { SectorFiducialCut = cut; }
0037   void set_store_hits(bool store_hits) { _store_hits = store_hits; }
0038   void set_use_nn(bool use_nn) { _use_nn = use_nn; }
0039   void set_do_hit_association(bool do_assoc) { do_hit_assoc = do_assoc; }
0040   void set_do_wedge_emulation(bool do_wedge) { do_wedge_emulation = do_wedge; }
0041   void set_do_sequential(bool do_seq) { do_sequential = do_seq; }
0042   void set_do_split(bool split) { do_split = split; }
0043   void set_fixed_window(int fixed) { do_fixed_window = fixed; }
0044   void set_pedestal(float val) { pedestal = val; }
0045   void set_seed_threshold(float val) { seed_threshold = val; }
0046   void set_edge_threshold(float val) { edge_threshold = val; }
0047   void set_min_err_squared(float val) { min_err_squared = val; }
0048   void set_min_clus_size(float val) { min_clus_size = val; }
0049   void set_min_adc_sum(float val) { min_adc_sum = val; }
0050   void set_remove_singles(bool do_sing) { do_singles = do_sing; }
0051   void set_read_raw(bool read_raw) { do_read_raw = read_raw; }
0052   void set_max_cluster_half_size_phi(unsigned short size) { MaxClusterHalfSizePhi = size; }
0053   void set_max_cluster_half_size_z(unsigned short size) { MaxClusterHalfSizeT = size; }
0054   void set_reject_event(bool reject) { m_rejectEvent = reject; }
0055   void set_ClusHitsVerbose(bool set = true) { record_ClusHitsVerbose = set; }
0056   void set_nzbins(int val){NZBinsSide = val; is_reco = true;}
0057   void set_rawdata_reco()
0058   {
0059     set_do_hit_association(false);
0060     set_do_split(false);
0061     set_pedestal(0);
0062     set_seed_threshold(5);
0063     set_edge_threshold(3);
0064     set_min_err_squared(0);
0065     set_min_clus_size(0);
0066     set_min_adc_sum(5);
0067     set_remove_singles(true);
0068     set_max_cluster_half_size_phi(10);
0069     set_max_cluster_half_size_z(20);
0070     set_fixed_window(3);
0071   };
0072   void set_sampa_tbias(double value ) { m_sampa_tbias = value; }
0073   ClusHitsVerbosev1 *mClusHitsVerbose{nullptr};
0074 
0075  private:
0076   bool is_in_sector_boundary(int phibin, int sector, PHG4TpcCylinderGeom *layergeom) const;
0077   bool record_ClusHitsVerbose{false};
0078 
0079   TrkrHitSetContainer *m_hits = nullptr;
0080   RawHitSetContainer *m_rawhits = nullptr;
0081   TrkrClusterContainer *m_clusterlist = nullptr;
0082   TrkrClusterHitAssoc *m_clusterhitassoc = nullptr;
0083   ActsGeometry *m_tGeometry = nullptr;
0084   bool m_rejectEvent = true;
0085   bool _store_hits = false;
0086   bool _use_nn = false;
0087   bool do_hit_assoc = true;
0088   bool do_wedge_emulation = false;
0089   bool do_read_raw = false;
0090   bool do_sequential = false;
0091   bool do_singles = true;
0092   bool do_split = false;
0093   bool is_reco = false;
0094   int do_fixed_window = 0;
0095   double pedestal = 74.4;
0096   double seed_threshold = 11;
0097   double edge_threshold = 10;
0098   double min_err_squared = 0.01;
0099   double min_clus_size = 1;
0100   double min_adc_sum = 5;
0101   double SectorFiducialCut = 0.5;
0102   unsigned short MaxClusterHalfSizePhi = 3;
0103   unsigned short MaxClusterHalfSizeT = 5;
0104 
0105   double m_tdriftmax = 0;
0106   double AdcClockPeriod = 53.0;  // ns
0107   double NZBinsSide = 249;
0108 
0109   // TPC shaping offset correction parameter
0110   // From Tony Frawley July 5, 2022
0111   double m_sampa_tbias = 39.6;  // ns
0112 
0113   TrainingHitsContainer *m_training;
0114 };
0115 
0116 #endif