From 5db35a4705d7c7b805692a6ad6dd2b4df0cbe75f Mon Sep 17 00:00:00 2001
From: matta <matta@npt>
Date: Mon, 11 Feb 2013 11:30:35 +0000
Subject: [PATCH] * Changing the input file of Eventgenerator to new standard
 and performing test  - Fixing bug in particle and gamma dicay causing seg
 fault when leaving the program  - fixing bug in NP function caussing
 2Dgaussian to be stuck for sigmaX=sigmaY=0 case

---
 Inputs/EventGenerator/12Li.reaction           | 24 ++++++++-----
 Inputs/EventGenerator/132Sndp.reaction        | 31 ++++++++++-------
 .../132SndpTestMarcIsotropic.reaction         | 23 ++++++++-----
 Inputs/EventGenerator/134Snpt.reaction        | 23 ++++++++-----
 .../19C208Pb_570MeV_EneSpr1_flat.reaction     | 23 ++++++++-----
 Inputs/EventGenerator/27Alppp.reaction        | 34 +++++++++++--------
 Inputs/EventGenerator/40Ca.reaction           |  2 +-
 Inputs/EventGenerator/60Fe.reaction           | 24 ++++++++-----
 Inputs/EventGenerator/69Ni.reaction           | 27 ++++++++++-----
 Inputs/EventGenerator/9He.reaction            | 22 ------------
 Inputs/EventGenerator/Source.reaction         | 23 -------------
 Inputs/EventGenerator/e569.reaction           | 27 ++++++++++-----
 NPLib/Physics/NPFunction.cxx                  |  5 +++
 NPSimulation/src/EventGeneratorGammaDecay.cc  |  3 --
 .../src/EventGeneratorParticleDecay.cc        |  1 -
 15 files changed, 157 insertions(+), 135 deletions(-)
 delete mode 100644 Inputs/EventGenerator/9He.reaction
 delete mode 100644 Inputs/EventGenerator/Source.reaction

diff --git a/Inputs/EventGenerator/12Li.reaction b/Inputs/EventGenerator/12Li.reaction
index d8b2cc58e..4622b307e 100644
--- a/Inputs/EventGenerator/12Li.reaction
+++ b/Inputs/EventGenerator/12Li.reaction
@@ -3,20 +3,28 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Beam energy given in MeV ; Excitation in MeV ; SigmaXY in mm
 %  SigmaThetaX/PhiY in deg
-Transfert
+Beam
+  Particle= 11Li
+  Energy= 550
+	SigmaEnergy= 0
+	SigmaThetaX= 0.6921330164
+	SigmaPhiY= 0.963142053
+	SigmaX= 6.232
+	SigmaY= 9.069
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+TwoBodyReaction
 	Beam= 11Li
 	Target= 2H
 	Light= 1H
 	Heavy= 12Li
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 1.0
-	BeamEnergy= 550
-	BeamEnergySpread= 0
-	SigmaThetaX= 0.6921330164
-	SigmaPhiY= 0.963142053
-	SigmaX= 6.232
-	SigmaY= 9.069
-	CrossSectionPath= flat.txt
+	CrossSectionPath= flat.txt CS
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/132Sndp.reaction b/Inputs/EventGenerator/132Sndp.reaction
index 72598b481..f9080ecf8 100644
--- a/Inputs/EventGenerator/132Sndp.reaction
+++ b/Inputs/EventGenerator/132Sndp.reaction
@@ -2,24 +2,31 @@
 %%%%%%%%%  Reaction file for 60Fe(d,p)61Fe reaction  %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%Beam energy given in MeV ; Excitation in MeV ; emmitance in rad
-Transfert
+Beam
+  Particle= 132Sn
+  Energy= 1320
+	SigmaEnergy= 0
+	SigmaThetaX= 0
+	SigmaPhiY= 0
+	SigmaX= 0
+	SigmaY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
 	Beam= 132Sn
 	Target= 2H
 	Light= 1H
 	Heavy= 133Sn
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 0.0
-	BeamEnergy= 1320
-	BeamEnergySpread= 0
-	SigmaX= 0
-	SigmaY= 0
-	SigmaThetaX= 0 
-	SigmaPhiY= 0
-	CrossSectionPath= sn132dp_gs_10AMeV.txt
-%	CrossSectionPath= 132Sndp_10A_MeV_2f7_ZR_FRC.lis
-%	CrossSectionPath= flat.txt
-   HalfOpenAngleMin= 0
-   HalfOpenAngleMax= 180
+  CrossSectionPath= sn132dp_gs_10AMeV.txt CS
+%CrossSectionPath= 132Sndp_10A_MeV_2f7_ZR_FRC.lis
+%CrossSectionPath= flat.txt
+  HalfOpenAngleMin= 0
+  HalfOpenAngleMax= 180
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction b/Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction
index 3a3f1a6c6..b8dab4c3d 100644
--- a/Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction
+++ b/Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction
@@ -2,20 +2,27 @@
 %%%%%%%%%  Reaction file for 60Fe(d,p)61Fe reaction  %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%Beam energy given in MeV ; Excitation in MeV ; emmitance in rad
