Analysis Software
Documentation for sPHENIX simulation 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  }
41  {
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 PHG4Hits for a specific tracker
56  std::set<PHG4Hit*> all_truth_hits(TrkrDefs::hitkey hit_key, const TrkrDefs::TrkrId trkrid);
58 
59  // backtrace through to PHG4Particles
60  std::set<PHG4Particle*> all_truth_particles(TrkrDefs::hitkey hit_key);
62 
63  // backtrace through to PHG4Particles for a specific tracker
64  std::set<PHG4Particle*> all_truth_particles(TrkrDefs::hitkey hit_key, const TrkrDefs::TrkrId trkrid);
66 
67  // forwardtrace through to SvtxHits
68  std::set<TrkrDefs::hitkey> all_hits_from(PHG4Particle* truthparticle);
69  std::set<TrkrDefs::hitkey> all_hits_from(PHG4Hit* truthhit);
71 
72  // overlap calculations
75 
76  unsigned int get_errors() { return _errors + _trutheval.get_errors(); }
77 
78  private:
79  void get_node_pointers(PHCompositeNode* topNode);
80  bool has_node_pointers();
81 
86 
91 
93 
94  bool _strict = false;
95  int _verbosity = 0;
96  unsigned int _errors = 0;
97 
98  bool _do_cache = true;
99  std::map<TrkrDefs::hitkey, std::set<PHG4Hit*> > _cache_all_truth_hits;
100  std::map<TrkrDefs::hitkey, PHG4Hit*> _cache_max_truth_hit_by_energy;
101  std::map<TrkrDefs::hitkey, std::set<PHG4Particle*> > _cache_all_truth_particles;
102  std::map<TrkrDefs::hitkey, PHG4Particle*> _cache_max_truth_particle_by_energy;
103  std::map<PHG4Particle*, std::set<TrkrDefs::hitkey> > _cache_all_hits_from_particle;
104  std::map<PHG4Hit*, std::set<TrkrDefs::hitkey> > _cache_all_hits_from_g4hit;
105  std::map<PHG4Hit*, TrkrDefs::hitkey> _cache_best_hit_from_g4hit;
106  std::map<std::pair<TrkrDefs::hitkey, PHG4Particle*>, float> _cache_get_energy_contribution_g4particle;
107  std::map<std::pair<TrkrDefs::hitkey, PHG4Hit*>, float> _cache_get_energy_contribution_g4hit;
108 };
109 
110 #endif // G4EVAL_SVTXHITEVAL_H