#include <G4KaonMinusAbsorption.hh>
Inheritance diagram for G4KaonMinusAbsorption:
Public Member Functions | |
G4KaonMinusAbsorption (const G4String &processName="KaonMinusAbsorption", G4ProcessType aType=fHadronic) | |
~G4KaonMinusAbsorption () | |
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 G4KaonMinusAbsorption.hh.
G4KaonMinusAbsorption::G4KaonMinusAbsorption | ( | const G4String & | processName = "KaonMinusAbsorption" , |
|
G4ProcessType | aType = fHadronic | |||
) |
Definition at line 46 of file G4KaonMinusAbsorption.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 massKaonMinus(G4KaonMinus::KaonMinus()->GetPDGMass()/GeV), 00050 massGamma(G4Gamma::Gamma()->GetPDGMass()/GeV), 00051 massPionZero(G4PionZero::PionZero()->GetPDGMass()/GeV), 00052 massProton(G4Proton::Proton()->GetPDGMass()/GeV), 00053 massLambda(G4Lambda::Lambda()->GetPDGMass()/GeV), 00054 pdefKaonMinus(G4KaonMinus::KaonMinus()), 00055 pdefGamma(G4Gamma::Gamma()), 00056 pdefPionZero(G4PionZero::PionZero()), 00057 pdefProton(G4Proton::Proton()), 00058 pdefNeutron(G4Neutron::Neutron()), 00059 pdefLambda(G4Lambda::Lambda()), 00060 pdefDeuteron(G4Deuteron::Deuteron()), 00061 pdefTriton(G4Triton::Triton()), 00062 pdefAlpha(G4Alpha::Alpha()) 00063 { 00064 G4HadronicDeprecate("G4KaonMinusAbsorption"); 00065 if (verboseLevel>0) { 00066 G4cout << GetProcessName() << " is created "<< G4endl; 00067 } 00068 SetProcessSubType(fHadronAtRest); 00069 pv = new G4GHEKinematicsVector [MAX_SECONDARIES+1]; 00070 eve = new G4GHEKinematicsVector [MAX_SECONDARIES]; 00071 gkin = new G4GHEKinematicsVector [MAX_SECONDARIES]; 00072 00073 G4HadronicProcessStore::Instance()->RegisterExtraProcess(this); 00074 }
G4KaonMinusAbsorption::~G4KaonMinusAbsorption | ( | ) |
Definition at line 78 of file G4KaonMinusAbsorption.cc.
References G4HadronicProcessStore::DeRegisterExtraProcess(), and G4HadronicProcessStore::Instance().
00079 { 00080 G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this); 00081 delete [] pv; 00082 delete [] eve; 00083 delete [] gkin; 00084 }
G4VParticleChange * G4KaonMinusAbsorption::AtRestDoIt | ( | const G4Track & | , | |
const G4Step & | ||||
) | [virtual] |
Reimplemented from G4VRestProcess.
Definition at line 146 of file G4KaonMinusAbsorption.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.
00155 { 00156 00157 // Initialize ParticleChange 00158 // all members of G4VParticleChange are set to equal to 00159 // corresponding member in G4Track 00160 00161 aParticleChange.Initialize(track); 00162 00163 // Store some global quantities that depend on current material and particle 00164 00165 globalTime = track.GetGlobalTime()/s; 00166 G4Material * aMaterial = track.GetMaterial(); 00167 const G4int numberOfElements = aMaterial->GetNumberOfElements(); 00168 const G4ElementVector* theElementVector = aMaterial->GetElementVector(); 00169 00170 const G4double* theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector(); 00171 G4double normalization = 0; 00172 for ( G4int i1=0; i1 < numberOfElements; i1++ ) 00173 { 00174 normalization += theAtomicNumberDensity[i1] ; // change when nucleon specific 00175 // probabilities are included. 00176 } 00177 G4double runningSum= 0.; 00178 G4double random = G4UniformRand()*normalization; 00179 for ( G4int i2=0; i2 < numberOfElements; i2++ ) 00180 { 00181 runningSum += theAtomicNumberDensity[i2]; // change when nucleon specific 00182 // probabilities are included. 00183 if (random<=runningSum) 00184 { 00185 targetCharge = G4double( ((*theElementVector)[i2])->GetZ()); 00186 targetAtomicMass = (*theElementVector)[i2]->GetN(); 00187 } 00188 } 00189 if (random>runningSum) 00190 { 00191 targetCharge = G4double((*theElementVector)[numberOfElements-1]->GetZ()); 00192 targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN(); 00193 00194 } 00195 00196 if (verboseLevel>1) { 00197 G4cout << "G4KaonMinusAbsorption::AtRestDoIt is invoked " <<G4endl; 00198 } 00199 00200 G4ParticleMomentum momentum; 00201 G4float localtime; 00202 00203 G4ThreeVector position = track.GetPosition(); 00204 00205 GenerateSecondaries(); // Generate secondaries 00206 00207 aParticleChange.SetNumberOfSecondaries( ngkine ); 00208 00209 for ( G4int isec = 0; isec < ngkine; isec++ ) { 00210 G4DynamicParticle* aNewParticle = new G4DynamicParticle; 00211 aNewParticle->SetDefinition( gkin[isec].GetParticleDef() ); 00212 aNewParticle->SetMomentum( gkin[isec].GetMomentum() * GeV ); 00213 00214 localtime = globalTime + gkin[isec].GetTOF(); 00215 00216 G4Track* aNewTrack = new G4Track( aNewParticle, localtime*s, position ); 00217 aNewTrack->SetTouchableHandle(track.GetTouchableHandle()); 00218 aParticleChange.AddSecondary( aNewTrack ); 00219 00220 } 00221 00222 aParticleChange.ProposeLocalEnergyDeposit( 0.0*GeV ); 00223 00224 aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the incident KaonMinus 00225 00226 // clear InteractionLengthLeft 00227 00228 ResetNumberOfInteractionLengthLeft(); 00229 00230 return &aParticleChange; 00231 00232 }
G4double G4KaonMinusAbsorption::AtRestGetPhysicalInteractionLength | ( | const G4Track & | , | |
G4ForceCondition * | ||||
) | [virtual] |
Reimplemented from G4VRestProcess.
Definition at line 120 of file G4KaonMinusAbsorption.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.
00124 { 00125 // beggining of tracking 00126 ResetNumberOfInteractionLengthLeft(); 00127 00128 // condition is set to "Not Forced" 00129 *condition = NotForced; 00130 00131 // get mean life time 00132 currentInteractionLength = GetMeanLifeTime(track, condition); 00133 00134 if ((currentInteractionLength <0.0) || (verboseLevel>2)){ 00135 G4cout << "G4KaonMinusAbsorptionProcess::AtRestGetPhysicalInteractionLength "; 00136 G4cout << "[ " << GetProcessName() << "]" <<G4endl; 00137 track.GetDynamicParticle()->DumpInfo(); 00138 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; 00139 G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl; 00140 } 00141 00142 return theNumberOfInteractionLengthLeft * currentInteractionLength; 00143 00144 }
void G4KaonMinusAbsorption::BuildPhysicsTable | ( | const G4ParticleDefinition & | ) | [virtual] |
Reimplemented from G4VProcess.
Definition at line 91 of file G4KaonMinusAbsorption.cc.
References G4HadronicProcessStore::Instance(), and G4HadronicProcessStore::PrintInfo().
00092 { 00093 G4HadronicProcessStore::Instance()->PrintInfo(&p); 00094 }
G4double G4KaonMinusAbsorption::GetMeanLifeTime | ( | const G4Track & | , | |
G4ForceCondition * | ||||
) | [inline, virtual] |
Implements G4VRestProcess.
Definition at line 72 of file G4KaonMinusAbsorption.hh.
Referenced by AtRestGetPhysicalInteractionLength().
G4int G4KaonMinusAbsorption::GetNumberOfSecondaries | ( | ) |
G4GHEKinematicsVector * G4KaonMinusAbsorption::GetSecondaryKinematics | ( | ) |
G4bool G4KaonMinusAbsorption::IsApplicable | ( | const G4ParticleDefinition & | ) | [virtual] |
void G4KaonMinusAbsorption::PreparePhysicsTable | ( | const G4ParticleDefinition & | ) | [virtual] |
Reimplemented from G4VProcess.
Definition at line 86 of file G4KaonMinusAbsorption.cc.
References G4HadronicProcessStore::Instance(), and G4HadronicProcessStore::RegisterParticleForExtraProcess().
00087 { 00088 G4HadronicProcessStore::Instance()->RegisterParticleForExtraProcess(this, &p); 00089 }