File indexing completed on 2025-08-05 08:18:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef G4TPC_PHG4TPCDISTORTION_H
0012 #define G4TPC_PHG4TPCDISTORTION_H
0013
0014 #include <memory>
0015 #include <string>
0016
0017 class TFile;
0018 class TH3;
0019 class TTree;
0020
0021
0022 class PHG4TpcDistortion
0023 {
0024 public:
0025
0026 explicit PHG4TpcDistortion() = default;
0027
0028
0029
0030
0031
0032 double get_x_distortion_cartesian(double x, double y, double z) const;
0033
0034
0035 double get_y_distortion_cartesian(double x, double y, double z) const;
0036
0037
0038 double get_z_distortion_cartesian(double x, double y, double z) const;
0039
0040
0041 double get_r_distortion(double r, double phi, double z) const;
0042
0043
0044 double get_rphi_distortion(double r, double phi, double z) const;
0045
0046
0047 double get_z_distortion(double r, double phi, double z) const;
0048
0049
0050 double get_reaches_readout(double r, double phi, double z) const;
0051
0052
0053 int Verbosity() const
0054 {
0055 return verbosity;
0056 }
0057
0058
0059
0060
0061
0062
0063
0064 void set_do_static_distortions(bool value)
0065 {
0066 m_do_static_distortions = value;
0067 }
0068
0069
0070 void set_static_distortion_filename(const std::string &value)
0071 {
0072 m_static_distortion_filename = value;
0073 }
0074
0075
0076 void set_do_time_ordered_distortions(bool value)
0077 {
0078 m_do_time_ordered_distortions = value;
0079 }
0080
0081
0082 void set_time_ordered_distortion_filename(const std::string &value)
0083 {
0084 m_time_ordered_distortion_filename = value;
0085 }
0086
0087
0088 void set_do_ReachesReadout(bool value)
0089 {
0090 m_do_ReachesReadout = value;
0091 }
0092
0093 void set_read_phi_as_radians(bool flag)
0094 {
0095 m_phi_hist_in_radians = flag;
0096 }
0097
0098
0099 void Init();
0100
0101
0102 void load_event(int event_num);
0103
0104
0105 void Verbosity(const int ival)
0106 {
0107 verbosity = ival;
0108 }
0109
0110
0111
0112 private:
0113
0114 double get_distortion(char axis, double r, double phi, double z) const;
0115
0116
0117 int verbosity = 0;
0118
0119
0120 bool m_phi_hist_in_radians = true;
0121
0122 bool m_do_ReachesReadout = false;
0123
0124
0125
0126 bool m_do_static_distortions = false;
0127 std::string m_static_distortion_filename;
0128 std::unique_ptr<TFile> m_static_tfile;
0129 TH3 *hDRint[2] = {nullptr, nullptr};
0130 TH3 *hDPint[2] = {nullptr, nullptr};
0131 TH3 *hDZint[2] = {nullptr, nullptr};
0132 TH3 *hReach[2] = {nullptr, nullptr};
0133
0134
0135
0136
0137 bool m_do_time_ordered_distortions = false;
0138 std::string m_time_ordered_distortion_filename;
0139 std::unique_ptr<TFile> m_time_ordered_tfile;
0140 TTree *TimeTree = nullptr;
0141 TH3 *TimehDR[2] = {nullptr, nullptr};
0142 TH3 *TimehDP[2] = {nullptr, nullptr};
0143 TH3 *TimehDZ[2] = {nullptr, nullptr};
0144 TH3 *TimehRR[2] = {nullptr, nullptr};
0145
0146 };
0147
0148 #endif