Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PVDivision.cc,v 1.20 2006/06/29 18:18:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4PVDivision.cc,v 1.22 2008/12/03 16:41:45 arce Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4PVDivision Implementation file
|
||||
//
|
||||
@@ -217,12 +217,12 @@ G4PVDivision::CheckAndSetParameters( const EAxis pAxis,
|
||||
//
|
||||
G4String msolType = pMotherLogical->GetSolid()->GetEntityType();
|
||||
G4String dsolType = GetLogicalVolume()->GetSolid()->GetEntityType();
|
||||
if( msolType != dsolType )
|
||||
if( msolType != dsolType && ( msolType != "G4Trd" || dsolType != "G4Trap" ) )
|
||||
{
|
||||
G4String message =
|
||||
"Incorrect solid type for division of volume " + GetName()
|
||||
+ " It is: " + msolType + ", while it should be: " + dsolType;
|
||||
G4Exception("G4VDivisionParameterisation::CheckAndSetParameters()",
|
||||
G4Exception("G4PVDivision::CheckAndSetParameters()",
|
||||
"IllegalConstruct", FatalException, message );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PVDivisionFactory.cc,v 1.2 2006/06/29 18:18:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4PVDivisionFactory Implementation file
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParameterisationBox.cc,v 1.10 2006/06/29 18:18:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4ParameterisationBox Implementation file
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParameterisationCons.cc,v 1.9 2006/06/29 18:18:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4ParameterisationCons Implementation file
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParameterisationPara.cc,v 1.11 2006/06/29 18:18:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4ParameterisationPara Implementation file
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParameterisationPolycone.cc,v 1.15 2006/06/29 18:18:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4ParameterisationPolycone Implementation file
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParameterisationPolyhedra.cc,v 1.16 2007/05/18 07:27:23 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4ParameterisationPolyhedra Implementation file
|
||||
//
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParameterisationTrd.cc,v 1.14 2006/06/29 18:18:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4ParameterisationTrd.cc,v 1.16 2008/12/18 12:57:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4ParameterisationTrd Implementation file
|
||||
//
|
||||
@@ -90,16 +90,16 @@ G4ParameterisationTrdX( EAxis axis, G4int nDiv,
|
||||
G4Trd* msol = (G4Trd*)(fmotherSolid);
|
||||
if( divType == DivWIDTH )
|
||||
{
|
||||
fnDiv = CalculateNDiv( 2*msol->GetXHalfLength1(),
|
||||
fnDiv = CalculateNDiv( msol->GetXHalfLength1()+msol->GetXHalfLength2(),
|
||||
width, offset );
|
||||
}
|
||||
else if( divType == DivNDIV )
|
||||
{
|
||||
fwidth = CalculateWidth( 2*msol->GetXHalfLength1(), nDiv, offset );
|
||||
fwidth = CalculateWidth( msol->GetXHalfLength1()+msol->GetXHalfLength2(), nDiv, offset );
|
||||
}
|
||||
|
||||
#ifdef G4DIVDEBUG
|
||||
if( verbose >= -1 )
|
||||
if( verbose >= 1 )
|
||||
{
|
||||
G4cout << " G4ParameterisationTrdX - ## divisions " << fnDiv << " = "
|
||||
<< nDiv << G4endl
|
||||
@@ -107,6 +107,13 @@ G4ParameterisationTrdX( EAxis axis, G4int nDiv,
|
||||
<< " Width " << fwidth << " = " << width << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
G4double mpDx1 = msol->GetXHalfLength1();
|
||||
G4double mpDx2 = msol->GetXHalfLength2();
|
||||
if( std::fabs(mpDx1 - mpDx2) > kCarTolerance )
|
||||
{
|
||||
bDivInTrap = true;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@@ -118,7 +125,7 @@ G4ParameterisationTrdX::~G4ParameterisationTrdX()
|
||||
G4double G4ParameterisationTrdX::GetMaxParameter() const
|
||||
{
|
||||
G4Trd* msol = (G4Trd*)(fmotherSolid);
|
||||
return 2*msol->GetXHalfLength1();
|
||||
return (msol->GetXHalfLength1()+msol->GetXHalfLength2());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@@ -128,11 +135,17 @@ ComputeTransformation( const G4int copyNo,
|
||||
G4VPhysicalVolume *physVol ) const
|
||||
{
|
||||
G4Trd* msol = (G4Trd*)(fmotherSolid );
|
||||
G4double mdx = msol->GetXHalfLength1();
|
||||
G4double mdx = ( msol->GetXHalfLength1() + msol->GetXHalfLength2() ) / 2.;
|
||||
|
||||
//----- translation
|
||||
G4ThreeVector origin(0.,0.,0.);
|
||||
G4double posi = -mdx + foffset + (copyNo+0.5)*fwidth;
|
||||
G4double posi;
|
||||
if( !bDivInTrap ) {
|
||||
posi = -mdx + foffset + (copyNo+0.5)*fwidth;
|
||||
} else {
|
||||
G4double aveHL = (msol->GetXHalfLength1()+msol->GetXHalfLength2())/2.;
|
||||
posi = - aveHL + foffset + (copyNo+0.5)*aveHL/fnDiv*2;
|
||||
}
|
||||
if( faxis == kXAxis )
|
||||
{
|
||||
origin.setX( posi );
|
||||
@@ -145,9 +158,9 @@ ComputeTransformation( const G4int copyNo,
|
||||
}
|
||||
|
||||
#ifdef G4DIVDEBUG
|
||||
if( verbose >= -2 )
|
||||
if( verbose >= 2 )
|
||||
{
|
||||
G4cout << std::setprecision(8) << " G4ParameterisationTrdX: "
|
||||
G4cout << std::setprecision(8) << " G4ParameterisationTrdX::ComputeTransformation "
|
||||
<< copyNo << G4endl
|
||||
<< " Position: " << origin << " - Axis: " << faxis << G4endl;
|
||||
}
|
||||
@@ -168,18 +181,69 @@ ComputeDimensions( G4Trd& trd, const G4int, const G4VPhysicalVolume* ) const
|
||||
G4double pDy2 = msol->GetYHalfLength2();
|
||||
G4double pDz = msol->GetZHalfLength();
|
||||
G4double pDx = fwidth/2.;
|
||||
|
||||
|
||||
trd.SetAllParameters ( pDx, pDx, pDy1, pDy2, pDz );
|
||||
|
||||
#ifdef G4DIVDEBUG
|
||||
if( verbose >= -2 )
|
||||
if( verbose >= 2 )
|
||||
{
|
||||
G4cout << " G4ParameterisationTrdX::ComputeDimensions():" << G4endl;
|
||||
G4cout << " G4ParameterisationTrdX::ComputeDimensions():" << copyNo << G4endl;
|
||||
trd.DumpInfo();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4VSolid* G4ParameterisationTrdX::
|
||||
ComputeSolid(const G4int i, G4VPhysicalVolume * pv)
|
||||
{
|
||||
if( bDivInTrap )
|
||||
{
|
||||
return G4VDivisionParameterisation::ComputeSolid(i, pv);
|
||||
}
|
||||
else
|
||||
{
|
||||
return theTrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void
|
||||
G4ParameterisationTrdX::
|
||||
ComputeDimensions( G4Trap& trap, const G4int copyNo, const G4VPhysicalVolume* ) const
|
||||
{
|
||||
G4Trd* msol = (G4Trd*)(fmotherSolid);
|
||||
G4double pDy1 = msol->GetYHalfLength1();
|
||||
G4double pDy2 = msol->GetYHalfLength2();
|
||||
G4double pDz = msol->GetZHalfLength();
|
||||
G4double pDx1 = msol->GetXHalfLength1()/fnDiv;
|
||||
G4double pDx2 = msol->GetXHalfLength2()/fnDiv;
|
||||
|
||||
G4double cxy1 = -msol->GetXHalfLength1() + foffset + (copyNo+0.5)*pDx1*2;// centre of the side at y=-pDy1
|
||||
G4double cxy2 = -msol->GetXHalfLength2() + foffset + (copyNo+0.5)*pDx2*2;// centre of the side at y=+pDy1
|
||||
G4double alp = std::atan( (cxy2-cxy1)/pDz );
|
||||
|
||||
trap.SetAllParameters ( pDz,
|
||||
0.,
|
||||
0.,
|
||||
pDy1,
|
||||
pDx1,
|
||||
pDx2,
|
||||
alp,
|
||||
pDy2,
|
||||
pDx1,
|
||||
pDx2,
|
||||
alp);
|
||||
|
||||
#ifdef G4DIVDEBUG
|
||||
if( verbose >= 2 )
|
||||
{
|
||||
G4cout << " G4ParameterisationTrdX::ComputeDimensions():" << copyNo << G4endl;
|
||||
trap.DumpInfo();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void G4ParameterisationTrdX::CheckParametersValidity()
|
||||
{
|
||||
@@ -189,9 +253,12 @@ void G4ParameterisationTrdX::CheckParametersValidity()
|
||||
|
||||
G4double mpDx1 = msol->GetXHalfLength1();
|
||||
G4double mpDx2 = msol->GetXHalfLength2();
|
||||
bDivInTrap = false;
|
||||
|
||||
if( std::fabs(mpDx1 - mpDx2) > kCarTolerance )
|
||||
{
|
||||
return;
|
||||
|
||||
G4cerr << "ERROR - G4ParameterisationTrdX::CheckParametersValidity()"
|
||||
<< G4endl
|
||||
<< " Making a division of a TRD along axis X," << G4endl
|
||||
@@ -204,6 +271,12 @@ void G4ParameterisationTrdX::CheckParametersValidity()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void G4ParameterisationTrdX::
|
||||
ComputeTrapParams()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
G4ParameterisationTrdY::
|
||||
G4ParameterisationTrdY( EAxis axis, G4int nDiv,
|
||||
@@ -260,6 +333,7 @@ ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol ) const
|
||||
//----- translation
|
||||
G4ThreeVector origin(0.,0.,0.);
|
||||
G4double posi = -mdy + foffset + (copyNo+0.5)*fwidth;
|
||||
|
||||
if( faxis == kYAxis )
|
||||
{
|
||||
origin.setY( posi );
|
||||
@@ -274,7 +348,7 @@ ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol ) const
|
||||
#ifdef G4DIVDEBUG
|
||||
if( verbose >= 2 )
|
||||
{
|
||||
G4cout << std::setprecision(8) << " G4ParameterisationTrdY " << copyNo
|
||||
G4cout << std::setprecision(8) << " G4ParameterisationTrdY::ComputeTransformation " << copyNo
|
||||
<< " pos " << origin << " rot mat " << " axis " << faxis << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParameterisationTubs.cc,v 1.8 2006/06/29 18:18:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4ParameterisationTubs Implementation file
|
||||
//
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VDivisionParameterisation.cc,v 1.12 2007/05/11 13:26:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4VDivisionParameterisation.cc,v 1.14 2008/12/03 16:41:15 arce Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// class G4VDivisionParameterisation Implementation file
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user