60 if (
this == &right)
return *
this;
71 verboseLevel = right.verboseLevel;
80 for (std::size_t i=0; i<=std::size_t(
TotBin); ++i)
100 if (vector !=
nullptr )
104 for (std::size_t i=0; i<=std::size_t(
TotBin); ++i)
144 G4cout <<
"G4VRangeToEnergyConverter::Convert() - ";
146 <<
" with Range Cut " << rangeCut/mm <<
"[mm]" <<
G4endl;
164 static const G4double tune = 0.025*mm*g/cm3, lowen = 30.*keV ;
173 G4cout <<
"G4VRangeToEnergyConverter::Convert() - ";
175 <<
"( " << density <<
")" <<
G4endl;
189 if (rangeVector ==
nullptr)
201 &&(theKineticEnergyCuts < lowen) )
204 theKineticEnergyCuts /= (1.+(1.-theKineticEnergyCuts/lowen)
205 * tune/(rangeCut*density));
217 return theKineticEnergyCuts;
227 if ( (lowedge<0.0)||(highedge<=lowedge) )
230 G4cerr <<
"Error in G4VRangeToEnergyConverter::SetEnergyRange()";
231 G4cerr <<
": illegal energy range" <<
"(" << lowedge/GeV;
234 G4Exception(
"G4VRangeToEnergyConverter::SetEnergyRange()",
235 "ProcCuts101",
JustWarning,
"Illegal energy range");
312 G4cout <<
"G4VRangeToEnergyConverter::BuildLossTable() - ";
324 for (std::size_t i=0; i<=std::size_t(
TotBin); ++i)
344 const G4double* atomicNumDensityVector
350 std::vector<G4double> lossV;
351 for ( std::size_t ib=0; ib<=std::size_t(
TotBin); ++ib)
354 for (i=0; i<std::size_t(NumEl); ++i)
356 G4int IndEl = (*elementVector)[i]->GetIndex();
357 loss += atomicNumDensityVector[i]*
358 (*((*theLossTable)[IndEl]))[ib];
360 lossV.push_back(loss);
373 for ( i=0; i<=std::size_t(
TotBin); ++i )
377 if (i==0) s0 += 0.5*q;
382 Value = (s0 + 0.5*q)*dltau ;
386 Value = (s0 - 0.5*q)*dltau ;
399 std::size_t materialIndex
416 if ( theCutInLength <= r1 ) {
return T1; }
420 for (std::size_t ibin=0; ibin<=std::size_t(
TotBin); ++ibin)
424 if ( r>rmax ) rmax=r;
425 if (r <theCutInLength )
430 else if (r >theCutInLength )
438 if ( theCutInLength >= rmax )
443 G4cout <<
"G4VRangeToEnergyConverter::ConvertCutToKineticEnergy ";
445 G4cout <<
"The cut in range [" << theCutInLength/mm <<
" (mm)] ";
446 G4cout <<
" is too big " ;
447 G4cout <<
" for material idx=" << materialIndex <<
G4endl;
456 const std::size_t MAX_LOOP = 1000;
457 for (std::size_t loop_count=0; loop_count<MAX_LOOP; ++loop_count)
459 if (std::fabs(1.-r3/theCutInLength)<
epsilon )
break;
460 if ( theCutInLength <= r3 )
468 T3 = std::sqrt(T1*T2);
469 r3 = rangeVector->
Value(T3);
double epsilon(double density, double temperature)
std::vector< G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Material * > G4MaterialTable
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
static G4ElementTable * GetElementTable()
static size_t GetNumberOfElements()
G4double GetDensity() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() const
static G4MaterialTable * GetMaterialTable()
const G4String & GetName() const
const G4String & GetParticleName() const
void insert(G4PhysicsVector *)
G4double Energy(std::size_t index) const
G4double Value(G4double theEnergy, std::size_t &lastidx) const
G4double GetLowEdgeEnergy(std::size_t binNumber) const
void PutValue(std::size_t index, G4double theValue)
static G4double LowestEnergy
G4PhysicsTable G4LossTable
std::vector< G4RangeVector * > fRangeVectorStore
virtual void BuildRangeVector(const G4Material *aMaterial, G4RangeVector *rangeVector)
G4PhysicsLogVector G4RangeVector
G4bool operator!=(const G4VRangeToEnergyConverter &r) const
G4bool operator==(const G4VRangeToEnergyConverter &r) const
virtual G4double Convert(G4double rangeCut, const G4Material *material)
G4LossTable * theLossTable
static G4double GetMaxEnergyCut()
static G4double HighestEnergy
virtual G4double ComputeLoss(G4double AtomicNumber, G4double KineticEnergy)=0
G4double ConvertCutToKineticEnergy(G4RangeVector *theRangeVector, G4double theCutInLength, std::size_t materialIndex) const
G4int GetVerboseLevel() const
G4VRangeToEnergyConverter()
static void SetMaxEnergyCut(G4double value)
virtual void BuildLossTable()
static G4double MaxEnergyCut
static G4double GetLowEdgeEnergy()
virtual ~G4VRangeToEnergyConverter()
static void SetEnergyRange(G4double lowedge, G4double highedge)
static G4double GetHighEdgeEnergy()
const G4ParticleDefinition * theParticle
G4PhysicsLogVector G4LossVector
G4VRangeToEnergyConverter & operator=(const G4VRangeToEnergyConverter &r)