64 fDensityStack.clear();
67void G4PhysicalVolumeMassScene::ProcessVolume (
const G4VSolid& solid)
74 if (pCurrentPV != fpLastPV) {
75 fpLastPV = pCurrentPV;
96 if (currentDepth == 0) fVolume = currentVolume;
98 if (currentDepth > fLastDepth) {
99 fDensityStack.push_back (fLastDensity);
100 }
else if (currentDepth < fLastDepth) {
101 fDensityStack.pop_back();
103 fLastDepth = currentDepth;
104 fLastDensity = currentDensity;
106 if (currentDepth > 0) motherDensity = fDensityStack.back();
108 G4double subtractedMass = currentVolume * motherDensity;
109 G4double addedMass = currentVolume * currentDensity;
110 fMass -= subtractedMass;
127 "G4PhysicalVolumeMassScene::AccrueMass: WARNING:"
128 "\n Mass going negative for \""
132 ". Larger than mother?"
G4GLOB_DLL std::ostream G4cout
G4double GetDensity() const
G4PhysicalVolumeMassScene(G4PhysicalVolumeModel *)
virtual ~G4PhysicalVolumeMassScene()
G4VPhysicalVolume * GetCurrentPV() const
G4Material * GetCurrentMaterial() const
G4int GetCurrentDepth() const
virtual G4int GetCopyNo() const =0
const G4String & GetName() const