Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4AntiNeutronAnnihilationAtRest Class Reference

#include <G4AntiNeutronAnnihilationAtRest.hh>

Inheritance diagram for G4AntiNeutronAnnihilationAtRest:
G4VRestProcess G4VProcess

Public Member Functions

 G4AntiNeutronAnnihilationAtRest (const G4String &processName="AntiNeutronAnnihilationAtRest", G4ProcessType aType=fHadronic)
 
 ~G4AntiNeutronAnnihilationAtRest ()
 
G4bool IsApplicable (const G4ParticleDefinition &)
 
void PreparePhysicsTable (const G4ParticleDefinition &)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
G4double GetMeanLifeTime (const G4Track &, G4ForceCondition *)
 
G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
G4int GetNumberOfSecondaries ()
 
G4GHEKinematicsVectorGetSecondaryKinematics ()
 
- Public Member Functions inherited from G4VRestProcess
 G4VRestProcess (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4VRestProcess (G4VRestProcess &)
 
virtual ~G4VRestProcess ()
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &, G4double, G4ForceCondition *)
 
virtual G4VParticleChangePostStepDoIt (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
 
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 &)
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 
- 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 47 of file G4AntiNeutronAnnihilationAtRest.hh.

Constructor & Destructor Documentation

G4AntiNeutronAnnihilationAtRest::G4AntiNeutronAnnihilationAtRest ( const G4String processName = "AntiNeutronAnnihilationAtRest",
G4ProcessType  aType = fHadronic 
)

Definition at line 47 of file G4AntiNeutronAnnihilationAtRest.cc.

References fHadronAtRest, G4cout, G4endl, G4HadronicDeprecate, G4VProcess::GetProcessName(), G4HadronicProcessStore::Instance(), MAX_SECONDARIES, G4HadronicProcessStore::RegisterExtraProcess(), G4VProcess::SetProcessSubType(), and G4VProcess::verboseLevel.

48  :
49  G4VRestProcess (processName, aType), // initialization
50  massPionMinus(G4PionMinus::PionMinus()->GetPDGMass()/GeV),
51  massPionZero(G4PionZero::PionZero()->GetPDGMass()/GeV),
52  massPionPlus(G4PionPlus::PionPlus()->GetPDGMass()/GeV),
53  massGamma(G4Gamma::Gamma()->GetPDGMass()/GeV),
54  massAntiNeutron(G4AntiNeutron::AntiNeutron()->GetPDGMass()/GeV),
55  massNeutron(G4Neutron::Neutron()->GetPDGMass()/GeV),
56  pdefGamma(G4Gamma::Gamma()),
57  pdefPionPlus(G4PionPlus::PionPlus()),
58  pdefPionZero(G4PionZero::PionZero()),
59  pdefPionMinus(G4PionMinus::PionMinus()),
60  pdefProton(G4Proton::Proton()),
61  pdefNeutron(G4Neutron::Neutron()),
62  pdefAntiNeutron(G4AntiNeutron::AntiNeutron()),
63  pdefDeuteron(G4Deuteron::Deuteron()),
64  pdefTriton(G4Triton::Triton()),
65  pdefAlpha(G4Alpha::Alpha())
66 {
67  G4HadronicDeprecate("G4AntiNeutronAnnihilationAtRest");
68  if (verboseLevel>0) {
69  G4cout << GetProcessName() << " is created "<< G4endl;
70  }
75 
77 }
G4int verboseLevel
Definition: G4VProcess.hh:368
static G4HadronicProcessStore * Instance()
#define G4HadronicDeprecate(name)
G4GLOB_DLL std::ostream G4cout
#define MAX_SECONDARIES
static G4Triton * Triton()
Definition: G4Triton.cc:95
static G4Proton * Proton()
Definition: G4Proton.cc:93
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
static G4PionZero * PionZero()
Definition: G4PionZero.cc:104
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
void RegisterExtraProcess(G4VProcess *)
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
#define G4endl
Definition: G4ios.hh:61
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
static G4AntiNeutron * AntiNeutron()
G4AntiNeutronAnnihilationAtRest::~G4AntiNeutronAnnihilationAtRest ( )

Definition at line 81 of file G4AntiNeutronAnnihilationAtRest.cc.

References G4HadronicProcessStore::DeRegisterExtraProcess(), and G4HadronicProcessStore::Instance().

