File indexing completed on 2026-08-31 08:21:17
0001 #ifndef G4EVAL_SiliconDriftEvaluator_H
0002 #define G4EVAL_SiliconDriftEvaluator_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <fun4all/SubsysReco.h>
0012 #include <phool/PHObject.h>
0013
0014 #include <string>
0015 #include <vector>
0016
0017 class SvtxTrackMap;
0018 class TH2F;
0019 class TH3F;
0020
0021 class SiliconDriftEvaluator : public SubsysReco
0022 {
0023 public:
0024
0025 SiliconDriftEvaluator(const std::string& = "SiliconDriftEvaluator");
0026
0027
0028 virtual int Init(PHCompositeNode*);
0029
0030
0031 virtual int InitRun(PHCompositeNode*);
0032
0033
0034 virtual int process_event(PHCompositeNode*);
0035
0036
0037 virtual int End(PHCompositeNode*);
0038
0039
0040 class TrackStruct
0041 {
0042 public:
0043 using List = std::vector<TrackStruct>;
0044
0045
0046 unsigned int _nclusters_mvtx = 0;
0047 unsigned int _nclusters_intt = 0;
0048 unsigned int _nclusters_tpc = 0;
0049
0050
0051 float _pt = 0;
0052 float _eta = 0;
0053 float _phi = 0;
0054
0055
0056
0057
0058 float _z_tpc = 0;
0059
0060
0061 float _z_si = 0;
0062
0063
0064 short int _crossing = 0;
0065
0066
0067 float _dz = 0;
0068 };
0069
0070
0071 class Container : public PHObject
0072 {
0073 public:
0074
0075 explicit Container() = default;
0076
0077
0078 explicit Container(const Container&) = delete;
0079
0080
0081 Container& operator=(const Container&) = delete;
0082
0083
0084 void Reset() override
0085 {
0086 _tracks.clear();
0087 }
0088
0089
0090
0091
0092 const TrackStruct::List& tracks() const
0093 {
0094 return _tracks;
0095 }
0096
0097
0098
0099 void addTrack(const TrackStruct& track)
0100 {
0101 _tracks.push_back(track);
0102 }
0103
0104 void clearTracks()
0105 {
0106 _tracks.clear();
0107 }
0108
0109 private:
0110
0111 TrackStruct::List _tracks;
0112
0113 ClassDefOverride(Container, 1)
0114 };
0115
0116
0117 void set_trackmapname(const std::string& value) { m_trackmapname = value; }
0118
0119
0120 void set_drift_velocity(double value) { m_drift_velocity = value; }
0121
0122
0123 void set_crossing_interval(double value) { m_crossing_interval = value; }
0124
0125
0126 void set_min_pt(double value) { m_min_pt = value; }
0127
0128
0129 void set_min_nclusters_tpc(unsigned int value) { m_min_nclusters_tpc = value; }
0130
0131
0132 void set_min_nclusters_mvtx(unsigned int value) { m_min_nclusters_mvtx = value; }
0133
0134
0135 void set_min_nclusters_intt(unsigned int value) { m_min_nclusters_intt = value; }
0136
0137
0138 void set_max_eta(double value) { m_max_eta = value; }
0139
0140
0141 void set_max_z(double value) { m_max_z = value; }
0142
0143
0144 void set_max_dz(double value) { m_max_dz = value; }
0145
0146
0147 void set_min_slice_entries(int value) { m_min_slice_entries = value; }
0148
0149
0150 void set_plot_filename(const std::string& value) { m_plot_filename = value; }
0151
0152
0153 void set_root_filename(const std::string& value) { m_root_filename = value; }
0154
0155 private:
0156
0157 int load_nodes(PHCompositeNode*);
0158
0159
0160 void evaluate_tracks();
0161
0162
0163 Container* m_container = nullptr;
0164
0165
0166 SvtxTrackMap* m_track_map = nullptr;
0167
0168
0169 TH3F* m_hist3D = nullptr;
0170
0171
0172 std::string m_trackmapname = "SvtxTrackMap";
0173
0174
0175 double m_drift_velocity = 0.00747;
0176
0177
0178 double m_crossing_interval = 106.65237;
0179
0180
0181
0182 double m_min_pt = 0.5;
0183 unsigned int m_min_nclusters_tpc = 20;
0184 unsigned int m_min_nclusters_mvtx = 3;
0185 unsigned int m_min_nclusters_intt = 2;
0186 double m_max_eta = 0.9;
0187
0188
0189 double m_max_z = 20.0;
0190 double m_max_dz = 10.0;
0191
0192
0193 int m_min_slice_entries = 10;
0194
0195
0196 std::string m_plot_filename = "silicon_drift_calib.png";
0197
0198
0199 std::string m_root_filename = "silicon_drift_calib.root";
0200 };
0201
0202 #endif