File indexing completed on 2025-08-05 08:18:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H
0011 #define G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H
0012
0013 #include <fun4all/SubsysReco.h>
0014
0015 #include <map>
0016 #include <string>
0017 #include <vector>
0018
0019
0020 class PHCompositeNode;
0021 class PHG4TruthInfoContainer;
0022 class SvtxTrackMap;
0023 class SvtxVertexMap;
0024 class TTree;
0025 class TH2D;
0026
0027
0028 class PHG4TrackFastSimEval : public SubsysReco
0029 {
0030 public:
0031
0032 PHG4TrackFastSimEval(const std::string& name = "PHG4TrackFastSimEval",
0033 const std::string& filename = "g4eval.root",
0034 const std::string& trackmapname = "SvtxTrackMap");
0035
0036
0037 int Init(PHCompositeNode*) override;
0038
0039
0040 int InitRun(PHCompositeNode*) override;
0041
0042
0043 int process_event(PHCompositeNode*) override;
0044
0045
0046 int End(PHCompositeNode*) override;
0047
0048
0049 void set_filename(const std::string& file)
0050 {
0051 m_OutFileName = file;
0052 }
0053
0054
0055 void set_trackmapname(const std::string& name)
0056 {
0057 m_TrackMapName = name;
0058 }
0059
0060
0061 void reset_variables();
0062
0063 void AddProjection(const std::string& name);
0064
0065 private:
0066 void fill_track_tree(PHCompositeNode*);
0067 void fill_vertex_tree(PHCompositeNode*);
0068
0069
0070 int GetNodes(PHCompositeNode*);
0071
0072
0073 PHG4TruthInfoContainer* m_TruthInfoContainer;
0074 SvtxTrackMap* m_TrackMap;
0075 SvtxVertexMap* m_VertexMap;
0076
0077
0078 TTree* m_TracksEvalTree;
0079 TTree* m_VertexEvalTree;
0080
0081
0082 TH2D* m_H2D_DeltaMomVsTruthMom;
0083 TH2D* m_H2D_DeltaMomVsTruthEta;
0084
0085
0086 int m_EventCounter;
0087
0088
0089 int m_TTree_Event{};
0090
0091 int m_TTree_gTrackID{};
0092 int m_TTree_gFlavor{};
0093 float m_TTree_gpx{};
0094 float m_TTree_gpy{};
0095 float m_TTree_gpz{};
0096 float m_TTree_gvx{};
0097 float m_TTree_gvy{};
0098 float m_TTree_gvz{};
0099 float m_TTree_gvt{};
0100
0101
0102 int m_TTree_TrackID{};
0103 int m_TTree_Charge{};
0104 int m_TTree_nHits{};
0105 float m_TTree_px{};
0106 float m_TTree_py{};
0107 float m_TTree_pz{};
0108 float m_TTree_pcax{};
0109 float m_TTree_pcay{};
0110 float m_TTree_pcaz{};
0111 float m_TTree_dca2d{};
0112
0113 std::map<int, int> m_TTree_HitContainerID_nHits_map;
0114
0115
0116 float m_TTree_vx{};
0117 float m_TTree_vy{};
0118 float m_TTree_vz{};
0119 float m_TTree_DeltaVx{};
0120 float m_TTree_DeltaVy{};
0121 float m_TTree_DeltaVz{};
0122 int m_TTree_nTracks{};
0123 int m_TTree_nFromTruth{};
0124
0125
0126 std::string m_OutFileName;
0127
0128
0129 std::string m_TrackMapName;
0130
0131
0132 std::map<std::string, unsigned int> m_ProjectionNameMap;
0133
0134 std::vector<std::vector<float>> m_TTree_proj_vec;
0135 std::vector<std::vector<float>> m_TTree_proj_p_vec;
0136
0137 std::vector<std::vector<float>> m_TTree_ref_vec;
0138 std::vector<std::vector<float>> m_TTree_ref_p_vec;
0139 };
0140
0141 #endif