48 G4VParticleChange* pChange = pRegProcess->PostStepDoIt( track,
step );
49 pChange->SetVerboseLevel(0);
50 pChange->SetSecondaryWeightByProcess(
true);
52 G4double secWeight = 1.0;
54 std::vector<G4Track*> secondaries;
60 G4double
s =
step.GetStepLength();
61 G4double
x = pRegProcess->GetCurrentInteractionLength();
62 nw = pChange->GetParentWeight();
67 if (
wc < 1.0
e-10)
wc = 1.0;
68 nw *= 1/
wc * (1. - exp(-s/x))/(1 - exp(-
eFactor*s/x)) ;
69 G4cout <<
" MNSPXSB.PostStepDoit(): original wt = " << pChange->GetParentWeight() <<
" eF = " <<
eFactor << G4endl;
70 G4cout <<
" MNSPXSB.PostStepDoit(): New weight = " << nw <<
" wc = " <<
wc <<
" s= " << s <<
" x = " << x << G4endl;
71 ((G4ParticleChange*)pChange)->ProposeParentWeight(nw) ;
76 ((G4ParticleChange*)pChange)->ProposeParentWeight(nw) ;
83 pChange->SetNumberOfSecondaries(pChange->GetNumberOfSecondaries()+1);
84 G4ThreeVector mDirection = track.GetDynamicParticle()->GetMomentumDirection();
85 G4DynamicParticle* aD =
new G4DynamicParticle((track.GetDynamicParticle())->GetDefinition(),
86 G4LorentzVector(mDirection,
87 (track.GetDynamicParticle())->GetKineticEnergy()+
step.GetTotalEnergyDeposit()));
88 G4Track* secTrk =
new G4Track(aD,
step.GetDeltaTime(),
step.GetDeltaPosition());
89 pChange->AddSecondary(secTrk);
90 pChange->GetSecondary(pChange->GetNumberOfSecondaries()-1)->
95 nw = track.GetWeight();
96 pChange->ProposeParentWeight(nw);
100 secWeight = secWeight*nw;
106 G4VParticleChange* particleChange =
new G4VParticleChange();
108 for (
unsigned int ii=0; ii<(
unsigned int)
fNSplit; ii++) {
109 particleChange = pRegProcess->PostStepDoIt(track,
step);
111 throw std::runtime_error(
"MuNuclearSplittingProcessXSecBias::PostStepDoIt(): no particle change");
113 G4int numSec(particleChange->GetNumberOfSecondaries());
115 for (j=0; j<numSec; j++)
117 G4Track* newSec =
new G4Track(*(particleChange->GetSecondary(j)));
118 G4String pdgstr = newSec->GetParticleDefinition()->GetParticleName();
120 G4int
pdg = newSec->GetParticleDefinition()->GetPDGEncoding();
121 if (
abs(pdg)==310 ||
abs(pdg)==311 ||
abs(pdg)==3122 ||
abs(pdg)==2112)
125 if (pdg==G4KaonZeroShort::KaonZeroShort()->GetPDGEncoding()&&G4UniformRand()<0.50)
127 pdg = G4KaonZeroLong::KaonZeroLong()->GetPDGEncoding();
128 pdgstr = G4KaonZeroLong::KaonZeroLong()->GetParticleName();
129 G4LorentzVector pK0L(newSec->GetMomentum(),TMath::Sqrt(TMath::Power(G4KaonZeroLong::KaonZeroLong()->GetPDGMass(),2)+TMath::Power(newSec->GetMomentum().mag(),2)));
130 G4DynamicParticle *newK0L =
new G4DynamicParticle(G4KaonZeroLong::KaonZeroLong(),pK0L);
132 G4Track* newSecK0L =
new G4Track(newK0L,track.GetGlobalTime(),track.GetPosition());
133 secondaries.push_back(newSecK0L);
137 secondaries.push_back(newSec);
143 pChange->SetNumberOfSecondaries(secondaries.size());
144 pChange->SetSecondaryWeightByProcess(
true);
149 while (iter != secondaries.end()) {
150 G4Track* myTrack = *iter;
151 G4String pdgstr = myTrack->GetParticleDefinition()->GetParticleName();
152 G4double ke = myTrack->GetKineticEnergy()/
CLHEP::GeV;
153 G4int pdg = myTrack->GetParticleDefinition()->GetPDGEncoding();
154 if (
abs(pdg)==130 ||
abs(pdg)==310 ||
abs(pdg)==311 ||
abs(pdg)==3122 ||
abs(pdg)==2112)
157 std::cout <<
"MuNuclSplXSB(): Adding " << pdgstr <<
" of Kinetic Energy and weight " << ke <<
" GeV and " << secWeight <<
"." <<
std::endl;
159 myTrack->SetWeight(secWeight);
160 pChange->AddSecondary(myTrack);
G4double XBiasSurvivalProbability()
static constexpr double GeV
G4double XBiasSecondaryWeight()
QTextStream & endl(QTextStream &s)