Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcClusterBuilder.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcClusterBuilder.h
1 #ifndef G4TPC_TPCCLUSTERBUILDER_H
2 #define G4TPC_TPCCLUSTERBUILDER_H
3 
4 // Revised 04-Dec-2022, David Stewart
5 // basic use:
6 // (a) optionally used set_current_track() (pointless to not set the track though,
7 // otherwise the new TrkrClsuters won't be assigned to the proper location)
8 // (b) fill with TrkrHits in addhitset() (in the MapToPadPlane module)
9 // (c) after all TrkrHit's have been added for a given truth track,
10 // call cluster_and_reset(false) to generate the TrkrClusters from the
11 // TrkrHit's, fill in the clusterkeys in the truth_track, and reset
12 // the TrkrHit container.
13 // (d) at the end of the event, run cluster_and_reset(true) which will check
14 // if there are clusters to make, and also clear out the counter for the
15 // hitsetkeys
16 //
17 // Note:
18 // - the algorithm to get the local surface will probably be updated in
19 // TpcClusterizer, when that happens update here as well
20 
21 #include <phool/PHObject.h>
22 #include <trackbase/TrkrDefs.h>
23 #include <trackbase/TpcDefs.h>
25 #include <trackbase/ActsGeometry.h>
26 #include <map>
27 #include <climits>
28 #include <iostream>
29 
30 using std::ostream;
31 
34 class TrkrCluster;
37 class TrkrTruthTrack;
39 class ClusHitsVerbosev1;
40 
41 // This is the basic data for each set of TrkrHits from each TrkrHitsSet
42 // to be used in tpc/TpcClusterizer.cc
44  double square(double);
45  double square(float);
46 
47  TrkrClusterContainer* m_clusterlist { nullptr }; // fill for output
48  ActsGeometry* m_tGeometry { nullptr }; // used to generate clusters
50 
51  // internal containers to fill and consume hits and fill with tracks
53  /* TrkrTruthTrack* current_track { nullptr }; */
54  std::map<TrkrDefs::hitsetkey,unsigned int> hitsetkey_cnt {};
55 
56  public:
57  private:
58 
59  int n_tracks {0};
60  int verbosity {0};
61 
62  public:
64  /* TrkrClusterContainer* _truth_cluster_container */
65  /* , ActsGeometry* _ActsGeometry */
66  /* , PHG4TpcCylinderGeomContainer* _geom_container */
67  /* ); */
68 
69  void fixme_check();
70  void fixme_short_check();
71 
72  bool b_collect_hits { false };
73  /* bool is_embedded_track {false}; */
74  void cluster_hits (TrkrTruthTrack* track);
75  void addhitset (TrkrDefs::hitsetkey, TrkrDefs::hitkey, float neffelectrons);
76  void set_current_track (TrkrTruthTrack* _trkrtruthtrack);
77  void print(TrkrTruthTrackContainer*, int nclusprint=-1);
79  void set_verbosity(int verbosity_level);
80 
82  delete m_hits;
83  };
84 
85  private: // from TpcClusterizer.h parameters; also used as general
86  /* bool do_wedge_emulation = false; */
87  /* double SectorFiducialCut = 0.5; */
88  /* unsigned short MaxClusterHalfSizePhi = 3; */
89  /* unsigned short MaxClusterHalfSizeT = 5; */
90  /* int cluster_version = 4; */
91  double AdcClockPeriod = 53.0; // ns
92 
93  // TPC shaping offset correction parameter
94  // From Tony Frawley July 5, 2022
95  double m_sampa_tbias = 39.6; // ns
96 
97 
98  // for pixel thresholds
99  private:
100  double m_pixel_thresholdrat { 0.01 };
102 
103  public:
104  void clear_hitsetkey_cnt();
105  void set_pixel_thresholdrat (double val) { m_pixel_thresholdrat = val; };
106  bool needs_input_nodes = true;
107  void set_input_nodes(
108  TrkrClusterContainer* _truth_cluster_container
109  , ActsGeometry* _ActsGeometry
110  , PHG4TpcCylinderGeomContainer* _geom_container
111  , ClusHitsVerbosev1* _clushitsverbose
112  );
113 };
114 
115 #endif //TRACKBASE_PADPLANEREADOUTSTRUCT_H