82 {
84  delete [] pv;
85  delete [] eve;
86  delete [] gkin;
87 }
void DeRegisterExtraProcess(G4VProcess *)
static G4HadronicProcessStore * Instance()

Member Function Documentation

G4VParticleChange * G4AntiNeutronAnnihilationAtRest::AtRestDoIt ( const G4Track track,
const G4Step  
)
virtual

Reimplemented from G4VRestProcess.

Definition at line 149 of file G4AntiNeutronAnnihilationAtRest.cc.

References G4ParticleChange::AddSecondary(), G4VProcess::aParticleChange, fStopAndKill, G4cout, G4endl, G4UniformRand, G4Material::GetAtomicNumDensityVector(), G4Material::GetElementVector(), G4Track::GetGlobalTime(), G4Track::GetMaterial(), G4Material::GetNumberOfElements(), G4Track::GetPosition(), G4GHEKinematicsVector::GetTOF(), G4Track::GetTouchableHandle(), python.hepunit::GeV, G4ParticleChange::Initialize(), G4VParticleChange::ProposeLocalEnergyDeposit(), G4VParticleChange::ProposeTrackStatus(), G4VProcess::ResetNumberOfInteractionLengthLeft(), G4DynamicParticle::SetDefinition(), G4DynamicParticle::SetMomentum(), G4VParticleChange::SetNumberOfSecondaries(), G4Track::SetTouchableHandle(), and G4VProcess::verboseLevel.

158 {
159 
160 // Initialize ParticleChange
161 // all members of G4VParticleChange are set to equal to
162 // corresponding member in G4Track
163 
165 
166 // Store some global quantities that depend on current material and particle
167 
168  globalTime = track.GetGlobalTime()/s;
169  G4Material * aMaterial = track.GetMaterial();
170  const G4int numberOfElements = aMaterial->GetNumberOfElements();
171  const G4ElementVector* theElementVector = aMaterial->GetElementVector();
172 
173  const G4double* theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector();
174  G4double normalization = 0;
175  for ( G4int i1=0; i1 < numberOfElements; i1++ )
176  {
177  normalization += theAtomicNumberDensity[i1] ; // change when nucleon specific
178  // probabilities are included.
179  }
180  G4double runningSum= 0.;
181  G4double random = G4UniformRand()*normalization;
182  for ( G4int i2=0; i2 < numberOfElements; i2++ )
183  {
184  runningSum += theAtomicNumberDensity[i2]; // change when nucleon specific
185  // probabilities are included.
186  if (random<=runningSum)
187  {
188  targetCharge = G4double( ((*theElementVector)[i2])->GetZ());
189  targetAtomicMass = (*theElementVector)[i2]->GetN();
190  }
191  }
192  if (random>runningSum)
193  {
194  targetCharge = G4double( ((*theElementVector)[numberOfElements-1])->GetZ());
195  targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN();
196  }
197 
198  if (verboseLevel>1) {
199  G4cout << "G4AntiNeutronAnnihilationAtRest::AtRestDoIt is invoked " <<G4endl;
200  }
201 
202  G4ParticleMomentum momentum;
203  G4float localtime;
204 
206 
207  GenerateSecondaries(); // Generate secondaries
208 
210 
211  for ( G4int isec = 0; isec < ngkine; isec++ ) {
212  G4DynamicParticle* aNewParticle = new G4DynamicParticle;
213  aNewParticle->SetDefinition( gkin[isec].GetParticleDef() );
214  aNewParticle->SetMomentum( gkin[isec].GetMomentum() * GeV );
215 
216  localtime = globalTime + gkin[isec].GetTOF();
217 
218  G4Track* aNewTrack = new G4Track( aNewParticle, localtime*s, position );
219  aNewTrack->SetTouchableHandle(track.GetTouchableHandle());
220  aParticleChange.AddSecondary( aNewTrack );
221 
222  }
223 
225 
226  aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the incident AntiNeutron
227 
228 // clear InteractionLengthLeft
229 
231 
232  return &aParticleChange;
233 
234 }
void SetMomentum(const G4ThreeVector &momentum)
G4int verboseLevel
Definition: G4VProcess.hh:368
std::vector< G4Element * > G4ElementVector
const XML_Char * s
float G4float
Definition: G4Types.hh:77
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
virtual void ResetNumberOfInteractionLengthLeft()
Definition: G4VProcess.cc:95
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
int G4int
Definition: G4Types.hh:78
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
G4double GetGlobalTime() const
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:214
const G4TouchableHandle & GetTouchableHandle() const
G4Material * GetMaterial() const
virtual void Initialize(const G4Track &)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
void AddSecondary(G4Track *aSecondary)
#define G4endl
Definition: G4ios.hh:61
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double G4AntiNeutronAnnihilationAtRest::AtRestGetPhysicalInteractionLength ( const G4Track track,
G4ForceCondition condition 
)
virtual

