Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TruthClusterizerBase.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TruthClusterizerBase.h
1 #ifndef G4TRACKING_TRUTHCLUSTERIZERBASE
2 #define G4TRACKING_TRUTHCLUSTERIZERBASE
3 
4 // Generated March 2023, David Stewart
5 //
6 // Virtual base class used to cluster TrkrHits into TrkrClusters, but using only the reconstructed hits
7 // from phg4 embedded (``truth'') tracks. In each of the following modules, a child-class will be derived
8 // with the "cluster_hits()" virtual function implemented
9 // - PHG4MvtxHitReco
10 // - PHG4InttHitReco
11 // - PHG4TpcElectronDrift
12 // - (maybe?) tpot?
13 //
14 // It's job is to:
15 // (1) build TrkrTruthTracks in the TrkrTruthTrackContainer
16 // (2) build TrkrClusters in the truth clusters TrkrClusterContainer
17 // It does this by collecting the TrkrHit's associated with each PHG4 truth track, and when they
18 // are all collected, it calls the down-stream macros (the same ones which do the Svtx clustering)
19 // on this subset of the TrkrHits, and assigning these clusters to the TrkrClusterContainer and
20 // the associated TrkrTruthTrackContainer.
21 
22 #include <trackbase/TrkrDefs.h>
24 #include <map>
25 #include <iostream>
26 
27 class PHCompositeNode;
31 class TrkrTruthTrack;
33 class PHG4Hit;
34 
36  protected:
38  int m_verbosity { 0 };
39  PHCompositeNode* m_topNode { nullptr };
41  TrkrClusterContainer* m_clusters { nullptr }; // cluster container passed to individual clusterers
43  int m_trkid { -1 };
44  bool m_is_emb { false };
45  bool m_was_emb { false };
46  bool m_is_new_track { false };
48 
49 
50  std::map<TrkrDefs::hitsetkey,unsigned int> m_hitsetkey_cnt {}; // counter for making ckeys form hitsetkeys
51 
52  // implemented individually for mvtx, intt and tpc cluster hits
53  /* static int dummy_cluster_hits() { */
54  /* return Fun4AllReturnCodes::EVENT_OK; */
55  /* }; */
56 
57  public:
59  void init_clusterizer_base ( PHCompositeNode*& _topNode, int verbosity );
60  virtual ~TruthClusterizerBase();
61 
62  // main use functions
65  void update_track();
66  void transfer_clusters();
67 
68  void addhitset (TrkrDefs::hitsetkey, TrkrDefs::hitkey, float neffelectrons);
69 
70  // convenience
71  int Verbosity() { return m_verbosity; };
72  void set_verbosity(int _) { m_verbosity = _; };
73  void print_clusters(int nclusprint=20);
74 
75 };
76 
77 #endif