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