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

#include <G4QDiscProcessMixer.hh>

+ Inheritance diagram for G4QDiscProcessMixer:

Public Member Functions

 G4QDiscProcessMixer (const G4String &processName="Mixed Discrete Process", const G4ParticleDefinition *proj=G4Gamma::Gamma(), G4ProcessType pType=fHadronic)
 
 ~G4QDiscProcessMixer ()
 
G4bool IsApplicable (const G4ParticleDefinition &particle)
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
G4double GetMeanFreePath (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)
 
G4VParticleChangePostStepDoIt (const G4Track &aTrack, const G4Step &aStep)
 
void AddDiscreteProcess (G4VDiscreteProcess *DP, G4double MaxE)
 
- Public Member Functions inherited from G4VDiscreteProcess
 G4VDiscreteProcess (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4VDiscreteProcess (G4VDiscreteProcess &)
 
virtual ~G4VDiscreteProcess ()
 
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 ()
 
G4int operator== (const G4VProcess &right) const
 
G4int 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
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 
virtual G4double GetMeanFreePath (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)=0
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChangepParticleChange
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft
 
G4double currentInteractionLength
 
G4double theInitialNumberOfInteractionLength
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType
 
G4int theProcessSubType
 
G4double thePILfactor
 
G4bool enableAtRestDoIt
 
G4bool enableAlongStepDoIt
 
G4bool enablePostStepDoIt
 
G4int verboseLevel
 

Detailed Description

Definition at line 53 of file G4QDiscProcessMixer.hh.

Constructor & Destructor Documentation

◆ G4QDiscProcessMixer()

G4QDiscProcessMixer::G4QDiscProcessMixer ( const G4String processName = "Mixed Discrete Process",
const G4ParticleDefinition proj = G4Gamma::Gamma(),
G4ProcessType  pType = fHadronic 
)

Definition at line 45 of file G4QDiscProcessMixer.cc.

47 :
48 G4VDiscreteProcess(name, pType), DPParticle(particle)
49{
50 G4HadronicDeprecate("G4QDiscProcessMixer");
51
52#ifdef debug
53 G4cout<<"G4QDiscProcessMixer::Constructor is called processName="<<name<<G4endl;
54#endif
55 if (verboseLevel>0) G4cout<<GetProcessName()<<" process is created "<<G4endl;
56}
#define G4HadronicDeprecate(name)
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetProcessName() const
Definition: G4VProcess.hh:379

◆ ~G4QDiscProcessMixer()

G4QDiscProcessMixer::~G4QDiscProcessMixer ( )

Definition at line 59 of file G4QDiscProcessMixer.cc.

60{
61 // Now the responsibility of deleting is deligated to the user, who created them
62 //for_each(theDPVector.begin(), theDPVector.end(), DeleteDiscreteProcess());
63}

Member Function Documentation

◆ AddDiscreteProcess()

void G4QDiscProcessMixer::AddDiscreteProcess ( G4VDiscreteProcess DP,
G4double  MaxE 
)

Definition at line 65 of file G4QDiscProcessMixer.cc.

66{
67 static const G4double maxEn = 1.E8*megaelectronvolt; // Conditional INF
68 if(!theDPVector.size()) // The first process in the DiscreteProcessVector (MaxE=INF)
69 {
70 std::pair<G4VDiscreteProcess*, G4double>* QDiscProc =
71 new std::pair<G4VDiscreteProcess*, G4double>(DP, maxEn);
72 theDPVector.push_back( QDiscProc );
73 }
74 else
75 {
76 if(ME < theDPVector[theDPVector.size()-1]->second)
77 {
78 std::pair<G4VDiscreteProcess*, G4double>* QDiscProc =
79 new std::pair<G4VDiscreteProcess*, G4double>(DP, ME);
80 theDPVector.push_back( QDiscProc );
81 }
82 else // Wrong Max Energy Order for the new process in the sequence of processes
83 {
84 // G4cerr<<"G4QDiscProcessMixer::AddDiscreteProcess:LastMaxE("<<theDPVector.size()-1
85 // <<")="<<theDPVector[theDPVector.size()-1]->second<<" <= MaxE="<<ME<<G4endl;
86 // G4Exception("G4QDiscProcessMixer::AddDiscreteProcess: Wrong Max Energy Order");
88 ed << " LastMaxE(" << theDPVector.size()-1 << ")="
89 << theDPVector[theDPVector.size()-1]->second << " <= MaxE=" << ME << G4endl;
90 G4Exception("G4QDiscProcessMixer::AddDiscreteProcess()", "HAD_CHPS_0000",
91 FatalException, ed);
92 }
93 }
94}
@ FatalException
double G4double
Definition: G4Types.hh:64
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76

Referenced by G4QInelasticCHIPS_HPBuilder::Build(), G4QNeutronBuilder::Build(), G4QNeutronHPBuilder::Build(), and G4QProtonBuilder::Build().

◆ GetMeanFreePath()

G4double G4QDiscProcessMixer::GetMeanFreePath ( const G4Track aTrack,
G4double  previousStepSize,
G4ForceCondition condition 
)
virtual

Implements G4VDiscreteProcess.

Definition at line 125 of file G4QDiscProcessMixer.cc.

126{
127 return DBL_MAX;
128}
#define DBL_MAX
Definition: templates.hh:83

◆ IsApplicable()

G4bool G4QDiscProcessMixer::IsApplicable ( const G4ParticleDefinition particle)
virtual

Reimplemented from G4VProcess.

Definition at line 96 of file G4QDiscProcessMixer.cc.

97{
98#ifdef debug
99 G4cout<<"G4QDiscProcessMixer::IsApplicable: part="<<particle.GetParticleName()<<" = "
100 <<DPParticle->GetParticleName()<<G4endl;
101#endif
102 if(particle == *DPParticle) return true;
103 return false;
104}
const G4String & GetParticleName() const

◆ PostStepDoIt()

G4VParticleChange * G4QDiscProcessMixer::PostStepDoIt ( const G4Track aTrack,
const G4Step aStep 
)
virtual

Reimplemented from G4VDiscreteProcess.

Definition at line 130 of file G4QDiscProcessMixer.cc.

132{
133 G4double kEn=Track.GetDynamicParticle()->GetKineticEnergy(); // Projectile kinetic energy
134 G4int maxDP=theDPVector.size();
135 if(maxDP) for(G4int i=maxDP-1; i>-1; i--) if(kEn < theDPVector[i]->second)
136 {
137#ifdef debug
138 G4cout<<"G4QDPMix::PSDoIt: i="<<i<<",kEn="<<kEn<<" < "<<theDPVector[i]->second<<G4endl;
139#endif
140 //EnMomConservation= theDPVector[i]->first->GetEnegryMomentumConservation();
141 //nOfNeutrons = theDPVector[i]->first->GetNumberOfNeutronsInTarget();
142 return theDPVector[i]->first->PostStepDoIt(Track, Step);
143 }
144 return G4VDiscreteProcess::PostStepDoIt(Track, Step);
145}
int G4int
Definition: G4Types.hh:66
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)

◆ PostStepGetPhysicalInteractionLength()

G4double G4QDiscProcessMixer::PostStepGetPhysicalInteractionLength ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
virtual

Reimplemented from G4VDiscreteProcess.

Definition at line 106 of file G4QDiscProcessMixer.cc.

109{
110 G4double kEn=Track.GetDynamicParticle()->GetKineticEnergy(); // Projectile kinetic energy
111 G4int maxDP=theDPVector.size();
112 if(maxDP) for(G4int i=maxDP-1; i>-1; i--) if(kEn < theDPVector[i]->second)
113 {
114#ifdef debug
115 G4cout<<"G4QDPMix::PSGetPIL:"<<i<<",kEn="<<kEn<<" < "<<theDPVector[i]->second<<", PIL="
116 <<theDPVector[i]->first->PostStepGetPhysicalInteractionLength(Track,PrevStSize,F)
117 <<G4endl;
118#endif
119 return theDPVector[i]->first->PostStepGetPhysicalInteractionLength(Track,PrevStSize,F);
120 }
121 return DBL_MAX;
122}

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