Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:25

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 // --------------------------------------------------------------------
0029 
0030 inline
0031 G4double G4VoxelLimits::GetMaxXExtent() const
0032 {
0033   return fxAxisMax;
0034 }
0035 
0036 inline
0037 G4double G4VoxelLimits::GetMaxYExtent() const
0038 {
0039   return fyAxisMax;
0040 }
0041 
0042 inline
0043 G4double G4VoxelLimits::GetMaxZExtent() const
0044 {
0045   return fzAxisMax;
0046 }
0047 
0048 inline
0049 G4double G4VoxelLimits::GetMinXExtent() const
0050 {
0051   return fxAxisMin;
0052 }
0053 
0054 inline
0055 G4double G4VoxelLimits::GetMinYExtent() const
0056 {
0057   return fyAxisMin;
0058 }
0059 
0060 inline
0061 G4double G4VoxelLimits::GetMinZExtent() const
0062 {
0063   return fzAxisMin;
0064 }
0065 
0066 inline
0067 G4double G4VoxelLimits::GetMaxExtent(const EAxis pAxis) const
0068 {
0069   if (pAxis==kXAxis)
0070   {
0071     return GetMaxXExtent();
0072   }
0073   else if (pAxis==kYAxis)
0074   {
0075     return GetMaxYExtent();
0076   }
0077   else 
0078   {
0079     assert(pAxis==kZAxis);
0080     return GetMaxZExtent();
0081   }
0082 }
0083 
0084 inline
0085 G4double G4VoxelLimits::GetMinExtent(const EAxis pAxis) const
0086 {
0087   if (pAxis==kXAxis)
0088   {
0089     return GetMinXExtent();
0090   }
0091   else if (pAxis==kYAxis)
0092   {
0093     return GetMinYExtent();
0094   }
0095   else 
0096   {
0097     assert(pAxis==kZAxis);
0098     return GetMinZExtent();
0099   }
0100 }
0101 
0102 inline
0103 G4bool G4VoxelLimits::IsXLimited() const
0104 {
0105   return !(fxAxisMin==-kInfinity&&fxAxisMax==kInfinity);
0106 }
0107 
0108 inline
0109 G4bool G4VoxelLimits::IsYLimited() const
0110 {
0111   return !(fyAxisMin==-kInfinity&&fyAxisMax==kInfinity);
0112 }
0113 
0114 inline
0115 G4bool G4VoxelLimits::IsZLimited() const
0116 {
0117   return !(fzAxisMin==-kInfinity&&fzAxisMax==kInfinity);
0118 }
0119 
0120 inline
0121 G4bool G4VoxelLimits::IsLimited() const
0122 {
0123   return (IsXLimited()||IsYLimited()||IsZLimited());
0124 }
0125 
0126 inline
0127 G4bool G4VoxelLimits::IsLimited(const EAxis pAxis) const
0128 {
0129   if (pAxis==kXAxis)
0130   {
0131     return IsXLimited();
0132   }
0133   else if (pAxis==kYAxis)
0134   {
0135     return IsYLimited();
0136   }
0137   else 
0138   {
0139     assert(pAxis==kZAxis);
0140     return IsZLimited();
0141   }
0142 }
0143 
0144 inline
0145 G4bool G4VoxelLimits::Inside(const G4ThreeVector& pVec) const
0146 {
0147   return (GetMinXExtent()<=pVec.x()) &&
0148       (GetMaxXExtent()>=pVec.x()) &&
0149       (GetMinYExtent()<=pVec.y()) &&
0150       (GetMaxYExtent()>=pVec.y()) &&
0151       (GetMinZExtent()<=pVec.z()) &&
0152       (GetMaxZExtent()>=pVec.z());
0153 }