48 theParticle(0), theLossTable(0), NumberOfElements(0), TotBin(300),
67 if (
this == &right)
return *
this;
85 for (
size_t i=0; i<=size_t(
TotBin); i++) {
105 for (
size_t i=0; i<=size_t(
TotBin); i++) {
135 return this == &
right;
140 return this != &
right;
152 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
154 <<
" with Range Cut " << rangeCut/
mm <<
"[mm]" <<
G4endl;
178 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
180 <<
"( " << density <<
")" <<
G4endl;
194 if (rangeVector == 0) {
204 && (theKineticEnergyCuts < lowen) ) {
206 theKineticEnergyCuts /= (1.+(1.-theKineticEnergyCuts/lowen)*
207 tune/(rangeCut*density));
216 return theKineticEnergyCuts;
226 if ( (lowedge<0.0)||(highedge<=lowedge) ){
228 G4cerr <<
"Error in G4VRangeToEnergyConverter::SetEnergyRange";
229 G4cerr <<
" : illegal energy range" <<
"(" << lowedge/
GeV;
232 G4Exception(
"G4VRangeToEnergyConverter::SetEnergyRange()",
305 G4cout <<
"G4VRangeToEnergyConverter::BuildLossTable() ";
317 for (
size_t i=0; i<=size_t(
TotBin); i++) {
340 std::vector<G4double> lossV;
341 for (
size_t ib=0; ib<=size_t(
TotBin); ib++) {
343 for (i=0; i<size_t(NumEl); i++) {
344 G4int IndEl = (*elementVector)[i]->GetIndex();
345 loss += atomicNumDensityVector[i]*
346 (*((*theLossTable)[IndEl]))[ib];
348 lossV.push_back(loss);
360 for ( i=0; i<=size_t(
TotBin); i++) {
363 if (i==0) s0 += 0.5*q;
367 Value = (s0 + 0.5*q)*dltau ;
369 Value = (s0 - 0.5*q)*dltau ;
399 if ( theCutInLength <= r1 ) {
return T1; }
403 for (
size_t ibin=0; ibin<=size_t(
TotBin); ibin++) {
406 if ( r>rmax ) rmax=
r;
407 if (r <theCutInLength ) {
410 }
else if (r >theCutInLength ) {
417 if ( theCutInLength >= rmax ) {
420 G4cout <<
"G4VRangeToEnergyConverter::ConvertCutToKineticEnergy ";
422 G4cout <<
"The cut in range [" << theCutInLength/
mm <<
" (mm)] ";
423 G4cout <<
" is too big " ;
424 G4cout <<
" for material idx=" << materialIndex <<
G4endl;
433 const size_t MAX_LOOP = 1000;
434 for (
size_t loop_count=0; loop_count<MAX_LOOP; ++loop_count){
435 if (std::fabs(1.-r3/theCutInLength)<epsilon )
break;
436 if ( theCutInLength <= r3 ) {
441 T3 = std::sqrt(T1*T2);
442 r3 = rangeVector->
Value(T3);