Geant4-11
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4PhysicalVolumeMassScene Class Reference

#include <G4PhysicalVolumeMassScene.hh>

Inheritance diagram for G4PhysicalVolumeMassScene:
G4PseudoScene G4VGraphicsScene

Public Member Functions

void AddCompound (const G4Mesh &)
 
void AddCompound (const G4THitsMap< G4double > &)
 
void AddCompound (const G4THitsMap< G4StatDouble > &)
 
void AddCompound (const G4VDigi &)
 
void AddCompound (const G4VHit &)
 
void AddCompound (const G4VTrajectory &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Plotter &)
 
void AddPrimitive (const G4Polyhedron &)
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitive (const G4Text &)
 
void AddSolid (const G4Box &solid)
 
void AddSolid (const G4Cons &solid)
 
void AddSolid (const G4Ellipsoid &solid)
 
void AddSolid (const G4Orb &solid)
 
void AddSolid (const G4Para &solid)
 
void AddSolid (const G4Polycone &solid)
 
void AddSolid (const G4Polyhedra &solid)
 
void AddSolid (const G4Sphere &solid)
 
void AddSolid (const G4TessellatedSolid &solid)
 
void AddSolid (const G4Torus &solid)
 
void AddSolid (const G4Trap &solid)
 
void AddSolid (const G4Trd &solid)
 
void AddSolid (const G4Tubs &solid)
 
void AddSolid (const G4VSolid &solid)
 
void BeginPrimitives (const G4Transform3D &)
 
void BeginPrimitives2D (const G4Transform3D &)
 
void EndPrimitives ()
 
void EndPrimitives2D ()
 
 G4PhysicalVolumeMassScene (G4PhysicalVolumeModel *)
 
virtual const G4VisExtentGetExtent () const
 
G4double GetMass () const
 
G4double GetVolume () const
 
void PostAddSolid ()
 
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void Reset ()
 
virtual ~G4PhysicalVolumeMassScene ()
 

Protected Attributes

const G4Transform3DfpCurrentObjectTransformation
 

Private Member Functions

void ProcessVolume (const G4VSolid &)
 

Private Attributes

std::deque< G4doublefDensityStack
 
G4double fLastDensity
 
G4int fLastDepth
 
G4double fMass
 
G4VPhysicalVolumefpLastPV
 
G4PhysicalVolumeModelfpPVModel
 
G4int fPVPCount
 
G4double fVolume
 

Detailed Description

Definition at line 64 of file G4PhysicalVolumeMassScene.hh.

Constructor & Destructor Documentation

◆ G4PhysicalVolumeMassScene()

G4PhysicalVolumeMassScene::G4PhysicalVolumeMassScene ( G4PhysicalVolumeModel pPVModel)

◆ ~G4PhysicalVolumeMassScene()

G4PhysicalVolumeMassScene::~G4PhysicalVolumeMassScene ( )
virtual

Definition at line 54 of file G4PhysicalVolumeMassScene.cc.

54{}

Member Function Documentation

◆ AddCompound() [1/6]

void G4PseudoScene::AddCompound ( const G4Mesh )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 83 of file G4PseudoScene.hh.

83{}

◆ AddCompound() [2/6]

void G4PseudoScene::AddCompound ( const G4THitsMap< G4double > &  )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 81 of file G4PseudoScene.hh.

81{}

◆ AddCompound() [3/6]

void G4PseudoScene::AddCompound ( const G4THitsMap< G4StatDouble > &  )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 82 of file G4PseudoScene.hh.

82{}

◆ AddCompound() [4/6]

void G4PseudoScene::AddCompound ( const G4VDigi )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 80 of file G4PseudoScene.hh.

80{}

◆ AddCompound() [5/6]

void G4PseudoScene::AddCompound ( const G4VHit )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 79 of file G4PseudoScene.hh.

79{}

◆ AddCompound() [6/6]

void G4PseudoScene::AddCompound ( const G4VTrajectory )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 78 of file G4PseudoScene.hh.

78{}

◆ AddPrimitive() [1/7]