-Transfert
+Beam
+  Particle= 132Sn
+  Energy= 1320
+	SigmaEnergy= 0
+	SigmaX= 0.851
+	SigmaY= 0.851
+	SigmaThetaX= 0 
+	SigmaPhiY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
 	Beam= 132Sn
 	Target= 2H
 	Light= 1H
 	Heavy= 133Sn
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 0.0
-	BeamEnergy= 1320
-	BeamEnergySpread= 0
-	SigmaX= 0.851
-	SigmaY= 0.851
-	SigmaThetaX= 0 
-	SigmaPhiY= 0
-	CrossSectionPath= flat.txt
+	CrossSectionPath= flat.txt CS
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/134Snpt.reaction b/Inputs/EventGenerator/134Snpt.reaction
index 5a9d186af..8358daae1 100644
--- a/Inputs/EventGenerator/134Snpt.reaction
+++ b/Inputs/EventGenerator/134Snpt.reaction
@@ -2,20 +2,27 @@
 %%%%%%%%%  Reaction file for 60Fe(d,p)61Fe reaction  %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%Beam energy given in MeV ; Excitation in MeV ; emmitance in rad
-Transfert
+Beam
+  Particle= 134Sn
+  Energy= 1340
+	SigmaEnergy= 0
+	SigmaX= 0
+	SigmaY= 0
+	SigmaThetaX= 0 
+	SigmaPhiY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
 	Beam= 134Sn
 	Target= 1H
 	Light= 3H
 	Heavy= 132Sn
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 0.0
-	BeamEnergy= 1340
-	BeamEnergySpread= 0
-	SigmaX= 0
-	SigmaY= 0
-	SigmaThetaX= 0 
-	SigmaPhiY= 0
-	CrossSectionPath= CS_Ep10MeV_sn134pt_gs_1h9demi.dat
+	CrossSectionPath= CS_Ep10MeV_sn134pt_gs_1h9demi.dat CS
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/19C208Pb_570MeV_EneSpr1_flat.reaction b/Inputs/EventGenerator/19C208Pb_570MeV_EneSpr1_flat.reaction
index 77f0989ba..2eaeed349 100644
--- a/Inputs/EventGenerator/19C208Pb_570MeV_EneSpr1_flat.reaction
+++ b/Inputs/EventGenerator/19C208Pb_570MeV_EneSpr1_flat.reaction
@@ -2,20 +2,27 @@
 %%%  Reaction file for 208Pb(19C,19C)208Pb reaction  %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%Beam energy given in MeV ; Excitation in MeV ; emmitance in rad
-Transfert
+Beam
+  Particle= 19C
+  Energy= 570
+	SigmaEnergy= 5.70
+	SigmaX= 1.
+	SigmaY= 1.
+	SigmaThetaX= 0. 
+	SigmaPhiY= 0.
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
 	Beam= 19C
 	Target= 208Pb
 	Light= 19C
 	Heavy= 208Pb
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 0.0
-	BeamEnergy= 570
-	BeamEnergySpread= 5.70
-	SigmaX= 1.
-	SigmaY= 1.
-	SigmaThetaX= 0. 
-	SigmaPhiY= 0.
-	CrossSectionPath= flat.txt
+	CrossSectionPath= flat.txt CS
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/27Alppp.reaction b/Inputs/EventGenerator/27Alppp.reaction
index e8190b868..28d33b633 100644
--- a/Inputs/EventGenerator/27Alppp.reaction
+++ b/Inputs/EventGenerator/27Alppp.reaction
@@ -2,25 +2,31 @@
 %%%%%%%%% Reaction file for 11Li(d,3He)10He reaction %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%Beam energy given in MeV ; Excitation in MeV
-TransfertToResonance
+Beam
+  Particle= 1H
+  Energy= 18
+	SigmaEnergy= 0
+	SigmaThetaX= 0
+	SigmaPhiY= 0
+	SigmaX= 0
+	SigmaY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
 	Beam= 1H
 	Target= 27Al
 	Light= 1H
 	Heavy= 27Al
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 13.0
-	BeamEnergy= 18
-	BeamEnergySpread= 0
-	SigmaThetaX= 0
-	SigmaPhiY= 0
-	SigmaX= 0
-	SigmaY= 0
-	ResonanceWidth= 0
-	ResonanceDecayZ= 12
-	ResonanceDecayA= 26
-	CrossSectionPath= flat.txt
+	CrossSectionPath= flat.txt CS
 	ShootLight= 1
