Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
@@ -21,13 +21,14 @@
// ********************************************************************
//
//
// $Id: G4ParameterisationPara.cc,v 1.6 2003/11/19 11:51:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ParameterisationPara.cc,v 1.8 2004/05/17 07:20:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// class G4ParameterisationPara Implementation file
//
// 26.05.03 - P.Arce Initial version
// ********************************************************************
// 26.05.03 - P.Arce, Initial version
// 08.04.04 - I.Hrivnacova, Implemented reflection
// --------------------------------------------------------------------
#include "G4ParameterisationPara.hh"
@@ -37,26 +38,64 @@
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ReflectedSolid.hh"
#include "G4Para.hh"
//--------------------------------------------------------------------------
G4VParameterisationPara::
G4VParameterisationPara( EAxis axis, G4int nDiv, G4double width,
G4double offset, G4VSolid* msolid,
DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
{
G4Para* msol = (G4Para*)(msolid);
if (msolid->GetEntityType() == "G4ReflectedSolid")
{
// Get constituent solid
G4VSolid* mConstituentSolid
= ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid();
msol = (G4Para*)(mConstituentSolid);
fmotherSolid = msol;
// Create a new solid with inversed parameters
G4Para* newSolid
= new G4Para(msol->GetName(),
msol->GetXHalfLength(),
msol->GetYHalfLength(),
msol->GetZHalfLength(),
atan(msol->GetTanAlpha()),
M_PI - msol->GetSymAxis().theta(),
msol->GetSymAxis().phi());
msol = newSolid;
fmotherSolid = newSolid;
fReflectedSolid = true;
fDeleteSolid = true;
}
}
//------------------------------------------------------------------------
G4VParameterisationPara::~G4VParameterisationPara()
{
}
//------------------------------------------------------------------------
G4ParameterisationParaX::
G4ParameterisationParaX( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
: G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
{
CheckParametersValidity();
SetType( "DivisionParaX" );
G4Para* mpara = (G4Para*)(fmotherSolid);
if( divType == DivWIDTH )
{
G4Para* mpara = (G4Para*)(msolid);
fnDiv = CalculateNDiv( 2*mpara->GetXHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Para* mpara = (G4Para*)(msolid);
fwidth = CalculateWidth( 2*mpara->GetXHalfLength(), nDiv, offset );
}
@@ -145,19 +184,18 @@ G4ParameterisationParaY::
G4ParameterisationParaY( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
: G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
{
CheckParametersValidity();
SetType( "DivisionParaY" );
G4Para* mpara = (G4Para*)(fmotherSolid);
if( divType == DivWIDTH )
{
G4Para* mpara = (G4Para*)(msolid);
fnDiv = CalculateNDiv( 2*mpara->GetYHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Para* mpara = (G4Para*)(msolid);
fwidth = CalculateWidth( 2*mpara->GetYHalfLength(), nDiv, offset );
}
@@ -248,19 +286,18 @@ G4ParameterisationParaZ::
G4ParameterisationParaZ( EAxis axis, G4int nDiv,
G4double width, G4double offset,
G4VSolid* msolid, DivisionType divType )
: G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
: G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
{
CheckParametersValidity();
SetType( "DivisionParaZ" );
G4Para* mpara = (G4Para*)(fmotherSolid);
if( divType == DivWIDTH )
{
G4Para* mpara = (G4Para*)(msolid);
fnDiv = CalculateNDiv( 2*mpara->GetZHalfLength(), width, offset );
}
else if( divType == DivNDIV )
{
G4Para* mpara = (G4Para*)(msolid);
fwidth = CalculateWidth( 2*mpara->GetZHalfLength(), nDiv, offset );
}
@@ -296,7 +333,7 @@ ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const
G4double mdz = msol->GetZHalfLength( );
//----- translation
G4double posi = -mdz + foffset + (copyNo+0.5)*fwidth;
G4double posi = -mdz + OffsetZ() + (copyNo+0.5)*fwidth;
G4ThreeVector symAxis = msol->GetSymAxis();
G4ThreeVector origin( symAxis * posi / symAxis.z() );