33#ifndef G4DNASMOLUCHOWSKIDIFFUSION_HH_
34#define G4DNASMOLUCHOWSKIDIFFUSION_HH_
61 return root_random.Rndm();
64#define G4cout std::cout
65#define G4endl std::endl
76 static double ComputeS(
double r,
double D,
double t)
78 double sTransform = r / (2. * std::sqrt(
D * t));
84 return sTransform * 2. * std::sqrt(
D * t);
89 return std::pow(r / sTransform, 2.) / (4. *
D);
125 static double constant = -4./std::sqrt(3.141592653589793);
126 return sTransform*sTransform*
G4Exp(-sTransform*sTransform)*constant;
131 static double my_pi = 3.141592653589793;
132 static double constant = 4.*my_pi/std::pow(4.*my_pi, 1.5);
133 return r*r/std::pow(
D * _time,1.5)*
G4Exp(-r*r/(4. *
D * _time))*constant;
182 double proposedProba,
184 double& returnedValue)
194 bool returnFlag =
false;
202 if(proposedXValue >
fXmin)
203 fXmin = proposedXValue;
207 if(proposedXValue <
fXmax)
208 fXmax = proposedXValue;
221 if(proposedXValue <
fXmax)
222 fXmax = proposedXValue;
226 if(proposedXValue >
fXmin)
228 fXmin = proposedXValue;
239 fSum = proposedProba;
245 fXmax = proposedXValue;
249 fXmin = proposedXValue;
279 if(boundingBox.
Propose(x, newProba, nextProba, proposedX))
305 static double constant = 2./std::sqrt(3.141592653589793);
306 return erfc(sTransform) + constant*sTransform*
G4Exp(-sTransform*sTransform);
311 auto index_low = (size_t) trunc(proba/
fEpsilon);
321 double tangente = (low_y-up_y)/(low_x - up_x);
323 return low_y + tangente*(proba-low_x);
326 size_t index_up = index_low+1;
340 double tangente = (low_y-up_y)/(low_x - up_x);
342 return low_y + tangente*(proba-low_x);
350 double Plot(
double* x,
double* )
G4double epsilon(G4double density, G4double temperature)
G4double D(G4double temp)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
double GetInverseProbability(double proba)
void PrepareReverseTable(double xmin, double xmax)
std::vector< double > fInverse
static double GetDensityProbability(double r, double _time, double D)
static double GetDifferential(double sTransform)
double GetRandomTime(double distance, double D)
double Plot(double *x, double *)
static double ComputeDistance(double sTransform, double D, double t)
static double ComputeTime(double sTransform, double D, double r)
virtual ~G4DNASmoluchowskiDiffusion()
static double ComputeS(double r, double D, double t)
double EstimateCrossingTime(double proba, double distance, double D)
void InitialiseInverseProbability(double xmax=3e28)
G4DNASmoluchowskiDiffusion(double epsilon=1e-5)
double GetRandomDistance(double _time, double D)
static double GetCumulativeProbability(double sTransform)
double PlotInverse(double *x, double *)
BoundingBox(double xmin, double xmax, double toleranceY)
double fIncreasingCumulativeFunction
PreviousAction fPreviousAction
bool Propose(double proposedXValue, double proposedProba, double nextProba, double &returnedValue)