Reimplemented from G4VRestProcess.

Definition at line 123 of file G4AntiNeutronAnnihilationAtRest.cc.

References G4VProcess::currentInteractionLength, G4DynamicParticle::DumpInfo(), G4cout, G4endl, G4Track::GetDynamicParticle(), G4Track::GetMaterial(), GetMeanLifeTime(), G4Material::GetName(), G4VProcess::GetProcessName(), NotForced, ns, G4VProcess::ResetNumberOfInteractionLengthLeft(), G4VProcess::theNumberOfInteractionLengthLeft, and G4VProcess::verboseLevel.

127 {
128  // beggining of tracking
130 
131  // condition is set to "Not Forced"
132  *condition = NotForced;
133 
134  // get mean life time
136 
137  if ((currentInteractionLength <0.0) || (verboseLevel>2)){
138  G4cout << "G4AntiNeutronAnnihilationAtRestProcess::AtRestGetPhysicalInteractionLength ";
139  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
140  track.GetDynamicParticle()->DumpInfo();
141  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
142  G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl;
143  }
144 
146 
147 }
G4double condition(const G4ErrorSymMatrix &m)
G4double GetMeanLifeTime(const G4Track &, G4ForceCondition *)
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4DynamicParticle * GetDynamicParticle() const
const G4String & GetName() const
Definition: G4Material.hh:176
void DumpInfo(G4int mode=0) const
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
virtual void ResetNumberOfInteractionLengthLeft()
Definition: G4VProcess.cc:95
G4GLOB_DLL std::ostream G4cout
G4double currentInteractionLength
Definition: G4VProcess.hh:297
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4Material * GetMaterial() const
#define G4endl
Definition: G4ios.hh:61
#define ns
Definition: xmlparse.cc:597
void G4AntiNeutronAnnihilationAtRest::BuildPhysicsTable ( const G4ParticleDefinition p)
virtual

Reimplemented from G4VProcess.

Definition at line 94 of file G4AntiNeutronAnnihilationAtRest.cc.

References G4HadronicProcessStore::Instance(), and G4HadronicProcessStore::PrintInfo().

95 {
97 }
static G4HadronicProcessStore * Instance()
void PrintInfo(const G4ParticleDefinition *)
G4double G4AntiNeutronAnnihilationAtRest::GetMeanLifeTime ( const G4Track ,
G4ForceCondition  
)
inlinevirtual

Implements G4VRestProcess.

Definition at line 72 of file G4AntiNeutronAnnihilationAtRest.hh.

Referenced by AtRestGetPhysicalInteractionLength().

73  {return 0.0;}
G4int G4AntiNeutronAnnihilationAtRest::GetNumberOfSecondaries ( )

Definition at line 110 of file G4AntiNeutronAnnihilationAtRest.cc.

111 {
112  return ( ngkine );
113 
114 }
G4GHEKinematicsVector * G4AntiNeutronAnnihilationAtRest::GetSecondaryKinematics ( )

Definition at line 117 of file G4AntiNeutronAnnihilationAtRest.cc.

118 {
119  return ( &gkin[0] );
120 
121 }
G4bool G4AntiNeutronAnnihilationAtRest::IsApplicable ( const G4ParticleDefinition particle)
virtual

Reimplemented from G4VProcess.

Definition at line 101 of file G4AntiNeutronAnnihilationAtRest.cc.

104 {
105  return ( &particle == pdefAntiNeutron );
106 
107 }
void G4AntiNeutronAnnihilationAtRest::PreparePhysicsTable ( const G4ParticleDefinition p)
virtual

Reimplemented from G4VProcess.

Definition at line 89 of file G4AntiNeutronAnnihilationAtRest.cc.

References G4HadronicProcessStore::Instance(), and G4HadronicProcessStore::RegisterParticleForExtraProcess().

90 {
92 }
static G4HadronicProcessStore * Instance()
void RegisterParticleForExtraProcess(G4VProcess *, const G4ParticleDefinition *)

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