EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxHitEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxHitEval.h
1 #ifndef G4EVAL_SVTXHITEVAL_H
2 #define G4EVAL_SVTXHITEVAL_H
3 
4 #include "SvtxTruthEval.h"
5 
6 #include <trackbase/TrkrDefs.h>
7 
8 #include <map>
9 #include <set>
10 #include <utility>
11 
12 class PHCompositeNode;
13 
14 class PHG4Hit;
15 class PHG4HitContainer;
16 class PHG4Particle;
18 
21 class TrkrHitTruthAssoc;
22 
24 {
25  public:
26  SvtxHitEval(PHCompositeNode* topNode);
27  virtual ~SvtxHitEval();
28 
29  void next_event(PHCompositeNode* topNode);
30  void do_caching(bool do_cache)
31  {
32  _do_cache = do_cache;
33  _trutheval.do_caching(do_cache);
34  }
35  void set_strict(bool strict)
36  {
37  _strict = strict;
38  _trutheval.set_strict(strict);
39  }
40  void set_verbosity(int verbosity)
41  {
42  _verbosity = verbosity;
43  _trutheval.set_verbosity(verbosity);
44  }
45 
46  // access the clustereval (and its cached values)
48 
49  //PHG4Cell* get_cell(SvtxHit* hit);
50 
51  // backtrace through to PHG4Hits
52  std::set<PHG4Hit*> all_truth_hits(TrkrDefs::hitkey hit_key);
54 
55  // backtrace through to PHG4Particles
56  std::set<PHG4Particle*> all_truth_particles(TrkrDefs::hitkey hit_key);
58 
59  // forwardtrace through to SvtxHits
60  std::set<TrkrDefs::hitkey> all_hits_from(PHG4Particle* truthparticle);
61  std::set<TrkrDefs::hitkey> all_hits_from(PHG4Hit* truthhit);
63 
64  // overlap calculations
67 
68  unsigned int get_errors() { return _errors + _trutheval.get_errors(); }
69 
70  private:
71  void get_node_pointers(PHCompositeNode* topNode);
72  bool has_node_pointers();
73 
78 
83 
85 
86  bool _strict;
88  unsigned int _errors;
89 
90  bool _do_cache;
91  std::map<TrkrDefs::hitkey, std::set<PHG4Hit*> > _cache_all_truth_hits;
92  std::map<TrkrDefs::hitkey, PHG4Hit*> _cache_max_truth_hit_by_energy;
93  std::map<TrkrDefs::hitkey, std::set<PHG4Particle*> > _cache_all_truth_particles;
94  std::map<TrkrDefs::hitkey, PHG4Particle*> _cache_max_truth_particle_by_energy;
95  std::map<PHG4Particle*, std::set<TrkrDefs::hitkey> > _cache_all_hits_from_particle;
96  std::map<PHG4Hit*, std::set<TrkrDefs::hitkey> > _cache_all_hits_from_g4hit;
97  std::map<PHG4Hit*, TrkrDefs::hitkey> _cache_best_hit_from_g4hit;
98  std::map<std::pair<TrkrDefs::hitkey, PHG4Particle*>, float> _cache_get_energy_contribution_g4particle;
99  std::map<std::pair<TrkrDefs::hitkey, PHG4Hit*>, float> _cache_get_energy_contribution_g4hit;
100 };
101 
102 #endif // G4EVAL_SVTXHITEVAL_H