66 fDensityStack.clear();
69void G4PhysicalVolumeMassScene::ProcessVolume (
const G4VSolid& solid)
76 if (pCurrentPV != fpLastPV) {
77 fpLastPV = pCurrentPV;
98 if (currentDepth == 0) fVolume = currentVolume;
100 if (currentDepth > fLastDepth) {
101 fDensityStack.push_back (fLastDensity);
102 }
else if (currentDepth < fLastDepth) {
103 fDensityStack.pop_back();
105 fLastDepth = currentDepth;
106 fLastDensity = currentDensity;
108 if (currentDepth > 0) motherDensity = fDensityStack.back();
110 G4double subtractedMass = currentVolume * motherDensity;
111 G4double addedMass = currentVolume * currentDensity;
112 fMass -= subtractedMass;
129 "G4PhysicalVolumeMassScene::AccrueMass: WARNING:"
130 "\n Mass going negative for \""
134 ". Larger than mother?"
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