File indexing completed on 2025-12-16 09:20:28
0001 #ifndef TPCCALIB_TPCSPACECHARGEMATRIXCONTAINERV1_H
0002 #define TPCCALIB_TPCSPACECHARGEMATRIXCONTAINERV1_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "TpcSpaceChargeMatrixContainer.h"
0012
0013 #include <array>
0014
0015
0016
0017
0018 class TpcSpaceChargeMatrixContainerv1 : public TpcSpaceChargeMatrixContainer
0019 {
0020 public:
0021
0022 TpcSpaceChargeMatrixContainerv1();
0023
0024
0025 ~TpcSpaceChargeMatrixContainerv1() override = default;
0026
0027
0028
0029
0030
0031 void identify(std::ostream& os = std::cout) const override;
0032
0033
0034 void get_grid_dimensions(int& phibins, int& rbins, int& zbins) const override;
0035
0036
0037 int get_grid_size() const override;
0038
0039
0040 int get_cell_index(int iphibin, int irbin, int izbin) const override;
0041
0042
0043 int get_entries(int cell_index) const override;
0044
0045
0046 float get_lhs(int cell_index, int i, int j) const override;
0047
0048
0049 float get_rhs(int cell_index, int i) const override;
0050
0051
0052
0053
0054
0055
0056
0057 void Reset() override;
0058
0059
0060
0061
0062
0063
0064 void set_grid_dimensions(int phibins, int rbins, int zbins) override;
0065
0066
0067 void add_to_entries(int cell_index) override
0068 {
0069 add_to_entries(cell_index, 1);
0070 }
0071
0072
0073 void add_to_entries(int cell_index, int value) override;
0074
0075
0076 void add_to_lhs(int cell_index, int i, int j, float value) override;
0077
0078
0079 void add_to_rhs(int cell_index, int i, float value) override;
0080
0081
0082 bool add(const TpcSpaceChargeMatrixContainer& other) override;
0083
0084
0085
0086 private:
0087
0088 bool bound_check(int cell_index) const;
0089
0090
0091 bool bound_check(int cell_index, int i) const;
0092
0093
0094 bool bound_check(int cell_index, int i, int j) const;
0095
0096
0097 int get_flat_index(int i, int j) const;
0098
0099
0100
0101 int m_phibins = 36;
0102 int m_rbins = 16;
0103 int m_zbins = 80;
0104
0105
0106
0107 static constexpr int m_ncoord = 3;
0108
0109
0110
0111
0112
0113 using matrix_t = std::array<float, m_ncoord * m_ncoord>;
0114 using column_t = std::array<float, m_ncoord>;
0115
0116
0117 std::vector<matrix_t> m_lhs;
0118
0119
0120 std::vector<column_t> m_rhs;
0121
0122
0123 std::vector<int> m_entries;
0124
0125 ClassDefOverride(TpcSpaceChargeMatrixContainerv1, 1)
0126 };
0127
0128 #endif