ECCE @ EIC 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 
19 
20 #include <map>
21 #include <set>
22 #include <vector>
23 #include <memory>
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  }
38  void set_verbosity(int verbosity)
39  {
40  _verbosity = verbosity;
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<unsigned int, 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  private:
68  void get_node_pointers(PHCompositeNode* topNode);
69  bool has_node_pointers();
70 
71  void LayerClusterG4Hits(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);
72 
73  float line_circle_intersection(float x[], float y[], float z[], float radius);
74 
75  void G4ClusterSize(unsigned int layer, std::vector<std::vector<double>> contributing_hits_entry,std::vector<std::vector<double>> contributing_hits_exit, float &g4phisize, float &g4zsize);
76 
77  unsigned int getAdcValue(double gedep);
78 
80 
81  PHG4TruthInfoContainer* _truthinfo{nullptr};
86 
91 
92  bool _strict;
94  unsigned int _errors;
95  unsigned long iclus;
96 
97  const unsigned int _nlayers_maps = 3;
98  const unsigned int _nlayers_intt = 4;
99  const unsigned int _nlayers_tpc = 48;
100  const unsigned int _nlayers_mms = 2;
101 
102  std::multimap<TrkrDefs::cluskey, PHG4Hit*> _truth_cluster_truth_hit_map;
103 
104  bool _do_cache;
105  std::set<PHG4Hit*> _cache_all_truth_hits;
106  std::map<PHG4Particle*, std::set<PHG4Hit*> > _cache_all_truth_hits_g4particle;
107  std::map<PHG4Particle*, std::map<unsigned int, std::shared_ptr<TrkrCluster> > > _cache_all_truth_clusters_g4particle;
108  std::map<PHG4Particle*, PHG4Hit*> _cache_get_innermost_truth_hit;
109  std::map<PHG4Particle*, PHG4Hit*> _cache_get_outermost_truth_hit;
110  std::map<PHG4Hit*, PHG4Particle*> _cache_get_primary_particle_g4hit;
111 
112 };
113 
114 #endif // G4EVAL_SVTXTRUTHEVAL_H