Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TpcCylinderGeom.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TpcCylinderGeom.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4DETECTORS_PHG4TPCCYLINDERGEOM_H
4 #define G4DETECTORS_PHG4TPCCYLINDERGEOM_H
5 
6 #include "PHG4CylinderGeom.h"
7 
8 #include <array>
9 #include <cmath>
10 #include <iostream> // for cout, ostream
11 #include <string>
12 #include <utility> // for pair
13 
15 {
16  public:
18 
20 
21  // from PHObject
22  void identify(std::ostream& os = std::cout) const override;
23 
24  int get_layer() const override { return layer; }
25  double get_radius() const override { return radius; }
26  double get_thickness() const override { return thickness; }
27  int get_binning() const { return binning; }
28  int get_zbins() const;
29  int get_phibins() const;
30  double get_zmin() const override;
31  double get_phistep() const;
32  double get_phimin() const;
33  double get_zstep() const;
34  int get_etabins() const;
35  double get_etastep() const;
36  double get_etamin() const;
37 
38  virtual std::pair<double, double> get_zbounds(const int ibin) const;
39  virtual std::pair<double, double> get_phibounds(const int ibin) const;
40  virtual std::pair<double, double> get_etabounds(const int ibin) const;
41  virtual double get_etacenter(const int ibin) const;
42  virtual double get_zcenter(const int ibin) const;
43  virtual double get_phicenter(const int ibin) const;
44  virtual double get_phicenter_new(const int ibin) const;
45  virtual double get_phi(const float ibin) const;
46 
47  virtual int get_etabin(const double eta) const;
48  virtual int get_zbin(const double z) const;
49  virtual int get_phibin(const double phi, int side = 0) const;
50  virtual int get_phibin_new(const double phi) const;
51 
52  virtual float get_pad_float(const double phi, int side = 0) const;
53  virtual float get_tbin_float(const double z) const;
54  virtual int find_phibin(const double phi, int side = 0) const;
55 
56  void set_layer(const int i) override { layer = i; }
57  void set_binning(const int i) { binning = i; }
58  void set_radius(const double r) override { radius = r; }
59  void set_thickness(const double t) override { thickness = t; }
60  void set_zbins(const int i);
61  void set_zmin(const double z) override;
62  void set_zstep(const double z);
63  void set_phibins(const int i);
64  void set_phistep(const double phi);
65  void set_phimin(const double phi);
66  void set_etabins(const int i);
67  void set_etamin(const double z);
68  void set_etastep(const double z);
69 
70  static const int NSides = 2;
71 
72  void set_r_bias(std::array<std::vector<double>, NSides> dr) { sector_R_bias = dr; }
73  void set_phi_bias(std::array<std::vector<double>, NSides> dphi) { sector_Phi_bias = dphi; }
74 
75  // void set_sector_phi(const double s_phi){sector_phi = s_phi;}
76  void set_sector_min_phi(std::array<std::vector<double>, NSides> s_min_phi) { sector_min_Phi = s_min_phi; }
77  void set_sector_max_phi(std::array<std::vector<double>, NSides> s_max_phi) { sector_max_Phi = s_max_phi; }
78 
79  std::array<std::vector<double>, NSides> get_sector_min_phi() { return sector_min_Phi; }
80  std::array<std::vector<double>, NSides> get_sector_max_phi() { return sector_max_Phi; }
81 
82  protected:
83  void check_binning_method(const int i) const;
84  void check_binning_method_eta(const std::string& src = "") const;
85  void check_binning_method_phi(const std::string& src = "") const;
86  std::string methodname(const int i) const;
87  int layer{-999};
88  int binning{0};
89  double radius{std::numeric_limits<double>::quiet_NaN()};
90  int nzbins{-1};
91  double zmin{std::numeric_limits<double>::quiet_NaN()};
92  double zstep{std::numeric_limits<double>::quiet_NaN()};
93  int nphibins{-1};
94  double phimin{-M_PI};
95  double phistep{std::numeric_limits<double>::quiet_NaN()};
96  double thickness{std::numeric_limits<double>::quiet_NaN()};
97 
98  std::array<std::vector<double>, NSides> sector_R_bias;
99  std::array<std::vector<double>, NSides> sector_Phi_bias;
100  std::array<std::vector<double>, NSides> sector_min_Phi;
101  std::array<std::vector<double>, NSides> sector_max_Phi;
102 
103  // streamer
104  friend std::ostream& operator<<(std::ostream&, const PHG4TpcCylinderGeom&);
105 
106  ClassDefOverride(PHG4TpcCylinderGeom, 2)
107 };
108 
109 #endif