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;
183 double proposedProba,
185 double& returnedValue)
195 bool returnFlag =
false;
203 if(proposedXValue >
fXmin)
204 fXmin = proposedXValue;
208 if(proposedXValue <
fXmax)
209 fXmax = proposedXValue;
222 if(proposedXValue <
fXmax)
223 fXmax = proposedXValue;
227 if(proposedXValue >
fXmin)
229 fXmin = proposedXValue;
240 fSum = proposedProba;
246 fXmax = proposedXValue;
250 fXmin = proposedXValue;
280 if(boundingBox.
Propose(x, newProba, nextProba, proposedX))
306 static double constant = 2./std::sqrt(3.141592653589793);
307 return erfc(sTransform) + constant*sTransform*
G4Exp(-sTransform*sTransform);
312 size_t index_low = (size_t) trunc(proba/
fEpsilon);
322 double tangente = (low_y-up_y)/(low_x - up_x);
324 return low_y + tangente*(proba-low_x);
327 size_t index_up = index_low+1;
341 double tangente = (low_y-up_y)/(low_x - up_x);
343 return low_y + tangente*(proba-low_x);
351 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)
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)