Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:56

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4CYLINDERCELLGEOM_H
0004 #define G4DETECTORS_PHG4CYLINDERCELLGEOM_H
0005 
0006 #include <phool/PHObject.h>
0007 
0008 #include <cmath>
0009 #include <iostream>  // for cout, ostream
0010 #include <string>
0011 #include <utility>  // for pair
0012 
0013 class PHG4CylinderCellGeom : public PHObject
0014 {
0015  public:
0016   PHG4CylinderCellGeom() = default;
0017 
0018   ~PHG4CylinderCellGeom() override = default;
0019 
0020   // from PHObject
0021   void identify(std::ostream& os = std::cout) const override;
0022 
0023   int get_layer() const { return layer; }
0024   double get_radius() const { return radius; }
0025   double get_thickness() const { return thickness; }
0026   int get_binning() const { return binning; }
0027   int get_zbins() const;
0028   int get_phibins() const;
0029   double get_zmin() const;
0030   double get_phistep() const;
0031   double get_phimin() const;
0032   double get_zstep() const;
0033   int get_etabins() const;
0034   double get_etastep() const;
0035   double get_etamin() const;
0036 
0037   virtual std::pair<double, double> get_zbounds(const int ibin) const;
0038   virtual std::pair<double, double> get_phibounds(const int ibin) const;
0039   virtual std::pair<double, double> get_etabounds(const int ibin) const;
0040   virtual double get_etacenter(const int ibin) const;
0041   virtual double get_zcenter(const int ibin) const;
0042   virtual double get_phicenter(const int ibin) const;
0043 
0044   virtual int get_etabin(const double eta) const;
0045   virtual int get_zbin(const double z) const;
0046   virtual int get_phibin(const double phi) const;
0047 
0048   void set_layer(const int i) { layer = i; }
0049   void set_binning(const int i) { binning = i; }
0050   void set_radius(const double r) { radius = r; }
0051   void set_thickness(const double t) { thickness = t; }
0052   void set_zbins(const int i);
0053   void set_zmin(const double z);
0054   void set_zstep(const double z);
0055   void set_phibins(const int i);
0056   void set_phistep(const double phi);
0057   void set_phimin(const double phi);
0058   void set_etabins(const int i);
0059   void set_etamin(const double z);
0060   void set_etastep(const double z);
0061 
0062  protected:
0063   void check_binning_method(const int i) const;
0064   void check_binning_method_eta(const std::string& src = "") const;
0065   void check_binning_method_phi(const std::string& src = "") const;
0066   std::string methodname(const int i) const;
0067   int layer = -999;
0068   int binning = 0;
0069   double radius = NAN;
0070   int nzbins = -1;
0071   double zmin = NAN;
0072   double zstep = NAN;
0073   int nphibins = -1;
0074   double phimin = -M_PI;
0075   double phistep = NAN;
0076   double thickness = NAN;
0077 
0078   ClassDefOverride(PHG4CylinderCellGeom, 1)
0079 };
0080 
0081 #endif