File indexing completed on 2025-12-17 09:21:53
0001 #ifndef G4EVAL_TRACKEVALUATION_H
0002 #define G4EVAL_TRACKEVALUATION_H
0003
0004
0005
0006
0007
0008
0009 #include "TrackEvaluationContainerv1.h"
0010
0011 #include <fun4all/SubsysReco.h>
0012
0013 #include <trackbase/ClusterErrorPara.h>
0014 #include <trackbase/TrkrDefs.h>
0015
0016 #include <map>
0017 #include <set>
0018 #include <string>
0019
0020 class ActsGeometry;
0021 class PHCompositeNode;
0022 class PHG4TpcGeomContainer;
0023 class PHG4CylinderGeomContainer;
0024 class PHG4Hit;
0025 class PHG4HitContainer;
0026 class PHG4Particle;
0027 class PHG4TruthInfoContainer;
0028 class SvtxTrack;
0029 class SvtxTrackMap;
0030 class SvtxTrackState;
0031 class TrkrCluster;
0032 class TrkrClusterContainer;
0033 class TrkrClusterHitAssoc;
0034 class TrkrHitSetContainer;
0035 class TrkrHitTruthAssoc;
0036
0037 class TrackEvaluation : public SubsysReco
0038 {
0039 public:
0040
0041 TrackEvaluation(const std::string& = "TrackEvaluation");
0042
0043
0044 int Init(PHCompositeNode*) override;
0045
0046
0047 int InitRun(PHCompositeNode*) override;
0048
0049
0050 int process_event(PHCompositeNode*) override;
0051
0052
0053 int End(PHCompositeNode*) override;
0054
0055 enum Flags
0056 {
0057 EvalEvent = 1 << 0,
0058 EvalClusters = 1 << 1,
0059 EvalTracks = 1 << 2
0060 };
0061
0062
0063 void set_flags(unsigned int flags)
0064 {
0065 m_flags = flags;
0066 }
0067
0068 private:
0069
0070 int load_nodes(PHCompositeNode*);
0071
0072
0073 void evaluate_event();
0074
0075
0076 void evaluate_clusters();
0077
0078
0079 void evaluate_tracks();
0080
0081
0082 using G4HitSet = std::set<PHG4Hit*>;
0083 G4HitSet find_g4hits(TrkrDefs::cluskey) const;
0084 G4HitSet find_g4hits(TrkrDefs::cluskey, int id) const;
0085
0086
0087 std::pair<int, int> get_max_contributor(SvtxTrack*) const;
0088
0089
0090 int get_embed(PHG4Particle*) const;
0091
0092
0093 TrackEvaluationContainerv1::ClusterStruct create_cluster(TrkrDefs::cluskey, TrkrCluster*, SvtxTrack*) const;
0094
0095
0096 void add_trk_information(TrackEvaluationContainerv1::ClusterStruct&, SvtxTrackState*) const;
0097
0098
0099
0100
0101
0102
0103 void add_trk_information_micromegas(TrackEvaluationContainerv1::ClusterStruct&, int , SvtxTrackState*) const;
0104
0105
0106 void add_truth_information(TrackEvaluationContainerv1::ClusterStruct&, const std::set<PHG4Hit*>&) const;
0107
0108
0109
0110
0111
0112
0113 void add_truth_information_micromegas(TrackEvaluationContainerv1::ClusterStruct&, int , const std::set<PHG4Hit*>&) const;
0114
0115
0116 TrackEvaluationContainerv1* m_container = nullptr;
0117
0118
0119 unsigned int m_flags = EvalEvent | EvalClusters | EvalTracks;
0120
0121
0122 ActsGeometry* m_tGeometry = nullptr;
0123
0124
0125 TrkrHitSetContainer* m_hitsetcontainer = nullptr;
0126
0127
0128 TrkrClusterContainer* m_cluster_map = nullptr;
0129
0130
0131 TrkrClusterHitAssoc* m_cluster_hit_map = nullptr;
0132
0133
0134 TrkrHitTruthAssoc* m_hit_truth_map = nullptr;
0135
0136
0137 SvtxTrackMap* m_track_map = nullptr;
0138
0139
0140
0141 PHG4HitContainer* m_g4hits_tpc = nullptr;
0142 PHG4HitContainer* m_g4hits_intt = nullptr;
0143 PHG4HitContainer* m_g4hits_mvtx = nullptr;
0144 PHG4HitContainer* m_g4hits_micromegas = nullptr;
0145
0146
0147
0148 PHG4TruthInfoContainer* m_g4truthinfo = nullptr;
0149
0150
0151 PHG4TpcGeomContainer* m_tpc_geom_container = nullptr;
0152
0153
0154 PHG4CylinderGeomContainer* m_micromegas_geom_container = nullptr;
0155
0156
0157 using G4HitMap = std::map<TrkrDefs::cluskey, G4HitSet>;
0158 mutable G4HitMap m_g4hit_map;
0159 ClusterErrorPara _ClusErrPara;
0160 };
0161
0162 #endif