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* )
std::vector< double > fInverse
void InitialiseInverseProbability(double xmax=3e28)
static double ComputeDistance(double sTransform, double D, double t)
double EstimateCrossingTime(double proba, double distance, double D)
double PlotInverse(double *x, double *)
static double GetCumulativeProbability(double sTransform)
void PrepareReverseTable(double xmin, double xmax)
G4DNASmoluchowskiDiffusion(double epsilon=1e-5)
double GetInverseProbability(double proba)
double fIncreasingCumulativeFunction
G4GLOB_DLL std::ostream G4cout
BoundingBox(double xmin, double xmax, double toleranceY)
PreviousAction fPreviousAction
double GetRandomTime(double distance, double D)
static double ComputeTime(double sTransform, double D, double r)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static double ComputeS(double r, double D, double t)
static double GetDifferential(double sTransform)
static double GetDensityProbability(double r, double _time, double D)
bool Propose(double proposedXValue, double proposedProba, double nextProba, double &returnedValue)
double epsilon(double density, double temperature)
double Plot(double *x, double *)
double GetRandomDistance(double _time, double D)
virtual ~G4DNASmoluchowskiDiffusion()