79 theFlag =
new std::vector<G4bool>;
95 const std::vector<G4PhysicsTable*>& list)
97 size_t n_processes = list.size();
100 if(1 >= n_processes) {
return; }
102 size_t nCouples = dedxTable->size();
103 if(0 >= nCouples) {
return; }
105 for (
size_t i=0; i<nCouples; ++i) {
113 for (
size_t j=0; j<npoints; ++j) {
115 for (
size_t k=0; k<n_processes; ++k) {
134 size_t nCouples = dedxTable->size();
135 if(0 >= nCouples) {
return; }
140 for (
size_t i=0; i<nCouples; ++i) {
142 if( !(*
theFlag)[i] ) {
continue; }
156 for (
size_t k=1; k<npoints; ++k) {
160 if(dedx1 > 0.0) {
break; }
169 if(npoints < 2) { npoints = 2; }
171 delete (*rangeTable)[i];
191 for (
size_t j=1; j<npoints; ++j) {
194 G4double de = (energy2 - energy1) * del;
199 for (
size_t k=0; k<
n; ++k) {
201 dedx1 = pv->
Value(energy);
202 if(dedx1 > 0.0) { sum += de/dedx1; }
221 size_t nCouples = rangeTable->size();
222 if(0 >= nCouples) {
return; }
224 for (
size_t i=0; i<nCouples; ++i) {
227 if( !(*
theFlag)[i] ) {
continue; }
234 delete (*invRangeTable)[i];
238 for (
size_t j=0; j<npoints; ++j) {
254 size_t nCouples = table->size();
255 size_t nFlags =
theFlag->size();
278 if(nFlags < nCouples) {
279 for(
size_t i=nFlags; i<nCouples; ++i) {
282 for(
size_t i=nFlags; i<nCouples; ++i) {
theDensityIdx->push_back(-1); }
283 for(
size_t i=nFlags; i<nCouples; ++i) {
theFlag->push_back(
true); }
285 for(
size_t i=0; i<nCouples; ++i) {
289 (*theFlag)[i] = table->
GetFlag(i);
291 (*theDensityIdx)[i] = i;
300 for(
size_t j=0; j<nCouples; ++j) {
302 if(j == i) {
continue; }
310 (*theDensityIdx)[i] = j;
312 (*theFlag)[i] =
false;
315 (*theDensityIdx)[j] = j;
316 (*theDensityFactor)[j] = 1.0;
317 (*theFlag)[j] =
true;
351 theFlag->resize(nCouples,
true);
353 for(
size_t i=0; i<nCouples; ++i) {
358 (*theDensityIdx)[i] = i;
367 for(
size_t j=0; j<nCouples; ++j) {
369 if(j == i) {
continue; }
377 (*theDensityIdx)[i] = j;
379 (*theFlag)[i] =
false;
382 (*theDensityIdx)[j] = j;
383 (*theDensityFactor)[j] = 1.0;
384 (*theFlag)[j] =
true;
413 if(!table) {
return table; }
431 for(
size_t i=0; i<numOfCouples; ++i) {
447 if(0.0 >= tmin) { tmin =
eV; }
453 n *=
G4int(std::log10(emax/tmin) + 0.5);
460 for(
G4int j=0; j<=
n; ++j) {
void BuildRangeTable(const G4PhysicsTable *dedxTable, G4PhysicsTable *rangeTable, G4bool isIonisation=false)
void PutValues(size_t binNumber, G4double binValue, G4double dataValue)
static void SetPhysicsVector(G4PhysicsTable *physTable, size_t idx, G4PhysicsVector *vec)
static G4LossTableManager * Instance()
std::vector< G4int > * theDensityIdx
G4PhysicsTable * BuildTableForModel(G4PhysicsTable *table, G4VEmModel *model, const G4ParticleDefinition *, G4double emin, G4double emax, G4bool spline)
virtual G4double MinPrimaryEnergy(const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
G4double GetDensity() const
G4bool GetFlag(size_t idx) const
size_t GetVectorLength() const
void FillSecondDerivatives()
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
size_t GetTableSize() const
void PutValue(size_t index, G4double theValue)
virtual ~G4LossTableBuilder()
void BuildInverseRangeTable(const G4PhysicsTable *rangeTable, G4PhysicsTable *invRangeTable, G4bool isIonisation=false)
G4double Energy(size_t index) const
G4double Value(G4double theEnergy, size_t &lastidx) const
static const G4double emax
void BuildDEDXTable(G4PhysicsTable *dedxTable, const std::vector< G4PhysicsTable * > &)
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::vector< G4double > * theDensityFactor
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void InitialiseBaseMaterials(G4PhysicsTable *table)
G4int GetNumberOfBinsPerDecade() const
G4double energy(const ThreeVector &p, const G4double m)
std::vector< G4bool > * theFlag
const G4Material * GetBaseMaterial() const
G4bool GetFlag(size_t i) const
G4ProductionCuts * GetProductionCuts() const
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
const G4Material * GetMaterial() const