60 #define State(theXInfo) (fpBrownianState->theXInfo)
70 #define GREEN_ON_BLUE "\033[1;32;44m"
71 #define RESET "\033[0m"
73 static double InvErf(
double x)
78 static double InvErfc(
double x)
112 if (
this == &rhs)
return *
this;
143 const double timeStep,
159 if(
GetIT(track)->GetTrackingInfo()->IsLeadingStep())
162 bool makeException =
true;
170 exceptionDescription <<
"ComputeStep is called while the track has the minimum interaction time";
171 exceptionDescription <<
" so it should not recompute a timeStep ";
172 G4Exception(
"G4DNABrownianTransportation::ComputeStep",
"G4DNABrownianTransportation001",
177 State(fGeometryLimitedStep) =
false;
188 while(spaceStep >
State(endpointDistance))
197 spaceStep = sqrt(x*x + y*y + z*z);
212 State(fEndGlobalTimeComputed) = true ;
219 <<
"G4ITBrownianTransportation::ComputeStep() : "
221 <<
" : Molecule name: " << molecule-> GetName()
223 <<
"Diffusion length : " <<
G4BestUnit(spaceStep,
"Length")
224 <<
" within time step : " <<
G4BestUnit(timeStep,
"Time")
240 <<
"G4ITBrownianTransportation::PostStepDoIt() :"
262 << setw(18)<<
"G4DNABrownianTransportation::Diffusion :"
276 if(waterDensity == 0.0)
297 G4double xMomentum = cos(phi)* sin(theta);
298 G4double yMomentum = sin(theta)*sin(phi);
302 State(fMomentumChanged) =
true;
330 if(
State(fGeometryLimitedStep))
338 State(theInteractionTimeLeft) = (geometryStepLength*geometryStepLength)/(64 * diffusionCoefficient);
342 State(theInteractionTimeLeft) = 1/(4*diffusionCoefficient) * pow(geometryStepLength/InvErfc(
G4UniformRand()),2);
346 State(fPathLengthWasCorrected) =
false;
350 geometryStepLength = 2*sqrt(diffusionCoefficient*
State(theInteractionTimeLeft) ) *InvErf(
G4UniformRand());
351 State(fPathLengthWasCorrected) =
true;
352 State(endpointDistance) = geometryStepLength;
355 return geometryStepLength ;
ThreeVector shoot(const G4int Ap, const G4int Af)
const std::vector< double > * GetDensityTableFor(const G4Material *) const
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4double GetLocalTime() const
G4ParticleChangeForTransport fParticleChange
G4DNABrownianTransportation & operator=(const G4DNABrownianTransportation &other)
std::ostringstream G4ExceptionDescription
G4double GetStepLength() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &)
static double inverseErf(double t)
const G4ThreeVector & GetPosition() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &)
G4double GetDiffusionCoefficient() const
virtual void StartTracking(G4Track *aTrack)
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual const G4String & GetName() const =0
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection)
static G4NistManager * Instance()
const G4String & GetParticleName() const
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
G4StepPoint * GetPreStepPoint() const
const G4String & GetName() const
G4bool fUseMaximumTimeBeforeReachingBoundary
virtual void StartTracking(G4Track *aTrack)
const G4ThreeVector & GetMomentumDirection() const
G4IT * GetIT(const G4Track *track)
G4GLOB_DLL std::ostream G4cout
G4bool fPathLengthWasCorrected
G4int GetCurrentStepNumber() const
void SetInstantiateProcessState(G4bool flag)
void SetProcessSubType(G4int)
G4double GetDeltaTime() const
G4double GetGlobalTime() const
G4Molecule * GetMolecule(const G4Track &track)
const G4String & GetProcessName() const
G4Material * GetMaterial() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4DNAMolecularMaterial * Instance()
const G4VProcess * GetProcessDefinedStep() const
#define InitProcessState(destination, source)
G4StepPoint * GetPostStepPoint() const
virtual void ComputeStep(const G4Track &, const G4Step &, const double, double &)
void ProposeEnergy(G4double finalEnergy)
void Diffusion(const G4Track &track)
G4DNABrownianTransportation(const G4String &aName="DNABrownianTransportation", G4int verbosityLevel=1)
G4double GetGlobalTime() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void ProposeTrackStatus(G4TrackStatus status)
virtual ~G4DNABrownianTransportation()
G4bool ProposesTimeStep() const
void SetMomentumChanged(G4bool b)
G4int GetProcessSubType() const
const std::vector< G4double > * fpWaterDensity
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)