Import Geant4 1.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:34:16 +02:00
parent ca1c8cb059
commit 103bda00c8
2654 changed files with 29719 additions and 20203 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4BoundingSphereScene.cc,v 1.2.8.1 1999/12/07 20:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4BoundingSphereScene.cc,v 1.3 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 7th June 1997
@@ -38,7 +38,7 @@ void G4BoundingSphereScene::Accrue (const G4VSolid& solid) {
AccrueBoundingSphere (thisCentre, thisRadius);
/***********************************************
G4cout << "G4BoundingSphereScene::Accrue: centre: " << fCentre
<< ", radius: " << fRadius << endl;
<< ", radius: " << fRadius << G4endl;
***********************************************/
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FlavoredParallelWorldModel.cc,v 1.3.8.1 1999/12/07 20:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4FlavoredParallelWorldModel.cc,v 1.4 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HitsModel.cc,v 1.3.8.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4HitsModel.cc,v 1.4 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 26th August 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalVolumeModel.cc,v 1.1.6.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LogicalVolumeModel.cc,v 1.4 2000/01/17 10:34:48 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 26th July 1999.
@@ -18,7 +18,7 @@
#include "G4PVPlacement.hh"
#include "G4ModelingParameters.hh"
#include "G4VGraphicsScene.hh"
////////////////#include "G4DrawVoxels.hh"
#include "G4DrawVoxels.hh"
G4LogicalVolumeModel::G4LogicalVolumeModel
(G4LogicalVolume* pLV,
@@ -63,23 +63,21 @@ void G4LogicalVolumeModel::DescribeYourselfTo
G4ModelingParameters nonCulledMP (*fpMP);
nonCulledMP.SetCulling (false);
fpMP = &nonCulledMP;
G4PhysicalVolumeModel::DescribeYourselfTo (sceneHandler);
fpMP = tpMP;
/*****************************
// Add Voxels.
G4DrawVoxels dv;
G4PlacedPolyhedronList* pPPL =
dv.CreatePlacedPolyhedra (fpTopPV -> GetLogicalVolume ());
for (int i = 0; i < pPPL -> entries (); i++) {
const G4Transform3D& transform = (*pPPL)[i].GetTransform ();
const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron ();
sceneHandler.BeginPrimitives (transform);
sceneHandler.AddPrimitive (polyhedron);
sceneHandler.EndPrimitives ();
if (fpTopPV -> GetLogicalVolume () -> GetVoxelHeader ()) {
// Add Voxels.
G4DrawVoxels dv;
G4PlacedPolyhedronList* pPPL =
dv.CreatePlacedPolyhedra (fpTopPV -> GetLogicalVolume ());
for (int i = 0; i < pPPL -> entries (); i++) {
const G4Transform3D& transform = (*pPPL)[i].GetTransform ();
const G4Polyhedron& polyhedron = (*pPPL)[i].GetPolyhedron ();
sceneHandler.BeginPrimitives (transform);
sceneHandler.AddPrimitive (polyhedron);
sceneHandler.EndPrimitives ();
}
delete pPPL;
}
delete pPPL;
*********************************/
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ModelingParameters.cc,v 1.3.8.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4ModelingParameters.cc,v 1.4 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 31st December 1997.
@@ -86,14 +86,14 @@ void G4ModelingParameters::SetVisibleDensity (G4double visibleDensity) {
const G4double reasonableMaximum = 10.0 * g / cm3;
if (visibleDensity < 0) {
G4cout << "G4ModelingParameters::SetVisibleDensity: attempt to set negative "
"density - ignored." << endl;
"density - ignored." << G4endl;
}
else {
if (fVisibleDensity > reasonableMaximum) {
G4cout << "G4ModelingParameters::SetVisibleDensity: density > "
<< reasonableMaximum
<< " g / cm3 - did you mean this?"
<< endl;
<< G4endl;
}
fVisibleDensity = visibleDensity;
}
@@ -105,7 +105,7 @@ void G4ModelingParameters::SetNoOfSides (G4int nSides) {
nSides = nSidesMin;
G4cout << "G4ModelingParameters::SetNoOfSides: attempt to set the"
"\nnumber of sides per circle < " << nSidesMin
<< "; forced to" << nSides << endl;
<< "; forced to" << nSides << G4endl;
}
fNoOfSides = nSides;
}
@@ -125,10 +125,10 @@ void G4ModelingParameters::PrintDifferences
(fViewGeom != that.fViewGeom) ||
(fViewHits != that.fViewHits) ||
(fViewDigis != that.fViewDigis))
G4cout << "Difference in 1st batch." << endl;
G4cout << "Difference in 1st batch." << G4endl;
}
ostream& operator << (ostream& os, const G4ModelingParameters& mp) {
G4std::ostream& operator << (G4std::ostream& os, const G4ModelingParameters& mp) {
os << "Modeling parameters and options:";
os << "\n Default vis. attributes: " << *mp.fpDefaultVisAttributes;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NullModel.cc,v 1.2.8.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4NullModel.cc,v 1.3 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 4th April 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicalVolumeModel.cc,v 1.6.2.1 1999/12/07 20:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PhysicalVolumeModel.cc,v 1.8 2000/01/11 17:19:07 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 31st December 1997.
@@ -28,11 +28,7 @@
#include "G4PhysicalVolumeSearchScene.hh"
#include "G4TransportationManager.hh"
#ifdef WIN32
#include <strstrea.h>
#else
#include <strstream.h>
#endif
#include "g4std/strstream"
G4PhysicalVolumeModel::G4PhysicalVolumeModel
(G4VPhysicalVolume* pVPV,
@@ -53,8 +49,8 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
fppCurrentLV (0)
{
const int len = 8; char a [len];
ostrstream o (a, len); o.seekp (ios::beg);
o << fpTopPV -> GetCopyNo () << ends;
G4std::ostrstream o (a, len); o.seekp (G4std::ios::beg);
o << fpTopPV -> GetCopyNo () << G4std::ends;
fGlobalTag = fpTopPV -> GetName () + "." + a;
fGlobalDescription = "G4PhysicalVolumeModel " + fGlobalTag;
@@ -123,9 +119,9 @@ void G4PhysicalVolumeModel::DescribeYourselfTo
G4String G4PhysicalVolumeModel::GetCurrentTag () const {
const int len = 8; char a [len];
ostrstream o (a, len); o.seekp (ios::beg);
G4std::ostrstream o (a, len); o.seekp (G4std::ios::beg);
if (fpCurrentPV) {
o << fpCurrentPV -> GetCopyNo () << ends;
o << fpCurrentPV -> GetCopyNo () << G4std::ends;
return fpCurrentPV -> GetName () + "." + a;
}
else {
@@ -242,7 +238,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
"G4PhysicalVolumeModel::VisitGeometryAndGetVisReps: WARNING:"
"\n built-in replicated volumes replicated in radius are not yet"
"\n properly visualizable."
<< endl;
<< G4endl;
break;
case kPhi:
rotation.rotateZ (-(offset+n*width));
@@ -302,7 +298,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
<< rotation.thetaZ() << ", "
<< rotation.phiZ();
G4cout << "\n Translation: " << theNewAT.getTranslation();
G4cout << endl;
G4cout << G4endl;
**********************************************************/
// Make decision to Draw.
@@ -310,7 +306,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
if (thisToBeDrawn) {
const G4VisAttributes* pVisAttribs = pLV -> GetVisAttributes ();
if (!pVisAttribs) pVisAttribs = fpMP -> GetDefaultVisAttributes ();
DescribeSolids (theNewAT, pSol, pVisAttribs, sceneHandler);
DescribeSolid (theNewAT, pSol, pVisAttribs, sceneHandler);
}
// First check if mother covers...
@@ -337,32 +333,36 @@ void G4PhysicalVolumeModel::DescribeAndDescend
}
}
void G4PhysicalVolumeModel::DescribeSolids
void G4PhysicalVolumeModel::DescribeSolid
(const G4Transform3D& theAT,
G4VSolid* pSol,
const G4VisAttributes* pVisAttribs,
G4VGraphicsScene& sceneHandler) {
// Look for "constituents". Could be a Boolean solid.
G4VSolid* pBoolSolA = pSol -> GetConstituentSolid (0);
if (pBoolSolA) {
// Boolean solid - display components...
DescribeSolids (theAT, pBoolSolA, pVisAttribs, sceneHandler);
G4VSolid* pBoolSolB = pSol -> GetConstituentSolid (1);
if (!pBoolSolB) {
G4VSolid* pSol0 = pSol -> GetConstituentSolid (0);
if (pSol0) {
// Composite solid - describe components...
DescribeSolid (theAT, pSol0, pVisAttribs, sceneHandler);
G4VSolid* pSol1 = pSol -> GetConstituentSolid (1);
if (!pSol1) {
G4Exception
("G4PhysicalVolumeModel::DescribeSolids:"
("G4PhysicalVolumeModel::DescribeSolid:"
" 2nd component solid is missing.");
}
G4Transform3D theBT (theAT);
G4DisplacedSolid* pDisSol = pBoolSolB -> GetDisplacedSolidPtr ();
if (pDisSol) {
theBT = theBT * G4Transform3D (pDisSol -> GetObjectRotation ().inverse (),
pDisSol -> GetObjectTranslation ());
}
DescribeSolids (theBT, pBoolSolB, pVisAttribs, sceneHandler);
DescribeSolid (theAT, pSol1, pVisAttribs, sceneHandler);
}
else { // Non-boolean solid.
sceneHandler.PreAddThis (theAT, *pVisAttribs);
else { // Non-composite solid.
G4DisplacedSolid* pDisSol = pSol -> GetDisplacedSolidPtr ();
if (pDisSol) {
sceneHandler.PreAddThis
(theAT *
G4Transform3D (pDisSol -> GetObjectRotation ().inverse (),
pDisSol -> GetObjectTranslation ()),
*pVisAttribs);
}
else {
sceneHandler.PreAddThis (theAT, *pVisAttribs);
}
pSol -> DescribeYourselfTo (sceneHandler);
sceneHandler.PostAddThis ();
}
@@ -431,7 +431,7 @@ G4bool G4PhysicalVolumeModel::Validate () {
-> GetNavigatorForTracking () -> GetWorldVolume ();
// The idea now is to seek a PV with the same name and copy no
// in the hope it's the same one!!
G4cout << "G4PhysicalVolumeModel::Validate() called." << endl;
G4cout << "G4PhysicalVolumeModel::Validate() called." << G4endl;
G4PhysicalVolumeSearchScene searchScene (fTopPVName, fTopPVCopyNo);
G4PhysicalVolumeModel searchModel (world);
searchModel.DescribeYourselfTo (searchScene);
@@ -442,7 +442,7 @@ G4bool G4PhysicalVolumeModel::Validate () {
<< ") still exists and is being used."
"\n Be warned that this does not necessarily guarantee it's the same"
"\n volume you originally specified in /vis/scene/add/."
<< endl;
<< G4endl;
fpTopPV = foundVolume;
return true;
}
@@ -450,7 +450,7 @@ G4bool G4PhysicalVolumeModel::Validate () {
G4cout << " A volume of the same name and copy number (\""
<< fTopPVName << "\", copy " << fTopPVCopyNo
<< ") no longer exists."
<< endl;
<< G4endl;
return false;
}
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.3.8.1 1999/12/07 20:54:12 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.4 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 10th August 1998.
@@ -45,16 +45,16 @@ void G4PhysicalVolumeSearchScene::FindVolume (const G4VSolid& solid) {
/**************************************************
G4cout << "Required volume: \"" << fRequiredPhysicalVolumeName
<< "\", copy no. " << fRequiredCopyNo << endl;
<< "\", copy no. " << fRequiredCopyNo << G4endl;
G4cout << "PhysicalVolume: \"" << fpCurrentPV -> GetName ()
<< "\", copy no. " << fpCurrentPV -> GetCopyNo () << endl;
<< "\", copy no. " << fpCurrentPV -> GetCopyNo () << G4endl;
*******************************************/
if (fRequiredPhysicalVolumeName == "list") {
for (G4int i = 0; i < fCurrentDepth; i++ ) G4cout << " ";
G4cout << "\"" << fpCurrentPV -> GetName ()
<< "\", copy no. " << fpCurrentPV -> GetCopyNo ()
<< endl;
<< G4endl;
return;
}
@@ -78,7 +78,7 @@ void G4PhysicalVolumeSearchScene::FindVolume (const G4VSolid& solid) {
"\n physical volumes which have different parentage. Besides,"
"\n it's tricky to specify in general; we plan a GUI to do this."
"\n This function gives you access to the first occurrence only."
<< endl;
<< G4endl;
}
}
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrajectoriesModel.cc,v 1.5.8.1 1999/12/07 20:54:12 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4TrajectoriesModel.cc,v 1.6 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 26th August 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VModel.cc,v 1.3.6.1 1999/12/07 20:54:12 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4VModel.cc,v 1.4 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// John Allison 31st December 1997.
@@ -27,7 +27,7 @@ G4VModel::G4VModel (const G4Transform3D& modelTransformation,
G4VModel::~G4VModel () {}
ostream& operator << (ostream& os, const G4VModel& m) {
G4std::ostream& operator << (G4std::ostream& os, const G4VModel& m) {
os << m.fGlobalDescription;
os << "\n Modeling parameters:";
if (m.fpMP) {