Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:12:18

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 // 
0026 // G4VoxelLimits inline implementation
0027 //
0028 // Author: Paul Kent (CERN), 13.07.1995
0029 // --------------------------------------------------------------------
0030 
0031 inline
0032 G4double G4VoxelLimits::GetMaxXExtent() const
0033 {
0034   return fxAxisMax;
0035 }
0036 
0037 inline
0038 G4double G4VoxelLimits::GetMaxYExtent() const
0039 {
0040   return fyAxisMax;
0041 }
0042 
0043 inline
0044 G4double G4VoxelLimits::GetMaxZExtent() const
0045 {
0046   return fzAxisMax;
0047 }
0048 
0049 inline
0050 G4double G4VoxelLimits::GetMinXExtent() const
0051 {
0052   return fxAxisMin;
0053 }
0054 
0055 inline
0056 G4double G4VoxelLimits::GetMinYExtent() const
0057 {
0058   return fyAxisMin;
0059 }
0060 
0061 inline
0062 G4double G4VoxelLimits::GetMinZExtent() const
0063 {
0064   return fzAxisMin;
0065 }
0066 
0067 inline
0068 G4double G4VoxelLimits::GetMaxExtent(const EAxis pAxis) const
0069 {
0070   if (pAxis==kXAxis)
0071   {
0072     return GetMaxXExtent();
0073   }
0074   if (pAxis==kYAxis)
0075   {
0076     return GetMaxYExtent();
0077   }
0078   assert(pAxis==kZAxis);
0079   return GetMaxZExtent();
0080 }
0081 
0082 inline
0083 G4double G4VoxelLimits::GetMinExtent(const EAxis pAxis) const
0084 {
0085   if (pAxis==kXAxis)
0086   {
0087     return GetMinXExtent();
0088   }
0089   if (pAxis==kYAxis)
0090   {
0091     return GetMinYExtent();
0092   }
0093   assert(pAxis==kZAxis);
0094   return GetMinZExtent();
0095 }
0096 
0097 inline
0098 G4bool G4VoxelLimits::IsXLimited() const
0099 {
0100   return fxAxisMin!=-kInfinity||fxAxisMax!=kInfinity;
0101 }
0102 
0103 inline
0104 G4bool G4VoxelLimits::IsYLimited() const
0105 {
0106   return fyAxisMin!=-kInfinity||fyAxisMax!=kInfinity;
0107 }
0108 
0109 inline
0110 G4bool G4VoxelLimits::IsZLimited() const
0111 {
0112   return fzAxisMin!=-kInfinity||fzAxisMax!=kInfinity;
0113 }
0114 
0115 inline
0116 G4bool G4VoxelLimits::IsLimited() const
0117 {
0118   return (IsXLimited()||IsYLimited()||IsZLimited());
0119 }
0120 
0121 inline
0122 G4bool G4VoxelLimits::IsLimited(const EAxis pAxis) const
0123 {
0124   if (pAxis==kXAxis)
0125   {
0126     return IsXLimited();
0127   }
0128   if (pAxis==kYAxis)
0129   {
0130     return IsYLimited();
0131   }
0132   assert(pAxis==kZAxis);
0133   return IsZLimited();
0134 }
0135 
0136 inline
0137 G4bool G4VoxelLimits::Inside(const G4ThreeVector& pVec) const
0138 {
0139   return (GetMinXExtent()<=pVec.x()) &&
0140       (GetMaxXExtent()>=pVec.x()) &&
0141       (GetMinYExtent()<=pVec.y()) &&
0142       (GetMaxYExtent()>=pVec.y()) &&
0143       (GetMinZExtent()<=pVec.z()) &&
0144       (GetMaxZExtent()>=pVec.z());
0145 }