49 theParticle(0), theLossTable(0), NumberOfElements(0), TotBin(300),
68 if (
this == &right)
return *
this;
81 verboseLevel = right.verboseLevel;
89 for (
size_t i=0; i<=size_t(
TotBin); i++) {
109 for (
size_t i=0; i<=size_t(
TotBin); i++) {
127 return this == &
right;
132 return this != &
right;
144 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
146 <<
" with Range Cut " << rangeCut/
mm <<
"[mm]" <<
G4endl;
170 G4cout <<
"G4VRangeToEnergyConverter::Convert() ";
172 <<
"( " << density <<
")" <<
G4endl;
186 if (rangeVector == 0) {
196 && (theKineticEnergyCuts < lowen) ) {
198 theKineticEnergyCuts /= (1.+(1.-theKineticEnergyCuts/lowen)*
199 tune/(rangeCut*density));
208 return theKineticEnergyCuts;
218 if ( (lowedge<0.0)||(highedge<=lowedge) ){
220 G4cerr <<
"Error in G4VRangeToEnergyConverter::SetEnergyRange";
221 G4cerr <<
" : illegal energy range" <<
"(" << lowedge/
GeV;
224 G4Exception(
"G4VRangeToEnergyConverter::SetEnergyRange()",
297 G4cout <<
"G4VRangeToEnergyConverter::BuildLossTable() ";
309 for (
size_t i=0; i<=size_t(
TotBin); i++) {
332 std::vector<G4double> lossV;
333 for (
size_t ib=0; ib<=size_t(
TotBin); ib++) {
335 for (i=0; i<size_t(NumEl); i++) {
336 G4int IndEl = (*elementVector)[i]->GetIndex();
337 loss += atomicNumDensityVector[i]*
338 (*((*theLossTable)[IndEl]))[ib];
340 lossV.push_back(loss);
349 for ( i=0; i<=size_t(
TotBin); i++) {
352 if (i==0) s0 += 0.5*q;
356 Value = (s0 + 0.5*q)*dltau ;
358 Value = (s0 - 0.5*q)*dltau ;
388 if ( theCutInLength <= r1 ) {
return T1; }
392 for (
size_t ibin=0; ibin<=size_t(
TotBin); ibin++) {
395 if ( r>rmax ) rmax=
r;
396 if (r <theCutInLength ) {
399 }
else if (r >theCutInLength ) {
406 if ( theCutInLength >= rmax ) {
409 G4cout <<
"G4VRangeToEnergyConverter::ConvertCutToKineticEnergy ";
411 G4cout <<
"The cut in range [" << theCutInLength/
mm <<
" (mm)] ";
412 G4cout <<
" is too big " ;
413 G4cout <<
" for material idx=" << materialIndex <<
G4endl;
422 while ( std::fabs(1.-r3/theCutInLength)>epsilon ) {
423 if ( theCutInLength <= r3 ) {
428 T3 = std::sqrt(T1*T2);
429 r3 = rangeVector->
Value(T3);
static G4double HighestEnergy
virtual void BuildLossTable()
G4PhysicsLogVector G4RangeVector
G4PhysicsLogVector G4LossVector
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)
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
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4PhysicsTable G4LossTable
G4VRangeToEnergyConverter()
std::vector< G4RangeVector * > fRangeVectorStore
static G4double MaxEnergyCut
const XML_Char int const XML_Char * value
size_t GetNumberOfElements() const
static G4ElementTable * GetElementTable()
static G4double GetHighEdgeEnergy()
const G4ParticleDefinition * theParticle
G4GLOB_DLL std::ostream G4cerr
static G4double LowestEnergy