Files
geant4/source/geometry/solids/CSG/include/G4Para.icc
T
2016-06-09 11:11:55 +02:00

130 lines
3.3 KiB
Plaintext

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4Para.icc,v 1.5 2004/12/02 09:31:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
//
// G4Para.icc
//
// Implementation of inline methods of G4Para
// --------------------------------------------------------------------
inline
G4double G4Para::GetZHalfLength() const
{
return fDz ;
}
inline
G4ThreeVector G4Para::GetSymAxis() const
{
G4double cosTheta = 1.0/std::sqrt(1+fTthetaCphi*fTthetaCphi +
fTthetaSphi*fTthetaSphi) ;
return G4ThreeVector(fTthetaCphi*cosTheta,
fTthetaSphi*cosTheta,
cosTheta) ;
}
inline
G4double G4Para::GetYHalfLength() const
{
return fDy ;
}
inline
G4double G4Para::GetXHalfLength() const
{
return fDx ;
}
inline
G4double G4Para::GetTanAlpha() const
{
return fTalpha ;
}
inline
void G4Para::SetXHalfLength(G4double val)
{
fDx= val;
fCubicVolume= 0.;
fpPolyhedron = 0;
}
inline
void G4Para::SetYHalfLength(G4double val)
{
fDy= val;
fCubicVolume= 0.;
fpPolyhedron = 0;
}
inline
void G4Para::SetZHalfLength(G4double val)
{
fDz= val;
fCubicVolume= 0.;
fpPolyhedron = 0;
}
inline
void G4Para::SetAlpha(G4double alpha)
{
fTalpha= std::tan(alpha);
fCubicVolume= 0.;
fpPolyhedron = 0;
}
inline
void G4Para::SetTanAlpha(G4double val)
{
fTalpha= val;
fCubicVolume= 0.;
fpPolyhedron = 0;
}
inline
void G4Para::SetThetaAndPhi(double pTheta, double pPhi)
{
fTthetaCphi=std::tan(pTheta)*std::cos(pPhi);
fTthetaSphi=std::tan(pTheta)*std::sin(pPhi);
fCubicVolume= 0.;
fpPolyhedron = 0;
}
///////////////////////////////////////////////////
//
// It is like G4Box, since para transformations keep the volume to be const
inline
G4double G4Para::GetCubicVolume()
{
if(fCubicVolume != 0.) ;
else fCubicVolume = 8*fDx*fDy*fDz;
return fCubicVolume;
}