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