190 G4Exception(
"G4PenelopeBremsstrahlungFS::BuildScaledXSTable()",
195 G4cout <<
"Entering in G4PenelopeBremsstrahlungFS::BuildScaledXSTable for " <<
197 G4cout <<
"Threshold = " << cut/
keV <<
" keV, isMaster= " << isMaster <<
204 new std::map< std::pair<const G4Material*,G4double> ,
G4PhysicsTable*>;
221 std::vector<G4double> *StechiometricFactors =
new std::vector<G4double>;
225 for (
G4int i=0;i<nElements;i++)
227 G4double fraction = fractionVector[i];
228 G4double atomicWeigth = (*elementVector)[i]->GetA()/(
g/
mole);
229 StechiometricFactors->push_back(fraction/atomicWeigth);
232 G4double MaxStechiometricFactor = 0.;
233 for (
G4int i=0;i<nElements;i++)
235 if ((*StechiometricFactors)[i] > MaxStechiometricFactor)
236 MaxStechiometricFactor = (*StechiometricFactors)[i];
239 for (
G4int i=0;i<nElements;i++)
240 (*StechiometricFactors)[i] /= MaxStechiometricFactor;
244 for (
G4int i=0;i<nElements;i++)
246 G4double Z = (*elementVector)[i]->GetZ();
247 sumz2 += (*StechiometricFactors)[i]*Z*
Z;
248 sums += (*StechiometricFactors)[i];
261 for (
G4int iel=0;iel<nElements;iel++)
263 G4double Z = (*elementVector)[iel]->GetZ();
265 G4double wgt = (*StechiometricFactors)[iel]*Z*Z/ZBR2;
275 ed <<
"Error in G4PenelopeBremsstrahlungFS::BuildScaledXSTable" <<
G4endl;
276 ed <<
"Unable to retrieve data for element " << iZ <<
G4endl;
277 G4Exception(
"G4PenelopeBremsstrahlungFS::BuildScaledXSTable()",
284 for (
size_t ie=0;ie<
nBinsE;ie++)
286 (*tempData)[ie] += wgt*(*atomData)[ie*(
nBinsX+1)+
nBinsX];
287 for (
size_t ix=0;ix<
nBinsX;ix++)
288 (*tempMatrix)[ie*nBinsX+ix] += wgt*(*atomData)[ie*(nBinsX+1)+ix];
296 for (
size_t ie=0;ie<
nBinsE;ie++)
300 for (
size_t ix=0;ix<
nBinsX;ix++)
301 tempData2[ix] = (*tempMatrix)[ie*nBinsX+ix];
307 G4double TST = 100.*std::fabs(fnorm-1.0);
311 ed <<
"G4PenelopeBremsstrahlungFS. Corrupted data files?" <<
G4endl;
312 G4cout <<
"TST= " << TST <<
"; fnorm = " << fnorm <<
G4endl;
316 G4Exception(
"G4PenelopeBremsstrahlungFS::BuildScaledXSTable()",
319 for (
size_t ix=0;ix<
nBinsX;ix++)
320 (*tempMatrix)[ie*nBinsX+ix] *= fnorm;
326 G4PhysicsTable* thePhysicsTable =
new G4PhysicsTable();
334 for (
size_t i=0;i<
nBinsX;i++)
335 thePhysicsTable->
push_back(
new G4PhysicsFreeVector(nBinsE+1));
337 for (
size_t ix=0;ix<
nBinsX;ix++)
339 G4PhysicsFreeVector* theVec =
340 (G4PhysicsFreeVector*) ((*thePhysicsTable)[ix]);
341 for (
size_t ie=0;ie<
nBinsE;ie++)
344 G4double aValue = (*tempMatrix)[ie*nBinsX+ix];
347 theVec->
PutValue(ie+1,logene,std::log(aValue));
353 G4double val1eV = (*theVec)[1]+derivative*(log1eV-theVec->
Energy(1));
357 std::pair<const G4Material*,G4double> theKey = std::make_pair(material,cut);
360 delete StechiometricFactors;
std::map< G4int, G4DataVector * > * theElementData
static const size_t nBinsE
std::vector< G4Element * > G4ElementVector
void PutValue(size_t binNumber, G4double binValue, G4double dataValue)
std::ostringstream G4ExceptionDescription
static const size_t nBinsX
void push_back(G4PhysicsVector *)
std::map< std::pair< const G4Material *, G4double >, G4PhysicsTable * > * theSamplingTable
std::map< const G4Material *, G4double > * theEffectiveZSq
const G4double * GetFractionVector() const
void InitializeEnergySampling(const G4Material *, G4double cut)
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
int classic_electr_radius
std::map< std::pair< const G4Material *, G4double >, G4PhysicsFreeVector *> * thePBcut
size_t GetNumberOfElements() const
static const double millibarn
std::map< std::pair< const G4Material *, G4double >, G4PhysicsTable * > * theReducedXSTable
const G4ElementVector * GetElementVector() const
G4double Energy(size_t index) const
void ReadDataFile(G4int Z)
const G4String & GetName() const
G4double GetMomentumIntegral(G4double *y, G4double up, G4int momOrder) const
G4double theEGrid[nBinsE]