File indexing completed on 2025-08-06 08:19:05
0001 #ifndef G4EVAL_BASETRUTHEVAL_H
0002 #define G4EVAL_BASETRUTHEVAL_H
0003
0004 #include <set>
0005
0006 class PHCompositeNode;
0007 class PHG4Hit;
0008 class PHG4Particle;
0009 class PHG4Shower;
0010 class PHG4TruthInfoContainer;
0011 class PHG4VtxPoint;
0012
0013 class BaseTruthEval
0014 {
0015 public:
0016 explicit BaseTruthEval(PHCompositeNode* topNode);
0017 virtual ~BaseTruthEval();
0018
0019
0020 void next_event(PHCompositeNode* topNode);
0021
0022
0023
0024 void set_strict(bool strict) { m_Strict = strict; }
0025
0026
0027 unsigned int get_errors() { return m_Errors; }
0028
0029
0030 void set_verbosity(int verbosity) { m_Verbosity = verbosity; }
0031
0032
0033
0034 bool has_reduced_node_pointers();
0035
0036
0037 int get_embed(PHG4Particle* particle);
0038
0039
0040 PHG4VtxPoint* get_vertex(PHG4Particle* particle);
0041
0042
0043 bool is_primary(PHG4Shower* shower);
0044
0045
0046 bool is_primary(PHG4Particle* particle);
0047
0048
0049 PHG4Shower* get_primary_shower(PHG4Shower* shower);
0050
0051
0052 PHG4Shower* get_primary_shower(PHG4Particle* particle);
0053
0054
0055 PHG4Particle* get_primary_particle(PHG4Particle* particle);
0056
0057
0058 PHG4Particle* get_primary_particle(PHG4Shower* shower);
0059
0060
0061 std::set<PHG4Shower*> all_secondary_showers(PHG4Shower* shower);
0062
0063
0064 bool are_same_shower(PHG4Shower* s1, PHG4Shower* s2);
0065
0066
0067 bool are_same_particle(PHG4Particle* p1, PHG4Particle* p2);
0068
0069
0070 bool are_same_vertex(PHG4VtxPoint* vtx1, PHG4VtxPoint* vtx2);
0071
0072
0073
0074 bool has_full_node_pointers() { return has_reduced_node_pointers(); }
0075
0076
0077 PHG4Particle* get_particle(PHG4Hit* g4hit);
0078
0079
0080 PHG4Shower* get_primary_shower(PHG4Hit* g4hit);
0081
0082
0083 PHG4Particle* get_primary_particle(PHG4Hit* g4hit);
0084
0085
0086 PHG4Particle* get_particle(const int trackid);
0087
0088
0089 bool is_g4hit_from_primary_shower(PHG4Hit* g4hit, PHG4Shower* shower);
0090
0091
0092 bool is_g4hit_from_particle(PHG4Hit* g4hit, PHG4Particle* particle);
0093
0094 private:
0095 void get_node_pointers(PHCompositeNode* topNode);
0096
0097 PHG4TruthInfoContainer* m_TruthInfo = nullptr;
0098
0099 bool m_Strict = false;
0100 int m_Verbosity = 0;
0101 unsigned int m_Errors = 0;
0102 };
0103
0104 #endif