-	ShootHeavy= 0
-	ShootDecayProduct= 1
+	ShootHeavy= 1
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+ParticleDecay 27Al
+  Daughter= 26Mg p
+  ExcitationEnergy= 0 0
+  shoot= 1 1
diff --git a/Inputs/EventGenerator/40Ca.reaction b/Inputs/EventGenerator/40Ca.reaction
index 72e69b5ad..c99ff0cc9 100644
--- a/Inputs/EventGenerator/40Ca.reaction
+++ b/Inputs/EventGenerator/40Ca.reaction
@@ -20,6 +20,6 @@ TwoBodyReaction
   Heavy= 40Ca
   ExcitationEnergyLight= 0.0
   ExcitationEnergyHeavy= 0.0
-  CrossSectionPath= flat.txt   CS10He
+  CrossSectionPath= flat.txt   CS
   ShootLight= 1
   ShootHeavy= 1
diff --git a/Inputs/EventGenerator/60Fe.reaction b/Inputs/EventGenerator/60Fe.reaction
index 92f87dfaa..f45f8e3a3 100644
--- a/Inputs/EventGenerator/60Fe.reaction
+++ b/Inputs/EventGenerator/60Fe.reaction
@@ -1,21 +1,27 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%  Reaction file for 60Fe(d,p)61Fe reaction  %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%Beam energy given in MeV ; Excitation in MeV ; emmitance in rad
-Transfert
+Beam
+  Particle= 60Fe
+  Energy= 1628.41
+  SigmaEnergy= 0
+	SigmaX= 0
+	SigmaY= 0
+	SigmaThetaX= 0 
+	SigmaPhiY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TwoBodyReaction
 	Beam= 60Fe
 	Target= 2H
 	Light= 1H
 	Heavy= 61Fe
 	ExcitationEnergyHeavy= 0.0
 	ExcitationEnergyLight= 0.0
-	BeamEnergy= 1628.41
-	BeamEnergySpread= 0
-	SigmaX= 0
-	SigmaY= 0
-	SigmaThetaX= 0 
-	SigmaPhiY= 0
-	CrossSectionPath= fe61_p3_2gs.n
+  CrossSectionPath= fe61_p3_2gs.n CS
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/69Ni.reaction b/Inputs/EventGenerator/69Ni.reaction
index 914614472..9924ea6d8 100644
--- a/Inputs/EventGenerator/69Ni.reaction
+++ b/Inputs/EventGenerator/69Ni.reaction
@@ -1,21 +1,30 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%% Reaction file for 11Li(d,3He)10He reaction %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%Beam energy given in MeV ; Excitation in MeV
-Transfert
+Beam
+  Particle= 68Ni
+  Energy= 1904
+  SigmaEnergy= 0
+  SigmaX= 1.5
+	SigmaY= 1.5
+	SigmaThetaX= 0.005
+	SigmaPhiY= 0.005
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+TwoBodyReaction
 	Beam= 68Ni
 	Target= 2H
 	Light= 1H
 	Heavy= 69Ni
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 2.0
-	BeamEnergy= 1904
-	BeamEnergySpread= 0
-	SigmaX= 1.5
-	SigmaY= 1.5
-	SigmaThetaX= 0.005
-	SigmaPhiY= 0.005
-	CrossSectionPath= ./Data/CrossSection/ni69_d5_01.n
+	%CrossSectionPath= ./Data/CrossSection/ni69_d5_01.n CS
+  CrossSectionPath= flat.txt CS
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/9He.reaction b/Inputs/EventGenerator/9He.reaction
deleted file mode 100644
index efff66a02..000000000
--- a/Inputs/EventGenerator/9He.reaction
+++ /dev/null
@@ -1,22 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%% Reaction file for 11Li(d,3He)10He reaction %%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Beam energy given in MeV ; Excitation in MeV ; SigmaXY in mm
-%  SigmaThetaX/PhiY in deg
-Transfert
-	Beam= 11Li
-	Target= 2H
-	Light= 4He
-	Heavy= 9He
-	ExcitationEnergyLight= 0.0
-	ExcitationEnergyHeavy= 1.0
-	BeamEnergy= 550
-	BeamEnergySpread= 0
-	SigmaThetaX= 0.6921330164
-	SigmaPhiY= 0.963142053
-	SigmaX= 6.232
-	SigmaY= 9.069
-	CrossSectionPath= flat.txt
-	ShootLight= 1
-	ShootHeavy= 0
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/Source.reaction b/Inputs/EventGenerator/Source.reaction
deleted file mode 100644
index 12b39ee5e..000000000
--- a/Inputs/EventGenerator/Source.reaction
+++ /dev/null
@@ -1,23 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%  File used for PARIS analysis when a gamma source %%%%
-%%% The reaction is irrelevent and just kept for the format %%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Beam energy given in MeV ; Excitation in MeV ; SigmaXY in mm
-%  SigmaThetaX/PhiY in deg
-Transfert
-	Beam= 11Li
-	Target= 2H
-	Light= 1H
-	Heavy= 12Li
-	ExcitationEnergyLight= 0.0
-	ExcitationEnergyHeavy= 1.0
-	BeamEnergy= 550
-	BeamEnergySpread= 0
-	SigmaThetaX= 0.6921330164
-	SigmaPhiY= 0.963142053
-	SigmaX= 6.232
-	SigmaY= 9.069
-	CrossSectionPath= flat.txt
-	ShootLight= 1
-	ShootHeavy= 0
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Inputs/EventGenerator/e569.reaction b/Inputs/EventGenerator/e569.reaction
index 108c421bc..de4defd9e 100644
--- a/Inputs/EventGenerator/e569.reaction
+++ b/Inputs/EventGenerator/e569.reaction
@@ -1,21 +1,30 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%% Reaction file for 11Li(d,3He)10He reaction %%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%Beam energy given in MeV ; Excitation in MeV
-Transfert
+Beam
+  Particle= 14O
+  Energy= 252
+  SigmaEnergy= 0
+	SigmaX= 2
+	SigmaY= 1.5
+	SigmaThetaX= 0
+	SigmaPhiY= 0
+  MeanThetaX= 0
+  MeanPhiY= 0
+  MeanX= 0
+  MeanY= 0
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+TwoBodyReaction
 	Beam= 14O
 	Target= 2H
 	Light= 3H
 	Heavy= 13O
 	ExcitationEnergyLight= 0.0
 	ExcitationEnergyHeavy= 0.0
