ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetRecoEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetRecoEval.h
1 #ifndef G4EVAL_JETRECOEVAL_H
2 #define G4EVAL_JETRECOEVAL_H
3 
4 #include "JetTruthEval.h"
5 
6 #include <g4jets/Jet.h>
7 
8 #include <map>
9 #include <set>
10 #include <string>
11 #include <utility>
12 
13 class CaloEvalStack;
14 
15 class JetMap;
16 
17 class PHCompositeNode;
18 
19 class PHG4Hit;
20 class PHG4Particle;
21 class PHG4Shower;
22 
24 class RawTowerContainer;
25 
26 class SvtxEvalStack;
27 class SvtxTrackMap;
28 
30 {
31  public:
35  const std::string& recojetname,
36  const std::string& truthjetname);
37  virtual ~JetRecoEval();
38 
40  void next_event(PHCompositeNode* topNode);
41 
43  void do_caching(bool do_cache)
44  {
45  _do_cache = do_cache;
46  _jettrutheval.do_caching(do_cache);
47  }
48 
51  void set_strict(bool strict)
52  {
53  _strict = strict;
54  _jettrutheval.set_strict(strict);
55  }
56 
58  unsigned int get_errors() { return _errors + _jettrutheval.get_errors(); }
59 
61  void set_verbosity(int verbosity)
62  {
63  _verbosity = verbosity;
64  _jettrutheval.set_verbosity(verbosity);
65  }
66 
69 
72 
75 
78 
81 
84 
87 
90  // ---reduced sim node or better----------------------------------------------
91 
93  std::set<PHG4Shower*> all_truth_showers(Jet* recojet);
94 
96  std::set<PHG4Particle*> all_truth_particles(Jet* recojet);
97 
99  std::set<Jet*> all_truth_jets(Jet* recojet);
100 
102  Jet* max_truth_jet_by_energy(Jet* recojet);
103 
105  std::set<Jet*> all_jets_from(Jet* truthjet);
106 
108  Jet* best_jet_from(Jet* truthjet);
109 
112  Jet* unique_reco_jet_from_truth(Jet* truthjet);
113 
117 
119  float get_energy_contribution(Jet* recojet, Jet* truthjet);
120 
122  float get_energy_contribution(Jet* recojet, Jet::SRC src);
123 
124  void set_track_nodename(const std::string& name);
125 
126  // ---full sim node required--------------------------------------------------
127 
129  std::set<PHG4Hit*> all_truth_hits(Jet* recojet);
130 
131  private:
132  void get_node_pointers(PHCompositeNode* topNode);
133 
135  std::string _recojetname;
136  std::string _truthjetname;
137 
140 
154 
155  bool _strict;
157  unsigned int _errors;
158 
159  bool _do_cache;
160  std::map<Jet*, std::set<PHG4Shower*> > _cache_all_truth_showers;
161  std::map<Jet*, std::set<PHG4Particle*> > _cache_all_truth_particles;
162  std::map<Jet*, std::set<Jet*> > _cache_all_truth_jets;
163  std::map<Jet*, Jet*> _cache_max_truth_jet_by_energy;
164  std::map<Jet*, std::set<Jet*> > _cache_all_jets_from;
165  std::map<Jet*, Jet*> _cache_best_jet_from;
166  std::map<std::pair<Jet*, Jet*>, float> _cache_get_energy_contribution;
167  std::map<std::pair<Jet*, Jet::SRC>, float> _cache_get_energy_contribution_src;
168  std::map<Jet*, std::set<PHG4Hit*> > _cache_all_truth_hits;
169  std::string m_TrackNodeName = "SvtxTrackMap";
170 };
171 
172 #endif // G4EVAL_JETRECOEVAL_H