EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CaloRawClusterEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CaloRawClusterEval.h
1 #ifndef G4EVAL_CALORAWCLUSTEREVAL_H
2 #define G4EVAL_CALORAWCLUSTEREVAL_H
3 
4 #include "CaloRawTowerEval.h"
5 #include "CaloTruthEval.h"
6 
7 #include <map>
8 #include <set>
9 #include <string>
10 #include <utility>
11 
12 class PHCompositeNode;
13 class PHG4Hit;
14 class PHG4Particle;
15 class PHG4Shower;
17 class RawCluster;
18 class RawTowerContainer;
19 
21 {
22  public:
24  CaloRawClusterEval(PHCompositeNode* topNode, const std::string& caloname);
25  virtual ~CaloRawClusterEval();
26 
28  int get_caloid() { return get_truth_eval()->get_caloid(); }
29 
31  void next_event(PHCompositeNode* topNode);
32 
34  void do_caching(bool do_cache)
35  {
36  _do_cache = do_cache;
37  _towereval.do_caching(do_cache);
38  }
39 
42  void set_strict(bool strict)
43  {
44  _strict = strict;
45  _towereval.set_strict(strict);
46  }
47 
49  unsigned int get_errors() { return _errors + _towereval.get_errors(); }
50 
52  void set_verbosity(int verbosity)
53  {
54  _verbosity = verbosity;
55  _towereval.set_verbosity(verbosity);
56  }
57 
60 
63 
64  // ---reduced sim node or better----------------------------------------------
65 
68 
69  // shower interface
70 
72  std::set<PHG4Shower*> all_truth_primary_showers(RawCluster* cluster);
73 
76 
78  std::set<RawCluster*> all_clusters_from(PHG4Shower* primary);
79 
82 
84  float get_energy_contribution(RawCluster* cluster, PHG4Shower* primary);
85 
86  // particle interface
87 
89  std::set<PHG4Particle*> all_truth_primary_particles(RawCluster* cluster);
90 
93 
95  std::set<RawCluster*> all_clusters_from(PHG4Particle* primary);
96 
99 
101  float get_energy_contribution(RawCluster* cluster, PHG4Particle* primary);
102 
103  // ---full sim node required--------------------------------------------------
104 
106  bool has_full_node_pointers();
107 
109  std::set<PHG4Hit*> all_truth_hits(RawCluster* cluster);
110 
111  private:
112  void get_node_pointers(PHCompositeNode* topNode);
113 
114  std::string _caloname;
118 
119  bool _strict;
121  unsigned int _errors;
122 
123  bool _do_cache;
124  std::map<RawCluster*, std::set<PHG4Shower*> > _cache_all_truth_primary_showers;
125  std::map<RawCluster*, PHG4Shower*> _cache_max_truth_primary_shower_by_energy;
126  std::map<PHG4Shower*, std::set<RawCluster*> > _cache_all_clusters_from_primary_shower;
127  std::map<PHG4Shower*, RawCluster*> _cache_best_cluster_from_primary_shower;
128  std::map<std::pair<RawCluster*, PHG4Shower*>, float> _cache_get_energy_contribution_primary_shower;
129 
130  std::map<RawCluster*, std::set<PHG4Particle*> > _cache_all_truth_primary_particles;
131  std::map<RawCluster*, PHG4Particle*> _cache_max_truth_primary_particle_by_energy;
132  std::map<PHG4Particle*, std::set<RawCluster*> > _cache_all_clusters_from_primary_particle;
133  std::map<PHG4Particle*, RawCluster*> _cache_best_cluster_from_primary_particle;
134  std::map<std::pair<RawCluster*, PHG4Particle*>, float> _cache_get_energy_contribution_primary_particle;
135 
136  std::map<RawCluster*, std::set<PHG4Hit*> > _cache_all_truth_hits;
137 };
138 
139 #endif // G4EVAL_CALORAWCLUSTEREVAL_H