Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4MvtxHitReco.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4MvtxHitReco.h
1 #ifndef G4MVTX_PHG4MVTXHITRECO_H
2 #define G4MVTX_PHG4MVTXHITRECO_H
3 
4 #include <phparameter/PHParameterInterface.h>
5 #include <trackbase/TrkrDefs.h>
6 
7 #include <fun4all/SubsysReco.h>
8 
9 #include <gsl/gsl_rng.h>
10 
11 #include <map>
12 #include <memory> // for unique_ptr
13 #include <string>
14 
15 class ClusHitsVerbosev1;
16 class PHCompositeNode;
17 class PHG4Hit;
21 class TrkrTruthTrack;
23 
25 {
26  public:
27  explicit PHG4MvtxHitReco(
28  const std::string &name = "PHG4MvtxHitReco",
29  const std::string &detector = "MVTX");
30 
31  ~PHG4MvtxHitReco() override;
32 
34  int InitRun(PHCompositeNode *topNode) override;
35 
37  int process_event(PHCompositeNode *topNode) override;
38 
39  void Detector(const std::string &d) { m_detector = d; }
40 
42  //In the future use the relevant set parameter function
43  void set_timing_window(const int detid, const double tmin, const double tmax);
44 
46  void SetDefaultParameters() override;
47 
48  private:
49  std::pair<double, double> generate_alpide_pulse(const double energy_deposited);
50 
52 
53  int get_strobe_frame(double alpide_time, double strobe_zero_tm_start);
54 
56 
58 
59  double m_tmin;
60  double m_tmax;
63  //double crossing_period = 106.0;
65 
66  bool m_in_sphenix_srdo = false;
67 
68  class Deleter
69  {
70  public:
72  void operator()(gsl_rng *rng) const { gsl_rng_free(rng); }
73  };
74 
75  std::unique_ptr<gsl_rng, Deleter> m_rng;
76 
77  // needed for clustering truth tracks
78  private:
79  TrkrTruthTrackContainer* m_truthtracks { nullptr }; // output truth tracks
80  TrkrClusterContainer* m_truthclusters { nullptr }; // output clusters indexed to TrkrDefs::cluskeys in m_truthtracks
82  int m_trkid { -1 };
83  bool m_is_emb { false };
85  const int m_cluster_version { 4 };
86  TrkrHitSetContainer* m_truth_hits; // generate and delete a container for each truth track
87  std::map<TrkrDefs::hitsetkey,unsigned int> m_hitsetkey_cnt {}; // counter for making ckeys form hitsetkeys
88 
89 
90  PHG4Hit* prior_g4hit { nullptr }; // used to check for jumps in g4hits for loopers;
91  void addtruthhitset ( TrkrDefs::hitsetkey, TrkrDefs::hitkey, float neffelectrons );
92  void truthcheck_g4hit ( PHG4Hit*, PHCompositeNode* topNode );
93  void cluster_truthhits ( PHCompositeNode* topNode );
94  void end_event_truthcluster ( PHCompositeNode* topNode );
95 
96  double m_pixel_thresholdrat { 0.01 };
97  float max_g4hitstep { 3.5 };
98  bool record_ClusHitsVerbose { false };
99 
100  public:
101  void set_pixel_thresholdrat (double val) { m_pixel_thresholdrat = val; };
102 
103  void set_ClusHitsVerbose(bool set=true) { record_ClusHitsVerbose = set; };
105 };
106 
107 #endif