Geant4  10.02.p03
CexmcHadronicProcess Class Reference

#include <CexmcHadronicProcess.hh>

Inheritance diagram for CexmcHadronicProcess:
Collaboration diagram for CexmcHadronicProcess:

Public Member Functions

 CexmcHadronicProcess (const G4String &name=CexmcStudiedProcessLastName)
 
 ~CexmcHadronicProcess ()
 
G4VParticleChange * PostStepDoIt (const G4Track &track, const G4Step &step)
 
G4bool IsApplicable (const G4ParticleDefinition &particle)
 
void RegisterProductionModel (CexmcProductionModel *model)
 
- Public Member Functions inherited from G4HadronicProcess
 G4HadronicProcess (const G4String &processName="Hadronic", G4ProcessType procType=fHadronic)
 
 G4HadronicProcess (const G4String &processName, G4HadronicProcessType subType)
 
virtual ~G4HadronicProcess ()
 
void RegisterMe (G4HadronicInteraction *a)
 
G4double GetElementCrossSection (const G4DynamicParticle *part, const G4Element *elm, const G4Material *mat=0)
 
G4double GetMicroscopicCrossSection (const G4DynamicParticle *part, const G4Element *elm, const G4Material *mat=0)
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
void DumpPhysicsTable (const G4ParticleDefinition &p)
 
void AddDataSet (G4VCrossSectionDataSet *aDataSet)
 
std::vector< G4HadronicInteraction * > & GetHadronicInteractionList ()
 
G4double GetMeanFreePath (const G4Track &aTrack, G4double, G4ForceCondition *)
 
const G4NucleusGetTargetNucleus () const
 
const G4IsotopeGetTargetIsotope ()
 
virtual void ProcessDescription (std::ostream &outFile) const
 
void BiasCrossSectionByFactor (G4double aScale)
 
void SetEpReportLevel (G4int level)
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
G4CrossSectionDataStoreGetCrossSectionDataStore ()
 
void MultiplyCrossSectionBy (G4double factor)
 
