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) {
118 for (
size_t j=0; j<npoints; ++j) {
120 for (
size_t k=0; k<n_processes; ++k) {
139 size_t nCouples = dedxTable->size();
140 if(0 >= nCouples) {
return; }
145 for (
size_t i=0; i<nCouples; ++i) {
147 if( !(*
theFlag)[i] ) {
continue; }
161 for (
size_t k=1; k<npoints; ++k) {
165 if(dedx1 > 0.0) {
break; }
174 if(npoints < 2) { npoints = 2; }
176 delete (*rangeTable)[i];
196 for (
size_t j=1; j<npoints; ++j) {
199 G4double de = (energy2 - energy1) * del;
204 for (
size_t k=0; k<
n; ++k) {
206 dedx1 = pv->
Value(energy);
207 if(dedx1 > 0.0) { sum += de/dedx1; }
226 size_t nCouples = rangeTable->size();
227 if(0 >= nCouples) {
return; }
229 for (
size_t i=0; i<nCouples; ++i) {
232 if( !(*
theFlag)[i] ) {
continue; }
239 delete (*invRangeTable)[i];
243 for (
size_t j=0; j<npoints; ++j) {
259 size_t nCouples = table->size();
260 size_t nFlags =
theFlag->size();
283 if(nFlags < nCouples) {
284 for(
size_t i=nFlags; i<nCouples; ++i) {
287 for(
size_t i=nFlags; i<nCouples; ++i) {
theDensityIdx->push_back(-1); }
288 for(
size_t i=nFlags; i<nCouples; ++i) {
theFlag->push_back(
true); }
290 for(
size_t i=0; i<nCouples; ++i) {
294 (*theFlag)[i] = table->
GetFlag(i);
296 (*theDensityIdx)[i] = i;
305 for(
size_t j=0; j<nCouples; ++j) {
307 if(j == i) {
continue; }
315 (*theDensityIdx)[i] = j;
317 (*theFlag)[i] =
false;
320 (*theDensityIdx)[j] = j;
321 (*theDensityFactor)[j] = 1.0;
322 (*theFlag)[j] =
true;
356 theFlag->resize(nCouples,
true);
358 for(
size_t i=0; i<nCouples; ++i) {
363 (*theDensityIdx)[i] = i;
372 for(
size_t j=0; j<nCouples; ++j) {
374 if(j == i) {
continue; }
382 (*theDensityIdx)[i] = j;
384 (*theFlag)[i] =
false;
387 (*theDensityIdx)[j] = j;
388 (*theDensityFactor)[j] = 1.0;
389 (*theFlag)[j] =
true;
418 if(!table) {
return table; }
437 for(
size_t i=0; i<numOfCouples; ++i) {
453 if(0.0 >= tmin) { tmin =
eV; }
459 n *=
G4int(std::log10(emax/tmin) + 0.5);
466 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
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