65 fDensityStack.clear();
68void G4PhysicalVolumeMassScene::AccrueMass (
const G4VSolid& solid)
75 if (pCurrentPV != fpLastPV) {
76 fpLastPV = pCurrentPV;
97 if (currentDepth == 0) fVolume = currentVolume;
99 if (currentDepth > fLastDepth) {
100 fDensityStack.push_back (fLastDensity);
101 }
else if (currentDepth < fLastDepth) {
102 fDensityStack.pop_back();
104 fLastDepth = currentDepth;
105 fLastDensity = currentDensity;
107 if (currentDepth > 0) motherDensity = fDensityStack.back();
109 G4double subtractedMass = currentVolume * motherDensity;
110 G4double addedMass = currentVolume * currentDensity;
111 fMass -= subtractedMass;
128 "G4PhysicalVolumeMassScene::AccrueMass: WARNING:"
129 "\n Mass going negative for \""
133 ". Larger than mother?"
G4DLLIMPORT 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