From c49ca75b5ffdae192c869bd1422fcc181cd3b57a Mon Sep 17 00:00:00 2001
From: Adrien Matta <matta@lpccaen.in2p3.fr>
Date: Fri, 20 Sep 2024 09:49:57 +0200
Subject: [PATCH] * fixing bug preventing reaction to occure

---
 NPSimulation/Process/BeamReaction.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/NPSimulation/Process/BeamReaction.cc b/NPSimulation/Process/BeamReaction.cc
index 3f9bb927c..6d395b9b2 100644
--- a/NPSimulation/Process/BeamReaction.cc
+++ b/NPSimulation/Process/BeamReaction.cc
@@ -68,7 +68,7 @@ void NPS::BeamReaction::ReadConfiguration() {
 
   if (input.GetAllBlocksWithToken("TwoBodyReaction").size() > 0)
     m_ReactionType = TwoBody;
-  if (input.GetAllBlocksWithToken("InelasticBreakup").size() > 0)
+  else if (input.GetAllBlocksWithToken("InelasticBreakup").size() > 0)
     m_ReactionType = InelasticBreakup;
   else if (input.GetAllBlocksWithToken("QFSReaction").size() > 0)
     m_ReactionType = QFS;
@@ -92,7 +92,7 @@ void NPS::BeamReaction::ReadConfiguration() {
   }
 
   // Inelastic Breakup
-  if (m_ReactionType == InelasticBreakup) {
+  else if (m_ReactionType == InelasticBreakup) {
     m_InelasticBreakup.ReadConfigurationFile(input);
     m_BeamName = NPL::ChangeNameToG4Standard(m_InelasticBreakup.GetParticleBeam()->GetName());
     if (m_InelasticBreakup.GetParticleLight()->GetName() != "") {
@@ -438,7 +438,7 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastStep)
   ////////////////////////////////////////
   // Inelastic Breakup Reaction Case /////
   ////////////////////////////////////////
-  if (m_ReactionType == InelasticBreakup) {
+  else if (m_ReactionType == InelasticBreakup) {
 
     static G4IonTable* IonTable = G4ParticleTable::GetParticleTable()->GetIonTable();
     //////Define the kind of particle to shoot////////
-- 
GitLab