Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNASmoluchowskiDiffusion::BoundingBox Struct Reference

#include <G4DNASmoluchowskiDiffusion.hh>

Public Types

enum  PreviousAction { IncreaseProba , DecreaseProba , Undefined }
 

Public Member Functions

 BoundingBox (double xmin, double xmax, double toleranceY)
 
void Print ()
 
bool Propose (double proposedXValue, double proposedProba, double nextProba, double &returnedValue)
 

Public Attributes

double fXmax
 
double fXmin
 
double fXmaxDef
 
double fXminDef
 
double fToleranceY
 
double fSum {0}
 
double fIncreasingCumulativeFunction
 
PreviousAction fPreviousAction
 

Detailed Description

Definition at line 138 of file G4DNASmoluchowskiDiffusion.hh.

Member Enumeration Documentation

◆ PreviousAction

Constructor & Destructor Documentation

◆ BoundingBox()

G4DNASmoluchowskiDiffusion::BoundingBox::BoundingBox ( double xmin,
double xmax,
double toleranceY )
inline

Member Function Documentation

◆ Print()

void G4DNASmoluchowskiDiffusion::BoundingBox::Print ( )
inline

Definition at line 176 of file G4DNASmoluchowskiDiffusion.hh.

177 {
178 G4cout << "fXmin: " << fXmin << " | fXmax: " << fXmax << G4endl;
179 }
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

◆ Propose()

bool G4DNASmoluchowskiDiffusion::BoundingBox::Propose ( double proposedXValue,
double proposedProba,
double nextProba,
double & returnedValue )
inline

Definition at line 181 of file G4DNASmoluchowskiDiffusion.hh.

185 {
186// G4cout << "---------------------------" << G4endl;
187// G4cout << "Proposed x value: " << proposedXValue
188// << "| proposedProba: " << proposedProba
189// << "| nextProba: " << nextProba
190// << " | fXmin: " << fXmin << " (" << G4DNASmoluchowskiDiffusion::GetCumulativeProbability(fXmin) <<")"
191// << " | fXmax: " << fXmax << " (" << G4DNASmoluchowskiDiffusion::GetCumulativeProbability(fXmax) <<")"
192// << G4endl;
193
194 bool returnFlag = false;
195
196 if(proposedProba < nextProba-fToleranceY) // proba trop petite ==> augmente
197 {
198 // G4cout << "proposedProba < nextProba-fToleranceY" << G4endl;
199
200 if(fIncreasingCumulativeFunction > 0) // croissant
201 {
202 if(proposedXValue > fXmin)
203 fXmin = proposedXValue;
204 }
205 else if(fIncreasingCumulativeFunction < 0) // decroissant
206 {
207 if(proposedXValue < fXmax)
208 fXmax = proposedXValue;
209 }
210
211 returnedValue = (fXmax + fXmin)/2;
212 returnFlag = false;
214 }
215 else if(proposedProba > nextProba+fToleranceY) // proba trop grande
216 {
217 // G4cout << "proposedProba > nextProba+fToleranceY" << G4endl;
218
220 {
221 if(proposedXValue < fXmax)
222 fXmax = proposedXValue;
223 }
225 {
226 if(proposedXValue > fXmin)
227 {
228 fXmin = proposedXValue;
229 }
230 }
231
232 returnedValue = (fXmax + fXmin)/2;
233 returnFlag = false;
235 }
236 else
237 {
238 // G4cout << "IN THE INTERVAL !! : " << nextProba << G4endl;
239 fSum = proposedProba;
240
241 // Assuming search for next proba is increasing
243 {
244 fXmin = fXminDef;
245 fXmax = proposedXValue;
246 }
248 {
249 fXmin = proposedXValue;
250 fXmax = fXmaxDef;
251 }
252 returnFlag = true;
254 }
255
256 return returnFlag;
257 }

Referenced by G4DNASmoluchowskiDiffusion::PrepareReverseTable().

Member Data Documentation

◆ fIncreasingCumulativeFunction

double G4DNASmoluchowskiDiffusion::BoundingBox::fIncreasingCumulativeFunction

Definition at line 146 of file G4DNASmoluchowskiDiffusion.hh.

Referenced by BoundingBox(), and Propose().

◆ fPreviousAction

PreviousAction G4DNASmoluchowskiDiffusion::BoundingBox::fPreviousAction

Definition at line 155 of file G4DNASmoluchowskiDiffusion.hh.

Referenced by BoundingBox(), and Propose().

◆ fSum

double G4DNASmoluchowskiDiffusion::BoundingBox::fSum {0}

Definition at line 145 of file G4DNASmoluchowskiDiffusion.hh.

145{0};

Referenced by Propose().

◆ fToleranceY

double G4DNASmoluchowskiDiffusion::BoundingBox::fToleranceY

Definition at line 144 of file G4DNASmoluchowskiDiffusion.hh.

Referenced by Propose().

◆ fXmax

double G4DNASmoluchowskiDiffusion::BoundingBox::fXmax

Definition at line 140 of file G4DNASmoluchowskiDiffusion.hh.

Referenced by BoundingBox(), Print(), and Propose().

◆ fXmaxDef

double G4DNASmoluchowskiDiffusion::BoundingBox::fXmaxDef

Definition at line 142 of file G4DNASmoluchowskiDiffusion.hh.

Referenced by BoundingBox(), and Propose().

◆ fXmin

double G4DNASmoluchowskiDiffusion::BoundingBox::fXmin

Definition at line 141 of file G4DNASmoluchowskiDiffusion.hh.

Referenced by BoundingBox(), Print(), and Propose().

◆ fXminDef

double G4DNASmoluchowskiDiffusion::BoundingBox::fXminDef

Definition at line 143 of file G4DNASmoluchowskiDiffusion.hh.

Referenced by BoundingBox(), and Propose().


The documentation for this struct was generated from the following file: