42#define MAX_SECONDARIES 100
46G4PionMinusAbsorptionAtRest::G4PionMinusAbsorptionAtRest(
const G4String& processName,
49 massPionMinus(
G4PionMinus::PionMinus()->GetPDGMass()/GeV),
98 return ( &particle == pdefPionMinus );
131 G4cout <<
"G4PionMinusAbsorptionAtRestProcess::AtRestGetPhysicalInteractionLength ";
168 for (
G4int i1=0; i1 < numberOfElements; i1++ )
170 normalization += theAtomicNumberDensity[i1] ;
175 for (
G4int i2=0; i2 < numberOfElements; i2++ )
177 runningSum += theAtomicNumberDensity[i2];
179 if (random<=runningSum)
181 targetCharge =
G4double((*theElementVector)[i2]->GetZ());
182 targetAtomicMass = (*theElementVector)[i2]->GetN();
185 if (random>runningSum)
187 targetCharge =
G4double((*theElementVector)[numberOfElements-1]->GetZ());
188 targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN();
193 G4cout <<
"G4PionMinusAbsorptionAtRest::AtRestDoIt is invoked " <<
G4endl;
201 GenerateSecondaries();
205 for (
G4int isec = 0; isec < ngkine; isec++ ) {
208 aNewParticle->
SetMomentum( gkin[isec].GetMomentum() * GeV );
210 localtime = globalTime + gkin[isec].
GetTOF();
231void G4PionMinusAbsorptionAtRest::GenerateSecondaries()
246 result.
SetMass( massPionMinus );
251 PionMinusAbsorption(&nopt);
270 for (l = 1; l <= ntot; ++l) {
276 gkin[ngkine] = eve[index];
277 gkin[ngkine].
SetTOF( eve[index].GetTOF() * 5e-11 );
296void G4PionMinusAbsorptionAtRest::PionMinusAbsorption(
G4int *nopt)
299 static G4int nt, nbl;
302 static G4float ran2, tof1, ekin;
303 static G4float ekin1, ekin2, black;
318 pv[1].
SetMass( massPionMinus );
322 if (targetAtomicMass <=
G4float(1.5)) {
330 tof1 = std::log(ran) *
G4float(-25.);
354 black = std::log(targetAtomicMass) *
G4float(.5);
364 for (i = 1; i <= nbl; ++i) {
369 ekin1 = -
G4double(ekin) * std::log(ran2);
372 pnrat =
G4float(1.) - targetCharge / targetAtomicMass;
387 black = std::log(targetAtomicMass) *
G4float(.5);
397 for (i = 1; i <= nbl; ++i) {
402 ekin1 = -
G4double(ekin) * std::log(ran2);
426 tof1 = std::log(ran) *
G4float(-25.);
428 for (i = 2; i <= nt; ++i) {
432 for (i = 3; i <= nt; ++i) {
443void G4PionMinusAbsorptionAtRest::Poisso(
G4float xav,
G4int *iran)
448 static G4float rr, ran, rrr, ran1;
458 ran1 = xav + ran1 * std::sqrt(xav);
472 for (i = 1; i <= fivex; ++i) {
475 rrr = std::pow(xav,
G4float(i)) / NFac(i);
479 rrr = std::exp(i * std::log(xav) -
492 p1 = xav * std::exp(-
G4double(xav));
518G4int G4PionMinusAbsorptionAtRest::NFac(
G4int n)
532 for (i = 2; i <= j; ++i) {
541void G4PionMinusAbsorptionAtRest::Normal(
G4float *ran)
549 for (i = 1; i <= 12; ++i) {
std::vector< G4Element * > G4ElementVector
G4double condition(const G4ErrorSymMatrix &m)
#define G4HadronicDeprecate(name)
G4DLLIMPORT std::ostream G4cout
void DumpInfo(G4int mode=0) const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
G4ParticleDefinition * GetParticleDef()
void SetParticleDef(G4ParticleDefinition *c)
void SetMass(G4double mas)
void SetKineticEnergyAndUpdate(G4double ekin)
void DeRegisterExtraProcess(G4VProcess *)
void RegisterExtraProcess(G4VProcess *)
void RegisterParticleForExtraProcess(G4VProcess *, const G4ParticleDefinition *)
static G4HadronicProcessStore * Instance()
void PrintInfo(const G4ParticleDefinition *)
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() const
const G4String & GetName() const
void AddSecondary(G4Track *aSecondary)
virtual void Initialize(const G4Track &)
G4double GetPDGMass() const
void BuildPhysicsTable(const G4ParticleDefinition &)
void PreparePhysicsTable(const G4ParticleDefinition &)
G4int GetNumberOfSecondaries()
G4bool IsApplicable(const G4ParticleDefinition &)
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
~G4PionMinusAbsorptionAtRest()
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4GHEKinematicsVector * GetSecondaryKinematics()
G4double GetMeanLifeTime(const G4Track &, G4ForceCondition *)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4double currentInteractionLength
virtual void ResetNumberOfInteractionLengthLeft()
G4ParticleChange aParticleChange
G4double theNumberOfInteractionLengthLeft
void SetProcessSubType(G4int)
const G4String & GetProcessName() const