Skip to content
Snippets Groups Projects
Commit 09b8b769 authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* 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
parent daf661fd
No related branches found
No related tags found
No related merge requests found
...@@ -97,6 +97,7 @@ void Target::ReadConfiguration(string Path){ ...@@ -97,6 +97,7 @@ void Target::ReadConfiguration(string Path){
bool check_X = false ; bool check_X = false ;
bool check_Y = false ; bool check_Y = false ;
bool check_Z = false ; bool check_Z = false ;
bool check_Angle = false;
bool check_Density = false ; bool check_Density = false ;
bool check_WinThickness = false ; bool check_WinThickness = false ;
bool check_WinMaterial = false ; bool check_WinMaterial = false ;
...@@ -129,7 +130,7 @@ void Target::ReadConfiguration(string Path){ ...@@ -129,7 +130,7 @@ void Target::ReadConfiguration(string Path){
} }
else if (DataBuffer.compare(0, 6, "ANGLE=") == 0) { else if (DataBuffer.compare(0, 6, "ANGLE=") == 0) {
// check_Angle = true ; check_Angle = true ;
ConfigFile >> DataBuffer; ConfigFile >> DataBuffer;
m_TargetAngle = atof(DataBuffer.c_str()) * deg; m_TargetAngle = atof(DataBuffer.c_str()) * deg;
if(VerboseLevel==1) G4cout << "Target Angle: " << m_TargetAngle / deg << G4endl ; if(VerboseLevel==1) G4cout << "Target Angle: " << m_TargetAngle / deg << G4endl ;
...@@ -188,7 +189,8 @@ void Target::ReadConfiguration(string Path){ ...@@ -188,7 +189,8 @@ void Target::ReadConfiguration(string Path){
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
// If all Token found toggle out // If all Token found toggle out
if( check_Thickness && check_Radius && check_Material 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 ; ReadingStatusTarget = false ;
} }
} }
...@@ -404,7 +406,6 @@ G4double Target::SlowDownBeam(G4ParticleDefinition* Beam, ...@@ -404,7 +406,6 @@ G4double Target::SlowDownBeam(G4ParticleDefinition* Beam,
G4double ThicknessBeforeInteraction = G4double ThicknessBeforeInteraction =
abs(ZInteraction - 0.5*m_EffectiveThickness) / cos(m_TargetAngle); abs(ZInteraction - 0.5*m_EffectiveThickness) / cos(m_TargetAngle);
G4double dedx,de; G4double dedx,de;
static G4EmCalculator emCalculator; static G4EmCalculator emCalculator;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment