49 theParticle(0), theLossTable(0), NumberOfElements(0), TotBin(300),
68 if (
this == &right)
return *
this;
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
G4double Energy(size_t index) const
static void SetMaxEnergyCut(G4double value)
static G4double GetLowEdgeEnergy()
static constexpr double MeV
G4double GetLowEdgeEnergy(size_t binNumber) const
static G4MaterialTable * GetMaterialTable()
static constexpr double keV
virtual void BuildRangeVector(const G4Material *aMaterial, G4RangeVector *rangeVector)
static constexpr double mm
static G4double GetHighEdgeEnergy()
G4VRangeToEnergyConverter & operator=(const G4VRangeToEnergyConverter &right)
G4double ConvertCutToKineticEnergy(G4RangeVector *theRangeVector, G4double theCutInLength, size_t materialIndex) const
const G4ElementVector * GetElementVector() const
const G4String & GetParticleName() const
G4double Value(G4double theEnergy, size_t &lastidx) const
G4int operator!=(const G4VRangeToEnergyConverter &right) const
static G4double MaxEnergyCut
G4LossTable * theLossTable
G4PhysicsTable G4LossTable
G4PhysicsLogVector G4RangeVector
const G4String & GetName() const
static constexpr double g
virtual G4double ComputeLoss(G4double AtomicNumber, G4double KineticEnergy)=0
G4int operator==(const G4VRangeToEnergyConverter &right) const
static G4double LowestEnergy
const XML_Char int const XML_Char * value
G4VRangeToEnergyConverter()
virtual G4double Convert(G4double rangeCut, const G4Material *material)
G4PhysicsLogVector G4LossVector
G4GLOB_DLL std::ostream G4cerr
std::vector< G4Material * > G4MaterialTable
double epsilon(double density, double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Element * > G4ElementVector
void insert(G4PhysicsVector *)
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * theParticle
std::vector< G4RangeVector * > fRangeVectorStore
static size_t GetNumberOfElements()
const G4double * GetAtomicNumDensityVector() const
static constexpr double cm3
static constexpr double GeV
static G4double GetMaxEnergyCut()
static void SetEnergyRange(G4double lowedge, G4double highedge)
virtual ~G4VRangeToEnergyConverter()
void PutValue(size_t index, G4double theValue)
size_t GetNumberOfElements() const
static G4ElementTable * GetElementTable()
virtual void BuildLossTable()
G4double GetDensity() const