-	BeamEnergy= 252
-	BeamEnergySpread= 0
-	SigmaX= 2
-	SigmaY= 1.5
-	SigmaThetaX= 0
-	SigmaPhiY= 0
-	CrossSectionPath= ../Data/CrossSection/flat.txt
+	%CrossSectionPath= ../Data/CrossSection/flat.txt CS
+  CrossSectionPath= flat.txt CS
 	ShootLight= 1
 	ShootHeavy= 0
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/NPLib/Physics/NPFunction.cxx b/NPLib/Physics/NPFunction.cxx
index 2948824ad..a4a9e93ef 100644
--- a/NPLib/Physics/NPFunction.cxx
+++ b/NPLib/Physics/NPFunction.cxx
@@ -229,6 +229,11 @@ void RandomGaussian2D(double MeanX, double MeanY, double SigmaX, double SigmaY,
     Y = MeanY;
     X = gRandom->Gaus(MeanX, SigmaX);
   }
+  
+  else {
+    X = MeanX;
+    Y = MeanY;
+  }
 }
 
 }
diff --git a/NPSimulation/src/EventGeneratorGammaDecay.cc b/NPSimulation/src/EventGeneratorGammaDecay.cc
index 9b5b8742f..bb3a6dfca 100644
--- a/NPSimulation/src/EventGeneratorGammaDecay.cc
+++ b/NPSimulation/src/EventGeneratorGammaDecay.cc
@@ -53,9 +53,6 @@ EventGeneratorGammaDecay::EventGeneratorGammaDecay(){
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 EventGeneratorGammaDecay::~EventGeneratorGammaDecay(){
-  for(unsigned i = 0  ; i < m_CrossSectionHist.size() ; i++)
-    delete m_CrossSectionHist[i];
-  
   m_CrossSectionHist.clear();
 }
 
diff --git a/NPSimulation/src/EventGeneratorParticleDecay.cc b/NPSimulation/src/EventGeneratorParticleDecay.cc
index 9c31da651..cb1e20f1a 100644
--- a/NPSimulation/src/EventGeneratorParticleDecay.cc
+++ b/NPSimulation/src/EventGeneratorParticleDecay.cc
@@ -51,7 +51,6 @@ EventGeneratorParticleDecay::EventGeneratorParticleDecay(){
 }
 
 EventGeneratorParticleDecay::~EventGeneratorParticleDecay(){
-  delete m_CrossSectionHist;
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-- 
GitLab