File indexing completed on 2025-08-06 08:18:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef G4DETECTORS_PHG4CYLINDERGEOMSPACALV2_H
0013 #define G4DETECTORS_PHG4CYLINDERGEOMSPACALV2_H
0014
0015 #include "PHG4CylinderGeom_Spacalv1.h"
0016
0017 #include <cmath>
0018 #include <iostream> // for cout, ostream
0019
0020 class PHParameters;
0021
0022 class PHG4CylinderGeom_Spacalv2 : public PHG4CylinderGeom_Spacalv1
0023 {
0024 public:
0025 PHG4CylinderGeom_Spacalv2();
0026
0027 ~PHG4CylinderGeom_Spacalv2() override
0028 {
0029 }
0030
0031
0032 void identify(std::ostream& os = std::cout) const override;
0033
0034
0035 void Print(Option_t* option = "") const override;
0036
0037
0038 void SetDefault() override;
0039
0040
0041 void ImportParameters(const PHParameters& param) override;
0042
0043 int get_azimuthal_n_sec() const override;
0044
0045 virtual void set_azimuthal_n_sec(int azimuthalNSec);
0046
0047
0048 double
0049 get_azimuthal_tilt() const
0050 {
0051 return azimuthal_tilt;
0052 }
0053
0054
0055 void
0056 set_azimuthal_tilt(double azimuthalTilt)
0057 {
0058 azimuthal_tilt = azimuthalTilt;
0059 }
0060
0061 bool is_azimuthal_seg_visible() const override;
0062
0063 virtual void set_azimuthal_seg_visible(bool b = true);
0064
0065 double get_polar_taper_ratio() const
0066 {
0067 return polar_taper_ratio;
0068 }
0069
0070 void
0071 set_polar_taper_ratio(double polarTaperRatio)
0072 {
0073 polar_taper_ratio = polarTaperRatio;
0074 }
0075
0076 double get_half_polar_taper_angle() const;
0077
0078 double
0079 get_sec_azimuthal_width() const;
0080
0081 double
0082 get_sec_depth() const
0083 {
0084 const double available_depth = get_thickness() - (sqrt((get_radius()) * (get_radius()) + (get_sec_azimuthal_width() / 2) * (get_sec_azimuthal_width() / 2)) - get_radius()) - get_assembly_spacing();
0085 if (available_depth < get_sec_azimuthal_width())
0086 return NAN;
0087 else
0088 return sqrt(
0089 available_depth * available_depth - get_sec_azimuthal_width() * get_sec_azimuthal_width());
0090 }
0091
0092 double
0093 get_block_width() const
0094 {
0095 return get_sec_azimuthal_width() - 0.0001;
0096 }
0097
0098 double
0099 get_block_depth() const
0100 {
0101 return sqrt(get_sec_depth() * get_sec_depth() - get_polar_taper_ratio() * get_polar_taper_ratio() * get_block_width() * get_block_width()) - get_assembly_spacing();
0102 }
0103
0104 double get_assembly_spacing() const
0105 {
0106 return assembly_spacing;
0107 }
0108
0109 void
0110 set_assembly_spacing(double assemblySpacing)
0111 {
0112 assembly_spacing = assemblySpacing;
0113 }
0114
0115
0116 double
0117 get_reg_fiber_grid_distance_taper() const;
0118
0119
0120 double
0121 get_reg_fiber_grid_distance_nontaper() const;
0122
0123 protected:
0124 int azimuthal_n_sec{std::numeric_limits<int>::min()};
0125
0126
0127 double azimuthal_tilt{std::numeric_limits<double>::quiet_NaN()};
0128 bool azimuthal_seg_visible{false};
0129 double polar_taper_ratio{std::numeric_limits<double>::quiet_NaN()};
0130 double assembly_spacing{std::numeric_limits<double>::quiet_NaN()};
0131
0132 ClassDefOverride(PHG4CylinderGeom_Spacalv2, 2)
0133 };
0134
0135 #endif