49 theParticle(0), theLossTable(0), NumberOfElements(0), TotBin(300),
68 if (
this == &right)
return *
this;
78 verboseLevel = right.verboseLevel;
86 for (
size_t i=0; i<=size_t(
TotBin); i++) {
106 for (
size_t i=0; i<=size_t(
TotBin); i++) {
136 return this == &
right;
141 return this != &
right;
153 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
155 <<
" with Range Cut " << rangeCut/
mm <<
"[mm]" <<
G4endl;
179 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
181 <<
"( " << density <<
")" <<
G4endl;
195 if (rangeVector == 0) {
205 && (theKineticEnergyCuts < lowen) ) {
207 theKineticEnergyCuts /= (1.+(1.-theKineticEnergyCuts/lowen)*
208 tune/(rangeCut*density));
217 return theKineticEnergyCuts;
227 if ( (lowedge<0.0)||(highedge<=lowedge) ){
229 G4cerr <<
"Error in G4VRangeToEnergyConverter::SetEnergyRange";
230 G4cerr <<
" : illegal energy range" <<
"(" << lowedge/
GeV;
233 G4Exception(
"G4VRangeToEnergyConverter::SetEnergyRange()",
306 G4cout <<
"G4VRangeToEnergyConverter::BuildLossTable() ";
318 for (
size_t i=0; i<=size_t(
TotBin); i++) {
341 std::vector<G4double> lossV;
342 for (
size_t ib=0; ib<=size_t(
TotBin); ib++) {
344 for (i=0; i<size_t(NumEl); i++) {
345 G4int IndEl = (*elementVector)[i]->GetIndex();
346 loss += atomicNumDensityVector[i]*
347 (*((*theLossTable)[IndEl]))[ib];
349 lossV.push_back(loss);
361 for ( i=0; i<=size_t(
TotBin); i++) {
364 if (i==0) s0 += 0.5*q;
368 Value = (s0 + 0.5*q)*dltau ;
370 Value = (s0 - 0.5*q)*dltau ;
400 if ( theCutInLength <= r1 ) {
return T1; }
404 for (
size_t ibin=0; ibin<=size_t(
TotBin); ibin++) {
407 if ( r>rmax ) rmax=r;
408 if (r <theCutInLength ) {
411 }
else if (r >theCutInLength ) {
418 if ( theCutInLength >= rmax ) {
421 G4cout <<
"G4VRangeToEnergyConverter::ConvertCutToKineticEnergy ";
423 G4cout <<
"The cut in range [" << theCutInLength/
mm <<
" (mm)] ";
424 G4cout <<
" is too big " ;
425 G4cout <<
" for material idx=" << materialIndex <<
G4endl;
434 const size_t MAX_LOOP = 1000;
435 for (
size_t loop_count=0; loop_count<MAX_LOOP; ++loop_count){
436 if (std::fabs(1.-r3/theCutInLength)<epsilon )
break;
437 if ( theCutInLength <= r3 ) {
442 T3 = std::sqrt(T1*T2);
443 r3 = rangeVector->
Value(T3);
static G4double HighestEnergy
virtual void BuildLossTable()
G4PhysicsLogVector G4RangeVector
G4PhysicsLogVector G4LossVector
static constexpr double mm
G4int operator!=(const G4VRangeToEnergyConverter &right) const
std::vector< G4Element * > G4ElementVector
void insert(G4PhysicsVector *)
G4int GetVerboseLevel() const
G4LossTable * theLossTable
const G4String & GetName() const
static G4MaterialTable * GetMaterialTable()
std::vector< G4Material * > G4MaterialTable
G4double GetDensity() const
virtual void BuildRangeVector(const G4Material *aMaterial, G4RangeVector *rangeVector)
static G4double GetLowEdgeEnergy()
G4double GetLowEdgeEnergy(size_t binNumber) const
const G4ElementVector * GetElementVector() const
const G4String & GetParticleName() const
static G4double GetMaxEnergyCut()
virtual G4double ComputeLoss(G4double AtomicNumber, G4double KineticEnergy)=0
G4GLOB_DLL std::ostream G4cout
G4double ConvertCutToKineticEnergy(G4RangeVector *theRangeVector, G4double theCutInLength, size_t materialIndex) const
static size_t GetNumberOfElements()
virtual G4double Convert(G4double rangeCut, const G4Material *material)
const XML_Char int const XML_Char * value
G4int operator==(const G4VRangeToEnergyConverter &right) const
static void SetMaxEnergyCut(G4double value)
void PutValue(size_t index, G4double theValue)
G4VRangeToEnergyConverter & operator=(const G4VRangeToEnergyConverter &right)
static void SetEnergyRange(G4double lowedge, G4double highedge)
G4double Energy(size_t index) const
virtual ~G4VRangeToEnergyConverter()
G4double Value(G4double theEnergy, size_t &lastidx) const
const G4double * GetAtomicNumDensityVector() const
static constexpr double cm3
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4PhysicsTable G4LossTable
G4VRangeToEnergyConverter()
std::vector< G4RangeVector * > fRangeVectorStore
static G4double MaxEnergyCut
static constexpr double GeV
static constexpr double MeV
size_t GetNumberOfElements() const
static G4ElementTable * GetElementTable()
static constexpr double keV
double epsilon(double density, double temperature)
static G4double GetHighEdgeEnergy()
const G4ParticleDefinition * theParticle
G4GLOB_DLL std::ostream G4cerr
static G4double LowestEnergy