Files
geant4/source/geometry/solids/CSG/include/G4Tubs.icc
T
2016-06-09 15:37:50 +02:00

167 lines
3.8 KiB
Plaintext

//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4Tubs.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
//
// G4Tubs.icc
//
// Implementation of inline methods of G4Tubs
// --------------------------------------------------------------------
inline
G4double G4Tubs::GetInnerRadius () const
{
return fRMin;
}
inline
G4double G4Tubs::GetOuterRadius () const
{
return fRMax;
}
inline
G4double G4Tubs::GetZHalfLength () const
{
return fDz;
}
inline
G4double G4Tubs::GetStartPhiAngle () const
{
return fSPhi;
}
inline
G4double G4Tubs::GetDeltaPhiAngle () const
{
return fDPhi;
}
inline
void G4Tubs::SetInnerRadius (G4double newRMin)
{
fRMin= newRMin;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
inline
void G4Tubs::SetOuterRadius (G4double newRMax)
{
fRMax= newRMax;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
inline
void G4Tubs::SetZHalfLength (G4double newDz)
{
fDz= newDz;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
inline
void G4Tubs::SetStartPhiAngle (G4double newSPhi)
{
fSPhi= newSPhi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
inline
void G4Tubs::SetDeltaPhiAngle (G4double newDPhi)
{
fDPhi= newDPhi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
// Older names for access functions
inline
G4double G4Tubs::GetRMin () const
{
return GetInnerRadius();
}
inline
G4double G4Tubs::GetRMax () const
{
return GetOuterRadius();
}
inline
G4double G4Tubs::GetDz () const
{
return GetZHalfLength() ;
}
inline
G4double G4Tubs::GetSPhi () const
{
return GetStartPhiAngle();
}
inline
G4double G4Tubs::GetDPhi () const
{
return GetDeltaPhiAngle();
}
inline
G4double G4Tubs::GetCubicVolume()
{
if(fCubicVolume != 0.) {;}
else { fCubicVolume = fDPhi*fDz*(fRMax*fRMax-fRMin*fRMin); }
return fCubicVolume;
}
inline
G4double G4Tubs::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
fSurfaceArea = fDPhi*(fRMin+fRMax)*(2*fDz+fRMax-fRMin);
if (fDPhi < twopi)
{
fSurfaceArea = fSurfaceArea + 4*fDz*(fRMax-fRMin);
}
}
return fSurfaceArea;
}