From 26cebe0a048f41246e48021a5f9f1ff7d4a4a702 Mon Sep 17 00:00:00 2001
From: Unknown <unknown>
Date: Wed, 2 Oct 2013 10:00:25 +0000
Subject: [PATCH]

---
 Licence/header_template                     |  2 +-
 NPAnalysis/10He_Riken/src/Analysis.cc       |  8 +++----
 NPSimulation/src/EventGeneratorTransfert.cc |  8 +++----
 NPSimulation/src/VEventGenerator.cc         | 25 +++++++++++++++------
 4 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/Licence/header_template b/Licence/header_template
index 1e51364c3..b51dd45a9 100644
--- a/Licence/header_template
+++ b/Licence/header_template
@@ -1,6 +1,6 @@
 /*****************************************************************************
  * Copyright (C) 2009 	this file is part of the NPTool Project              *
- * 				                                             *
+ * 				                                                             *
  * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
  * For the list of contributors see $NPTOOL/Licence/Contributors             *
  *****************************************************************************/
diff --git a/NPAnalysis/10He_Riken/src/Analysis.cc b/NPAnalysis/10He_Riken/src/Analysis.cc
index d23ecc584..f0088f64f 100644
--- a/NPAnalysis/10He_Riken/src/Analysis.cc
+++ b/NPAnalysis/10He_Riken/src/Analysis.cc
@@ -89,7 +89,7 @@ double TrueE=0 ; double TrueTheta=0 ;
 																20*micrometer		, // Target Thickness at 0 degree
 																ThetaMM2Surface		);																
 					
-//						E = E + ThinSi ;
+						//E = E + ThinSi ;
 						
 						E= He3StripAl.EvaluateInitialEnergy(	E 					, // Energy of the detected particle
 																0.4*micrometer		, // Target Thickness at 0 degree
@@ -105,9 +105,9 @@ double TrueE=0 ; double TrueTheta=0 ;
 																		1.5*mm				, // Target Thickness at 0 degree
 																		ThetaN				);
 																		
-					ThetaCM = myReaction -> EnergyLabToThetaCM( E , 1 ) /deg ;
-					ResolThetaCM =ThetaCM - Init->GetICEmittedAngleThetaCM(0) ;
-					Ex = myReaction -> ReconstructRelativistic( E , Theta ) ;	
+					ThetaCM = myReaction -> EnergyLabToThetaCM( E , 1 ) /deg 	;
+					ResolThetaCM =ThetaCM - Init->GetICEmittedAngleThetaCM(0) 	;
+					Ex = myReaction -> ReconstructRelativistic( E , Theta ) 	;	
 					X = HitDirection . X();
 					Y = HitDirection . Y();	
 				}
diff --git a/NPSimulation/src/EventGeneratorTransfert.cc b/NPSimulation/src/EventGeneratorTransfert.cc
index 7d8b4a38b..e165c29f2 100644
--- a/NPSimulation/src/EventGeneratorTransfert.cc
+++ b/NPSimulation/src/EventGeneratorTransfert.cc
@@ -309,10 +309,10 @@ void EventGeneratorTransfert::GenerateEvent(G4Event* anEvent , G4ParticleGun* pa
    = G4ParticleTable::GetParticleTable()->GetIon(HeavyZ, HeavyA, m_Reaction->GetExcitation()*MeV);
 
    // Vertex position and beam angle inte world frame
-   G4double x0 = 1000 * cm  ;
-   G4double y0 = 1000 * cm  ;
-   G4double Beam_thetaX = 0  ;
-   G4double Beam_phiY   = 0  ;
+   G4double x0 = 1000 * cm  	;
+   G4double y0 = 1000 * cm  	;
+   G4double Beam_thetaX = 0  	;
+   G4double Beam_phiY   = 0  	;
    
    //shoot inside the target with correlated angle
    if (m_TargetRadius != 0) {
diff --git a/NPSimulation/src/VEventGenerator.cc b/NPSimulation/src/VEventGenerator.cc
index c6c7b861b..8510e8a39 100644
--- a/NPSimulation/src/VEventGenerator.cc
+++ b/NPSimulation/src/VEventGenerator.cc
@@ -16,16 +16,27 @@ VEventGenerator::~VEventGenerator()
 
 void VEventGenerator::RandomGaussian2D(double MeanX,double MeanY,double SigmaX,double SigmaY,double &X,double &Y)
 	{
-		X = m_RandomEngine.Gaus( MeanX , SigmaX) ;
+		if(SigmaX!=0)
+			{
+				X = m_RandomEngine.Gaus( MeanX , SigmaX) ;
 		
-		double NumberOfSigma ;
+				double NumberOfSigma ;
 			
-		NumberOfSigma = ( 2*X / SigmaX ) ;
-		NumberOfSigma =  TMath::Floor( sqrt(NumberOfSigma*NumberOfSigma) + 1) ;
+				NumberOfSigma = ( 2*X / SigmaX ) ;
+				NumberOfSigma =  TMath::Floor( sqrt(NumberOfSigma*NumberOfSigma) + 1) ;
 		
-		double SigmaYPrim = sqrt( NumberOfSigma*SigmaY/2 *NumberOfSigma*SigmaY/2 * ( 1 - 2*X*X / (SigmaX*NumberOfSigma*SigmaX*NumberOfSigma)) ) ;
-			SigmaYPrim = SigmaYPrim / NumberOfSigma ; 
+				double SigmaYPrim = sqrt( NumberOfSigma*SigmaY/2 *NumberOfSigma*SigmaY/2 * ( 1 - 2*X*X / (SigmaX*NumberOfSigma*SigmaX*NumberOfSigma)) ) ;
+				SigmaYPrim = SigmaYPrim / NumberOfSigma ; 
 			
-		Y = m_RandomEngine.Gaus( MeanY , SigmaYPrim) ;
+				Y = m_RandomEngine.Gaus( MeanY , SigmaYPrim) ;
+			
+			}
+	
+		 else
+		 	{
+		 		X= MeanX;
+		 		Y= MeanY;
+		 	}
+		
 
 	}
-- 
GitLab