Skip to content

Commit 7265dbf

Browse files
authored
Addressed PR comments
1 parent 82bdf5c commit 7265dbf

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

SimG4Core/CustomPhysics/src/FullModelHadronicProcess.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,9 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack,
6767
G4ParticleDefinition* outgoingCloudDefinition = nullptr;
6868
G4ParticleDefinition* outgoingTargetDefinition = nullptr;
6969

70-
// Declare the quark cloud as a G4DynamicParticle. Throw an error if the cloud definition is not available
70+
// Declare the quark cloud as a G4DynamicParticle
7171
G4DynamicParticle* cloudParticle = new G4DynamicParticle();
7272
cloudParticle->SetDefinition(customIncomingRhadron->GetCloud());
73-
if (cloudParticle->GetDefinition() == nullptr) {
74-
G4cerr << "FullModelHadronicProcess::PostStepDoIt Definition of particle cloud not available!" << G4endl;
75-
exit(EXIT_FAILURE);
76-
}
7773

7874
// Define the gluino and quark cloud G4LorentzVector (momentum, total energy) based on the momentum of the R-hadron and the ratio of the masses
7975
double scale = cloudParticle->GetDefinition()->GetPDGMass() / incomingRhadron->GetDefinition()->GetPDGMass();
@@ -122,11 +118,6 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack,
122118
if (finalStateParticle->GetParticleType() == "rhadron") {
123119
outgoingRhadronDefinition = finalStateParticle;
124120
outgoingCloudDefinition = finalStateCustomParticle->GetCloud();
125-
if (outgoingCloudDefinition == nullptr) {
126-
G4cerr << "FullModelHadronicProcess::PostStepDoIt Definition of outgoing particle cloud not available!"
127-
<< G4endl;
128-
exit(EXIT_FAILURE);
129-
}
130121
}
131122

132123
if (finalStateParticle == G4Proton::Proton() || finalStateParticle == G4Neutron::Neutron())
@@ -249,10 +240,7 @@ G4VParticleChange* FullModelHadronicProcess::PostStepDoIt(const G4Track& aTrack,
249240
dynamicOutgoingRhadron->SetDefinition(incomingRhadron->GetDefinition());
250241
dynamicOutgoingRhadron->SetMomentum(gluinoMomentum.vect() + outgoingCloudp4Prime.vect());
251242
if (dynamicOutgoingRhadron->GetMomentum().mag() > DBL_MIN)
252-
aParticleChange.ProposeMomentumDirection(
253-
dynamicOutgoingRhadron->GetMomentum().x() / dynamicOutgoingRhadron->GetMomentum().mag(),
254-
dynamicOutgoingRhadron->GetMomentum().y() / dynamicOutgoingRhadron->GetMomentum().mag(),
255-
dynamicOutgoingRhadron->GetMomentum().z() / dynamicOutgoingRhadron->GetMomentum().mag());
243+
aParticleChange.ProposeMomentumDirection(dynamicOutgoingRhadron->GetMomentumDirection());
256244
else
257245
aParticleChange.ProposeMomentumDirection(1.0, 0.0, 0.0);
258246
aParticleChange.ProposeEnergy(dynamicOutgoingRhadron->GetKineticEnergy());

0 commit comments

Comments
 (0)