52 theParticle(0), theLossTable(0), NumberOfElements(0), TotBin(300),
66 if (
this == &right)
return *
this;
75 verboseLevel = right.verboseLevel;
84 for (
size_t i=0; i<size_t(
TotBin); i++) {
104 for (
size_t i=0; i<size_t(
TotBin); i++) {
122 return this == &
right;
127 return this != &
right;
139 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
141 <<
" with Range Cut " << rangeCut/
mm <<
"[mm]" <<
G4endl;
165 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
167 <<
"( " << density <<
")" <<
G4endl;
181 if (rangeVector == 0) {
191 && (theKineticEnergyCuts < lowen) ) {
193 theKineticEnergyCuts /= (1.+(1.-theKineticEnergyCuts/lowen)*
194 tune/(rangeCut*density));
203 return theKineticEnergyCuts;
213 if ( (lowedge<0.0)||(highedge<=lowedge) ){
215 G4cerr <<
"Error in G4VRangeToEnergyConverter::SetEnergyRange";
216 G4cerr <<
" : illegal energy range" <<
"(" << lowedge/
GeV;
219 G4Exception(
"G4VRangeToEnergyConverter::SetEnergyRange()",
292 G4cout <<
"G4VRangeToEnergyConverter::BuildLossTable() ";
304 for (
size_t i=0; i<size_t(
TotBin); i++) {
327 std::vector<G4double> lossV;
328 for (
size_t ib=0; ib<size_t(
TotBin); ib++) {
330 for (i=0; i<size_t(NumEl); i++) {
331 G4int IndEl = (*elementVector)[i]->GetIndex();
332 loss += atomicNumDensityVector[i]*
333 (*((*theLossTable)[IndEl]))[ib];
335 lossV.push_back(loss);
344 for ( i=0; i<size_t(
TotBin); i++) {
347 if (i==0) s0 += 0.5*q;
351 Value = (s0 + 0.5*q)*dltau ;
353 Value = (s0 - 0.5*q)*dltau ;
383 if ( theCutInLength <= r1 ) {
return T1; }
387 for (
size_t ibin=0; ibin<size_t(
TotBin); ibin++) {
390 if ( r>rmax ) rmax=
r;
391 if (r <theCutInLength ) {
394 }
else if (r >theCutInLength ) {
401 if ( theCutInLength >= rmax ) {
404 G4cout <<
"G4VRangeToEnergyConverter::ConvertCutToKineticEnergy ";
406 G4cout <<
"The cut in range [" << theCutInLength/
mm <<
" (mm)] ";
407 G4cout <<
" is too big " ;
408 G4cout <<
" for material idx=" << materialIndex <<
G4endl;
417 while ( std::fabs(1.-r3/theCutInLength)>epsilon ) {
418 if ( theCutInLength <= r3 ) {
423 T3 = std::sqrt(T1*T2);
424 r3 = rangeVector->
Value(T3);