void G4PseudoScene::AddPrimitive ( const G4Circle )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 91 of file G4PseudoScene.hh.

91{}

◆ AddPrimitive() [2/7]

void G4PseudoScene::AddPrimitive ( const G4Plotter )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 96 of file G4PseudoScene.hh.

96{}

◆ AddPrimitive() [3/7]

void G4PseudoScene::AddPrimitive ( const G4Polyhedron )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 94 of file G4PseudoScene.hh.

94{}

◆ AddPrimitive() [4/7]

void G4PseudoScene::AddPrimitive ( const G4Polyline )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 89 of file G4PseudoScene.hh.

89{}

◆ AddPrimitive() [5/7]

void G4PseudoScene::AddPrimitive ( const G4Polymarker )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 93 of file G4PseudoScene.hh.

93{}

◆ AddPrimitive() [6/7]

void G4PseudoScene::AddPrimitive ( const G4Square )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 92 of file G4PseudoScene.hh.

92{}

◆ AddPrimitive() [7/7]

void G4PseudoScene::AddPrimitive ( const G4Text )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 90 of file G4PseudoScene.hh.

90{}

◆ AddSolid() [1/14]

void G4PseudoScene::AddSolid ( const G4Box solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 61 of file G4PseudoScene.hh.

61{ProcessVolume (solid);}
virtual void ProcessVolume(const G4VSolid &)

References G4PseudoScene::ProcessVolume().

Referenced by G4OpenGLSceneHandler::AddCompound(), G4Qt3DSceneHandler::AddCompound(), and G4VtkSceneHandler::AddCompound().

◆ AddSolid() [2/14]

void G4PseudoScene::AddSolid ( const G4Cons solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 62 of file G4PseudoScene.hh.

62{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [3/14]

void G4PseudoScene::AddSolid ( const G4Ellipsoid solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 71 of file G4PseudoScene.hh.

71{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [4/14]

void G4PseudoScene::AddSolid ( const G4Orb solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 63 of file G4PseudoScene.hh.

63{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [5/14]

void G4PseudoScene::AddSolid ( const G4Para solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 64 of file G4PseudoScene.hh.

64{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [6/14]

void G4PseudoScene::AddSolid ( const G4Polycone solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 72 of file G4PseudoScene.hh.

72{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [7/14]

void G4PseudoScene::AddSolid ( const G4Polyhedra solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 73 of file G4PseudoScene.hh.

73{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [8/14]

void G4PseudoScene::AddSolid ( const G4Sphere solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 65 of file G4PseudoScene.hh.

65{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [9/14]

void G4PseudoScene::AddSolid ( const G4TessellatedSolid solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 74 of file G4PseudoScene.hh.

74{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [10/14]

void G4PseudoScene::AddSolid ( const G4Torus solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 66 of file G4PseudoScene.hh.

66{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [11/14]

void G4PseudoScene::AddSolid ( const G4Trap solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 67 of file G4PseudoScene.hh.

67{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [12/14]

void G4PseudoScene::AddSolid ( const G4Trd solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 68 of file G4PseudoScene.hh.

68{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [13/14]

void G4PseudoScene::AddSolid ( const G4Tubs solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 69 of file G4PseudoScene.hh.

69{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ AddSolid() [14/14]

void G4PseudoScene::AddSolid ( const G4VSolid solid)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 76 of file G4PseudoScene.hh.

76{ProcessVolume (solid);}

References G4PseudoScene::ProcessVolume().

◆ BeginPrimitives()

void G4PseudoScene::BeginPrimitives ( const G4Transform3D )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 85 of file G4PseudoScene.hh.

85{}

◆ BeginPrimitives2D()

void G4PseudoScene::BeginPrimitives2D ( const G4Transform3D )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 87 of file G4PseudoScene.hh.

87{}

◆ EndPrimitives()

void G4PseudoScene::EndPrimitives ( )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 86 of file G4PseudoScene.hh.

86{}

◆ EndPrimitives2D()

void G4PseudoScene::EndPrimitives2D ( )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 88 of file G4PseudoScene.hh.

88{}

◆ GetExtent()

const G4VisExtent & G4VGraphicsScene::GetExtent ( ) const
virtualinherited

Reimplemented in G4VSceneHandler, and G4BoundingExtentScene.

Definition at line 37 of file G4VGraphicsScene.cc.

38{
39 static const G4VisExtent defaultExtent = G4VisExtent();
40 return defaultExtent;
41}

Referenced by G4VFieldModel::DescribeYourselfTo().

◆ GetMass()

G4double G4PhysicalVolumeMassScene::GetMass ( ) const
inline

Definition at line 76 of file G4PhysicalVolumeMassScene.hh.

76{return fMass;}

References fMass.

Referenced by G4ASCIITreeSceneHandler::EndModeling().

◆ GetVolume()

G4double G4PhysicalVolumeMassScene::GetVolume ( ) const
inline

Definition at line 73 of file G4PhysicalVolumeMassScene.hh.

73{return fVolume;}

References fVolume.

Referenced by G4ASCIITreeSceneHandler::EndModeling().

◆ PostAddSolid()

void G4PseudoScene::PostAddSolid ( )
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 59 of file G4PseudoScene.hh.

59{}

◆ PreAddSolid()

void G4PseudoScene::PreAddSolid ( const G4Transform3D objectTransformation,
const G4VisAttributes  
)
inlinevirtualinherited

Implements G4VGraphicsScene.

Definition at line 56 of file G4PseudoScene.hh.

58 {fpCurrentObjectTransformation = &objectTransformation;}
const G4Transform3D * fpCurrentObjectTransformation

References G4PseudoScene::fpCurrentObjectTransformation.

◆ ProcessVolume()

void G4PhysicalVolumeMassScene::ProcessVolume ( const G4VSolid solid)
privatevirtual

Reimplemented from G4PseudoScene.

Definition at line 67 of file G4PhysicalVolumeMassScene.cc.

68{
69 G4int currentDepth = fpPVModel->GetCurrentDepth();
71 //G4LogicalVolume* pCurrentLV = fpPVModel->GetCurrentLV();
72 G4Material* pCurrentMaterial = fpPVModel->GetCurrentMaterial();
73
74 if (pCurrentPV != fpLastPV) {
75 fpLastPV = pCurrentPV;
76 fPVPCount = 0;
77 }
78
79 G4double currentVolume = ((G4VSolid&)solid).GetCubicVolume();
80 G4double currentDensity = pCurrentMaterial? pCurrentMaterial->GetDensity() : 0.;
81 /* Using G4Polyhedron... (gives slightly different answers on Tubs, e.g.).
82 G4Polyhedron* pPolyhedron = solid.GetPolyhedron();
83 if (!pPolyhedron) {
84 G4cout <<
85 "G4PhysicalVolumeMassScene::AccrueMass: WARNING:"
86 "\n No G4Polyhedron for" << solid.GetEntityType() <<
87 ". \"" << solid.GetName() << "\" will not be accounted."
88 "\n It will be as though not there, i.e., the density as its mother."
89 "\n Its daughters will still be found and accounted."
90 << G4endl;
91 currentVolume = 0.;
92 currentDensity = 0.;
93 }
94 */
95
96 if (currentDepth == 0) fVolume = currentVolume;
97
98 if (currentDepth > fLastDepth) {
99 fDensityStack.push_back (fLastDensity);
100 } else if (currentDepth < fLastDepth) {
101 fDensityStack.pop_back();
102 }
103 fLastDepth = currentDepth;
104 fLastDensity = currentDensity;
105 G4double motherDensity = 0.;
106 if (currentDepth > 0) motherDensity = fDensityStack.back();
107
108 G4double subtractedMass = currentVolume * motherDensity;
109 G4double addedMass = currentVolume * currentDensity;
110 fMass -= subtractedMass;
111 fMass += addedMass;
112 /* Debug
113 G4cout << "current vol = "
114 << G4BestUnit (currentVolume,"Volume")
115 << ", current density = "
116 << G4BestUnit (currentDensity, "Volumic Mass")
117 << ", mother density = "
118 << G4BestUnit (motherDensity, "Volumic Mass")
119 << G4endl;
120 G4cout << "Subtracted mass = " << G4BestUnit (subtractedMass, "Mass")
121 << ", added mass = " << G4BestUnit (addedMass, "Mass")
122 << ", new mass = " << G4BestUnit (fMass, "Mass")
123 << G4endl;
124 */
125 if (fMass < 0.) {
126 G4cout <<
127 "G4PhysicalVolumeMassScene::AccrueMass: WARNING:"
128 "\n Mass going negative for \""
129 << pCurrentPV->GetName() <<
130 "\", copy "
131 << pCurrentPV->GetCopyNo() <<
132 ". Larger than mother?"
133 << G4endl;
134 }
135}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double GetDensity() const
Definition: G4Material.hh:176
std::deque< G4double > fDensityStack
G4VPhysicalVolume * GetCurrentPV() const
G4Material * GetCurrentMaterial() const
virtual G4int GetCopyNo() const =0
const G4String & GetName() const

References fDensityStack, fLastDensity, fLastDepth, fMass, fpLastPV, fpPVModel, fPVPCount, fVolume, G4cout, G4endl, G4VPhysicalVolume::GetCopyNo(), G4PhysicalVolumeModel::GetCurrentDepth(), G4PhysicalVolumeModel::GetCurrentMaterial(), G4PhysicalVolumeModel::GetCurrentPV(), G4Material::GetDensity(), and G4VPhysicalVolume::GetName().

◆ Reset()

void G4PhysicalVolumeMassScene::Reset ( )

Definition at line 56 of file G4PhysicalVolumeMassScene.cc.

57{
58 fVolume = 0.;
59 fMass = 0.;
60 fpLastPV = 0;
61 fPVPCount = 0;
62 fLastDepth = 0;
63 fLastDensity = 0.;
64 fDensityStack.clear();
65}

References fDensityStack, fLastDensity, fLastDepth, fMass, fpLastPV, fPVPCount, and fVolume.

Field Documentation

◆ fDensityStack

std::deque<G4double> G4PhysicalVolumeMassScene::fDensityStack
private

Definition at line 91 of file G4PhysicalVolumeMassScene.hh.

Referenced by ProcessVolume(), and Reset().

◆ fLastDensity

G4double G4PhysicalVolumeMassScene::fLastDensity
private

Definition at line 90 of file G4PhysicalVolumeMassScene.hh.

Referenced by ProcessVolume(), and Reset().

◆ fLastDepth

G4int G4PhysicalVolumeMassScene::fLastDepth
private

Definition at line 89 of file G4PhysicalVolumeMassScene.hh.

Referenced by ProcessVolume(), and Reset().

◆ fMass

G4double G4PhysicalVolumeMassScene::fMass
private

Definition at line 86 of file G4PhysicalVolumeMassScene.hh.

Referenced by GetMass(), ProcessVolume(), and Reset().

◆ fpCurrentObjectTransformation

const G4Transform3D* G4PseudoScene::fpCurrentObjectTransformation
protectedinherited

◆ fpLastPV

G4VPhysicalVolume* G4PhysicalVolumeMassScene::fpLastPV
private

Definition at line 87 of file G4PhysicalVolumeMassScene.hh.

Referenced by ProcessVolume(), and Reset().

◆ fpPVModel

G4PhysicalVolumeModel* G4PhysicalVolumeMassScene::fpPVModel
private

Definition at line 84 of file G4PhysicalVolumeMassScene.hh.

Referenced by ProcessVolume().

◆ fPVPCount

G4int G4PhysicalVolumeMassScene::fPVPCount
private

Definition at line 88 of file G4PhysicalVolumeMassScene.hh.

Referenced by ProcessVolume(), and Reset().

◆ fVolume

G4double G4PhysicalVolumeMassScene::fVolume
private

Definition at line 85 of file G4PhysicalVolumeMassScene.hh.

Referenced by GetVolume(), ProcessVolume(), and Reset().


The documentation for this class was generated from the following files: