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;
158 G4double tune = 0.025*mm*g/cm3 ,lowen = 30.*keV ;
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);
std::vector< G4Element * > G4ElementVector
std::vector< G4Material * > G4MaterialTable
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
static size_t GetNumberOfElements()
static const G4ElementTable * GetElementTable()
G4double GetDensity() const
static const G4MaterialTable * GetMaterialTable()
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() const
const G4String & GetName() const
const G4String & GetParticleName() const
void insert(G4PhysicsVector *)
G4double Value(G4double theEnergy)
virtual G4double GetLowEdgeEnergy(size_t binNumber) const
void PutValue(size_t index, G4double theValue)
static G4double LowestEnergy
std::vector< G4RangeVector * > fRangeVectorStore
virtual void BuildRangeVector(const G4Material *aMaterial, G4RangeVector *rangeVector)
G4int operator==(const G4VRangeToEnergyConverter &right) const
virtual G4double Convert(G4double rangeCut, const G4Material *material)
G4LossTable * theLossTable
G4PhysicsLogVector G4RangeVector
static G4double GetMaxEnergyCut()
static G4double HighestEnergy
G4int operator!=(const G4VRangeToEnergyConverter &right) const
G4VRangeToEnergyConverter & operator=(const G4VRangeToEnergyConverter &right)
G4PhysicsTable G4LossTable
G4int GetVerboseLevel() const
G4VRangeToEnergyConverter()
static void SetMaxEnergyCut(G4double value)
G4PhysicsLogVector G4LossVector
virtual void BuildLossTable()
static G4double MaxEnergyCut
virtual G4double ComputeLoss(G4double AtomicNumber, G4double KineticEnergy) const =0
static G4double GetLowEdgeEnergy()
virtual ~G4VRangeToEnergyConverter()
static void SetEnergyRange(G4double lowedge, G4double highedge)
static G4double GetHighEdgeEnergy()
const G4ParticleDefinition * theParticle
G4double ConvertCutToKineticEnergy(G4RangeVector *theRangeVector, G4double theCutInLength, size_t materialIndex) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)