Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AxesModel.cc,v 1.5 2001/08/14 18:43:29 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 3rd April 2001
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4BoundingSphereScene.cc,v 1.8 2001/07/25 21:10:22 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 7th June 1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FlavoredParallelWorldModel.cc,v 1.6 2002/11/20 17:21:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// P. Mora de Freitas et M.Verderi - 19 June 1998.
|
||||
// Model for flavored parallel world volumes.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HitsModel.cc,v 1.9 2002/10/24 15:07:21 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LogicalVolumeModel.cc,v 1.9 2003/11/03 17:08:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th July 1999.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ModelingParameters.cc,v 1.6 2003/06/16 17:14:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4NullModel.cc,v 1.7 2003/05/30 13:01:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 4th April 1998.
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeMassScene.cc,v 1.3 2004/11/11 16:06:49 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 10th August 1998.
|
||||
// An artificial scene to find physical volumes.
|
||||
|
||||
#include "G4PhysicalVolumeMassScene.hh"
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4Vector3D.hh"
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Polyhedron.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
G4PhysicalVolumeMassScene::G4PhysicalVolumeMassScene ():
|
||||
fVolume (0.),
|
||||
fMass (0.),
|
||||
fpLastPV (0),
|
||||
fPVPCount (0),
|
||||
fLastDepth (0),
|
||||
fLastDensity (0.),
|
||||
fCurrentDepth (0),
|
||||
fpCurrentPV (0),
|
||||
fpCurrentLV (0)
|
||||
{}
|
||||
|
||||
G4PhysicalVolumeMassScene::~G4PhysicalVolumeMassScene () {}
|
||||
|
||||
void G4PhysicalVolumeMassScene::EstablishSpecials
|
||||
(G4PhysicalVolumeModel& pvModel) {
|
||||
pvModel.DefinePointersToWorkingSpace (&fCurrentDepth,
|
||||
&fpCurrentPV,
|
||||
&fpCurrentLV);
|
||||
}
|
||||
|
||||
void G4PhysicalVolumeMassScene::Reset ()
|
||||
{
|
||||
fVolume = 0.;
|
||||
fMass = 0.;
|
||||
fpLastPV = 0;
|
||||
fPVPCount = 0;
|
||||
fLastDepth = 0;
|
||||
fLastDensity = 0.;
|
||||
fDensityStack.clear();
|
||||
fCurrentDepth = 0;
|
||||
fpCurrentPV = 0;
|
||||
fpCurrentLV = 0;
|
||||
|
||||
}
|
||||
|
||||
void G4PhysicalVolumeMassScene::AccrueMass (const G4VSolid& solid)
|
||||
{
|
||||
if (fpCurrentPV != fpLastPV) {
|
||||
fpLastPV = fpCurrentPV;
|
||||
fPVPCount = 0;
|
||||
}
|
||||
|
||||
G4double currentVolume;
|
||||
G4double currentDensity;
|
||||
G4Polyhedron* pPolyhedron = solid.GetPolyhedron();
|
||||
if (pPolyhedron) {
|
||||
G4Material* pMaterial;
|
||||
G4VPVParameterisation* pP = fpCurrentPV->GetParameterisation();
|
||||
if (pP) {
|
||||
pMaterial = pP -> ComputeMaterial (fPVPCount++, fpCurrentPV);
|
||||
} else {
|
||||
pMaterial = fpCurrentLV->GetMaterial();
|
||||
}
|
||||
currentVolume = pPolyhedron->GetVolume();
|
||||
currentDensity = pMaterial->GetDensity();
|
||||
} else {
|
||||
G4cout <<
|
||||
"G4PhysicalVolumeMassScene::AccrueMass: WARNING:"
|
||||
"\n No G4Polyhedron for" << solid.GetEntityType() <<
|
||||
". \"" << solid.GetName() << "\" will not be accounted."
|
||||
"\n It will be as though not there, i.e., the density as its mother."
|
||||
"\n Its daughters will still be found and accounted."
|
||||
<< G4endl;
|
||||
currentVolume = 0.;
|
||||
currentDensity = 0.;
|
||||
}
|
||||
|
||||
if (fCurrentDepth == 0) fVolume = currentVolume;
|
||||
|
||||
if (fCurrentDepth > fLastDepth) {
|
||||
fDensityStack.push_back (fLastDensity);
|
||||
} else if (fCurrentDepth < fLastDepth) {
|
||||
fDensityStack.pop_back();
|
||||
}
|
||||
fLastDepth = fCurrentDepth;
|
||||
fLastDensity = currentDensity;
|
||||
G4double motherDensity = 0.;
|
||||
if (fCurrentDepth > 0) motherDensity = fDensityStack.back();
|
||||
|
||||
G4double subtractedMass = currentVolume * motherDensity;
|
||||
G4double addedMass = currentVolume * currentDensity;
|
||||
fMass -= subtractedMass;
|
||||
fMass += addedMass;
|
||||
/* Debug
|
||||
G4cout << "current vol = "
|
||||
<< G4BestUnit (currentVolume,"Volume")
|
||||
<< ", current density = "
|
||||
<< G4BestUnit (currentDensity, "Volumic Mass")
|
||||
<< ", mother density = "
|
||||
<< G4BestUnit (motherDensity, "Volumic Mass")
|
||||
<< G4endl;
|
||||
G4cout << "Subtracted mass = " << G4BestUnit (subtractedMass, "Mass")
|
||||
<< ", added mass = " << G4BestUnit (addedMass, "Mass")
|
||||
<< ", new mass = " << G4BestUnit (fMass, "Mass")
|
||||
<< G4endl;
|
||||
*/
|
||||
if (fMass < 0.) {
|
||||
G4cout <<
|
||||
"G4PhysicalVolumeMassScene::AccrueMass: WARNING:"
|
||||
"\n Mass going negative for \""
|
||||
<< fpCurrentPV->GetName() <<
|
||||
"\", copy "
|
||||
<< fpCurrentPV->GetCopyNo() <<
|
||||
". Larger than mother?"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeModel.cc,v 1.23 2003/11/12 13:05:10 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4PhysicalVolumeModel.cc,v 1.25 2004/09/22 19:50:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
@@ -99,6 +99,9 @@ void G4PhysicalVolumeModel::CalculateExtent () {
|
||||
fpMP = &mParams;
|
||||
DescribeYourselfTo (bsScene);
|
||||
fExtent = bsScene.GetBoundingSphereExtent ();
|
||||
if (!(fExtent.GetXmin() < fExtent.GetXmax())) {
|
||||
fExtent = fpTopPV -> GetLogicalVolume () -> GetSolid () -> GetExtent ();
|
||||
}
|
||||
fpMP = tempMP;
|
||||
fRequestedDepth = tempRequestedDepth;
|
||||
}
|
||||
@@ -298,9 +301,9 @@ void G4PhysicalVolumeModel::DescribeAndDescend
|
||||
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
|
||||
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
|
||||
|
||||
const HepRotation* pObjectRotation = pVPV -> GetObjectRotation ();
|
||||
const Hep3Vector& translation = pVPV -> GetTranslation ();
|
||||
G4Transform3D theLT (G4Transform3D (*pObjectRotation, translation));
|
||||
const G4RotationMatrix objectRotation = pVPV -> GetObjectRotationValue ();
|
||||
const G4ThreeVector& translation = pVPV -> GetTranslation ();
|
||||
G4Transform3D theLT (G4Transform3D (objectRotation, translation));
|
||||
|
||||
// Compute the accumulated transformation...
|
||||
// Note that top volume's transformation relative to the world
|
||||
@@ -317,7 +320,7 @@ void G4PhysicalVolumeModel::DescribeAndDescend
|
||||
<< pVPV -> GetName () << "." << pVPV -> GetCopyNo ();
|
||||
G4cout << "\n theAT: ";
|
||||
G4cout << "\n Rotation: ";
|
||||
HepRotation rotation = theAT.getRotation ();
|
||||
G4RotationMatrix rotation = theAT.getRotation ();
|
||||
G4cout << rotation.thetaX() << ", "
|
||||
<< rotation.phiX() << ", "
|
||||
<< rotation.thetaY() << ", "
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.7 2003/05/30 13:01:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 10th August 1998.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ScaleModel.cc,v 1.3 2001/08/14 18:43:31 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 21st July 2001.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TextModel.cc,v 1.4 2001/08/14 18:43:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 3rd April 2001
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoriesModel.cc,v 1.12 2002/11/11 18:39:28 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 26th August 1998.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VModel.cc,v 1.9 2003/06/16 17:14:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 31st December 1997.
|
||||
|
||||
Reference in New Issue
Block a user