Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VAdjointReverseReaction Class Reference

#include <G4VAdjointReverseReaction.hh>

+ Inheritance diagram for G4VAdjointReverseReaction:

Public Member Functions

 G4VAdjointReverseReaction (G4String process_name, G4bool whichScatCase)
 
virtual ~G4VAdjointReverseReaction ()
 
void PreparePhysicsTable (const G4ParticleDefinition &)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
void SetIntegralMode (G4bool aBool)
 
- Public Member Functions inherited from G4VDiscreteProcess
 G4VDiscreteProcess (const G4String &aName, G4ProcessType aType=fNotDefined)
 
 G4VDiscreteProcess (G4VDiscreteProcess &)
 
virtual ~G4VDiscreteProcess ()
 
G4VDiscreteProcessoperator= (const G4VDiscreteProcess &)=delete
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4VProcessoperator= (const G4VProcess &)=delete
 
G4bool operator== (const G4VProcess &right) const
 
G4bool operator!= (const G4VProcess &right) const
 
virtual G4VParticleChangePostStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)=0
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &track, G4ForceCondition *condition)=0
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)=0
 
G4double GetCurrentInteractionLength () const
 
void SetPILfactor (G4double value)
 
G4double GetPILfactor () const
 
G4double AlongStepGPIL (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4double AtRestGPIL (const G4Track &track, G4ForceCondition *condition)
 
G4double PostStepGPIL (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
const G4StringGetPhysicsTableFileName (const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
 
const G4StringGetProcessName () const
 
G4ProcessType GetProcessType () const
 
void SetProcessType (G4ProcessType)
 
G4int GetProcessSubType () const
 
void SetProcessSubType (G4int)
 
virtual void StartTracking (G4Track *)
 
virtual void EndTracking ()
 
virtual void SetProcessManager (const G4ProcessManager *)
 
virtual const G4ProcessManagerGetProcessManager ()
 
virtual void ResetNumberOfInteractionLengthLeft ()
 
G4double GetNumberOfInteractionLengthLeft () const
 
G4double GetTotalNumberOfInteractionLengthTraversed () const
 
G4bool isAtRestDoItIsEnabled () const
 
G4bool isAlongStepDoItIsEnabled () const
 
G4bool isPostStepDoItIsEnabled () const
 
virtual void DumpInfo () const
 
virtual void ProcessDescription (std::ostream &outfile) const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Protected Member Functions

virtual G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4double GetMeanFreePath (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)=0
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double prevStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Protected Attributes

G4VEmAdjointModeltheAdjointEMModel
 
G4ParticleChangefParticleChange
 
G4AdjointCSManagertheAdjointCSManager
 
G4bool IsScatProjToProjCase
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft = -1.0
 
G4double currentInteractionLength = -1.0
 
G4double theInitialNumberOfInteractionLength = -1.0
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType = fNotDefined
 
G4int theProcessSubType = -1
 
G4double thePILfactor = 1.0
 
G4int verboseLevel = 0
 
G4bool enableAtRestDoIt = true
 
G4bool enableAlongStepDoIt = true
 
G4bool enablePostStepDoIt = true
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 

Detailed Description

Definition at line 73 of file G4VAdjointReverseReaction.hh.

Constructor & Destructor Documentation

◆ G4VAdjointReverseReaction()

G4VAdjointReverseReaction::G4VAdjointReverseReaction ( G4String  process_name,
G4bool  whichScatCase 
)

Definition at line 43 of file G4VAdjointReverseReaction.cc.

44 :
45 G4VDiscreteProcess(process_name)
47 IsScatProjToProjCase=whichScatCase;
49 IsFwdCSUsed=false;
50 IsIntegralModeUsed=false;
51 lastCS=0.;
52 trackid = nstep = 0;
53}
static G4AdjointCSManager * GetAdjointCSManager()
G4AdjointCSManager * theAdjointCSManager

◆ ~G4VAdjointReverseReaction()

G4VAdjointReverseReaction::~G4VAdjointReverseReaction ( )
virtual

Definition at line 56 of file G4VAdjointReverseReaction.cc.

59}

Member Function Documentation

◆ BuildPhysicsTable()

void G4VAdjointReverseReaction::BuildPhysicsTable ( const G4ParticleDefinition )
virtual

Reimplemented from G4VProcess.

Definition at line 67 of file G4VAdjointReverseReaction.cc.

68{
69
70 theAdjointCSManager->BuildCrossSectionMatrices(); //do not worry it will be done just once
72
73}

◆ GetMeanFreePath()

G4double G4VAdjointReverseReaction::GetMeanFreePath ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
protectedvirtual

Implements G4VDiscreteProcess.

Definition at line 105 of file G4VAdjointReverseReaction.cc.

109 G4double preStepKinEnergy = track.GetKineticEnergy();
110
111 if(track.GetTrackID() != trackid) {
112 trackid = track.GetTrackID();
113 nstep = 0;
114 }
115 ++nstep;
116
117
118
119 /*G4double Sigma =
120 theAdjointEMModel->AdjointCrossSection(track.GetMaterialCutsCouple(),preStepKinEnergy,IsScatProjToProjCase);*/
121
122 G4double Sigma =
124
125 //G4double sig = Sigma;
126
127 G4double fwd_TotCS;
128 G4double corr = theAdjointCSManager->GetCrossSectionCorrection(track.GetDefinition(),preStepKinEnergy,track.GetMaterialCutsCouple(),IsFwdCSUsed, fwd_TotCS);
129
130 if(std::fabs(corr) > 100.) { Sigma = 0.0; }
131 else { Sigma *= corr; }
132
133 //G4cout<<fwd_TotCS<<G4endl;
134 /*if (IsFwdCSUsed && IsIntegralModeUsed){ //take the maximum cross section only for charged particle
135 G4double e_sigma_max, sigma_max;
136 theAdjointCSManager->GetMaxFwdTotalCS(track.GetDefinition(),
137 track.GetMaterialCutsCouple(), e_sigma_max, sigma_max);
138 if (e_sigma_max > preStepKinEnergy){
139 Sigma*=sigma_max/fwd_TotCS;
140 }
141 }
142 */
143
144 G4double mean_free_path = 1.e60 *mm;
145 if (Sigma>0) mean_free_path = 1./Sigma;
146 lastCS=Sigma;
147 /*
148 if(nstep > 100) {
149
150 G4cout << "#* " << track.GetDefinition()->GetParticleName()
151 << " " << GetProcessName()
152 << " Nstep " << nstep
153 << " E(MeV)= " << preStepKinEnergy << " Sig0= " << sig
154 << " sig1= " << Sigma << " mfp= " << mean_free_path << G4endl;
155
156 }
157 if (nstep > 20000) {
158 exit(1);
159 }
160 */
161 /*G4cout<<"Sigma "<<Sigma<<G4endl;
162 G4cout<<"mean_free_path [mm] "<<mean_free_path/mm<<G4endl;
163 */
164
165
166 return mean_free_path;
167}
G4double condition(const G4ErrorSymMatrix &m)
@ NotForced
double G4double
Definition: G4Types.hh:83
G4double GetCrossSectionCorrection(G4ParticleDefinition *aPartDef, G4double PreStepEkin, const G4MaterialCutsCouple *aCouple, G4bool &fwd_is_used, G4double &fwd_TotCS)
G4int GetTrackID() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)

