Geant4 10.7.0
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
 
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

Definition at line 157 of file G4DNASmoluchowskiDiffusion.hh.

Member Function Documentation

◆ Print()

void G4DNASmoluchowskiDiffusion::BoundingBox::Print ( )
inline

Definition at line 177 of file G4DNASmoluchowskiDiffusion.hh.

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

◆ Propose()

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

Definition at line 182 of file G4DNASmoluchowskiDiffusion.hh.

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

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

Definition at line 145 of file G4DNASmoluchowskiDiffusion.hh.

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: