Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4CylinderCellGeom.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4CylinderCellGeom.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4DETECTORS_PHG4CYLINDERCELLGEOM_H
4 #define G4DETECTORS_PHG4CYLINDERCELLGEOM_H
5 
6 #include <phool/PHObject.h>
7 
8 #include <cmath>
9 #include <iostream> // for cout, ostream
10 #include <string>
11 #include <utility> // for pair
12 
14 {
15  public:
16  PHG4CylinderCellGeom() = default;
17 
18  ~PHG4CylinderCellGeom() override = default;
19 
20  // from PHObject
21  void identify(std::ostream& os = std::cout) const override;
22 
23  int get_layer() const { return layer; }
24  double get_radius() const { return radius; }
25  double get_thickness() const { return thickness; }
26  int get_binning() const { return binning; }
27  int get_zbins() const;
28  int get_phibins() const;
29  double get_zmin() const;
30  double get_phistep() const;
31  double get_phimin() const;
32  double get_zstep() const;
33  int get_etabins() const;
34  double get_etastep() const;
35  double get_etamin() const;
36 
37  virtual std::pair<double, double> get_zbounds(const int ibin) const;
38  virtual std::pair<double, double> get_phibounds(const int ibin) const;
39  virtual std::pair<double, double> get_etabounds(const int ibin) const;
40  virtual double get_etacenter(const int ibin) const;
41  virtual double get_zcenter(const int ibin) const;
42  virtual double get_phicenter(const int ibin) const;
43 
44  virtual int get_etabin(const double eta) const;
45  virtual int get_zbin(const double z) const;
46  virtual int get_phibin(const double phi) const;
47 
48  void set_layer(const int i) { layer = i; }
49  void set_binning(const int i) { binning = i; }
50  void set_radius(const double r) { radius = r; }
51  void set_thickness(const double t) { thickness = t; }
52  void set_zbins(const int i);
53  void set_zmin(const double z);
54  void set_zstep(const double z);
55  void set_phibins(const int i);
56  void set_phistep(const double phi);
57  void set_phimin(const double phi);
58  void set_etabins(const int i);
59  void set_etamin(const double z);
60  void set_etastep(const double z);
61 
62  protected:
63  void check_binning_method(const int i) const;
64  void check_binning_method_eta(const std::string& src = "") const;
65  void check_binning_method_phi(const std::string& src = "") const;
66  std::string methodname(const int i) const;
67  int layer = -999;
68  int binning = 0;
69  double radius = NAN;
70  int nzbins = -1;
71  double zmin = NAN;
72  double zstep = NAN;
73  int nphibins = -1;
74  double phimin = -M_PI;
75  double phistep = NAN;
76  double thickness = NAN;
77 
78  ClassDefOverride(PHG4CylinderCellGeom, 1)
79 };
80 
81 #endif