#include <G4NeutronCaptureAtRest.hh>
Inheritance diagram for G4NeutronCaptureAtRest:
Public Member Functions | |
G4NeutronCaptureAtRest (const G4String &processName="NeutronCaptureAtRest", G4ProcessType aType=fHadronic) | |
~G4NeutronCaptureAtRest () | |
G4bool | IsApplicable (const G4ParticleDefinition &) |
void | PreparePhysicsTable (const G4ParticleDefinition &) |
void | BuildPhysicsTable (const G4ParticleDefinition &) |
G4double | AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *) |
G4double | GetMeanLifeTime (const G4Track &, G4ForceCondition *) |
G4VParticleChange * | AtRestDoIt (const G4Track &, const G4Step &) |
G4int | GetNumberOfSecondaries () |
G4GHEKinematicsVector * | GetSecondaryKinematics () |
Definition at line 47 of file G4NeutronCaptureAtRest.hh.
G4NeutronCaptureAtRest::G4NeutronCaptureAtRest | ( | const G4String & | processName = "NeutronCaptureAtRest" , |
|
G4ProcessType | aType = fHadronic | |||
) |
Definition at line 46 of file G4NeutronCaptureAtRest.cc.
References fHadronAtRest, G4cout, G4endl, G4HadronicDeprecate, G4VProcess::GetProcessName(), G4HadronicProcessStore::Instance(), MAX_SECONDARIES, G4HadronicProcessStore::RegisterExtraProcess(), G4VProcess::SetProcessSubType(), and G4VProcess::verboseLevel.
00047 : 00048 G4VRestProcess (processName, aType), // initialization 00049 massProton(G4Proton::Proton()->GetPDGMass()/GeV), 00050 massNeutron(G4Neutron::Neutron()->GetPDGMass()/GeV), 00051 massElectron(G4Electron::Electron()->GetPDGMass()/GeV), 00052 massDeuteron(G4Deuteron::Deuteron()->GetPDGMass()/GeV), 00053 massAlpha(G4Alpha::Alpha()->GetPDGMass()/GeV), 00054 pdefGamma(G4Gamma::Gamma()), 00055 pdefNeutron(G4Neutron::Neutron()) 00056 { 00057 G4HadronicDeprecate("G4NeutronCaptureAtRest"); 00058 if (verboseLevel>0) { 00059 G4cout << GetProcessName() << " is created "<< G4endl; 00060 } 00061 SetProcessSubType(fHadronAtRest); 00062 pv = new G4GHEKinematicsVector [MAX_SECONDARIES+1]; 00063 eve = new G4GHEKinematicsVector [MAX_SECONDARIES]; 00064 gkin = new G4GHEKinematicsVector [MAX_SECONDARIES]; 00065 00066 G4HadronicProcessStore::Instance()->RegisterExtraProcess(this); 00067 }
G4NeutronCaptureAtRest::~G4NeutronCaptureAtRest | ( | ) |
Definition at line 71 of file G4NeutronCaptureAtRest.cc.
References G4HadronicProcessStore::DeRegisterExtraProcess(), and G4HadronicProcessStore::Instance().
00072 { 00073 G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this); 00074 delete [] pv; 00075 delete [] eve; 00076 delete [] gkin; 00077 }
G4VParticleChange * G4NeutronCaptureAtRest::AtRestDoIt | ( | const G4Track & | , | |
const G4Step & | ||||
) | [virtual] |
Reimplemented from G4VRestProcess.
Definition at line 139 of file G4NeutronCaptureAtRest.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(), G4ParticleChange::Initialize(), position, G4VParticleChange::ProposeLocalEnergyDeposit(), G4VParticleChange::ProposeTrackStatus(), G4VProcess::ResetNumberOfInteractionLengthLeft(), G4VParticleChange::SetNumberOfSecondaries(), G4Track::SetTouchableHandle(), and G4VProcess::verboseLevel.
00148 { 00149 00150 // Initialize ParticleChange 00151 // all members of G4VParticleChange are set to equal to 00152 // corresponding member in G4Track 00153 00154 aParticleChange.Initialize(track); 00155 00156 // Store some global quantities that depend on current material and particle 00157 00158 globalTime = track.GetGlobalTime()/s; 00159 G4Material * aMaterial = track.GetMaterial(); 00160 const G4int numberOfElements = aMaterial->GetNumberOfElements(); 00161 const G4ElementVector* theElementVector = aMaterial->GetElementVector(); 00162 00163 const G4double* theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector(); 00164 G4double normalization = 0; 00165 for ( G4int i1=0; i1 < numberOfElements; i1++ ) 00166 { 00167 normalization += theAtomicNumberDensity[i1] ; // change when nucleon specific 00168 // probabilities are included. 00169 } 00170 G4double runningSum= 0.; 00171 G4double random = G4UniformRand()*normalization; 00172 for ( G4int i2=0; i2 < numberOfElements; i2++ ) 00173 { 00174 runningSum += theAtomicNumberDensity[i2]; // change when nucleon specific 00175 // probabilities are included. 00176 if (random<=runningSum) 00177 { 00178 targetCharge = G4double((*theElementVector)[i2]->GetZ()); 00179 targetAtomicMass = (*theElementVector)[i2]->GetN(); 00180 } 00181 } 00182 if (random>runningSum) 00183 { 00184 targetCharge = G4double((*theElementVector)[numberOfElements-1]->GetZ()); 00185 targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN(); 00186 00187 } 00188 00189 if (verboseLevel>1) { 00190 G4cout << "G4NeutronCaptureAtRest::AtRestDoIt is invoked " <<G4endl; 00191 } 00192 00193 G4ParticleMomentum momentum; 00194 G4float localtime; 00195 00196 G4ThreeVector position = track.GetPosition(); 00197 00198 GenerateSecondaries(); // Generate secondaries 00199 00200 aParticleChange.SetNumberOfSecondaries( ngkine ); 00201 00202 for ( G4int isec = 0; isec < ngkine; isec++ ) { 00203 G4DynamicParticle* aNewParticle = new G4DynamicParticle; 00204 aNewParticle->SetDefinition( gkin[isec].GetParticleDef() ); 00205 aNewParticle->SetMomentum( gkin[isec].GetMomentum() * GeV ); 00206 00207 localtime = globalTime + gkin[isec].GetTOF(); 00208 00209 G4Track* aNewTrack = new G4Track( aNewParticle, localtime*s, position ); 00210 aNewTrack->SetTouchableHandle(track.GetTouchableHandle()); 00211 aParticleChange.AddSecondary( aNewTrack ); 00212 00213 } 00214 00215 aParticleChange.ProposeLocalEnergyDeposit( 0.0*GeV ); 00216 00217 aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the incident Neutron 00218 00219 // clear InteractionLengthLeft 00220 00221 ResetNumberOfInteractionLengthLeft(); 00222 00223 return &aParticleChange; 00224 00225 }
G4double G4NeutronCaptureAtRest::AtRestGetPhysicalInteractionLength | ( | const G4Track & | , | |
G4ForceCondition * | ||||
) | [virtual] |
Reimplemented from G4VRestProcess.
Definition at line 113 of file G4NeutronCaptureAtRest.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.
00117 { 00118 // beggining of tracking 00119 ResetNumberOfInteractionLengthLeft(); 00120 00121 // condition is set to "Not Forced" 00122 *condition = NotForced; 00123 00124 // get mean life time 00125 currentInteractionLength = GetMeanLifeTime(track, condition); 00126 00127 if ((currentInteractionLength <0.0) || (verboseLevel>2)){ 00128 G4cout << "G4NeutronCaptureAtRestProcess::AtRestGetPhysicalInteractionLength "; 00129 G4cout << "[ " << GetProcessName() << "]" <<G4endl; 00130 track.GetDynamicParticle()->DumpInfo(); 00131 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; 00132 G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl; 00133 } 00134 00135 return theNumberOfInteractionLengthLeft * currentInteractionLength; 00136 00137 }
void G4NeutronCaptureAtRest::BuildPhysicsTable | ( | const G4ParticleDefinition & | ) | [virtual] |
Reimplemented from G4VProcess.
Definition at line 84 of file G4NeutronCaptureAtRest.cc.
References G4HadronicProcessStore::Instance(), and G4HadronicProcessStore::PrintInfo().
00085 { 00086 G4HadronicProcessStore::Instance()->PrintInfo(&p); 00087 }
G4double G4NeutronCaptureAtRest::GetMeanLifeTime | ( | const G4Track & | , | |
G4ForceCondition * | ||||
) | [inline, virtual] |
Implements G4VRestProcess.
Definition at line 73 of file G4NeutronCaptureAtRest.hh.
Referenced by AtRestGetPhysicalInteractionLength().
G4int G4NeutronCaptureAtRest::GetNumberOfSecondaries | ( | ) |
G4GHEKinematicsVector * G4NeutronCaptureAtRest::GetSecondaryKinematics | ( | ) |
G4bool G4NeutronCaptureAtRest::IsApplicable | ( | const G4ParticleDefinition & | ) | [virtual] |
void G4NeutronCaptureAtRest::PreparePhysicsTable | ( | const G4ParticleDefinition & | ) | [virtual] |
Reimplemented from G4VProcess.
Definition at line 79 of file G4NeutronCaptureAtRest.cc.
References G4HadronicProcessStore::Instance(), and G4HadronicProcessStore::RegisterParticleForExtraProcess().
00080 { 00081 G4HadronicProcessStore::Instance()->RegisterParticleForExtraProcess(this, &p); 00082 }