100 if (!fgets(
line, 132, fp)) {
101 Warning(
"ReadRangeTable",
"Problem reading energy limits in range table file for %s (%s)",
106 if (!strncmp(
line,
"COMPOUND", 8)) {
108 if (fgets(
line, 132, fp)) {}
109 int nel = atoi(
line);
110 for (
int el = 0; el < nel; el++) {
111 if (fgets(
line, 132, fp)) {}
113 sscanf(
line,
"%d %d %d", &z, &
a, &w);
117 else if (!strncmp(
line,
"MIXTURE", 7)) {
119 if (fgets(
line, 132, fp)) {}
120 int nel = atoi(
line);
121 for (
int el = 0; el < nel; el++) {
122 if (fgets(
line, 132, fp)) {}
125 sscanf(
line,
"%d %d %d %f", &z, &
a, &nat, &w);
130 if (!fgets(
line, 132, fp)) {
131 Warning(
"ReadRangeTable",
"Problem reading energy limits in range table file for %s (%s)",
136 while (
line[0] ==
'Z') {
139 sscanf(
line,
"Z = %d,%d %f < E/A < %f MeV", &z1,
141 if (fgets(
line, 132, fp)) {}
142 for (
int i = z1; i <= z2; i++) {
153 0., 1.e+03, 0,
"KVedaLossMaterial",
"RangeFunc");
157 0., 1.e+03, 0,
"KVedaLossMaterial",
"StoppingFunc");
160 my_npx =
gEnv->
GetValue(
"KVedaLoss.EnergyLoss.Npx", 100);
162 0., 1.e+03, 0,
"KVedaLossMaterial",
"DeltaEFunc");
165 my_npx =
gEnv->
GetValue(
"KVedaLoss.ResidualEnergy.Npx", 100);
167 0., 1.e+03, 0,
"KVedaLossMaterial",
"EResFunc");
172 if (sscanf(
line,
"%lf %lf %lf %lf %lf %lf %lf %lf",
178 Error(
"ReadRangeTable",
"problem reading coeffs 0-7 in range table for %s (%s)",
GetName(),
GetType());
181 if (!fgets(
line, 132, fp)) {
186 if (sscanf(
line,
"%lf %lf %lf %lf %lf %lf",
191 Error(
"ReadRangeTable",
"problem reading coeffs 8-13 in range table for %s (%s)",
GetName(),
GetType());
215 if (fgets(
line, 132, fp)) {}
294 for (
int j = 2; j < 7; j++)
299 for (
int jj = 2; jj < 7; jj++)
303 adm = (y2 - y1) / (x2 - x1);
306 if (isoAmat > 0.0)
riso *= (isoAmat /
fAmat);
343 for (
int j = 2; j < 7; j++)
348 for (
int jj = 2; jj < 7; jj++)
352 adm = (y2 - y1) / (x2 - x1);
355 if (isoAmat > 0.0)
riso *= (isoAmat /
fAmat);
379 ran = (*par)[2] + (*par)[3] *
DLEP;
411 ran = (*par)[2] + (*par)[3] *
DLEP;
413 for (
int i = 4; i < 8; i++) {
474 if (Z == 0)
return 0.0;
494 if (Z == 0)
return 0.0;
515 if (Z == 0)
return 0.0;
535 if (Z == 0)
return 0.0;
554 if (Z == 0)
return 0.0;
580 rangepar = std::vector<Double_t>(
fCoeff[Zion - 1].begin() + 2,
fCoeff[Zion - 1].end());
581 Aion =
fCoeff[Zion - 1][1];
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define ZMAX_VEDALOSS
maximum atomic number included in range tables
char * Form(const char *fmt,...)
const Char_t * GetType() const
Material for use in energy loss & range calculations.
void AddCompoundElement(Int_t Z, Int_t A, Int_t Natoms)
TF1 * fDeltaE
function parameterising energy loss in material
void AddMixtureElement(Int_t Z, Int_t A, Int_t Natoms, Double_t Proportion)
Double_t fAmat
effective mass number of material
TF1 * fEres
function parameterising residual energy after crossing material
TF1 * fRange
function parameterising range of charged particles in material
TF1 * fStopping
function parameterising stopping power of charged particles in material
Double_t fRangeOfLastDE
range corresponding to last calculated DE
Abstract base class for calculation of range & energy loss of charged particles in matter.
Dedicated optimised inversion of range-energy function for KVedaLoss.
Description of material in the KVedaLoss range table.
Double_t EResFunc(Double_t *, Double_t *)
TObjArray fInvRange
KVedaLossInverseRangeFunction objects.
Float_t GetEminValid(Int_t Z, Int_t A) const
virtual Double_t GetEResOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat=0.)
static KVedaLoss * fgTable
Double_t thickness
in g/cm**2
virtual TF1 * GetDeltaEFunction(Double_t e, Int_t Z, Int_t A, Double_t isoAmat=0)
virtual Double_t GetDeltaEOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat=0.)
Double_t StoppingFunc(Double_t *, Double_t *)
Bool_t ReadRangeTable(FILE *fp)
Double_t RF_Z
internal variables used by RangeFunc/DeltaEFunc
std::vector< Double_t > fEmin
Z-dependent minimum energy/nucleon for calculation to be valid.
virtual TF1 * GetRangeFunction(Int_t Z, Int_t A, Double_t isoAmat=0)
virtual ~KVedaLossMaterial()
Destructor.
Double_t RangeFunc(Double_t *, Double_t *)
std::vector< Double_t > fEmax
Z-dependent maximum energy/nucleon for calculation to be valid.
virtual Double_t GetRangeOfIon(Int_t Z, Int_t A, Double_t E, Double_t isoAmat=0.)
static Bool_t fNoLimits
if kTRUE, ignore max E limit for validity of calculation
virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0.)
void GetParameters(Int_t Zion, Int_t &Aion, std::vector< Double_t > &rangepar)
std::vector< Double_t > * par
Double_t DeltaEFunc(Double_t *, Double_t *)
KVedaLossMaterial()
Default constructor.
virtual TF1 * GetStoppingFunction(Int_t Z, Int_t A, Double_t isoAmat=0)
Float_t GetEmaxValid(Int_t Z, Int_t A) const
std::vector< std::vector< Double_t > > fCoeff
parameters for range tables
virtual Double_t GetEIncFromEResOfIon(Int_t Z, Int_t A, Double_t Eres, Double_t e, Double_t isoAmat=0.)
virtual TF1 * GetEResFunction(Double_t e, Int_t Z, Int_t A, Double_t isoAmat=0)
C++ implementation of VEDALOSS stopping power calculation.
static Bool_t IsUseNewRangeInversion()
virtual void SetOwner(Bool_t enable=kTRUE)
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Double_t GetMinimumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual void SetRange(Double_t xmin, Double_t xmax)
virtual void SetNpx(Int_t npx=100)
virtual Double_t GetX(Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual Double_t GetMaximumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual const char * GetName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
Double_t Min(Double_t a, Double_t b)
Double_t Power(Double_t x, Double_t y)
Double_t Max(Double_t a, Double_t b)
#define R0(v, w, x, y, z, i)