Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4BLOCKCELLGEOM_H
0004 #define G4DETECTORS_PHG4BLOCKCELLGEOM_H
0005 
0006 #include <phool/PHObject.h>
0007 
0008 #include <iostream>  // for cout, ostream
0009 #include <limits>
0010 #include <string>
0011 #include <utility>  // for pair
0012 
0013 class PHG4BlockCellGeom : public PHObject
0014 {
0015  public:
0016   PHG4BlockCellGeom() = default;
0017 
0018   ~PHG4BlockCellGeom() 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   int get_binning() const { return _binning; }
0025 
0026   int get_zbins() const;
0027   double get_zstep() const;
0028   double get_zmin() const;
0029 
0030   int get_xbins() const;
0031   double get_xstep() const;
0032   double get_xmin() const;
0033 
0034   int get_etabins() const;
0035   double get_etastep() const;
0036   double get_etamin() const;
0037 
0038   std::pair<double, double> get_zbounds(const int ibin) const;
0039   std::pair<double, double> get_etabounds(const int ibin) const;
0040   std::pair<double, double> get_xbounds(const int ibin) const;
0041 
0042   double get_etacenter(const int ibin) const;
0043   double get_zcenter(const int ibin) const;
0044   double get_xcenter(const int ibin) const;
0045 
0046   int get_etabin(const double eta) const;
0047   int get_zbin(const double z) const;
0048   int get_xbin(const double x) const;
0049 
0050   void set_layer(const int i) { _layer = i; }
0051   void set_binning(const int i) { _binning = i; }
0052 
0053   void set_zbins(const int i);
0054   void set_zmin(const double z);
0055   void set_zstep(const double z);
0056 
0057   void set_xbins(const int i);
0058   void set_xstep(const double x);
0059   void set_xmin(const double x);
0060 
0061   void set_etabins(const int i);
0062   void set_etamin(const double z);
0063   void set_etastep(const double z);
0064 
0065  protected:
0066   void check_binning_method(const int i) const;
0067   void check_binning_method_eta(const std::string& src = "") const;
0068   void check_binning_method_x(const std::string& src = "") const;
0069   std::string methodname(const int i) const;
0070 
0071   int _layer{std::numeric_limits<int>::min()};
0072   int _binning{0};
0073 
0074   int _nzbins{-1};
0075   double _zmin{std::numeric_limits<double>::quiet_NaN()};
0076   double _zstep{std::numeric_limits<double>::quiet_NaN()};
0077 
0078   int _nxbins{-1};
0079   double _xmin{std::numeric_limits<double>::quiet_NaN()};
0080   double _xstep{std::numeric_limits<double>::quiet_NaN()};
0081 
0082   ClassDefOverride(PHG4BlockCellGeom, 1)
0083 };
0084 
0085 #endif