#include <G4PhysicsOrderedFreeVector.hh>
Inheritance diagram for G4PhysicsOrderedFreeVector:
Public Member Functions | |
G4PhysicsOrderedFreeVector () | |
G4PhysicsOrderedFreeVector (G4double *Energies, G4double *Values, size_t VectorLength) | |
virtual | ~G4PhysicsOrderedFreeVector () |
void | InsertValues (G4double energy, G4double value) |
G4double | GetLowEdgeEnergy (size_t binNumber) const |
G4double | GetMaxValue () |
G4double | GetMinValue () |
G4double | GetEnergy (G4double aValue) |
G4double | GetMaxLowEdgeEnergy () |
G4double | GetMinLowEdgeEnergy () |
void | DumpValues () |
Definition at line 67 of file G4PhysicsOrderedFreeVector.hh.
G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector | ( | ) |
Definition at line 74 of file G4PhysicsOrderedFreeVector.cc.
References T_G4PhysicsOrderedFreeVector, and G4PhysicsVector::type.
00075 : G4PhysicsVector() 00076 { 00077 type = T_G4PhysicsOrderedFreeVector; 00078 }
G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector | ( | G4double * | Energies, | |
G4double * | Values, | |||
size_t | VectorLength | |||
) |
Definition at line 61 of file G4PhysicsOrderedFreeVector.cc.
References InsertValues(), T_G4PhysicsOrderedFreeVector, and G4PhysicsVector::type.
00064 : G4PhysicsVector() 00065 { 00066 type = T_G4PhysicsOrderedFreeVector; 00067 00068 for (size_t i = 0 ; i < VectorLength ; i++) 00069 { 00070 InsertValues(Energies[i], Values[i]); 00071 } 00072 }
G4PhysicsOrderedFreeVector::~G4PhysicsOrderedFreeVector | ( | ) | [virtual] |
void G4PhysicsOrderedFreeVector::DumpValues | ( | ) | [inline] |
Definition at line 72 of file G4PhysicsOrderedFreeVector.icc.
References G4PhysicsVector::binVector, G4PhysicsVector::dataVector, G4cout, G4endl, and G4PhysicsVector::numberOfNodes.
Referenced by G4Scintillation::DumpPhysicsTable(), G4OpWLS::DumpPhysicsTable(), G4OpRayleigh::DumpPhysicsTable(), and G4Cerenkov::DumpPhysicsTable().
00073 { 00074 for (size_t i = 0; i < numberOfNodes; i++) 00075 { 00076 G4cout << binVector[i] << "\t" << dataVector[i] << G4endl; 00077 } 00078 }
Definition at line 112 of file G4PhysicsOrderedFreeVector.cc.
References GetMaxLowEdgeEnergy(), GetMaxValue(), GetMinLowEdgeEnergy(), and GetMinValue().
Referenced by G4SPSRandomGenerator::GenRandEnergy(), G4SPSRandomGenerator::GenRandPhi(), G4SPSRandomGenerator::GenRandPosPhi(), G4SPSRandomGenerator::GenRandPosTheta(), G4SPSRandomGenerator::GenRandTheta(), G4SPSRandomGenerator::GenRandX(), G4SPSRandomGenerator::GenRandY(), G4SPSRandomGenerator::GenRandZ(), G4Scintillation::PostStepDoIt(), and G4OpWLS::PostStepDoIt().
00113 { 00114 00115 if (aValue <= GetMinValue()) { 00116 return GetMinLowEdgeEnergy(); 00117 } else if (aValue >= GetMaxValue()) { 00118 return GetMaxLowEdgeEnergy(); 00119 } else { 00120 size_t closestBin = FindValueBinLocation(aValue); 00121 G4double theEnergy = LinearInterpolationOfEnergy(aValue, closestBin); 00122 00123 return theEnergy; 00124 } 00125 }
G4double G4PhysicsOrderedFreeVector::GetLowEdgeEnergy | ( | size_t | binNumber | ) | const [virtual] |
Reimplemented from G4PhysicsVector.
Definition at line 107 of file G4PhysicsOrderedFreeVector.cc.
References G4PhysicsVector::binVector.
Referenced by G4SPSRandomGenerator::GenRandEnergy(), G4SPSRandomGenerator::GenRandPhi(), G4SPSRandomGenerator::GenRandPosPhi(), G4SPSRandomGenerator::GenRandPosTheta(), G4SPSRandomGenerator::GenRandTheta(), G4SPSRandomGenerator::GenRandX(), G4SPSRandomGenerator::GenRandY(), and G4SPSRandomGenerator::GenRandZ().
00108 { 00109 return binVector[binNumber]; 00110 }
G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy | ( | ) | [inline] |
Definition at line 60 of file G4PhysicsOrderedFreeVector.icc.
References G4PhysicsVector::binVector.
Referenced by G4SPSEneDistribution::ArbInterpolate(), GetEnergy(), and G4Cerenkov::PostStepDoIt().
00061 { 00062 return binVector.back(); 00063 }
G4double G4PhysicsOrderedFreeVector::GetMaxValue | ( | ) | [inline] |
Definition at line 48 of file G4PhysicsOrderedFreeVector.icc.
References G4PhysicsVector::dataVector.
Referenced by GetEnergy(), G4Scintillation::PostStepDoIt(), G4OpWLS::PostStepDoIt(), G4Cerenkov::PostStepDoIt(), and G4Cerenkov::PostStepGetPhysicalInteractionLength().
00049 { 00050 return dataVector.back(); 00051 }
G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy | ( | ) | [inline] |
Definition at line 66 of file G4PhysicsOrderedFreeVector.icc.
References G4PhysicsVector::binVector.
Referenced by G4SPSEneDistribution::ArbInterpolate(), GetEnergy(), and G4Cerenkov::PostStepDoIt().
00067 { 00068 return binVector.front(); 00069 }
G4double G4PhysicsOrderedFreeVector::GetMinValue | ( | ) | [inline] |
Definition at line 54 of file G4PhysicsOrderedFreeVector.icc.
References G4PhysicsVector::dataVector.
Referenced by GetEnergy().
00055 { 00056 return dataVector.front(); 00057 }
Definition at line 90 of file G4PhysicsOrderedFreeVector.cc.
References G4PhysicsVector::binVector, G4PhysicsVector::dataVector, G4PhysicsVector::edgeMax, G4PhysicsVector::edgeMin, and G4PhysicsVector::numberOfNodes.
Referenced by G4MaterialPropertiesTable::AddEntry(), G4SPSEneDistribution::ArbEnergyHisto(), G4SPSEneDistribution::ArbEnergyHistoFile(), G4SPSEneDistribution::EpnEnergyHisto(), G4PhysicsOrderedFreeVector(), G4SPSRandomGenerator::GenRandEnergy(), G4SPSRandomGenerator::GenRandPhi(), G4SPSRandomGenerator::GenRandPosPhi(), G4SPSRandomGenerator::GenRandPosTheta(), G4SPSRandomGenerator::GenRandTheta(), G4SPSRandomGenerator::GenRandX(), G4SPSRandomGenerator::GenRandY(), G4SPSRandomGenerator::GenRandZ(), G4GDMLReadMaterials::PropertyRead(), G4SPSRandomGenerator::SetEnergyBias(), G4SPSRandomGenerator::SetPhiBias(), G4SPSRandomGenerator::SetPosPhiBias(), G4SPSRandomGenerator::SetPosThetaBias(), G4SPSRandomGenerator::SetThetaBias(), G4SPSRandomGenerator::SetXBias(), G4SPSRandomGenerator::SetYBias(), G4SPSRandomGenerator::SetZBias(), G4SPSAngDistribution::UserDefAngPhi(), G4SPSAngDistribution::UserDefAngTheta(), and G4SPSEneDistribution::UserEnergyHisto().
00091 { 00092 std::vector<G4double>::iterator binLoc = 00093 std::lower_bound(binVector.begin(), binVector.end(), energy); 00094 00095 size_t binIdx = binLoc - binVector.begin(); // Iterator difference! 00096 00097 std::vector<G4double>::iterator dataLoc = dataVector.begin() + binIdx; 00098 00099 binVector.insert(binLoc, energy); 00100 dataVector.insert(dataLoc, value); 00101 00102 numberOfNodes++; 00103 edgeMin = binVector.front(); 00104 edgeMax = binVector.back(); 00105 }