20#include "CLHEP/Units/SystemOfUnits.h"
47 for (
int k=0; k<Nelem; k++ ) {
51 rho += w * pe->getDensity(tempK);
52 Aeff += w * pe->getAtomicA();
53 Zeff += w * pe->getAtomicZ();
56 ATH_MSG_ERROR(
"TRT_PAI_effectiveGas::TRT_PAI_effectiveGas: wtot is zero.");
73 std::vector<float> tempv;
74 for (
int k=0; k<Nelem; k++ ) {
76 tempv = pe->getLnELvls();
85 std::vector<float>::iterator vit;
110 for (
int i=0; i<NLvls; i++ ) {
113 for (
int k=0; k<Nelem; k++ ) {
115 if (
m_lnELvls[i] >= pe->getLnELvls()[0] ) {
123 fosc = std::clamp(fosc, 1e-300,1e+300);
134 for (
int i=NLvls-1; i>=0; --i) {
143 lnSigma = std::log(sigma);
148 for (
int i=0; i<NLvls; i++) {
153 double cnst = std::log(M_PI_2*
m_Wp2);
154 for (
int i=0; i<NLvls; i++) {
173 xsig = std::max(xsig,-99.);
174 xsig = std::exp( xsig + lnE );
185 fp = std::exp(std::max(fp, -99.0));
191 fm = std::exp(std::max(fm, -99.0));
194 double x = std::exp(lnD);
195 return x/(
x*
x-1.)*(fp-fm);
204 double extraParameter ) {
212 const double U[M]={-.8611363,-.3399810, .3399810 ,.8611363};
213 const double W[M]={ .3478548, .6521452, .6521452, .3478548};
218 double Dt = 0.5*(lnHi-lnLo);
224 for (
int i=1; i<=N; i++) {
225 for (
int k=0; k<M; k++) {
226 double arg = lnLo + D*(2*i-1+U[k]);
227 OTB += W[k] * (this->*pt2Func)(arg, extraParameter );
234 ATH_MSG_WARNING(
"effectiveGas::XGInt: integrate Divergence! " << std::abs(OTB-Y) <<
" " << std::abs(eps*OTB) );
237 }
while ( (std::abs(OTB-Y) > std::abs(eps*OTB)) && (eps>0) );
249 double E = std::exp(lnE);
250 double gammaSq = gamma*gamma;
251 double betaSq = 1.-1./gammaSq;
256 std::complex<double> Ceps1(er/(E*E), std::exp(ei));
257 std::complex<double> C1 = 1./gammaSq - Ceps1*betaSq;
258 std::complex<double> C2 = C1/(1.+Ceps1) * std::log(2.*betaSq*
MeeV/(E*C1));
262 x =
m_S2/betaSq * E * ( -2.*imag(C2)/(
m_Wp2*
M_PI) + (1.-std::exp(
x))/(E*E) );
270 std::vector<float>& lnEarray,
271 std::vector< std::vector<float> >& fnArray,
272 std::vector<float>& dndx)
281 int nGamVals = gamvec.size();
285 double lnEs = -99999999.;
287 fnArray.resize(nGamVals);
291 for (
int ig=0; ig<nGamVals; ++ig ) {
292 fnArray[ig].push_back(0.);
297 for (
int ie=NLvls-1; ie>=0; --ie ) {
300 for (
int ig=0; ig<nGamVals; ++ig ) {
303 fnArray[ig][nEVals] += ds;
305 if ( std::abs(lnEs-lnEi) > Rener || ie==0 ) {
307 lnEarray.push_back( lnEs );
309 for (
int ig=0; ig<nGamVals; ++ig ) {
310 fnArray[ig].push_back( fnArray[ig][nEVals] );
318 dndx.resize(nGamVals);
319 for (
int ig = 0; ig < nGamVals; ++ig ) {
320 dndx[ig] = fnArray[ig][nEVals-1];
#define ATH_MSG_WARNING(x)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
std::vector< float > m_lnEpsI
double XFReal(double lnD, double lnE)
double XGInt(double(TRT_PAI_effectiveGas::*pt2Func)(double, double), double lnLo, double lnHi, const double eps, double extraParameter)
std::vector< float > m_lnELvls
double XSigma(double lnE, double dummy)
std::vector< float > m_lnIntegratedSigmas
void GasTab(const std::vector< float > &gamvec, std::vector< float > &EArray, std::vector< std::vector< float > > &fnArray, std::vector< float > &dndx)
Tabulate double differential distribution.
std::vector< float > m_lnEpsR
std::vector< float > m_lnFosc
double dndedx(double lgE, double gamma)
TRT_PAI_effectiveGas(TRT_PAI_gasMixture *gm, double Emin, double Emax, double tempK, double eps)
Gas mixture = mixture of gas components.
TRT_PAI_element * getElement(unsigned int n)
Get element no.
double getElemWeight(unsigned int n)
Get weight of element no.
int getNElements()
Get number of different element in this gas mixture.
const double erg
1 ev to erg {erg}
const double mb
1mb to cm2
const double MeeV
same in ev
const double Nav
Avagadro constant.
const double he
same in ev
const double Qe
Electron charge{ESU}.
const double r0
electron radius{cm}
float Interpolate(const float &xval, const std::vector< float > &xtabulated, const std::vector< float > &ytabulated)
Interpolation function.
Tell the compiler to optimize assuming that FP may trap.
#define CXXUTILS_TRAPPING_FP