Geant4  10.02.p03
G4PhysicalVolumeMassScene Class Reference

#include <G4PhysicalVolumeMassScene.hh>

Inheritance diagram for G4PhysicalVolumeMassScene:
Collaboration diagram for G4PhysicalVolumeMassScene:

Public Member Functions

 G4PhysicalVolumeMassScene (G4PhysicalVolumeModel *)
 
virtual ~G4PhysicalVolumeMassScene ()
 
G4double GetVolume () const
 
G4double GetMass () const
 
void Reset ()
 
void PreAddSolid (const G4Transform3D &, const G4VisAttributes &)
 
void PostAddSolid ()
 
void AddSolid (const G4Box &solid)
 
void AddSolid (const G4Cons &solid)
 
void AddSolid (const G4Tubs &solid)
 
void AddSolid (const G4Trd &solid)
 
void AddSolid (const G4Trap &solid)
 
void AddSolid (const G4Sphere &solid)
 
void AddSolid (const G4Para &solid)
 
void AddSolid (const G4Torus &solid)
 
void AddSolid (const G4Polycone &solid)
 
void AddSolid (const G4Polyhedra &solid)
 
void AddSolid (const G4VSolid &solid)
 
void AddCompound (const G4VTrajectory &)
 
void AddCompound (const G4VHit &)
 
void AddCompound (const G4VDigi &)
 
void AddCompound (const G4THitsMap< G4double > &)
 
virtual void BeginPrimitives (const G4Transform3D &)
 
virtual void EndPrimitives ()
 
virtual void BeginPrimitives2D (const G4Transform3D &)
 
virtual void EndPrimitives2D ()
 
virtual void AddPrimitive (const G4Polyline &)
 
virtual void AddPrimitive (const G4Scale &)
 
virtual void AddPrimitive (const G4Text &)
 
virtual void AddPrimitive (const G4Circle &)
 
virtual void AddPrimitive (const G4Square &)
 
virtual void AddPrimitive (const G4Polymarker &)
 
virtual void AddPrimitive (const G4Polyhedron &)
 
- Public Member Functions inherited from G4VGraphicsScene
 G4VGraphicsScene ()
 
virtual ~G4VGraphicsScene ()
 
virtual const G4VisExtentGetExtent () const
 

Private Member Functions

void AccrueMass (const G4VSolid &)
 

Private Attributes

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

Detailed Description

Definition at line 75 of file G4PhysicalVolumeMassScene.hh.

Constructor & Destructor Documentation

◆ G4PhysicalVolumeMassScene()

G4PhysicalVolumeMassScene::G4PhysicalVolumeMassScene ( G4PhysicalVolumeModel pPVModel)

◆ ~G4PhysicalVolumeMassScene()

G4PhysicalVolumeMassScene::~G4PhysicalVolumeMassScene ( )
virtual

Definition at line 55 of file G4PhysicalVolumeMassScene.cc.

55 {}

Member Function Documentation

◆ AccrueMass()

void G4PhysicalVolumeMassScene::AccrueMass ( const G4VSolid solid)
private

Definition at line 68 of file G4PhysicalVolumeMassScene.cc.

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

◆ AddCompound() [1/4]

void G4PhysicalVolumeMassScene::AddCompound ( const G4VTrajectory )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 108 of file G4PhysicalVolumeMassScene.hh.

108 {}

◆ AddCompound() [2/4]

void G4PhysicalVolumeMassScene::AddCompound ( const G4VHit )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 109 of file G4PhysicalVolumeMassScene.hh.

109 {}

◆ AddCompound() [3/4]

void G4PhysicalVolumeMassScene::AddCompound ( const G4VDigi )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 110 of file G4PhysicalVolumeMassScene.hh.

110 {}

◆ AddCompound() [4/4]

void G4PhysicalVolumeMassScene::AddCompound ( const G4THitsMap< G4double > &  )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 111 of file G4PhysicalVolumeMassScene.hh.

111 {}

◆ AddPrimitive() [1/7]

virtual void G4PhysicalVolumeMassScene::AddPrimitive ( const G4Polyline )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 120 of file G4PhysicalVolumeMassScene.hh.

120 {}

◆ AddPrimitive() [2/7]

virtual void G4PhysicalVolumeMassScene::AddPrimitive ( const G4Scale )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 121 of file G4PhysicalVolumeMassScene.hh.

121 {}

◆ AddPrimitive() [3/7]

virtual void G4PhysicalVolumeMassScene::AddPrimitive ( const G4Text )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 122 of file G4PhysicalVolumeMassScene.hh.

122 {}

◆ AddPrimitive() [4/7]

virtual void G4PhysicalVolumeMassScene::AddPrimitive ( const G4Circle )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 123 of file G4PhysicalVolumeMassScene.hh.

123 {}

◆ AddPrimitive() [5/7]

virtual void G4PhysicalVolumeMassScene::AddPrimitive ( const G4Square )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 124 of file G4PhysicalVolumeMassScene.hh.

