Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AssemblyVolume.cc,v 1.10 2002/06/24 07:15:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4AssemblyVolume.cc,v 1.13 2002/09/10 17:07:15 radoone Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// Class G4AssemblyVolume - implementation
@@ -42,8 +42,10 @@ unsigned int G4AssemblyVolume::fsInstanceCounter = 0;
// Default constructor
//
G4AssemblyVolume::G4AssemblyVolume()
: fAssemblyID( 0 )
{
InstanceCountPlus();
SetAssemblyID( GetInstanceCount() );
SetImprintsCount( 0 );
}
@@ -192,7 +194,7 @@ void G4AssemblyVolume::MakeImprint( G4LogicalVolume* pMotherLV,
// ZZZ - the log. volume index inside the assembly volume
G4std::strstream pvName;
pvName << "av_"
<< GetInstanceCount()
<< GetAssemblyID()
<< "_impr_"
<< GetImprintsCount()
<< "_"
@@ -253,6 +255,8 @@ void G4AssemblyVolume::MakeImprint( G4LogicalVolume* pMotherLV,
// We start from the first available index
numberOfDaughters++;
ImprintsCountPlus();
for( unsigned int i = 0; i < fTriplets.size(); i++ )
{
// Generate the unique name for the next PV instance
@@ -266,7 +270,7 @@ void G4AssemblyVolume::MakeImprint( G4LogicalVolume* pMotherLV,
// ZZZ - the log. volume index inside the assembly volume
G4std::strstream pvName;
pvName << "av_"
<< GetInstanceCount()
<< GetAssemblyID()
<< "_impr_"
<< GetImprintsCount()
<< "_"
@@ -22,7 +22,7 @@
//
//
// $Id: G4DrawVoxels.cc,v 1.15 2002/04/19 08:20:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// class G4DrawVoxels
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4GeometryManager.cc,v 1.11 2002/05/17 17:59:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GeometryManager.cc,v 1.12 2002/11/19 17:15:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// class G4GeometryManager
//
@@ -125,6 +125,7 @@ void G4GeometryManager::BuildOptimisations(G4bool allOpts, G4bool verbose)
for (n=0; n<nVolumes; n++)
{
if (verbose) timer.Start();
volume=(*Store)[n];
// For safety, check if there are any existing voxels and
// delete before replacement
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4LogicalVolume.cc,v 1.10 2002/05/17 17:59:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4LogicalVolume.cc,v 1.11 2002/11/08 22:45:25 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// class G4LogicalVolume Implementation
@@ -168,7 +168,7 @@ G4LogicalVolume::SetFieldManager(G4FieldManager* pNewFieldMgr,
{
G4LogicalVolume* DaughterLogVol;
DaughterLogVol = GetDaughter(NoDaughters)->GetLogicalVolume();
if ( forceAllDaughters || (DaughterLogVol->GetFieldManager() != 0) )
if ( forceAllDaughters || (DaughterLogVol->GetFieldManager() == 0) )
{
DaughterLogVol->SetFieldManager(pNewFieldMgr, forceAllDaughters);
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4LogicalVolumeStore.cc,v 1.8 2002/04/26 16:24:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4LogicalVolumeStore
//
@@ -21,35 +21,50 @@
// ********************************************************************
//
//
// $Id: G4PVParameterised.cc,v 1.4 2001/07/11 09:59:21 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4PVParameterised.cc,v 1.7 2002/10/23 16:11:11 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// class G4PVParameterised
//
// Implementation
//
// ********************************************************************
#include "G4PVParameterised.hh"
G4PVParameterised::G4PVParameterised(const G4String& pName,
G4LogicalVolume* pLogical,
G4VPhysicalVolume* pMother,
const EAxis pAxis,
const G4int nReplicas,
G4VPVParameterisation *pParam) :
G4PVReplica(pName,pLogical,pMother,pAxis,nReplicas,0,0),
fparam(pParam)
G4PVParameterised::G4PVParameterised( const G4String& pName,
G4LogicalVolume* pLogical,
G4VPhysicalVolume* pMother,
const EAxis pAxis,
const G4int nReplicas,
G4VPVParameterisation *pParam)
: G4PVReplica(pName, pLogical, pMother, pAxis, nReplicas, 0, 0),
fparam(pParam)
{
#ifdef G4VERBOSE
if ((pMother) && (pMother->IsParameterised()))
{
G4cout << "WARNING - A parameterised volume is being placed" << G4endl
<< " inside another parameterised volume !" << G4endl
<< " To make sure that no overlaps are generated," << G4endl
<< " you should verify the mother replicated shapes" << G4endl
<< " are of the same type and dimensions." << G4endl
<< " Mother physical volume: " << pMother->GetName() << G4endl
<< " Parameterised volume: " << pName << G4endl
<< " (To switch this warning off, compile with G4_NO_VERBOSE)" << G4endl;
}
#endif
}
G4PVParameterised::G4PVParameterised(const G4String& pName,
G4LogicalVolume* pLogical,
G4LogicalVolume* pMotherLogical,
const EAxis pAxis,
const G4int nReplicas,
G4VPVParameterisation *pParam) :
G4PVReplica(pName,pLogical,pMotherLogical,pAxis,nReplicas,0,0),
fparam(pParam)
G4PVParameterised::G4PVParameterised( const G4String& pName,
G4LogicalVolume* pLogical,
G4LogicalVolume* pMotherLogical,
const EAxis pAxis,
const G4int nReplicas,
G4VPVParameterisation *pParam)
: G4PVReplica(pName, pLogical, pMotherLogical, pAxis, nReplicas, 0, 0),
fparam(pParam)
{
}
@@ -59,19 +74,23 @@ G4PVParameterised::~G4PVParameterised()
G4VPVParameterisation* G4PVParameterised::GetParameterisation() const
{
return fparam;
return fparam;
}
void G4PVParameterised::GetReplicationData(EAxis& axis,
G4int& nReplicas,
G4double& width,
G4double& offset,
G4bool& consuming) const
G4bool G4PVParameterised::IsParameterised() const
{
axis=faxis;
nReplicas=fnReplicas;
width=fwidth;
offset=foffset;
consuming=false;
return true;
}
void G4PVParameterised::GetReplicationData( EAxis& axis,
G4int& nReplicas,
G4double& width,
G4double& offset,
G4bool& consuming) const
{
axis = faxis;
nReplicas = fnReplicas;
width = fwidth;
offset = foffset;
consuming = false;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PVPlacement.cc,v 1.4 2001/07/11 09:59:21 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4PVPlacement.cc,v 1.5 2002/10/14 07:42:26 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// class G4PVPlacement Implementation
@@ -124,6 +124,11 @@ G4bool G4PVPlacement::IsReplicated() const
return false;
}
G4bool G4PVPlacement::IsParameterised() const
{
return false;
}
G4VPVParameterisation* G4PVPlacement::GetParameterisation() const
{
return 0;
+122 -84
View File
@@ -21,135 +21,173 @@
// ********************************************************************
//
//
// $Id: G4PVReplica.cc,v 1.4 2002/05/15 10:07:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4PVReplica.cc,v 1.9 2002/10/23 16:26:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// class G4PVReplica Implementation
//
// ********************************************************************
#include "G4PVReplica.hh"
#include "G4LogicalVolume.hh"
G4PVReplica::G4PVReplica(const G4String& pName,
G4LogicalVolume* pLogical,
G4VPhysicalVolume* pMother,
const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double offset) : G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,pMother), fcopyNo(-1)
G4PVReplica::G4PVReplica( const G4String& pName,
G4LogicalVolume* pLogical,
G4VPhysicalVolume* pMother,
const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double offset )
: G4VPhysicalVolume(0, G4ThreeVector(), pName, pLogical, pMother),
fcopyNo(-1)
{
if ((!pMother) || (!pMother->GetLogicalVolume()))
{
G4cout << "ERROR - NULL pointer specified as mother volume." << G4endl
<< " The world volume cannot be sliced or parameterised !"
<< G4endl;
G4Exception("G4PVReplica::G4PVReplica() - Not a valid geometry setup !");
}
if (pMother->GetLogicalVolume()->GetNoDaughters() != 1)
{
G4cout << "ERROR - A replica or parameterised volume must be" << G4endl
<< " the only daughter of a given mother volume !" << G4endl
<< " Mother physical volume: " << pMother->GetName() << G4endl
<< " Replicated volume: " << pName << G4endl;
G4Exception("G4PVReplica::G4PVReplica() - Not a valid geometry setup !");
}
CheckAndSetParameters (pAxis, nReplicas, width, offset);
}
G4PVReplica::G4PVReplica(const G4String& pName,
G4LogicalVolume* pLogical,
G4LogicalVolume* pMotherLogical,
const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double offset) : G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0), fcopyNo(-1)
G4PVReplica::G4PVReplica( const G4String& pName,
G4LogicalVolume* pLogical,
G4LogicalVolume* pMotherLogical,
const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double offset )
: G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0),
fcopyNo(-1)
{
if (pMotherLogical) pMotherLogical->AddDaughter(this);
if (!pMotherLogical)
{
G4cout << "ERROR - NULL pointer specified as mother volume for "
<< pName << "." << G4endl;
G4Exception("G4PVReplica::G4PVReplica() - Not a valid geometry setup !");
}
pMotherLogical->AddDaughter(this);
if (pMotherLogical->GetNoDaughters() != 1)
{
G4cout << "ERROR - A replica or parameterised volume must be" << G4endl
<< " the only daughter of a given mother volume !" << G4endl
<< " Mother logical volume: " << pMotherLogical->GetName() << G4endl
<< " Replicated volume: " << pName << G4endl;
G4Exception("G4PVReplica::G4PVReplica() - Not a valid geometry setup");
}
CheckAndSetParameters (pAxis, nReplicas, width, offset);
}
void G4PVReplica::CheckAndSetParameters (const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double offset) {
if (nReplicas<1)
{
G4Exception("G4PVReplica::G4PVReplica illegal no of replicas");
}
fnReplicas=nReplicas;
if (width<0)
{
G4Exception("G4PVReplica::G4PVReplica Width must be positive");
}
fwidth=width;
foffset=offset;
faxis=pAxis;
// Create rotation matrix for phi axis case & check axis is valid
G4RotationMatrix *pRMat;
switch (faxis)
{
case kPhi:
pRMat=new G4RotationMatrix();
if (!pRMat)
{
G4Exception("G4PVReplica::G4PVReplica rotation matrix alloc failed");
}
SetRotation(pRMat);
break;
case kRho:
case kXAxis:
case kYAxis:
case kZAxis:
case kUndefined:
break;
default:
G4Exception("G4PVReplica::G4PVReplica Unknown axis");
break;
}
void G4PVReplica::CheckAndSetParameters( const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double offset)
{
if (nReplicas<1)
{
G4Exception("G4PVReplica::CheckAndSetParameters() - Illegal number of replicas");
}
fnReplicas=nReplicas;
if (width<0)
{
G4Exception("G4PVReplica::CheckAndSetParameters() - Width must be positive");
}
fwidth = width;
foffset = offset;
faxis = pAxis;
// Create rotation matrix for phi axis case & check axis is valid
//
G4RotationMatrix* pRMat=0;
switch (faxis)
{
case kPhi:
pRMat=new G4RotationMatrix();
if (!pRMat)
{
G4Exception("G4PVReplica::CheckAndSetParameters() - Rotation matrix alloc failed");
}
SetRotation(pRMat);
break;
case kRho:
case kXAxis:
case kYAxis:
case kZAxis:
case kUndefined:
break;
default:
G4Exception("G4PVReplica::CheckAndSetParameters() - Unknown axis");
break;
}
}
G4PVReplica::~G4PVReplica()
{
if (faxis==kPhi)
{
delete GetRotation();
}
if ( faxis==kPhi )
{
delete GetRotation();
}
}
G4bool G4PVReplica::IsMany() const
{
return false;
return false;
}
G4int G4PVReplica::GetCopyNo() const
{
// return 0;
return fcopyNo;
return fcopyNo;
}
void G4PVReplica::SetCopyNo(G4int newCopyNo)
{
fcopyNo= newCopyNo;
fcopyNo = newCopyNo;
}
G4bool G4PVReplica::IsReplicated() const
{
return true;
return true;
}
G4bool G4PVReplica::IsParameterised() const
{
return false;
}
G4VPVParameterisation* G4PVReplica::GetParameterisation() const
{
return 0;
return 0;
}
void G4PVReplica::GetReplicationData(EAxis& axis,
G4int& nReplicas,
G4double& width,
G4double& offset,
G4bool& consuming) const
G4int G4PVReplica::GetMultiplicity() const
{
axis=faxis;
nReplicas=fnReplicas;
width=fwidth;
offset=foffset;
consuming=true;
return fnReplicas;
}
void G4PVReplica::GetReplicationData( EAxis& axis,
G4int& nReplicas,
G4double& width,
G4double& offset,
G4bool& consuming ) const
{
axis = faxis;
nReplicas = fnReplicas;
width = fwidth;
offset = foffset;
consuming = true;
}
void G4PVReplica::Setup(G4VPhysicalVolume *pMother)
{
SetMother(pMother);
SetMother(pMother);
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicalVolumeStore.cc,v 1.9 2002/04/26 16:24:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4PhysicalVolumeStore
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4SmartVoxelHeader.cc,v 1.20 2002/05/17 17:59:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// class G4SmartVoxelHeader
@@ -22,7 +22,7 @@
//
//
// $Id: G4SmartVoxelNode.cc,v 1.4 2002/04/19 08:20:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// Class G4SmartVoxelNode
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4SmartVoxelProxy.cc,v 1.1 2002/04/19 08:20:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// Class G4SmartVoxelProxy
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4SmartVoxelStat.cc,v 1.1 2001/10/22 16:08:05 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4SolidStore.cc,v 1.9 2002/04/26 16:24:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4SolidStore
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4VPVParameterisation.cc,v 1.3 2001/07/11 09:59:21 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// Default implementations for Parameterisations that do not
// parameterise solid and/or material
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VPhysicalVolume.cc,v 1.4 2001/07/11 09:59:21 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VPhysicalVolume.cc,v 1.5 2002/10/14 07:42:26 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// class G4VPhysicalVolume Implementation
@@ -57,6 +57,11 @@ G4VPhysicalVolume::~G4VPhysicalVolume()
G4PhysicalVolumeStore::DeRegister(this);
}
G4int G4VPhysicalVolume::GetMultiplicity() const
{
return 1;
}
G4RotationMatrix* G4VPhysicalVolume::GetObjectRotation() const
{
static G4RotationMatrix aRotM;
+8 -16
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VSolid.cc,v 1.13 2002/05/11 14:16:10 grichine Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VSolid.cc,v 1.14 2002/10/28 11:25:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// class G4VSolid
//
@@ -67,21 +67,13 @@ G4VSolid::~G4VSolid()
G4SolidStore::GetInstance()->DeRegister(this);
}
////////////////////////////////////////////////////////////////////////
//
// Returns name by value
G4String G4VSolid::GetName() const
//////////////////////////////////////////////////////////////////////////
//
// Streaming operator dumping solid contents
G4std::ostream& operator<< ( G4std::ostream& os, const G4VSolid& e )
{
return fshapeName;
}
/////////////////////////////////////////////////////////////////////////
void G4VSolid::SetName(const G4String& name)
{
fshapeName=name;
}
return e.StreamInfo(os);
}
//////////////////////////////////////////////////////////////////////////
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4VoxelLimits.cc,v 1.7 2002/04/19 08:20:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// class G4VoxelLimits
//