◆ PostStepDoIt()

G4VParticleChange * G4VAdjointReverseReaction::PostStepDoIt ( const G4Track track,
const G4Step  
)
virtual

Reimplemented from G4VDiscreteProcess.

Definition at line 76 of file G4VAdjointReverseReaction.cc.

77{
78
80
81 /* if (IsFwdCSUsed && IsIntegralModeUsed){ //INtegral mode still unstable
82 G4double Tkin = step.GetPostStepPoint()->GetKineticEnergy();
83 G4double fwdCS = theAdjointCSManager->GetTotalForwardCS(track.GetDefinition(), Tkin, track.GetMaterialCutsCouple());
84 //G4cout<<"lastCS "<<lastCS<<G4endl;
85 if (fwdCS<lastCS*G4UniformRand()) { // the reaction does not take place, same integral method as the one used for forward ionisation in G4
86 ClearNumberOfInteractionLengthLeft();
87 return fParticleChange;
88 }
89
90 }
91 */
92
96
98 return fParticleChange;
99
100
101
102}
virtual void Initialize(const G4Track &)
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)=0
void ClearNumberOfInteractionLengthLeft()
Definition: G4VProcess.hh:424

◆ PreparePhysicsTable()

void G4VAdjointReverseReaction::PreparePhysicsTable ( const G4ParticleDefinition )
virtual

Reimplemented from G4VProcess.

Definition at line 62 of file G4VAdjointReverseReaction.cc.

63{;
64}

◆ SetIntegralMode()

Member Data Documentation

◆ fParticleChange

G4ParticleChange* G4VAdjointReverseReaction::fParticleChange
protected

◆ IsScatProjToProjCase

G4bool G4VAdjointReverseReaction::IsScatProjToProjCase
protected

◆ theAdjointCSManager

G4AdjointCSManager* G4VAdjointReverseReaction::theAdjointCSManager
protected

◆ theAdjointEMModel


The documentation for this class was generated from the following files: