Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxTruthEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxTruthEval.h
1 #ifndef G4EVAL_SVTXTRUTHEVAL_H
2 #define G4EVAL_SVTXTRUTHEVAL_H
3 
4 #include "BaseTruthEval.h"
5 
6 #include <trackbase/TrkrDefs.h>
7 
8 class PHCompositeNode;
9 
10 class PHG4Hit;
11 class PHG4HitContainer;
12 class PHG4Particle;
16 class PHG4VtxPoint;
17 class TrkrCluster;
18 class ActsGeometry;
19 
20 #include <map>
21 #include <memory>
22 #include <set>
23 #include <vector>
24 
26 {
27  public:
29  virtual ~SvtxTruthEval();
30 
31  void next_event(PHCompositeNode* topNode);
32  void do_caching(bool do_cache) { _do_cache = do_cache; }
33  void set_strict(bool strict)
34  {
35  _strict = strict;
36  _basetrutheval.set_strict(strict);
37  }
39  {
41  _basetrutheval.set_verbosity(verbosity);
42  }
43 
44  std::set<PHG4Hit*> all_truth_hits();
45  std::set<PHG4Hit*> all_truth_hits(PHG4Particle* particle);
52  PHG4Particle* get_particle(const int trackid);
53 
54  std::map<TrkrDefs::cluskey, std::shared_ptr<TrkrCluster>> all_truth_clusters(PHG4Particle* particle);
55 
58  bool are_same_vertex(PHG4VtxPoint* vtx1, PHG4VtxPoint* vtx2);
59 
62 
63  unsigned int get_errors() { return _errors + _basetrutheval.get_errors(); }
64 
67 
68  private:
69  void get_node_pointers(PHCompositeNode* topNode);
70  bool has_node_pointers();
71 
72  void LayerClusterG4Hits(const std::set<PHG4Hit*>& truth_hits, std::vector<PHG4Hit*>& contributing_hits, std::vector<double>& contributing_hits_energy, std::vector<std::vector<double>>& contributing_hits_entry, std::vector<std::vector<double>>& contributing_hits_exit, float layer, float& x, float& y, float& z, float& t, float& e);
73 
74  float line_circle_intersection(float x[], float y[], float z[], float radius);
75 
76  void G4ClusterSize(TrkrDefs::cluskey ckey, unsigned int layer, std::vector<std::vector<double>> contributing_hits_entry, std::vector<std::vector<double>> contributing_hits_exit, float& g4phisize, float& g4zsize);
77 
78  unsigned int getAdcValue(double gedep);
79 
81 
87 
93 
94  bool _strict = false;
95  int _verbosity = 0;
96  unsigned int _errors = 0;
97  unsigned long iclus = 0;
98 
99  const unsigned int _nlayers_maps = 3;
100  const unsigned int _nlayers_intt = 4;
101  const unsigned int _nlayers_tpc = 48;
102  const unsigned int _nlayers_mms = 2;
103 
104  std::multimap<TrkrDefs::cluskey, PHG4Hit*> _truth_cluster_truth_hit_map;
105 
106  bool _do_cache = true;
107  std::set<PHG4Hit*> _cache_all_truth_hits;
108  std::map<PHG4Particle*, std::set<PHG4Hit*>> _cache_all_truth_hits_g4particle;
109  std::map<PHG4Particle*, std::map<TrkrDefs::cluskey, std::shared_ptr<TrkrCluster>>> _cache_all_truth_clusters_g4particle;
110  std::map<PHG4Particle*, PHG4Hit*> _cache_get_innermost_truth_hit;
111  std::map<PHG4Particle*, PHG4Hit*> _cache_get_outermost_truth_hit;
112  std::map<PHG4Hit*, PHG4Particle*> _cache_get_primary_particle_g4hit;
113 };
114 
115 #endif // G4EVAL_SVTXTRUTHEVAL_H