Jpp
18.0.1-rc.2
the software that should make you happy
|
Abstract base class for calculating the total probability (/m^2 target cross-section) for a photon from the source to hit the target (with a given, fixed number of scatterings) by Monte Carlo sampling the available nscat*3 dimensional phase space. More...
#include <JMarkovIntegrator.hh>
Public Member Functions | |
JMarkovIntegrator () | |
standard constructor More... | |
vector< double > | integrate (int N, int nscat, JSourceModel *src, JScatteringModel *sm, JTargetModel *trg, double lambda_abs) |
Integrate with N samples. More... | |
vector< double > | dummy_integrate (int N, int nscat, JSourceModel *src, JScatteringModel *sm, JTargetModel *trg, double lambda_abs) |
Integrate a test function with N samples. More... | |
vector< JPhotonPath > | get_diagnostic_ensemble (int N, int nscat, JSourceModel *src, JScatteringModel *sm, JTargetModel *trg, double lambda_abs) |
Return photon paths generated with the generatePath method. More... | |
Protected Member Functions | |
virtual JPhotonPath | generatePath (int nscat, double &winv) |
Generate a random photon path with a given number of scatterings. More... | |
virtual JPosition3D | generatePosition (int nscat, int nv, double &winv)=0 |
Generate a random position for vertex nv. More... | |
Abstract base class for calculating the total probability (/m^2 target cross-section) for a photon from the source to hit the target (with a given, fixed number of scatterings) by Monte Carlo sampling the available nscat*3 dimensional phase space.
The sample distribution is implemented in derived classes.
Random numbers are drawn from gRandom.
Definition at line 39 of file JMarkovIntegrator.hh.
|
inline |
vector< double > JMARKOV::JMarkovIntegrator::integrate | ( | int | N, |
int | nscat, | ||
JSourceModel * | src, | ||
JScatteringModel * | sm, | ||
JTargetModel * | trg, | ||
double | lambda_abs | ||
) |
Integrate with N samples.
Returns a vector with the contribution to the integral of each sample. The mean of those values is the estimate of the result of the integral, while the distribution itself can be used to estimate the stability of the result. In this distribution, you want to avoid
Definition at line 130 of file JMarkovIntegrator.hh.
vector< double > JMARKOV::JMarkovIntegrator::dummy_integrate | ( | int | N, |
int | nscat, | ||
JSourceModel * | src, | ||
JScatteringModel * | sm, | ||
JTargetModel * | trg, | ||
double | lambda_abs | ||
) |
Integrate a test function with N samples.
This can be used as a sanity check for derived classes of JMarkovIntegrator.
The integral should yield 1 when the complete relevant part of the volume is taken into account. If it does not, it may be a sign that the implementation is not correct.
Returns a vector with the contribution to the integral of each sample.
Definition at line 143 of file JMarkovIntegrator.hh.
vector< JPhotonPath > JMARKOV::JMarkovIntegrator::get_diagnostic_ensemble | ( | int | N, |
int | nscat, | ||
JSourceModel * | src, | ||
JScatteringModel * | sm, | ||
JTargetModel * | trg, | ||
double | lambda_abs | ||
) |
Return photon paths generated with the generatePath method.
This can be used to identify the parts of parameter space that are over- or undersampled in a given problem so that the integrator may be optimized to handle those better.
Definition at line 157 of file JMarkovIntegrator.hh.
|
inlineprotectedvirtual |
Generate a random photon path with a given number of scatterings.
winv must be set to the inverted probability density to generate this particular path.
Definition at line 94 of file JMarkovIntegrator.hh.
|
protectedpure virtual |
Generate a random position for vertex nv.
nv = 1 is the first scattering vertex, nv = 2 is the second scattering vertex etc.
So we require that 0 < nv <= nscat
winv has to be set to 1 over the probability density for this particular position. NOTE: this only works when the positions of each vertex are UNCORRELATED to each other (as in the default implementation of generatePath. If they are not, this method can be given a dummy implementation and be ignored.
Implemented in JMARKOV::JExperimentalIntegrator, JMARKOV::JSourceTargetIntegrator, JMARKOV::JMarkovEnsembleIntegrator, and JMARKOV::JMarkovUniformIntegrator.