Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:44

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 // $Id: $
0004 
0005 /*!
0006  * \file PHG4CylinderCellGeomSpacalv1.h
0007  * \brief
0008  * \author Jin Huang <jhuang@bnl.gov>
0009  * \version $Revision:   $
0010  * \date $Date: $
0011  */
0012 
0013 #ifndef G4DETECTORS_PHG4CYLINDERCELLGEOMSPACALV1_H
0014 #define G4DETECTORS_PHG4CYLINDERCELLGEOMSPACALV1_H
0015 
0016 #include "PHG4CylinderCellGeom.h"
0017 
0018 #include <iostream>  // for cout, ostream
0019 #include <map>
0020 #include <utility>  // for pair
0021 
0022 /*!
0023  * \brief PHG4CylinderCellGeom_Spacalv1
0024  */
0025 class PHG4CylinderCellGeom_Spacalv1 : public PHG4CylinderCellGeom
0026 {
0027  public:
0028   PHG4CylinderCellGeom_Spacalv1() = default;
0029   ~PHG4CylinderCellGeom_Spacalv1() override = default;
0030 
0031   void identify(std::ostream& os = std::cout) const override;
0032 
0033   std::pair<double, double>
0034   get_zbounds(const int ibin) const override;
0035   std::pair<double, double>
0036   get_etabounds(const int ibin) const override;
0037 
0038   double get_etacenter(const int ibin) const override;
0039   double get_zcenter(const int ibin) const override;
0040 
0041   int get_etabin(const double eta) const override;
0042   int get_zbin(const double z) const override;
0043 
0044   void set_zbounds(const int ibin, const std::pair<double, double>& bounds);
0045   void set_etabounds(const int ibin, const std::pair<double, double>& bounds);
0046 
0047   typedef std::pair<double, double> bound_t;
0048   typedef std::map<int, bound_t> bound_map_t;
0049 
0050   const bound_map_t&
0051   get_eta_bound_map() const
0052   {
0053     map_consistency_check();
0054     return eta_bound_map;
0055   }
0056 
0057   void set_eta_bound_map(const bound_map_t& etaBoundMap)
0058   {
0059     eta_bound_map = etaBoundMap;
0060   }
0061 
0062   const bound_map_t& get_z_bound_map() const
0063   {
0064     map_consistency_check();
0065     return z_bound_map;
0066   }
0067 
0068   void set_z_bound_map(const bound_map_t& boundMap)
0069   {
0070     z_bound_map = boundMap;
0071   }
0072 
0073   //! map tower_z_ID -> eta_bin number
0074   typedef std::map<int, int> tower_z_ID_eta_bin_map_t;
0075 
0076   //! map tower_z_ID -> eta_bin number
0077   const tower_z_ID_eta_bin_map_t& get_tower_z_ID_eta_bin_map() const
0078   {
0079     return tower_z_ID_eta_bin_map;
0080   }
0081 
0082   virtual int get_etabin_block(const int tower_z_ID) const;
0083 
0084   //! map tower_z_ID -> eta_bin number for blocks
0085   void set_tower_z_ID_eta_bin_map(const tower_z_ID_eta_bin_map_t& m)
0086   {
0087     tower_z_ID_eta_bin_map = m;
0088   }
0089 
0090  protected:
0091   void map_consistency_check() const;
0092 
0093   bound_map_t z_bound_map;
0094   bound_map_t eta_bound_map;
0095 
0096   //! map tower_z_ID -> eta_bin number for blocks
0097   tower_z_ID_eta_bin_map_t tower_z_ID_eta_bin_map;
0098 
0099   ClassDefOverride(PHG4CylinderCellGeom_Spacalv1, 2)
0100 };
0101 
0102 #endif /* PHG4CYLINDERCELLGEOMSPACALV1_H_ */