File indexing completed on 2026-08-31 08:21:20
0001
0002
0003 #ifndef TPCTRACKRECO_IDEALPADMAP_H
0004 #define TPCTRACKRECO_IDEALPADMAP_H
0005
0006 #include <array>
0007 #include <string>
0008 #include <vector>
0009
0010 class CDBTTree;
0011
0012 class IdealPadMap
0013 {
0014 public:
0015 IdealPadMap();
0016 ~IdealPadMap();
0017
0018 int load_from_cdb(int verbosity = 0);
0019 bool is_loaded() const { return m_is_loaded; }
0020
0021
0022
0023 int get_region(unsigned int layer) const;
0024 unsigned int get_pads_per_sector(unsigned int region) const;
0025 unsigned int get_pads_per_sector_for_layer(unsigned int layer) const;
0026 unsigned int get_total_phibins(unsigned int layer) const;
0027
0028
0029 double get_radius(unsigned int layer) const;
0030 double get_local_radius(unsigned int layer) const { return get_radius(layer); }
0031 double get_layer_thickness(unsigned int layer) const;
0032
0033
0034
0035 double get_cdb_local_phi(unsigned int layer, unsigned int local_phibin) const;
0036
0037
0038
0039 double get_phi(unsigned int side, unsigned int layer, unsigned int phibin) const;
0040
0041
0042 double get_phi(unsigned int side,
0043 unsigned int sector,
0044 unsigned int layer,
0045 unsigned int local_phibin) const;
0046
0047
0048 int get_layer_from_fee_channel(unsigned int fee, unsigned int channel) const;
0049
0050 private:
0051 static constexpr unsigned int N_SIDES = 2;
0052 static constexpr unsigned int N_SECTORS = 12;
0053 static constexpr unsigned int N_REGIONS = 3;
0054 static constexpr unsigned int N_LAYERS = 48;
0055 static constexpr unsigned int FIRST_LAYER = 7;
0056 static constexpr unsigned int LAST_LAYER = 54;
0057 static constexpr unsigned int N_FEE = 26;
0058 static constexpr unsigned int N_CH = 256;
0059
0060 int layer_index(unsigned int layer) const;
0061 double wrap_phi(double phi) const;
0062
0063 bool m_is_loaded = false;
0064
0065
0066 std::array<std::vector<double>, N_LAYERS> m_cdb_phi_by_layer;
0067 std::array<double, N_LAYERS> m_radius_cm_by_layer{};
0068
0069
0070 std::array<int, N_FEE * N_CH> m_layer_by_key{};
0071 };
0072
0073 #endif