From 09b8b76957c53d64cf9fbaa188e4341f7e862fb4 Mon Sep 17 00:00:00 2001 From: matta adrien <matta@lpccaen.in2p3.fr> Date: Fri, 21 Oct 2016 14:35:55 +0200 Subject: [PATCH] * Correct "serious" bug, causing the effective target thickness not to * be set correctly in the simulation -This lead to incorrect final beam energy being simulated --- NPSimulation/Core/Target.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NPSimulation/Core/Target.cc b/NPSimulation/Core/Target.cc index 663f9ee8b..8a5f340f8 100644 --- a/NPSimulation/Core/Target.cc +++ b/NPSimulation/Core/Target.cc @@ -97,6 +97,7 @@ void Target::ReadConfiguration(string Path){ bool check_X = false ; bool check_Y = false ; bool check_Z = false ; + bool check_Angle = false; bool check_Density = false ; bool check_WinThickness = false ; bool check_WinMaterial = false ; @@ -129,7 +130,7 @@ void Target::ReadConfiguration(string Path){ } else if (DataBuffer.compare(0, 6, "ANGLE=") == 0) { - // check_Angle = true ; + check_Angle = true ; ConfigFile >> DataBuffer; m_TargetAngle = atof(DataBuffer.c_str()) * deg; if(VerboseLevel==1) G4cout << "Target Angle: " << m_TargetAngle / deg << G4endl ; @@ -188,7 +189,8 @@ void Target::ReadConfiguration(string Path){ /////////////////////////////////////////////////// // If all Token found toggle out if( check_Thickness && check_Radius && check_Material - && check_X && check_Y && check_Z ){ + && check_X && check_Y && check_Z && check_Angle){ + m_EffectiveThickness = m_TargetThickness / cos(m_TargetAngle); ReadingStatusTarget = false ; } } @@ -404,7 +406,6 @@ G4double Target::SlowDownBeam(G4ParticleDefinition* Beam, G4double ThicknessBeforeInteraction = abs(ZInteraction - 0.5*m_EffectiveThickness) / cos(m_TargetAngle); - G4double dedx,de; static G4EmCalculator emCalculator; -- GitLab