ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxVertexEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxVertexEval.h
1 #ifndef G4EVAL_SVTXVERTEXEVAL_H
2 #define G4EVAL_SVTXVERTEXEVAL_H
3 
4 #include "SvtxTrackEval.h"
5 
6 #include <map>
7 #include <set>
8 #include <string> // for string
9 #include <utility>
10 
11 class PHCompositeNode;
12 
13 class PHG4Particle;
15 class PHG4VtxPoint;
16 
17 class SvtxClusterEval;
18 class SvtxHitEval;
19 class SvtxTrackMap;
20 class SvtxTruthEval;
21 class SvtxVertex;
22 class SvtxVertexMap;
23 
25 {
26  public:
28  virtual ~SvtxVertexEval();
29 
30  void next_event(PHCompositeNode* topNode);
31  void do_caching(bool do_cache)
32  {
33  _do_cache = do_cache;
34  _trackeval.do_caching(do_cache);
35  }
36  void set_strict(bool strict)
37  {
38  _strict = strict;
39  _trackeval.set_strict(strict);
40  }
41  void set_verbosity(int verbosity)
42  {
43  _verbosity = verbosity;
44  _trackeval.set_verbosity(verbosity);
45  }
46 
47  // access the sub evals (and the cached values)
52 
53  // backtrace through to PHG4Hits
54  std::set<PHG4Particle*> all_truth_particles(SvtxVertex* vertex);
55 
56  // backtrace through to PHG4VtxPoints
57  std::set<PHG4VtxPoint*> all_truth_points(SvtxVertex* vertex);
59 
60  // forwardtrace through to SvtxVertexs
61  std::set<SvtxVertex*> all_vertexes_from(PHG4VtxPoint* truthpoint);
63 
64  // overlap calculations
65  unsigned int get_ntracks_contribution(SvtxVertex* svtxvertex, PHG4VtxPoint* truthpoint);
66 
67  unsigned int get_errors() { return _errors + _trackeval.get_errors(); }
68 
69  void set_use_initial_vertex(bool use_init_vertex) { _use_initial_vertex = use_init_vertex; }
70  void set_use_genfit_vertex(bool use_genfit_vertex) { _use_genfit_vertex = use_genfit_vertex; }
71 
72  void set_track_nodename(const std::string& name);
73 
74  private:
75  void get_node_pointers(PHCompositeNode* topNode);
76  bool has_node_pointers();
77 
82 
83  bool _strict;
84  bool _use_initial_vertex = true;
85  bool _use_genfit_vertex = false;
87  unsigned int _errors;
88 
89  bool _do_cache;
90  std::map<SvtxVertex*, std::set<PHG4Particle*> > _cache_all_truth_particles;
91  std::map<SvtxVertex*, std::set<PHG4VtxPoint*> > _cache_all_truth_points;
92  std::map<SvtxVertex*, PHG4VtxPoint*> _cache_max_truth_point_by_ntracks;
93  std::map<PHG4VtxPoint*, std::set<SvtxVertex*> > _cache_all_vertexes_from_point;
94  std::map<PHG4VtxPoint*, SvtxVertex*> _cache_best_vertex_from_point;
95  std::map<std::pair<SvtxVertex*, PHG4VtxPoint*>, unsigned int> _cache_get_ntracks_contribution;
96  std::string m_TrackNodeName;
97 };
98 
99 #endif // G4EVAL_SVTXVERTEXEVAL_H