Import Geant4 7.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 12:11:21 +02:00
parent 516dbf1a58
commit d93e1e39a9
5384 changed files with 125662 additions and 82444 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.4 2004/09/13 20:57:01 johna Exp $
# $Id: GNUmakefile,v 1.5 2005/02/15 14:50:36 johna Exp $
name := G4Tree
@@ -24,8 +24,13 @@ CPPFLAGS += -I$(G4BASE)/global/HEPGeometry/include
CPPFLAGS += -I$(G4BASE)/graphics_reps/include
CPPFLAGS += -I$(G4BASE)/intercoms/include
CPPFLAGS += -I$(G4BASE)/geometry/management/include
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/CSG/include
CPPFLAGS += -I$(G4BASE)/geometry/solids/specific/include
CPPFLAGS += -I$(G4BASE)/materials/include
CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
CPPFLAGS += -I$(G4BASE)/digits_hits/detector/include
CPPFLAGS += -I$(G4BASE)/track/include
CPPFLAGS += -I$(G4BASE)/particles/management/include
include $(G4INSTALL)/config/common.gmk
@@ -22,7 +22,7 @@
//
//
// $Id: G4ASCIITree.hh,v 1.6 2004/09/13 20:52:50 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITreeMessenger.hh,v 1.5 2004/09/13 20:52:52 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4ASCIITreeMessenger.hh,v 1.6 2005/05/06 08:38:36 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -35,6 +35,8 @@
#include "G4UImessenger.hh"
#include <vector>
class G4ASCIITree;
class G4UIcommand;
class G4UIcmdWithAnInteger;
@@ -46,6 +48,7 @@ public:
virtual ~G4ASCIITreeMessenger();
G4String GetCurrentValue (G4UIcommand* command);
void SetNewValue (G4UIcommand* command, G4String newValue);
static std::vector<G4String> fVerbosityGuidance;
private:
G4ASCIITree* fpASCIITree;
G4UIcommand* fpDirectory;
@@ -22,7 +22,7 @@
//
//
// $Id: G4ASCIITreeSceneHandler.hh,v 1.12 2004/09/13 20:57:10 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -22,7 +22,7 @@
//
//
// $Id: G4ASCIITreeViewer.hh,v 1.4 2001/07/11 10:09:06 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VTree.hh,v 1.4 2001/07/11 10:09:07 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VTreeSceneHandler.hh,v 1.12 2004/11/11 16:03:41 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4VTreeSceneHandler.hh,v 1.14 2005/06/02 17:43:46 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -45,9 +45,9 @@ public:
G4VTreeSceneHandler(G4VGraphicsSystem& system,
const G4String& name);
virtual ~G4VTreeSceneHandler ();
void PreAddThis (const G4Transform3D& objectTransformation,
void PreAddSolid (const G4Transform3D& objectTransformation,
const G4VisAttributes&);
void PostAddThis ();
void PostAddSolid ();
////////////////////////////////////////////////////////////////
// Functions not used but required by the abstract interface.
@@ -66,13 +66,10 @@ public:
virtual void BeginModeling();
virtual void EndModeling();
static G4int GetSceneCount();
protected:
// In the derived class, override G4VScenehandler::RequestPrimitives
// to implement dump of the geometry hierarchy.
static G4int fSceneIdCount; // Counter for Tree scene handlers.
static G4int fSceneCount; // No. of extanct scene handlers.
const G4Transform3D* fpCurrentObjectTransformation;
};
@@ -21,21 +21,17 @@
// ********************************************************************
//
//
// $Id: G4VTreeSceneHandler.icc,v 1.4 2001/07/11 10:09:07 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4VTreeSceneHandler.icc,v 1.6 2005/06/02 17:43:46 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 18th May 2000
// An artificial graphics scene to find dump geometry hierarchy.
inline G4int G4VTreeSceneHandler::GetSceneCount() {
return fSceneCount;
}
inline void G4VTreeSceneHandler::PreAddThis
inline void G4VTreeSceneHandler::PreAddSolid
(const G4Transform3D& objectTransformation,
const G4VisAttributes&) {
fpCurrentObjectTransformation = &objectTransformation;
}
inline void G4VTreeSceneHandler::PostAddThis () {}
inline void G4VTreeSceneHandler::PostAddSolid () {}
@@ -22,7 +22,7 @@
//
//
// $Id: G4VTreeViewer.hh,v 1.4 2001/07/11 10:09:07 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
+2 -4
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITree.cc,v 1.8 2004/09/13 20:52:54 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4ASCIITree.cc,v 1.9 2005/06/02 17:43:46 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -51,8 +51,6 @@ G4ASCIITree::~G4ASCIITree () {
G4VSceneHandler* G4ASCIITree::CreateSceneHandler (const G4String& name) {
G4VSceneHandler* pScene = new G4ASCIITreeSceneHandler (*this, name);
G4cout << G4ASCIITreeSceneHandler::GetSceneCount ()
<< ' ' << fName << " scene handlers extanct." << G4endl;
return pScene;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITreeMessenger.cc,v 1.8 2004/09/22 20:01:18 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4ASCIITreeMessenger.cc,v 1.13 2005/05/06 08:38:36 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -37,10 +37,13 @@
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithAString.hh"
std::vector<G4String> G4ASCIITreeMessenger::fVerbosityGuidance;
G4ASCIITreeMessenger::G4ASCIITreeMessenger
(G4ASCIITree* ASCIITree):
fpASCIITree(ASCIITree) {
G4bool omitable, currentAsDefault;
G4bool omitable;
fpDirectory = new G4UIdirectory ("/vis/ASCIITree/");
fpDirectory -> SetGuidance ("Commands for ASCIITree control.");
@@ -49,19 +52,55 @@ G4ASCIITreeMessenger::G4ASCIITreeMessenger
fpDirectorySet -> SetGuidance ("Settings for ASCIITree control.");
fpCommandVerbose = new G4UIcmdWithAnInteger ("/vis/ASCIITree/verbose", this);
fpCommandVerbose -> SetGuidance ("/vis/ASCIITree/verbose [<verbosity>]");
fpCommandVerbose -> SetGuidance
("0 (default) mimimum - 10 maximum printing.");
fpCommandVerbose -> SetParameterName ("verbosity",
omitable = true,
currentAsDefault = false);
fVerbosityGuidance.push_back
("< 10: - does not print daughters of repeated placements,"
" does not repeat replicas.");
fVerbosityGuidance.push_back
(">= 10: prints all physical volumes.");
fVerbosityGuidance.push_back
("The level of detail is given by the units (verbosity%10):");
fVerbosityGuidance.push_back
(">= 0: prints physical volume name.");
fVerbosityGuidance.push_back
(">= 1: prints logical volume name (and names of sensitive detector"
" and readout geometry, if any).");
fVerbosityGuidance.push_back
(">= 2: prints solid name and type.");
fVerbosityGuidance.push_back
(">= 3: prints volume and density.");
fVerbosityGuidance.push_back
(">= 4: prints mass of each top physical volume in scene to depth specified.");
fVerbosityGuidance.push_back
(">= 5: prints mass of branch at each volume (can be time consuming).");
fVerbosityGuidance.push_back
("Note: by default, culling is switched off so all volumes are seen.");
fVerbosityGuidance.push_back
("Note: the mass calculation takes into account daughters, normally"
" to unlimited depth, which can be time consuuming. If you want the"
" mass of a particular subtree to a particular depth:");
fVerbosityGuidance.push_back
(" /vis/open ATree");
fVerbosityGuidance.push_back
(" /vis/ASCIITree/verbose 14");
fVerbosityGuidance.push_back
(" /vis/scene/create");
fVerbosityGuidance.push_back
(" /vis/scene/add/volume <subtree-physical-volume> ! <depth>");
fVerbosityGuidance.push_back
(" /vis/sceneHandler/attach");
fVerbosityGuidance.push_back
(" /vis/viewer/flush");
for (size_t i = 0; i < fVerbosityGuidance.size(); ++i) {
fpCommandVerbose -> SetGuidance(fVerbosityGuidance[i]);
}
fpCommandVerbose -> SetParameterName ("verbosity",omitable = true);
fpCommandVerbose -> SetDefaultValue(0);
fpCommandSetOutFile = new G4UIcmdWithAString ("/vis/ASCIITree/set/outFile", this
);
fpCommandSetOutFile -> SetGuidance
("/vis/ASCIITree/set/OutFile <out-filename>");
fpCommandSetOutFile -> SetGuidance ("Set name of output file.");
fpCommandSetOutFile -> SetParameterName ("out-filename",
omitable = true,
currentAsDefault = false);
omitable = true);
fpCommandSetOutFile -> SetDefaultValue ("G4cout");
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITreeSceneHandler.cc,v 1.16 2004/11/11 16:03:15 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4ASCIITreeSceneHandler.cc,v 1.20 2005/05/06 08:38:36 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -32,6 +32,7 @@
#include "G4ASCIITreeSceneHandler.hh"
#include "G4ASCIITree.hh"
#include "G4ASCIITreeMessenger.hh"
#include "G4VSolid.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4VPhysicalVolume.hh"
@@ -43,6 +44,8 @@
#include "G4Scene.hh"
#include "G4ModelingParameters.hh"
#include "G4PhysicalVolumeMassScene.hh"
#include "G4VSensitiveDetector.hh"
#include "G4VReadOutGeometry.hh"
G4ASCIITreeSceneHandler::G4ASCIITreeSceneHandler
(G4VGraphicsSystem& system,
@@ -87,36 +90,20 @@ void G4ASCIITreeSceneHandler::WriteHeader (std::ostream& os)
const G4ASCIITree* pSystem = (G4ASCIITree*)GetGraphicsSystem();
const G4int verbosity = pSystem->GetVerbosity();
const G4int detail = verbosity % 10;
os <<
"# Set verbosity with \"/vis/ASCIITree/verbose <verbosity>\":"
"\n# < 10: - does not print daughters of repeated placements."
"\n# - does not repeat replicas."
"\n# >= 10: prints all physical volumes."
"\n# The level of detail is given by the units (verbosity%10):"
"\n# >= 0: prints physical volume name."
"\n# >= 1: prints logical volume name."
"\n# >= 2: prints solid name and type."
"\n# >= 3: prints volume and density of solid."
"\n# >= 4: calculates and prints mass(es) of volume(s) in scene."
"\n# Note: by default, culling is switched off so all volumes are seen.";
if (detail >=4) {
os <<
"\n# Note: the mass is calculated for each physical volume in the scene,"
"\n# taking into account daughters up to the depth specified. Culling "
"\n# is ignored. If you want the mass of a particular subtree:"
"\n# /vis/drawVolume <name-of-physical-volume-at-top-of-subtree>"
"\n# /vis/viewer/flush";
os << "# Set verbosity with \"/vis/ASCIITree/verbose <verbosity>\":";
for (size_t i = 0;
i < G4ASCIITreeMessenger::fVerbosityGuidance.size(); ++i) {
os << "\n# " << G4ASCIITreeMessenger::fVerbosityGuidance[i];
}
os << "\n# Now printing with verbosity " << verbosity;
os << "\n# Format is: PV:n";
if (detail >= 1) os << " / LV";
if (detail >= 1) os << " / LV (SD,RO)";
if (detail >= 2) os << " / Solid(type)";
if (detail >= 3) os << ", volume, density";
os << "\n# where PV = Physical Volume";
if (detail <2) os << " and"; else os << ",";
os << " n = copy number";
if (detail >= 2) os << " and LV = Logical Volume";
if (detail >= 5) os << ", mass of branch";
os <<
"\n# Abbreviations: PV = Physical Volume, LV = Logical Volume,"
"\n# SD = Sensitive Detector, RO = Read Out Geometry.";
}
void G4ASCIITreeSceneHandler::EndModeling () {
@@ -147,12 +134,12 @@ void G4ASCIITreeSceneHandler::EndModeling () {
<< pvModel->GetTopPhysicalVolume()->GetCopyNo()
<< ", is "
<< G4BestUnit (volume, "Volume")
<< "\nMass of tree to ";
<< "\nMass of tree";
G4int requestedDepth = pvModel->GetRequestedDepth();
if (requestedDepth == G4PhysicalVolumeModel::UNLIMITED) {
G4cout << "unlimited depth";
} else {
G4cout << "depth " << requestedDepth;
if (requestedDepth != G4PhysicalVolumeModel::UNLIMITED) {
G4cout << ", ignoring daughters at depth "
<< requestedDepth
<< " and below,";
}
G4cout << " is " << G4BestUnit (mass, "Mass")
<< G4endl;
@@ -200,48 +187,59 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
}
// Print indented text...
for (G4int i = 0; i < fCurrentDepth; i++ ) *fpOutFile << " ";
if (fpCurrentPV) {
for (G4int i = 0; i < fCurrentDepth; i++ ) *fpOutFile << " ";
*fpOutFile << "\"" << fpCurrentPV->GetName()
<< "\":" << fpCurrentPV->GetCopyNo();
*fpOutFile << "\"" << fpCurrentPV->GetName()
<< "\":" << fpCurrentPV->GetCopyNo();
if (fpCurrentPV->IsReplicated()) {
if (verbosity < 10) {
// Add printing for replicas (when replicas are ignored)...
EAxis axis;
G4int nReplicas;
G4double width;
G4double offset;
G4bool consuming;
fpCurrentPV->GetReplicationData(axis,nReplicas,width,offset,consuming);
G4VPVParameterisation* pP = fpCurrentPV->GetParameterisation();
if (pP) {
if (detail < 3) {
if (fpCurrentPV->IsReplicated()) {
if (verbosity < 10) {
// Add printing for replicas (when replicas are ignored)...
EAxis axis;
G4int nReplicas;
G4double width;
G4double offset;
G4bool consuming;
fpCurrentPV->GetReplicationData(axis,nReplicas,width,offset,consuming);
G4VPVParameterisation* pP = fpCurrentPV->GetParameterisation();
if (pP) {
if (detail < 3) {
fReplicaSet.insert(fpCurrentPV);
*fpOutFile << " (" << nReplicas << " parametrised volumes)";
}
}
else {
fReplicaSet.insert(fpCurrentPV);
*fpOutFile << " (" << nReplicas << " parametrised volumes)";
*fpOutFile << " (" << nReplicas << " replicas)";
}
}
else {
fReplicaSet.insert(fpCurrentPV);
*fpOutFile << " (" << nReplicas << " replicas)";
}
else {
if (fLVSet.find(fpCurrentLV) != fLVSet.end()) {
if (verbosity < 10) {
// Add printing for repeated placement...
*fpOutFile << " (repeated placement)";
// ...and curtail descent.
((G4PhysicalVolumeModel*)fpModel)->CurtailDescent();
}
}
}
}
else {
if (fLVSet.find(fpCurrentLV) != fLVSet.end()) {
if (verbosity < 10) {
// Add printing for repeated placement...
*fpOutFile << " (repeated placement)";
// ...and curtail descent.
((G4PhysicalVolumeModel*)fpModel)->CurtailDescent();
}
}
}
if (detail >= 1) {
*fpOutFile << " / \""
<< fpCurrentLV->GetName() << "\"";
}
if (detail >= 1) {
*fpOutFile << " / \""
<< fpCurrentLV->GetName() << "\"";
G4VSensitiveDetector* sd = fpCurrentLV->GetSensitiveDetector();
if (sd) {
*fpOutFile << " (SD=\"" << sd->GetName() << "\"";
G4VReadOutGeometry* roGeom = sd->GetROgeometry();
if (roGeom) {
*fpOutFile << ",RO=\"" << roGeom->GetName() << "\"";
}
*fpOutFile << ")";
}
}
} // if (fpCurrentPV)
if (detail >= 2) {
*fpOutFile << " / \""
@@ -250,28 +248,25 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
<< solid.GetEntityType() << ")";
}
if (detail >= 3) {
G4Polyhedron* pPolyhedron = solid.GetPolyhedron();
if (pPolyhedron) {
G4Material* pMaterial;
G4VPVParameterisation* pP = fpCurrentPV->GetParameterisation();
if (pP) {
pMaterial = pP -> ComputeMaterial (fPVPCount++, fpCurrentPV);
} else {
pMaterial = fpCurrentLV->GetMaterial();
}
if (fpCurrentPV) {
if (detail >= 3) {
*fpOutFile << ", "
<< G4BestUnit(pPolyhedron->GetVolume(),"Volume")
<< G4BestUnit(((G4VSolid&)solid).GetCubicVolume(),"Volume")
<< ", "
<< G4BestUnit(pMaterial->GetDensity(), "Volumic Mass");
} else {
*fpOutFile << " (volume not available)";
<< G4BestUnit(fpCurrentMaterial->GetDensity(), "Volumic Mass");
}
}
if (fLVSet.find(fpCurrentLV) == fLVSet.end()) {
fLVSet.insert(fpCurrentLV); // Record new logical volume.
}
if (detail >= 5) {
*fpOutFile << ", "
<< G4BestUnit
(fpCurrentLV->GetMass(fpCurrentPV->IsParameterised(), // Force if so.
fpCurrentMaterial),"Mass");
}
if (fLVSet.find(fpCurrentLV) == fLVSet.end()) {
fLVSet.insert(fpCurrentLV); // Record new logical volume.
}
} // if (fpCurrentPV)
if (outFileName == "G4cout") {
G4cout << G4endl;
@@ -22,7 +22,7 @@
//
//
// $Id: G4ASCIITreeViewer.cc,v 1.6 2003/06/16 17:13:50 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
#include "G4ASCIITreeViewer.hh"
@@ -43,8 +43,6 @@ G4GAGTree::~G4GAGTree () {
G4VSceneHandler* G4GAGTree::CreateSceneHandler (const G4String& name) {
G4VSceneHandler* pScene = new G4GAGTreeSceneHandler (*this, name);
G4cout << G4GAGTreeSceneHandler::GetSceneCount ()
<< ' ' << fName << " scene handlers extanct." << G4endl;
return pScene;
}
@@ -132,6 +132,9 @@ void G4GAGTreeSceneHandler::EndModeling ()
void G4GAGTreeSceneHandler::RequestPrimitives (const G4VSolid&)
{
// Protection if solid drawn not from physical volume tree...(JA)
if (!fpCurrentPV) return;
//////////////////////////////
G4String cur_abs_pv_name ;
G4String pv_name_tmp ;
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VTree.cc,v 1.4 2001/07/11 10:09:08 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VTreeSceneHandler.cc,v 1.8 2004/11/11 16:03:53 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4VTreeSceneHandler.cc,v 1.9 2005/06/02 17:43:47 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -40,16 +40,11 @@
G4int G4VTreeSceneHandler::fSceneIdCount = 0;
// Counter for Tree scene handlers.
G4int G4VTreeSceneHandler::fSceneCount = 0;
// No. of extanct scene handlers.
G4VTreeSceneHandler::G4VTreeSceneHandler(G4VGraphicsSystem& system,
const G4String& name):
G4VSceneHandler(system, fSceneIdCount++, name),
fpCurrentObjectTransformation (0)
{
fSceneCount++;
}
{}
G4VTreeSceneHandler::~G4VTreeSceneHandler () {}
@@ -22,7 +22,7 @@
//
//
// $Id: G4VTreeViewer.cc,v 1.5 2003/06/16 17:13:53 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
#include "G4VTreeViewer.hh"