EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcSpaceChargeMatrixContainerv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcSpaceChargeMatrixContainerv1.h
1 #ifndef TPCCALIB_TPCSPACECHARGEMATRIXCONTAINERV1_H
2 #define TPCCALIB_TPCSPACECHARGEMATRIXCONTAINERV1_H
3 
12 
13 #include <array>
14 
19 {
20  public:
21 
24 
26  ~TpcSpaceChargeMatrixContainerv1() override = default;
27 
29 
30 
32  void identify(std::ostream &os = std::cout) const override;
33 
35  void get_grid_dimensions( int& phibins, int& rbins, int& zbins ) const override;
36 
38  int get_grid_size() const override;
39 
41  int get_cell_index( int iphibin, int irbin, int izbin ) const override;
42 
44  int get_entries( int cell_index ) const override;
45 
47  float get_lhs( int cell_index, int i, int j ) const override;
48 
50  float get_rhs( int cell_index, int i ) const override;
51 
53 
55 
56 
58  void Reset() override;
59 
61 
65  void set_grid_dimensions( int phibins, int rbins, int zbins ) override;
66 
68  void add_to_entries( int cell_index ) override
69  { add_to_entries( cell_index, 1 ); }
70 
72  void add_to_entries( int cell_index, int value ) override;
73 
75  void add_to_lhs( int cell_index, int i, int j, float value ) override;
76 
78  void add_to_rhs( int cell_index, int i, float value ) override;
79 
81  bool add( const TpcSpaceChargeMatrixContainer& other ) override;
82 
84 
85  private:
86 
88  bool bound_check( int cell_index ) const;
89 
91  bool bound_check( int cell_index, int i ) const;
92 
94  bool bound_check( int cell_index, int i, int j ) const;
95 
97  int get_flat_index( int i, int j ) const;
98 
100 
101  int m_phibins = 36;
102  int m_rbins = 16;
103  int m_zbins = 80;
105 
107  static constexpr int m_ncoord = 3;
108 
110 
113  using matrix_t = std::array<float, m_ncoord*m_ncoord>;
114  using column_t = std::array<float, m_ncoord>;
115 
117  std::vector<matrix_t> m_lhs;
118 
120  std::vector<column_t> m_rhs;
121 
123  std::vector<int> m_entries;
124 
125  ClassDefOverride(TpcSpaceChargeMatrixContainerv1, 1)
126 
127 };
128 
129 #endif