- 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 G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChange * AtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChange * AlongStepDoIt (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
 
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 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
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Private Member Functions

void CalculateTargetNucleus (const G4Material *material)
 
void FillTotalResult (G4HadFinalState *hadFinalState, const G4Track &track)
 

Private Attributes

CexmcProductionModelproductionModel
 
G4HadronicInteractioninteraction
 
G4ParticleChange * theTotalResult
 
G4Nucleus targetNucleus
 
G4bool isInitialized
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 
- Protected Member Functions inherited from G4HadronicProcess
G4HadronicInteractionChooseHadronicInteraction (const G4HadProjectile &aHadProjectile, G4Nucleus &aTargetNucleus, G4Material *aMaterial, G4Element *anElement)
 
G4NucleusGetTargetNucleusPointer ()
 
void DumpState (const G4Track &, const G4String &, G4ExceptionDescription &)
 
G4HadronicInteractionGetHadronicInteraction () const
 
G4double GetLastCrossSection ()
 
void FillResult (G4HadFinalState *aR, const G4Track &aT)
 
G4HadFinalStateCheckResult (const G4HadProjectile &thePro, const G4Nucleus &targetNucleus, G4HadFinalState *result)
 
void CheckEnergyMomentumConservation (const G4Track &, const G4Nucleus &)
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 
- Protected Attributes inherited from G4HadronicProcess
G4HadProjectile thePro
 
G4ParticleChange * theTotalResult
 
G4int epReportLevel
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChange * pParticleChange
 
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 60 of file CexmcHadronicProcess.hh.

Constructor & Destructor Documentation

◆ CexmcHadronicProcess()

CexmcHadronicProcess::CexmcHadronicProcess ( const G4String name = CexmcStudiedProcessLastName)
explicit

Definition at line 58 of file CexmcHadronicProcess.cc.

58  :
59  G4HadronicProcess( name ), productionModel( NULL ), interaction( NULL ),
60  theTotalResult( NULL ), isInitialized( false )
61 {
62  theTotalResult = new G4ParticleChange();
63 }
G4HadronicInteraction * interaction
CexmcProductionModel * productionModel
G4HadronicProcess(const G4String &processName="Hadronic", G4ProcessType procType=fHadronic)
G4ParticleChange * theTotalResult

◆ ~CexmcHadronicProcess()

CexmcHadronicProcess::~CexmcHadronicProcess ( )

Definition at line 66 of file CexmcHadronicProcess.cc.

67 {
68  delete theTotalResult;
69 }
G4ParticleChange * theTotalResult

Member Function Documentation

◆ CalculateTargetNucleus()

void CexmcHadronicProcess::CalculateTargetNucleus ( const G4Material material)
private

Definition at line 86 of file CexmcHadronicProcess.cc.

88 {
89  G4int numberOfElements( material->GetNumberOfElements() );
90  if ( numberOfElements > 1 )
91  {
92  G4cout << CEXMC_LINE_START "WARNING: Number of elements in target "
93  "material is more than 1.\n Only the first "
94  "element will be chosen for target nucleus" << G4endl;
95  }
96 
97  const G4Element * element( material->GetElement( 0 ) );
98  G4double ZZ( element->GetZ() );
99  G4int Z( G4int( ZZ + 0.5 ) );
100 
101  G4StableIsotopes stableIsotopes;
102  G4int index( stableIsotopes.GetFirstIsotope( Z ) );
103  G4double AA( stableIsotopes.GetIsotopeNucleonCount( index ) );
104 
105  targetNucleus.SetParameters( AA, ZZ );
106 }
Int_t index
G4int GetFirstIsotope(G4int Z)
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
Float_t Z
#define CEXMC_LINE_START
Definition: CexmcCommon.hh:52
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:202
G4int GetIsotopeNucleonCount(G4int number)
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetParameters(const G4double A, const G4double Z)
Definition: G4Nucleus.cc:212
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillTotalResult()

void CexmcHadronicProcess::FillTotalResult ( G4HadFinalState hadFinalState,
const G4Track &  track 
)
private

Definition at line 109 of file CexmcHadronicProcess.cc.

111 {
112  G4int numberOfSecondaries( hadFinalState->GetNumberOfSecondaries() );
113 
114  theTotalResult->Clear();
115  theTotalResult->Initialize( track );
116  theTotalResult->SetSecondaryWeightByProcess( true );
117  theTotalResult->ProposeLocalEnergyDeposit(
118  hadFinalState->GetLocalEnergyDeposit() );
119  theTotalResult->SetNumberOfSecondaries( numberOfSecondaries );
120  theTotalResult->ProposeEnergy( hadFinalState->GetEnergyChange() );
121  theTotalResult->ProposeTrackStatus( fAlive );
122  if ( hadFinalState->GetStatusChange() == stopAndKill )
123  theTotalResult->ProposeTrackStatus( fStopAndKill );
124 
125  for ( G4int i( 0 ); i < numberOfSecondaries; ++i )
126  {
127  G4double time( hadFinalState->GetSecondary( i )->GetTime() );
128  if ( time < 0 )
129  time = track.GetGlobalTime();
130 
131  G4Track * newTrack( new G4Track(
132  hadFinalState->GetSecondary( i )->GetParticle(),
133  time, track.GetPosition() ) );
134 
135  G4double newWeight( track.GetWeight() *
136  hadFinalState->GetSecondary( i )->GetWeight() );
137  newTrack->SetWeight( newWeight );
138  newTrack->SetTouchableHandle( track.GetTouchableHandle() );
139  theTotalResult->AddSecondary( newTrack );
140  }
141 
142  hadFinalState->Clear();
143 }
G4int GetNumberOfSecondaries() const
G4HadSecondary * GetSecondary(size_t i)
G4double GetEnergyChange() const
G4double GetWeight() const
int G4int
Definition: G4Types.hh:78
G4HadFinalStateStatus GetStatusChange() const
G4double GetLocalEnergyDeposit() const
G4double GetTime() const
G4DynamicParticle * GetParticle()
double G4double
Definition: G4Types.hh:76
G4ParticleChange * theTotalResult
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsApplicable()

G4bool CexmcHadronicProcess::IsApplicable ( const G4ParticleDefinition particle)
virtual

Reimplemented from G4VProcess.

Definition at line 195 of file CexmcHadronicProcess.cc.

197 {
198  if ( ! productionModel )
199  return false;
200 
201  G4ParticleDefinition * incidentParticle(
203 
204  if ( ! incidentParticle )
205  return false;
206 
207  return particle == *incidentParticle;
208 }
G4ParticleDefinition * GetIncidentParticle(void) const
CexmcProductionModel * productionModel
Here is the call graph for this function:

◆ PostStepDoIt()

G4VParticleChange * CexmcHadronicProcess::PostStepDoIt ( const G4Track &  track,
const G4Step &  step 
)
virtual

Reimplemented from G4HadronicProcess.

Definition at line 146 of file CexmcHadronicProcess.cc.

148 {
149  G4TrackStatus trackStatus( track.GetTrackStatus() );
150 
151  if ( trackStatus != fAlive && trackStatus != fSuspend )
152  {
153  theTotalResult->Clear();
154  theTotalResult->Initialize( track );
155 
156  return theTotalResult;
157  }
158 
159  /* NB: the target nucleus is chosen only once, it means that it will always
160  * have same Z and A, practically the first stable isotope of the first
161  * element in elements vector will be chosen. This simplification prompts
162  * the user to choose simple single-element material for the target, for
163  * example liquid hydrogen. On the other hand target nucleus is supposedly
164  * only needed if user decides to turn Fermi motion on, so this
165  * simplification should not be very harmful */
166  if ( ! isInitialized )
167  {
168  CalculateTargetNucleus( track.GetMaterial() );
169  isInitialized = true;
170  }
171 
172  G4HadProjectile projectile( track );
173  G4HadFinalState * result( interaction->ApplyYourself( projectile,
174  targetNucleus ) );
175  FillTotalResult( result, track );
176 
177  if ( theTotalResult->GetTrackStatus() != fStopAndKill )
178  {
179  CexmcTrackInfo * trackInfo( static_cast< CexmcTrackInfo * >(
180  track.GetUserInformation() ) );
181 
182  if ( trackInfo &&
183  trackInfo->GetTypeInfo() == CexmcIncidentParticleTrackType )
184  {
185  CexmcIncidentParticleTrackInfo * theTrackInfo(
186  static_cast< CexmcIncidentParticleTrackInfo * >( trackInfo ) );
187  theTrackInfo->SetNeedsTrackLengthResampling();
188  }
189  }
190 
191  return theTotalResult;
192 }
G4HadronicInteraction * interaction
void FillTotalResult(G4HadFinalState *hadFinalState, const G4Track &track)
void CalculateTargetNucleus(const G4Material *material)
G4ParticleChange * theTotalResult
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
Here is the call graph for this function:

◆ RegisterProductionModel()

void CexmcHadronicProcess::RegisterProductionModel ( CexmcProductionModel model)

Definition at line 72 of file CexmcHadronicProcess.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ interaction

G4HadronicInteraction* CexmcHadronicProcess::interaction
private

Definition at line 86 of file CexmcHadronicProcess.hh.

◆ isInitialized

G4bool CexmcHadronicProcess::isInitialized
private

Definition at line 93 of file CexmcHadronicProcess.hh.

◆ productionModel

CexmcProductionModel* CexmcHadronicProcess::productionModel
private

Definition at line 84 of file CexmcHadronicProcess.hh.

◆ targetNucleus

G4Nucleus CexmcHadronicProcess::targetNucleus
private

Definition at line 91 of file CexmcHadronicProcess.hh.

◆ theTotalResult

G4ParticleChange* CexmcHadronicProcess::theTotalResult
private

Definition at line 89 of file CexmcHadronicProcess.hh.


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