43 G4VParticleChange* particleChange =
new G4VParticleChange();
45 std::vector<G4Track*> secondaries;
51 for (
unsigned int ii=0; ii<(
unsigned int)
fNSplit; ii++) {
52 particleChange = pRegProcess->PostStepDoIt(track,
step);
54 throw std::runtime_error(
"MuNuclearSplittingProcess::PostStepDoIt(): no particle change");
56 G4int numSec(particleChange->GetNumberOfSecondaries());
57 for (j=0; j<numSec; j++)
59 G4Track* newSec =
new G4Track(*(particleChange->GetSecondary(j)));
60 G4String pdgstr = newSec->GetParticleDefinition()->GetParticleName();
61 G4double ke = newSec->GetKineticEnergy()/
CLHEP::GeV;
62 G4int
pdg = newSec->GetParticleDefinition()->GetPDGEncoding();
63 if (
abs(pdg)==310 ||
abs(pdg)==311 ||
abs(pdg)==3122 ||
abs(pdg)==2112)
67 if (pdg==G4KaonZeroShort::KaonZeroShort()->GetPDGEncoding()&&G4UniformRand()<0.50)
69 pdg = G4KaonZeroLong::KaonZeroLong()->GetPDGEncoding();
70 pdgstr = G4KaonZeroLong::KaonZeroLong()->GetParticleName();
71 G4LorentzVector pK0L(newSec->GetMomentum(),TMath::Sqrt(TMath::Power(G4KaonZeroLong::KaonZeroLong()->GetPDGMass(),2)+TMath::Power(newSec->GetMomentum().mag(),2)));
72 G4DynamicParticle *newK0L =
new G4DynamicParticle(G4KaonZeroLong::KaonZeroLong(),pK0L);
74 G4Track* newSecK0L =
new G4Track(newK0L,track.GetGlobalTime(),track.GetPosition());
75 secondaries.push_back(newSecK0L);
79 secondaries.push_back(newSec);
82 if (
abs(pdg)==130 ||
abs(pdg)==310 ||
abs(pdg)==311 ||
abs(pdg)==3122)
86 std::cout <<
"MuNuclSplProc: Creating " << pdgstr <<
" of Kinetic Energy " << ke <<
" GeV. numSec is " << j <<
std::endl;
93 particleChange->SetNumberOfSecondaries(secondaries.size());
94 particleChange->SetSecondaryWeightByProcess(
true);
97 while (iter != secondaries.end()) {
98 G4Track* myTrack = *iter;
99 G4String pdgstr = myTrack->GetParticleDefinition()->GetParticleName();
101 G4int pdg = myTrack->GetParticleDefinition()->GetPDGEncoding();
102 if (
abs(pdg)==130 ||
abs(pdg)==310 ||
abs(pdg)==311 ||
abs(pdg)==3122 ||
abs(pdg)==2112)
105 myTrack->SetWeight(weight);
106 particleChange->AddSecondary(myTrack);
109 return particleChange;
static constexpr double GeV
QTextStream & endl(QTextStream &s)