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

* Fixing a bug affecting slow down of beam inside the target for

* npsimulation
        - The bug effectively slowed the beam with half a target
parent c549a9ad
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
* Last update : 06/11/2009 * * Last update : 06/11/2009 *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Decription: * * Decription: *
* This class describe Cryogenic and standard Target. Derived fromNPS::VDetector* * This class describe Cryogenic and standard Target. Derived from *
* NPS::VDetector *
* * * *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Comment: * * Comment: *
...@@ -67,7 +68,6 @@ Target::Target(){ ...@@ -67,7 +68,6 @@ Target::Target(){
m_TargetRadius = 0 ; m_TargetRadius = 0 ;
m_WindowsThickness = 0 ; m_WindowsThickness = 0 ;
m_TargetDensity = 0 ; m_TargetDensity = 0 ;
m_EffectiveThickness = 0 ; // effective thickness at 0 deg, compute using angle and thickness
m_TargetNbLayers = 5; // Number of steps by default m_TargetNbLayers = 5; // Number of steps by default
// Set the global pointer // Set the global pointer
TargetInstance = this; TargetInstance = this;
...@@ -254,7 +254,7 @@ G4double Target::SlowDownBeam(G4ParticleDefinition* Beam, ...@@ -254,7 +254,7 @@ G4double Target::SlowDownBeam(G4ParticleDefinition* Beam,
} }
G4double ThicknessBeforeInteraction = G4double ThicknessBeforeInteraction =
abs(ZInteraction - 0.5*m_EffectiveThickness) / cos(m_TargetAngle); abs(ZInteraction - 0.5*m_TargetThickness) / cos(m_TargetAngle);
G4double dedx,de; G4double dedx,de;
static G4EmCalculator emCalculator; static G4EmCalculator emCalculator;
...@@ -278,7 +278,7 @@ G4double Target::SlowDownBeam(G4ParticleDefinition* Beam, ...@@ -278,7 +278,7 @@ G4double Target::SlowDownBeam(G4ParticleDefinition* Beam,
if(m_WindowsThickness!=0) if(m_WindowsThickness!=0)
for (G4int i = 0; i < m_TargetNbLayers; i++){ for (G4int i = 0; i < m_TargetNbLayers; i++){
dedx = emCalculator.ComputeTotalDEDX(IncidentEnergy, Beam, m_WindowsMaterial); dedx = emCalculator.ComputeTotalDEDX(IncidentEnergy, Beam, m_WindowsMaterial);
de = dedx * m_TargetNbLayers * m_WindowsThickness / cos(IncidentTheta); de = dedx * m_WindowsThickness / (cos(IncidentTheta)* m_TargetNbLayers);
IncidentEnergy -= de; IncidentEnergy -= de;
if(IncidentEnergy<0){ if(IncidentEnergy<0){
IncidentEnergy = 0; IncidentEnergy = 0;
......
...@@ -108,7 +108,6 @@ private: ...@@ -108,7 +108,6 @@ private:
G4double m_TargetThickness; G4double m_TargetThickness;
G4double m_TargetRadius; G4double m_TargetRadius;
G4double m_TargetAngle; G4double m_TargetAngle;
G4double m_EffectiveThickness;
G4Material* m_TargetMaterial; G4Material* m_TargetMaterial;
G4int m_TargetNbLayers; G4int m_TargetNbLayers;
......
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