124 {}

◆ AddPrimitive() [6/7]

virtual void G4PhysicalVolumeMassScene::AddPrimitive ( const G4Polymarker )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 125 of file G4PhysicalVolumeMassScene.hh.

125 {}

◆ AddPrimitive() [7/7]

virtual void G4PhysicalVolumeMassScene::AddPrimitive ( const G4Polyhedron )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 126 of file G4PhysicalVolumeMassScene.hh.

126 {}
Here is the call graph for this function:

◆ AddSolid() [1/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Box solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 97 of file G4PhysicalVolumeMassScene.hh.

97 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [2/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Cons solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 98 of file G4PhysicalVolumeMassScene.hh.

98 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [3/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Tubs solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 99 of file G4PhysicalVolumeMassScene.hh.

99 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [4/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Trd solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 100 of file G4PhysicalVolumeMassScene.hh.

100 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [5/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Trap solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 101 of file G4PhysicalVolumeMassScene.hh.

101 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [6/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Sphere solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 102 of file G4PhysicalVolumeMassScene.hh.

102 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [7/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Para solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 103 of file G4PhysicalVolumeMassScene.hh.

103 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [8/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Torus solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 104 of file G4PhysicalVolumeMassScene.hh.

104 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [9/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Polycone solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 105 of file G4PhysicalVolumeMassScene.hh.

105 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [10/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4Polyhedra solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 106 of file G4PhysicalVolumeMassScene.hh.

106 {AccrueMass (solid);}
Here is the call graph for this function:

◆ AddSolid() [11/11]

void G4PhysicalVolumeMassScene::AddSolid ( const G4VSolid solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 107 of file G4PhysicalVolumeMassScene.hh.

107 {AccrueMass (solid);}
Here is the call graph for this function:

◆ BeginPrimitives()

virtual void G4PhysicalVolumeMassScene::BeginPrimitives ( const G4Transform3D )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 116 of file G4PhysicalVolumeMassScene.hh.

116 {}

◆ BeginPrimitives2D()

virtual void G4PhysicalVolumeMassScene::BeginPrimitives2D ( const G4Transform3D )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 118 of file G4PhysicalVolumeMassScene.hh.

118 {}

◆ EndPrimitives()

virtual void G4PhysicalVolumeMassScene::EndPrimitives ( )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 117 of file G4PhysicalVolumeMassScene.hh.

117 {}

◆ EndPrimitives2D()

virtual void G4PhysicalVolumeMassScene::EndPrimitives2D ( )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 119 of file G4PhysicalVolumeMassScene.hh.

119 {}

◆ GetMass()

G4double G4PhysicalVolumeMassScene::GetMass ( ) const
inline

Definition at line 86 of file G4PhysicalVolumeMassScene.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVolume()

G4double G4PhysicalVolumeMassScene::GetVolume ( ) const
inline

Definition at line 83 of file G4PhysicalVolumeMassScene.hh.

Here is the caller graph for this function:

◆ PostAddSolid()

void G4PhysicalVolumeMassScene::PostAddSolid ( )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 96 of file G4PhysicalVolumeMassScene.hh.

96 {}

◆ PreAddSolid()

void G4PhysicalVolumeMassScene::PreAddSolid ( const G4Transform3D ,
const G4VisAttributes  
)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 95 of file G4PhysicalVolumeMassScene.hh.

95 {}

◆ Reset()

void G4PhysicalVolumeMassScene::Reset ( )

Definition at line 57 of file G4PhysicalVolumeMassScene.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ fDensityStack

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

Definition at line 137 of file G4PhysicalVolumeMassScene.hh.

◆ fLastDensity

G4double G4PhysicalVolumeMassScene::fLastDensity
private

Definition at line 136 of file G4PhysicalVolumeMassScene.hh.

◆ fLastDepth

G4int G4PhysicalVolumeMassScene::fLastDepth
private

Definition at line 135 of file G4PhysicalVolumeMassScene.hh.

◆ fMass

G4double G4PhysicalVolumeMassScene::fMass
private

Definition at line 132 of file G4PhysicalVolumeMassScene.hh.

◆ fpLastPV

G4VPhysicalVolume* G4PhysicalVolumeMassScene::fpLastPV
private

Definition at line 133 of file G4PhysicalVolumeMassScene.hh.

◆ fpPVModel

G4PhysicalVolumeModel* G4PhysicalVolumeMassScene::fpPVModel
private

Definition at line 130 of file G4PhysicalVolumeMassScene.hh.

◆ fPVPCount

G4int G4PhysicalVolumeMassScene::fPVPCount
private

Definition at line 134 of file G4PhysicalVolumeMassScene.hh.

◆ fVolume

G4double G4PhysicalVolumeMassScene::fVolume
private

Definition at line 131 of file G4PhysicalVolumeMassScene.hh.


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