Import Geant4 10.4.2 source tree
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
$Id: History 99076 2016-09-01 12:40:47Z gcosmo $
|
||||
$Id: History 110130 2018-05-16 06:43:10Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -25,6 +25,12 @@ committal in the CVS repository !
|
||||
History file for visualization/Tree sub-category
|
||||
------------------------------------------------
|
||||
|
||||
11th March 2018 John Allison (vistree-V10-03-00)
|
||||
- G4ASCIITreeSceneHandler.cc:
|
||||
o Fix bug in suppressed writing of repeated parameterised volumes.
|
||||
- G4ASCIITreeMessenger.cc:
|
||||
o Improve command guidance and advice printing.
|
||||
|
||||
31st August 2016 John Allison (vistree-V10-02-02)
|
||||
- G4ASCIITreeSceneHandler.cc:
|
||||
o Overall mass(es) now calculated for any specified top volume,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ASCIITreeMessenger.cc 99076 2016-09-01 12:40:47Z gcosmo $
|
||||
// $Id: G4ASCIITreeMessenger.cc 110130 2018-05-16 06:43:10Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
@@ -55,14 +55,11 @@ fpASCIITree(ASCIITree) {
|
||||
|
||||
fpCommandVerbose = new G4UIcmdWithAnInteger ("/vis/ASCIITree/verbose", this);
|
||||
fVerbosityGuidance.push_back
|
||||
(" < 10: - does not print daughters of repeated placements,"
|
||||
" does not repeat replicas.");
|
||||
(" < 10: notifies but does not print details of repeated volumes.");
|
||||
fVerbosityGuidance.push_back
|
||||
(" >= 10: prints all physical volumes.");
|
||||
(" >= 10: prints all physical volumes (touchables).");
|
||||
fVerbosityGuidance.push_back
|
||||
("The level of detail is given by verbosity%10:");
|
||||
fVerbosityGuidance.push_back
|
||||
("for each volume:");
|
||||
fVerbosityGuidance.push_back
|
||||
(" >= 0: physical volume name.");
|
||||
fVerbosityGuidance.push_back
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ASCIITreeSceneHandler.cc 99076 2016-09-01 12:40:47Z gcosmo $
|
||||
// $Id: G4ASCIITreeSceneHandler.cc 110130 2018-05-16 06:43:10Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
@@ -208,6 +208,8 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
|
||||
const PVPath& drawnPVPath = pPVModel->GetDrawnPVPath();
|
||||
//G4int currentDepth = pPVModel->GetCurrentDepth();
|
||||
G4VPhysicalVolume* pCurrentPV = pPVModel->GetCurrentPV();
|
||||
const G4String& currentPVName = pCurrentPV->GetName();
|
||||
const G4int currentCopyNo = pCurrentPV->GetCopyNo();
|
||||
G4LogicalVolume* pCurrentLV = pPVModel->GetCurrentLV();
|
||||
G4Material* pCurrentMaterial = pPVModel->GetCurrentMaterial();
|
||||
|
||||
@@ -215,41 +217,49 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
|
||||
G4int verbosity = pSystem->GetVerbosity();
|
||||
G4int detail = verbosity % 10;
|
||||
|
||||
if (verbosity < 10 && pCurrentPV->IsReplicated()) {
|
||||
// See if this has been a replica found before with same mother LV...
|
||||
// If verbosity < 10 suppress unnecessary repeated printing.
|
||||
// Repeated simple replicas can always be suppressed.
|
||||
// Paramaterisations can only be suppressed if verbosity < 3, since their
|
||||
// size, density, etc., are in principle different.
|
||||
const G4bool isParameterised = pCurrentPV->GetParameterisation();
|
||||
const G4bool isSimpleReplica = pCurrentPV->IsReplicated() && !isParameterised;
|
||||
const G4bool isAmenableToSupression =
|
||||
(verbosity < 10 && isSimpleReplica) || (verbosity < 3 && isParameterised);
|
||||
if (isAmenableToSupression) {
|
||||
// See if this has been found before with same mother LV...
|
||||
PVPath::const_reverse_iterator thisID = drawnPVPath.rbegin();
|
||||
PVPath::const_reverse_iterator motherID = ++drawnPVPath.rbegin();
|
||||
G4bool ignore = false;
|
||||
for (ReplicaSetIterator i = fReplicaSet.begin(); i != fReplicaSet.end();
|
||||
++i) {
|
||||
++i) {
|
||||
if (i->back().GetPhysicalVolume()->GetLogicalVolume() ==
|
||||
thisID->GetPhysicalVolume()->GetLogicalVolume()) {
|
||||
// For each one previously found (if more than one, they must
|
||||
// have different mothers)...
|
||||
// To avoid compilation errors on VC++ .Net 7.1...
|
||||
// Previously:
|
||||
// PVNodeID previousMotherID = ++(i->rbegin());
|
||||
// (Should that have been: PVNodeID::const_iterator previousMotherID?)
|
||||
// Replace
|
||||
// previousMotherID == i->rend()
|
||||
// by
|
||||
// i->size() <= 1
|
||||
// Replace
|
||||
// previousMotherID != i->rend()
|
||||
// by
|
||||
// i->size() > 1
|
||||
// Replace
|
||||
// previousMotherID->
|
||||
// by
|
||||
// (*i)[i->size() - 2].
|
||||
if (motherID == drawnPVPath.rend() &&
|
||||
i->size() <= 1)
|
||||
ignore = true; // Both have no mother.
|
||||
if (motherID != drawnPVPath.rend() &&
|
||||
i->size() > 1 &&
|
||||
motherID->GetPhysicalVolume()->GetLogicalVolume() ==
|
||||
(*i)[i->size() - 2].GetPhysicalVolume()->GetLogicalVolume())
|
||||
ignore = true; // Same mother LV...
|
||||
thisID->GetPhysicalVolume()->GetLogicalVolume()) {
|
||||
// For each one previously found (if more than one, they must
|
||||
// have different mothers)...
|
||||
// To avoid compilation errors on VC++ .Net 7.1...
|
||||
// Previously:
|
||||
// PVNodeID previousMotherID = ++(i->rbegin());
|
||||
// (Should that have been: PVNodeID::const_iterator previousMotherID?)
|
||||
// Replace
|
||||
// previousMotherID == i->rend()
|
||||
// by
|
||||
// i->size() <= 1
|
||||
// Replace
|
||||
// previousMotherID != i->rend()
|
||||
// by
|
||||
// i->size() > 1
|
||||
// Replace
|
||||
// previousMotherID->
|
||||
// by
|
||||
// (*i)[i->size() - 2].
|
||||
if (motherID == drawnPVPath.rend() &&
|
||||
i->size() <= 1)
|
||||
ignore = true; // Both have no mother.
|
||||
if (motherID != drawnPVPath.rend() &&
|
||||
i->size() > 1 &&
|
||||
motherID->GetPhysicalVolume()->GetLogicalVolume() ==
|
||||
(*i)[i->size() - 2].GetPhysicalVolume()->GetLogicalVolume())
|
||||
ignore = true; // Same mother LV...
|
||||
}
|
||||
}
|
||||
if (ignore) {
|
||||
@@ -258,20 +268,19 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
|
||||
}
|
||||
}
|
||||
|
||||
const G4String& currentPVName = pCurrentPV->GetName();
|
||||
const G4int currentCopyNo = pCurrentPV->GetCopyNo();
|
||||
|
||||
if (verbosity < 10 &&
|
||||
// Now suppress printing for volumes with the same name but different
|
||||
// copy number - but not if they are parameterisations that have not been
|
||||
// taken out above (those that are "amenable to suppression" will have been
|
||||
// taken out).
|
||||
if (verbosity < 10 && !isParameterised &&
|
||||
currentPVName == fLastPVName &&
|
||||
currentCopyNo != fLastCopyNo) {
|
||||
// For low verbosity, trap series of G4PVPlacements with the same name but
|
||||
// different copy number (replicas should have been taken out above)...
|
||||
// Check...
|
||||
if (pCurrentPV->IsReplicated()) {
|
||||
if (isAmenableToSupression) {
|
||||
G4Exception("G4ASCIITreeSceneHandler::RequestPrimitives",
|
||||
"vistree0001",
|
||||
JustWarning,
|
||||
"Replica unexpected");
|
||||
"Volume amenable to suppressed printing unexpected");
|
||||
}
|
||||
// Check mothers are identical...
|
||||
else if (pCurrentLV == (fpLastPV? fpLastPV->GetLogicalVolume(): 0)) {
|
||||
@@ -287,7 +296,7 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
|
||||
}
|
||||
fpLastPV = pCurrentPV;
|
||||
|
||||
// High verbosity or a new G4VPhysicalVolume...
|
||||
// High verbosity or a new or otherwise non-amenable volume...
|
||||
// Output copy number, if any, from previous invocation...
|
||||
if (fLastCopyNo != fLastNonSequentialCopyNo) {
|
||||
if (fLastCopyNo == fLastNonSequentialCopyNo + 1) *fpOutFile << ',';
|
||||
@@ -300,9 +309,9 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
|
||||
fLastPVName = currentPVName;
|
||||
fLastCopyNo = currentCopyNo;
|
||||
fLastNonSequentialCopyNo = currentCopyNo;
|
||||
// Start next line...
|
||||
// Indent according to drawn path depth...
|
||||
for (size_t i = 0; i < drawnPVPath.size(); i++ ) *fpOutFile << " ";
|
||||
// Start next line...
|
||||
*fpOutFile << "\"" << currentPVName
|
||||
<< "\":" << currentCopyNo;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History 108542 2018-02-16 09:35:32Z gcosmo $
|
||||
$Id: History 110128 2018-05-16 06:36:57Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,9 @@ committal in the CVS repository !
|
||||
History file for visualization/modeling
|
||||
---------------------------------------
|
||||
|
||||
11th March 2018 John Allison (modeling-V10-03-10)
|
||||
- G4PhysicalVolumeMassScene.cc: Protect case of no material in parallel world.
|
||||
|
||||
19th December 2017 Gabriele Cosmo (modeling-V10-03-09)
|
||||
- Fixed self-consistency in G4AttValueFilterT header (missing #include).
|
||||
Thanks to Raphael Isemann for reporting this.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicalVolumeMassScene.cc 99076 2016-09-01 12:40:47Z gcosmo $
|
||||
// $Id: G4PhysicalVolumeMassScene.cc 110128 2018-05-16 06:36:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// John Allison 10th August 1998.
|
||||
@@ -78,7 +78,7 @@ void G4PhysicalVolumeMassScene::ProcessVolume (const G4VSolid& solid)
|
||||
}
|
||||
|
||||
G4double currentVolume = ((G4VSolid&)solid).GetCubicVolume();
|
||||
G4double currentDensity = pCurrentMaterial->GetDensity();
|
||||
G4double currentDensity = pCurrentMaterial? pCurrentMaterial->GetDensity() : 0.;
|
||||
/* Using G4Polyhedron... (gives slightly different answers on Tubs, e.g.).
|
||||
G4Polyhedron* pPolyhedron = solid.GetPolyhedron();
|
||||
if (!pPolyhedron) {
|
||||
|
||||
Reference in New Issue
Block a user