Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4BoundingSphereScene.cc,v 2.4 1998/11/23 10:12:16 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4BoundingSphereScene.cc,v 1.2 1999/01/11 00:48:50 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 7th June 1997
@@ -5,21 +5,21 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FlavoredParallelWorldModel.cc,v 2.1 1998/08/22 16:35:04 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4FlavoredParallelWorldModel.cc,v 1.3 1999/04/16 09:05:41 mora Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
#include "G4FlavoredParallelWorldModel.hh"
#include "G4FlavoredParallelWorld.hh"
#include "G4VFlavoredParallelWorld.hh"
#include "G4VisAttributes.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
G4FlavoredParallelWorldModel::G4FlavoredParallelWorldModel
(G4FlavoredParallelWorld* FPW,
(G4VFlavoredParallelWorld* FPW,
G4int soughtDepth,
const G4Transform3D& modelTransformation,
const G4ModelingParameters* mp)
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HitsModel.cc,v 1.2 1998/08/31 15:42:15 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4HitsModel.cc,v 1.3 1999/05/10 14:04:28 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 26th August 1998.
@@ -14,24 +14,29 @@
#include "G4HitsModel.hh"
#include "G4ModelingParameters.hh"
#include "G4RunManager.hh"
#include "G4Event.hh"
#include "G4HCofThisEvent.hh"
G4HitsModel::~G4HitsModel () {}
G4HitsModel::G4HitsModel () {
fGlobalTag = "G4HitsModel for all hits.";
fGlobalDescription = fGlobalTag;
}
void G4HitsModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
G4RunManager* runManager = G4RunManager::GetRunManager ();
const G4Event* event = runManager -> GetCurrentEvent ();
if (event) {
G4HCofThisEvent* HCE = event -> GetHCofThisEvent ();
if (HCE) {
G4int nHC = HCE -> GetCapacity ();
for (int iHC = 0; iHC < nHC; iHC++) {
HCE -> GetHC (iHC) -> DrawAllHits ();
if (fpMP && fpMP -> IsViewHits ()) {
G4RunManager* runManager = G4RunManager::GetRunManager ();
const G4Event* event = runManager -> GetCurrentEvent ();
if (event) {
G4HCofThisEvent* HCE = event -> GetHCofThisEvent ();
if (HCE) {
G4int nHC = HCE -> GetCapacity ();
for (int iHC = 0; iHC < nHC; iHC++) {
HCE -> GetHC (iHC) -> DrawAllHits ();
}
}
}
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ModelingParameters.cc,v 2.2 1998/11/25 16:24:34 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ModelingParameters.cc,v 1.3 1999/05/25 09:14:26 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 31st December 1997.
@@ -25,7 +25,11 @@ G4ModelingParameters::G4ModelingParameters ():
fDensityCulling (false),
fVisibleDensity (0.01 * g / cm3),
fCullCovered (false),
fNoOfSides (24) {}
fNoOfSides (24),
fViewGeom (true),
fViewHits (true),
fViewDigis (true)
{}
G4ModelingParameters::G4ModelingParameters
(const G4VisAttributes* pDefaultVisAttributes,
@@ -35,7 +39,8 @@ G4ModelingParameters::G4ModelingParameters
G4bool isDensityCulling,
G4double visibleDensity,
G4bool isCullingCovered,
G4int noOfSides):
G4int noOfSides
):
fpDefaultVisAttributes (pDefaultVisAttributes),
fRepStyle (repStyle),
fCulling (isCulling),
@@ -43,7 +48,37 @@ G4ModelingParameters::G4ModelingParameters
fDensityCulling (isDensityCulling),
fVisibleDensity (visibleDensity),
fCullCovered (isCullingCovered),
fNoOfSides (noOfSides) {}
fNoOfSides (noOfSides),
fViewGeom (true),
fViewHits (true),
fViewDigis (true)
{}
G4ModelingParameters::G4ModelingParameters
(const G4VisAttributes* pDefaultVisAttributes,
G4ModelingParameters::RepStyle repStyle,
G4bool isCulling,
G4bool isCullingInvisible,
G4bool isDensityCulling,
G4double visibleDensity,
G4bool isCullingCovered,
G4int noOfSides,
G4bool isViewGeom,
G4bool isViewHits,
G4bool isViewDigis
):
fpDefaultVisAttributes (pDefaultVisAttributes),
fRepStyle (repStyle),
fCulling (isCulling),
fCullInvisible (isCullingInvisible),
fDensityCulling (isDensityCulling),
fVisibleDensity (visibleDensity),
fCullCovered (isCullingCovered),
fNoOfSides (noOfSides),
fViewGeom (isViewGeom),
fViewHits (isViewHits),
fViewDigis (isViewDigis)
{}
G4ModelingParameters::~G4ModelingParameters () {}
@@ -86,7 +121,10 @@ void G4ModelingParameters::PrintDifferences
(fDensityCulling != that.fDensityCulling) ||
(fVisibleDensity != that.fVisibleDensity) ||
(fCullCovered != that.fCullCovered) ||
(fNoOfSides != that.fNoOfSides))
(fNoOfSides != that.fNoOfSides) ||
(fViewGeom != that.fViewGeom) ||
(fViewHits != that.fViewHits) ||
(fViewDigis != that.fViewDigis))
G4cout << "Difference in 1st batch." << endl;
}
@@ -128,24 +166,39 @@ ostream& operator << (ostream& os, const G4ModelingParameters& mp) {
os << "\n No. of sides used in circle polygon approximation: "
<< mp.fNoOfSides;
os << "\n View geometry: ";
if (mp.fViewGeom) os << "true";
else os << "false";
os << "\n View hits : ";
if (mp.fViewHits) os << "true";
else os << "false";
os << "\n View digits : ";
if (mp.fViewDigis) os << "true";
else os << "false";
return os;
}
G4bool operator != (const G4ModelingParameters& mp1,
const G4ModelingParameters& mp2) {
G4bool G4ModelingParameters::operator !=
(const G4ModelingParameters& mp) const {
if (
(*mp1.fpDefaultVisAttributes != *mp2.fpDefaultVisAttributes) ||
(mp1.fRepStyle != mp2.fRepStyle) ||
(mp1.fCulling != mp2.fCulling) ||
(mp1.fCullInvisible != mp2.fCullInvisible) ||
(mp1.fDensityCulling != mp2.fDensityCulling) ||
(mp1.fCullCovered != mp2.fCullCovered) ||
(mp1.fNoOfSides != mp2.fNoOfSides))
(*fpDefaultVisAttributes != *mp.fpDefaultVisAttributes) ||
(fRepStyle != mp.fRepStyle) ||
(fCulling != mp.fCulling) ||
(fCullInvisible != mp.fCullInvisible) ||
(fDensityCulling != mp.fDensityCulling) ||
(fCullCovered != mp.fCullCovered) ||
(fNoOfSides != mp.fNoOfSides) ||
(fViewGeom != mp.fViewGeom) ||
(fViewHits != mp.fViewHits) ||
(fViewDigis != mp.fViewDigis))
return true;
if (mp1.fDensityCulling &&
(mp1.fVisibleDensity != mp2.fVisibleDensity)) return true;
if (fDensityCulling &&
(fVisibleDensity != mp.fVisibleDensity)) return true;
return false;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NullModel.cc,v 2.2 1998/08/31 15:42:16 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4NullModel.cc,v 1.2 1999/01/11 00:48:52 allison Exp $
// GEANT4 tag $Name: geant4-00-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 2.6 1998/11/25 16:25:49 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4PhysicalVolumeModel.cc,v 1.3 1999/01/10 13:25:51 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 31st December 1997.
@@ -58,14 +58,17 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
G4BoundingSphereScene bsScene;
const G4ModelingParameters* tempMP = fpMP;
G4ModelingParameters mParams
(0, // No default vis attributes.
(0, // No default vis attributes.
G4ModelingParameters::wireframe,
true, // Global culling.
true, // Cull invisible volumes.
false, // Density culling.
0., // Density (not relevant if density culling false).
true, // Cull daughters of opaque mothers.
24); // No of sides (not relevant for this operation).
true, // Global culling.
true, // Cull invisible volumes.
false, // Density culling.
0., // Density (not relevant if density culling false).
true, // Cull daughters of opaque mothers.
24, // No of sides (not relevant for this operation).
true, // View geometry.
false, // View hits - not relevant for physical volume model.
false); // View digis - not relevant for physical volume model.
fpMP = &mParams;
//bsScene.SetBoundingSphereExtent
// (fpTopPV -> GetLogicalVolume () -> GetSolid () -> GetExtent ());
@@ -76,35 +79,38 @@ G4PhysicalVolumeModel::G4PhysicalVolumeModel
void G4PhysicalVolumeModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
scene.EstablishSpecials (*this);
// See .hh file for explanation of this mechanism.
if (fpMP && fpMP -> IsViewGeom ()) {
fCurrentDepth = 0;
// Store in working space (via pointer to working space).
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
scene.EstablishSpecials (*this);
// See .hh file for explanation of this mechanism.
//G4Transform3D startingTransformation = fTransform;
G4Transform3D startingTransformation;
fCurrentDepth = 0;
// Store in working space (via pointer to working space).
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
VisitGeometryAndGetVisReps (fpTopPV,
fSoughtDepth,
startingTransformation,
scene);
//G4Transform3D startingTransformation = fTransform;
G4Transform3D startingTransformation;
// Clear current data and working space (via pointers to working space).
fCurrentDepth = 0;
fpCurrentPV = 0;
fpCurrentLV = 0;
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
VisitGeometryAndGetVisReps (fpTopPV,
fSoughtDepth,
startingTransformation,
scene);
scene.DecommissionSpecials (*this);
// Clear current data and working space (via pointers to working space).
fCurrentDepth = 0;
fpCurrentPV = 0;
fpCurrentLV = 0;
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
// Clear pointers to working space.
fpCurrentDepth = 0;
fppCurrentPV = 0;
fppCurrentLV = 0;
scene.DecommissionSpecials (*this);
// Clear pointers to working space.
fpCurrentDepth = 0;
fppCurrentPV = 0;
fppCurrentLV = 0;
}
}
G4String G4PhysicalVolumeModel::GetCurrentTag () const {
@@ -301,7 +307,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
// the volumes are visible and opaque, and then only if no sections
// or cutways are in operation.
G4bool cullDaughter = thisToBeDrawn && IsDaughterCulled (pLV);
if (!(thisToBeDrawn && IsDaughterCulled (pLV))) {
if (!cullDaughter) {
// OK, now let's check for daughters...
if (soughtDepth != 0) {
int nDaughters = pLV -> GetNoDaughters ();
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicalVolumeSearchScene.cc,v 2.1 1998/08/22 16:35:06 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.3 1999/02/07 17:23:22 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 10th August 1998.
@@ -42,12 +42,22 @@ void G4PhysicalVolumeSearchScene::EstablishSpecials
}
void G4PhysicalVolumeSearchScene::FindVolume (const G4VSolid& solid) {
/**************************************************
G4cout << "Required volume: \"" << fRequiredPhysicalVolumeName
<< "\", copy no. " << fRequiredCopyNo << endl;
G4cout << "PhysicalVolume: \"" << fpCurrentPV -> GetName ()
<< "\", copy no. " << fpCurrentPV -> GetCopyNo () << endl;
*******************************************/
if (fRequiredPhysicalVolumeName == "list") {
for (G4int i = 0; i < fCurrentDepth; i++ ) G4cout << " ";
G4cout << "\"" << fpCurrentPV -> GetName ()
<< "\", copy no. " << fpCurrentPV -> GetCopyNo ()
<< endl;
return;
}
if (fRequiredPhysicalVolumeName == fpCurrentPV -> GetName () &&
fRequiredCopyNo == fpCurrentPV -> GetCopyNo ()) {
// Current policy - take first one found!!
@@ -70,6 +80,6 @@ void G4PhysicalVolumeSearchScene::FindVolume (const G4VSolid& solid) {
"\n This function gives you access to the first occurrence only."
<< endl;
}
}
}
}
}
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrajectoriesModel.cc,v 1.2 1998/08/31 15:42:18 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4TrajectoriesModel.cc,v 1.5 1999/05/26 02:11:42 stanaka Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 26th August 1998.
@@ -17,6 +17,8 @@
#include "G4RunManager.hh"
#include "G4Event.hh"
G4TrajectoriesModel::~G4TrajectoriesModel () {}
G4TrajectoriesModel::G4TrajectoriesModel () {
fGlobalTag = "G4TrajectoriesModel for all trajectories.";
fGlobalDescription = fGlobalTag;
@@ -30,7 +32,11 @@ void G4TrajectoriesModel::DescribeYourselfTo (G4VGraphicsScene& scene) {
if (TC) {
G4int nT = TC -> entries ();
for (int iT = 0; iT < nT; iT++) {
(*TC) [iT] -> DrawTrajectory (50);
// GB : default representation should be the most efficent one.
// Representation with a circle at each step should be an option
// choosable from a command.
// (*TC) [iT] -> DrawTrajectory (50);
(*TC) [iT] -> DrawTrajectory ();
}
}
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VModel.cc,v 2.2 1998/08/22 16:34:30 allison Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VModel.cc,v 1.2 1999/01/11 00:48:54 allison Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// John Allison 31st December 1997.