61 #ifdef VERBOSE_ENERSPLIT
77 if( aStep == 0 )
return FALSE;
84 G4double kinEnergyPre = kinEnergyPreOrig;
89 for( ii = 0; ii < rnsl.size(); ii++ ){
92 #ifdef VERBOSE_ENERSPLIT
93 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes"<< ii <<
" RN: iter1 step length geom " << sl <<
G4endl;
97 #ifdef VERBOSE_ENERSPLIT
99 G4cout <<
"G4EnergySplitter RN: step length geom TOTAL " << slSum
100 <<
" true TOTAL " << stepLength
101 <<
" ratio " << stepLength/slSum
104 <<
" Number of geom steps " << rnsl.size() <<
G4endl;
108 for( ii = 0; ii < rnsl.size(); ii++ ){
110 G4double edepStep = edep * sl/slSum;
111 #ifdef VERBOSE_ENERSPLIT
112 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes"<< ii
113 <<
" edep " << edepStep <<
G4endl;
121 #ifdef VERBOSE_ENERSPLIT
125 for( ii = 0; ii < rnsl.size(); ii++ ){
129 for( ii = 0; ii < rnsl.size(); ii++ ){
130 G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes "<< ii
131 <<
" RN: iter0 corrected energy lost " << edep*rnsl[ii].second/slSum
137 G4double slRatio = stepLength/slSum;
138 #ifdef VERBOSE_ENERSPLIT
139 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes RN: iter 0, step ratio " << slRatio <<
G4endl;
145 std::vector<G4double> stepLengths;
149 for( ii = 0; ii < rnsl.size(); ii++ ){
151 stepLengths.push_back( sl * slRatio );
152 #ifdef VERBOSE_ENERSPLIT
153 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes"<< ii <<
" RN: iter" << iiter <<
" corrected step length " << sl*slRatio <<
G4endl;
157 for( ii = 0; ii < rnsl.size(); ii++ ){
160 if( kinEnergyPre > 0. ) {
161 dEdx = emcalc.
GetDEDX(kinEnergyPre, part, mate);
163 G4double elost = stepLengths[ii] * dEdx;
165 #ifdef VERBOSE_ENERSPLIT
166 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes"<< ii <<
" RN: iter1 energy lost " << elost
167 <<
" energy at interaction " << kinEnergyPre
168 <<
" = stepLength " << stepLengths[ii]
169 <<
" * dEdx " << dEdx <<
G4endl;
171 kinEnergyPre -= elost;
181 kinEnergyPre = kinEnergyPreOrig;
182 for( ii = 0; ii < rnsl.size(); ii++ ){
187 #ifdef VERBOSE_ENERSPLIT
188 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes" << ii
189 <<
" RN: iter" << iiter <<
" step length geom " << stepLengths[ii]
190 <<
" geom2true " << rnsl[ii].second / stepLengths[ii] <<
G4endl;
193 slSum += stepLengths[ii];
198 #ifdef VERBOSE_ENERSPLIT
199 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes" << ii <<
" RN: iter" << iiter <<
" step ratio " << slRatio <<
G4endl;
201 for( ii = 0; ii < rnsl.size(); ii++ ){
202 stepLengths[ii] *= slratio;
203 #ifdef VERBOSE_ENERSPLIT
204 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes"<< ii <<
" RN: iter" << iiter <<
" corrected step length " << stepLengths[ii] <<
G4endl;
211 for( ii = 0; ii < rnsl.size(); ii++ ){
214 if( kinEnergyPre > 0. ) {
215 dEdx = emcalc.
GetDEDX(kinEnergyPre, part, mate);
217 G4double elost = stepLengths[ii] * dEdx;
218 #ifdef VERBOSE_ENERSPLIT
219 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes"<< ii <<
" RN: iter" << iiter <<
" energy lost " << elost
220 <<
" energy at interaction " << kinEnergyPre
221 <<
" = stepLength " << stepLengths[ii]
222 <<
" * dEdx " << dEdx <<
G4endl;
224 kinEnergyPre -= elost;
232 G4double enerRatio = (edep/totalELost);
234 #ifdef VERBOSE_ENERSPLIT
235 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes"<< ii <<
" RN: iter" << iiter <<
" energy ratio " << enerRatio <<
G4endl;
238 #ifdef VERBOSE_ENERSPLIT
243 #ifdef VERBOSE_ENERSPLIT
245 if(verbose)
G4cout <<
"G4EnergySplitter::SplitEnergyInVolumes "<< ii <<
" RN: iter" << iiter <<
" corrected energy lost " <<
theEnergies[ii]
247 <<
" energy before interaction " << kinEnergyPreOrig-elostTot+
theEnergies[ii]
248 <<
" energy after interaction " << kinEnergyPreOrig-elostTot
264 std::vector<G4VPhysicalVolume*>::iterator cite;
265 for( cite = pvs->begin(); cite != pvs->end(); cite++ ) {
280 "No G4PhantomParameterisation found !");
318 "Invalid stepNo, smaller than 0 or bigger or equal to number of voxels traversed",
323 advance( ite, stepNo );
324 voxelID = (*ite).first;
333 advance( ite, stepNo );
334 stepLength = (*ite).second;
G4ParticleDefinition * GetDefinition() const
void GetStepLength(G4int stepNo, G4double &stepLength)
G4double GetStepLength() const
const G4String & GetName() const
G4Material * GetMaterial() const
const std::vector< std::pair< G4int, G4double > > & GetStepLengths()
static G4String ConvertToString(G4bool boolVal)
virtual ~G4EnergySplitter()
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
static G4PhysicalVolumeStore * GetInstance()
void GetFirstVoxelID(G4int &voxelID)
G4StepPoint * GetPreStepPoint() const
G4VPVParameterisation * GetParameterisation() const
G4GLOB_DLL std::ostream G4cout
G4PhantomParameterisation * thePhantomParam
void GetLastVoxelID(G4int &voxelID)
virtual G4int GetRegularStructureId() const =0
static const double second
void GetPhantomParam(G4bool mustExist)
G4double GetTotalEnergyDeposit() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4Material * GetMaterial(size_t nx, size_t ny, size_t nz) const
void GetVoxelID(G4int stepNo, G4int &voxelID)
std::vector< G4double > theEnergies
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
G4double GetKineticEnergy() const
G4bool IsPhantomVolume(G4VPhysicalVolume *pv)
static G4RegularNavigationHelper * Instance()
G4Track * GetTrack() const
G4double GetPDGCharge() const
G4int SplitEnergyInVolumes(const G4Step *aStep)
G4EnergyLossForExtrapolator * theElossExt