88 ed <<
"Initialisation called from a worker thread ";
94 theFlag =
new std::vector<G4bool>;
135 return (idx < theFlag->size()) ? (*theFlag)[idx] :
false;
150 const std::vector<G4PhysicsTable*>& list)
153 size_t n_processes = list.size();
154 if(1 >= n_processes) {
return; }
156 size_t nCouples = dedxTable->size();
159 if(0 >= nCouples) {
return; }
161 for (
size_t i=0; i<nCouples; ++i) {
163 if(pv0 ==
nullptr) {
continue; }
166 for (
size_t j=0; j<npoints; ++j) {
168 for (
size_t k=0; k<n_processes; ++k) {
189 const std::size_t nCouples = dedxTable->size();
190 if(0 >= nCouples) {
return; }
192 const std::size_t
n = 100;
195 for (std::size_t i=0; i<nCouples; ++i) {
197 if((pv ==
nullptr) || (
isBaseMatActive && !(*theFlag)[i])) {
continue; }
199 std::size_t bin0 = 0;
209 for (std::size_t k=1; k<npoints; ++k) {
213 if(dedx1 > 0.0) {
break; }
222 if(npoints < 3) { npoints = 3; }
224 delete (*rangeTable)[i];
235 for (std::size_t j=1; j<npoints; ++j) {
238 G4double de = (energy2 - energy1) * del;
241 std::size_t idx = j - 1;
244 for (std::size_t k=0; k<
n; ++k) {
247 if(dedx1 > 0.0) { sum += de/dedx1; }
267 std::size_t nCouples = rangeTable->size();
268 if(0 >= nCouples) {
return; }
270 for (std::size_t i=0; i<nCouples; ++i) {
275 delete (*invRangeTable)[i];
278 for (std::size_t j=0; j<npoints; ++j) {
299 std::size_t nFlags =
theFlag->size();
307 for(std::size_t i=0; i<nCouples; ++i) {
320 theFlag->resize(nCouples,
true);
321 if(
nullptr == table) {
return; }
329 for(std::size_t i=0; i<nCouples; ++i) {
330 (*theFlag)[i] = table->
GetFlag(i);
336 for(std::size_t i=0; i<nCouples; ++i) {
341 auto mat = couple->GetMaterial();
342 auto bmat = mat->GetBaseMaterial();
345 if(
nullptr != bmat) {
346 for(std::size_t j=0; j<nCouples; ++j) {
347 if(j == i) {
continue; }
350 if(bcouple->GetMaterial() == bmat &&
351 bcouple->GetProductionCuts() == pcuts) {
354 (*theDensityFactor)[i] = mat->GetDensity()/bmat->GetDensity();
355 (*theDensityIdx)[i] = j;
356 (*theFlag)[i] =
false;
359 (*theDensityFactor)[j] = 1.0;
360 (*theDensityIdx)[j] = j;
361 (*theFlag)[j] =
true;
392 if(
nullptr == table) {
return table; }
405 std::size_t numOfCouples = theCoupleTable->
GetTableSize();
409 for(std::size_t i=0; i<numOfCouples; ++i) {
432 if(
nullptr != aVector) {
435 for(
G4int j=0; j<=
n; ++j) {
static const G4double emax
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
static G4EmParameters * Instance()
G4int NumberOfBinsPerDecade() const
G4bool GetBaseMaterialFlag()
G4EmParameters * theParameters
void BuildRangeTable(const G4PhysicsTable *dedxTable, G4PhysicsTable *rangeTable)
void BuildDEDXTable(G4PhysicsTable *dedxTable, const std::vector< G4PhysicsTable * > &)
static std::vector< G4int > * theDensityIdx
const std::vector< G4double > * GetDensityFactors() const
const std::vector< G4int > * GetCoupleIndexes() const
void InitialiseBaseMaterials(const G4PhysicsTable *table=nullptr)
G4PhysicsTable * BuildTableForModel(G4PhysicsTable *table, G4VEmModel *model, const G4ParticleDefinition *, G4double emin, G4double emax, G4bool spline)
G4bool GetFlag(size_t idx)
G4LossTableBuilder(G4bool master=true)
void BuildInverseRangeTable(const G4PhysicsTable *rangeTable, G4PhysicsTable *invRangeTable)
static std::vector< G4bool > * theFlag
static std::vector< G4double > * theDensityFactor
const G4Material * GetMaterial() const
G4ProductionCuts * GetProductionCuts() const
const G4Material * GetBaseMaterial() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void PutValues(const std::size_t index, const G4double energy, const G4double value)
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
G4bool GetFlag(std::size_t i) const
void PutValue(const std::size_t index, const G4double value)
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
virtual G4double MinPrimaryEnergy(const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
static constexpr double eV
G4double energy(const ThreeVector &p, const G4double m)
T max(const T t1, const T t2)
brief Return the largest of the two arguments