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

---
 Inputs/EventGenerator/34Si.reaction           |  6 +-
 Inputs/EventGenerator/60Fe.reaction           |  8 +-
 Inputs/EventGenerator/69Ni.reaction           |  8 +-
 Inputs/EventGenerator/e569.reaction           |  7 +-
 .../include/EventGeneratorTransfert.hh        | 16 ++--
 NPSimulation/src/EventGeneratorTransfert.cc   | 82 +++++++++----------
 NPSimulation/src/VEventGenerator.cc           | 23 ------
 7 files changed, 65 insertions(+), 85 deletions(-)

diff --git a/Inputs/EventGenerator/34Si.reaction b/Inputs/EventGenerator/34Si.reaction
index 4df486e8f..edecfe2aa 100644
--- a/Inputs/EventGenerator/34Si.reaction
+++ b/Inputs/EventGenerator/34Si.reaction
@@ -10,8 +10,10 @@ Transfert
 	ExcitationEnergy= 2.0
 	BeamEnergy= 748
 	BeamEnergySpread= 0
-	BeamFWHMX= 0.5
-	BeamFWHMY= 0.5
+	SigmaX= 0.5
+	SigmaY= 0.5
+	SigmaThetaX= 0
+	SigmaPhiY= 0
 	BeamSpreadX= 0
 	CrossSectionPath= ni69_g7_01.n
 	ShootLight= 1
diff --git a/Inputs/EventGenerator/60Fe.reaction b/Inputs/EventGenerator/60Fe.reaction
index 24ad16495..9b4d370f9 100644
--- a/Inputs/EventGenerator/60Fe.reaction
+++ b/Inputs/EventGenerator/60Fe.reaction
@@ -10,10 +10,10 @@ Transfert
 	ExcitationEnergy= 2.0
 	BeamEnergy= 1200
 	BeamEnergySpread= 0
-	BeamFWHMX= 1
-	BeamFWHMY= 1
-	BeamEmmitanceTheta= 0.034
-	BeamEmmitancePhi= 0.01
+	SigmaX= 1
+	SigmaY= 1
+	SigmaThetaX= 0.034
+	SigmaPhiY= 0.01
 	CrossSectionPath= ni69_g7_01.n
 	ShootLight= 1
 	ShootHeavy= 0
diff --git a/Inputs/EventGenerator/69Ni.reaction b/Inputs/EventGenerator/69Ni.reaction
index f4c435c68..76d9893d2 100644
--- a/Inputs/EventGenerator/69Ni.reaction
+++ b/Inputs/EventGenerator/69Ni.reaction
@@ -10,10 +10,10 @@ Transfert
 	ExcitationEnergy= 2.0
 	BeamEnergy= 1904
 	BeamEnergySpread= 0
-	BeamFWHMX= 1.5
-	BeamFWHMY= 1.5
-	BeamSpreadX= 0.005
-	BeamSpreadY= 0.005
+	SigmaX= 1.5
+	SigmaY= 1.5
+	SigmaThetaX= 0.005
+	SigmaPhiY= 0.005
 	CrossSectionPath= ./Data/CrossSection/ni69_d5_01.n
 	ShootLight= 1
 	ShootHeavy= 0
diff --git a/Inputs/EventGenerator/e569.reaction b/Inputs/EventGenerator/e569.reaction
index 0221149c1..c7f8df64e 100644
--- a/Inputs/EventGenerator/e569.reaction
+++ b/Inputs/EventGenerator/e569.reaction
@@ -10,9 +10,10 @@ Transfert
 	ExcitationEnergy= 0.0
 	BeamEnergy= 252
 	BeamEnergySpread= 0
-	BeamFWHMX= 2
-	BeamFWHMY= 1.5
-	BeamSpreadX= 0
+	SigmaX= 2
+	SigmaY= 1.5
+	SigmaThetaX= 0
+	SigmaPhiY= 0
 	CrossSectionPath= ../Data/CrossSection/flat.txt
 	ShootLight= 1
 	ShootHeavy= 0
diff --git a/NPSimulation/include/EventGeneratorTransfert.hh b/NPSimulation/include/EventGeneratorTransfert.hh
index 2380f0dc9..f66562a6f 100644
--- a/NPSimulation/include/EventGeneratorTransfert.hh
+++ b/NPSimulation/include/EventGeneratorTransfert.hh
@@ -54,8 +54,8 @@ class EventGeneratorTransfert : public VEventGenerator
 		             double BeamEnergySpread  ,
 		             double BeamFWHMX         ,
 		             double BeamFWHMY         ,
-		             double BeamEmmitanceTheta       ,
-		             double BeamEmmitancePhi  ,
+		             double SigmaThetaX       ,
+		             double SigmaPhiY  ,
 		             bool   ShootLight        ,
 		             bool   ShootHeavy        ,
 		             string Path);                     // Path of the differentiel Cross Section
@@ -92,10 +92,10 @@ class EventGeneratorTransfert : public VEventGenerator
 		private: // Beam Parameter
 		   double         m_BeamEnergy ;
 		   double         m_BeamEnergySpread ;
-		   double         m_BeamFWHMX        ;
-		   double         m_BeamFWHMY        ;
-		   double         m_BeamEmmitanceTheta      ;
-		   double         m_BeamEmmitancePhi      ;
+		   double         m_SigmaX        ;
+		   double         m_SigmaY        ;
+		   double         m_SigmaThetaX      ;
+		   double         m_SigmaPhiY      ;
 
 		private: // Target Parameter
 		   double         m_TargetThickness ;
@@ -120,8 +120,8 @@ class EventGeneratorTransfert : public VEventGenerator
 		             double BeamEnergySpread  ,
 		             double BeamFWHMX         ,
 		             double BeamFWHMY         ,
-		             double BeamEmmitanceTheta       ,
-		             double BeamEmmitancePhi  ,
+		             double SigmaThetaX       ,
+		             double SigmaPhiY  ,
 		             bool   ShootLight        ,
 		             bool   ShootHeavy        ,
 		             string Path);                     // Path of the differentiel Cross Section
diff --git a/NPSimulation/src/EventGeneratorTransfert.cc b/NPSimulation/src/EventGeneratorTransfert.cc
index 41fd69c42..867236553 100644
--- a/NPSimulation/src/EventGeneratorTransfert.cc
+++ b/NPSimulation/src/EventGeneratorTransfert.cc
@@ -53,10 +53,10 @@ EventGeneratorTransfert::EventGeneratorTransfert()
 
    m_BeamEnergy       = 0;
    m_BeamEnergySpread = 0;
-   m_BeamFWHMX        = 0;
-   m_BeamFWHMY        = 0;
-   m_BeamEmmitanceTheta      = 0;
-   m_BeamEmmitancePhi=0 ;
+   m_SigmaX        = 0;
+   m_SigmaY        = 0;
+   m_SigmaThetaX      = 0;
+   m_SigmaPhiY=0 ;
    m_ShootLight       = 0;
    m_ShootHeavy       = 0;
 }
@@ -77,10 +77,10 @@ EventGeneratorTransfert::EventGeneratorTransfert(string name1             ,
 		             double BeamEnergy        ,        // Beam Energy
 		             double ExcitationEnergy  ,        // Excitation of Heavy Nuclei
 		             double BeamEnergySpread  ,
-		             double BeamFWHMX         ,
-		             double BeamFWHMY         ,
-		             double BeamEmmitanceTheta       ,
-		             double BeamEmmitancePhi  ,
+		             double SigmaX         ,
+		             double SigmaY         ,
+		             double SigmaThetaX       ,
+		             double SigmaPhiY  ,
 		             bool   ShootLight        ,
 		             bool   ShootHeavy        ,
 		             string Path)                     // Path of the differentiel Cross Section
@@ -92,10 +92,10 @@ EventGeneratorTransfert::EventGeneratorTransfert(string name1             ,
 		              BeamEnergy        ,        // Beam Energy
 		              ExcitationEnergy  ,        // Excitation of Heavy Nuclei
 		              BeamEnergySpread  ,
-		              BeamFWHMX         ,
-		              BeamFWHMY         ,
-		              BeamEmmitanceTheta       ,
-		              BeamEmmitancePhi  ,
+		              SigmaX         ,
+		              SigmaY         ,
+		              SigmaThetaX       ,
+		              SigmaPhiY  ,
 		               ShootLight        ,
 		                ShootHeavy        ,
 		             Path);        
@@ -131,7 +131,7 @@ void EventGeneratorTransfert::ReadConfiguration(string Path)
 
 ////////Reaction Setting needs///////
    string Beam, Target, Heavy, Light, CrossSectionPath ;
-   G4double BeamEnergy = 0 , ExcitationEnergy = 0 , BeamEnergySpread = 0 , BeamFWHMX = 0 , BeamFWHMY = 0 , BeamEmmitanceTheta = 0 , BeamEmmitancePhi=0;
+   G4double BeamEnergy = 0 , ExcitationEnergy = 0 , BeamEnergySpread = 0 , SigmaX = 0 , SigmaY = 0 , SigmaThetaX = 0 , SigmaPhiY=0;
    bool  ShootLight     = false ;
    bool  ShootHeavy      = false ;
    
@@ -224,32 +224,32 @@ while(ReadingStatus){
 	            G4cout << "Beam Energy Spread " << BeamEnergySpread / MeV << " MeV" << G4endl;
 	         }
 
-	        else if  (DataBuffer.compare(0, 11, "BeamFWHMX=") == 0) {
+	        else if  (DataBuffer.compare(0, 7, "SigmaX=") == 0) {
 	        	check_FWHMX = true ;
 	            ReactionFile >> DataBuffer;
-	            BeamFWHMX = atof(DataBuffer.c_str()) * mm;
-	            G4cout << "Beam FWHM X " << BeamFWHMX << " mm" << G4endl;
+	            SigmaX = atof(DataBuffer.c_str()) * mm;
+	            G4cout << "Beam FWHM X " << SigmaX << " mm" << G4endl;
 	         }
 
-	        else if  (DataBuffer.compare(0, 11, "BeamFWHMY=") == 0) {
+	        else if  (DataBuffer.compare(0, 7, "SigmaY=") == 0) {
 	        	check_FWHMY = true ;
 	            ReactionFile >> DataBuffer;
-	            BeamFWHMY = atof(DataBuffer.c_str()) * mm;
-	            G4cout << "Beam FWHM Y " << BeamFWHMX << " mm" << G4endl;
+	            SigmaY = atof(DataBuffer.c_str()) * mm;
+	            G4cout << "Beam FWHM Y " << SigmaX << " mm" << G4endl;
 	         }
 
-	        else if  (DataBuffer.compare(0, 19, "BeamEmmitanceTheta=") == 0) {
+	        else if  (DataBuffer.compare(0, 12, "SigmaThetaX=") == 0) {
 	        	check_EmmitanceTheta = true ;
 	            ReactionFile >> DataBuffer;
-	            BeamEmmitanceTheta = atof(DataBuffer.c_str()) * rad;
-	            G4cout << "Beam Emmitance Theta " << BeamEmmitanceTheta / deg << " deg" << G4endl;
+	            SigmaThetaX = atof(DataBuffer.c_str()) * deg;
+	            G4cout << "Beam Emmitance Theta " << SigmaThetaX / deg << " deg" << G4endl;
 	         }
 	         
-	        else if  (DataBuffer.compare(0, 17, "BeamEmmitancePhi=") == 0) {
+	        else if  (DataBuffer.compare(0, 10, "SigmaPhiY=") == 0) {
 	        	check_EmmitancePhi = true ;
 	            ReactionFile >> DataBuffer;
-	            BeamEmmitancePhi = atof(DataBuffer.c_str()) * rad;
-	            G4cout << "Beam Emmitance Phi " << BeamEmmitancePhi / deg << " deg" << G4endl;
+	            SigmaPhiY = atof(DataBuffer.c_str()) * deg;
+	            G4cout << "Beam Emmitance Phi " << SigmaPhiY / deg << " deg" << G4endl;
 	         }
 
 	        else if  (DataBuffer.compare(0, 17, "CrossSectionPath=") == 0) {
@@ -299,10 +299,10 @@ while(ReadingStatus){
          BeamEnergy        ,
          ExcitationEnergy  ,
          BeamEnergySpread  ,
-         BeamFWHMX         ,
-         BeamFWHMY         ,
-         BeamEmmitanceTheta       ,
-         BeamEmmitancePhi	,
+         SigmaX         ,
+         SigmaY         ,
+         SigmaThetaX       ,
+         SigmaPhiY	,
          ShootLight        ,
          ShootHeavy        ,
          CrossSectionPath);
@@ -340,13 +340,13 @@ void EventGeneratorTransfert::GenerateEvent(G4Event* anEvent , G4ParticleGun* pa
    //shoot inside the target with correlated angle
    if (m_TargetRadius != 0) {
       while (sqrt(x0*x0 + y0*y0) > m_TargetRadius) {
-         RandomGaussian2D(0,0,m_BeamFWHMX / 2.35,m_BeamEmmitanceTheta,x0,Beam_thetaX);
-         RandomGaussian2D(0,0,m_BeamFWHMY / 2.35,m_BeamEmmitancePhi  ,y0,Beam_phiY  );
+         RandomGaussian2D(0,0,m_SigmaX / 2.35,m_SigmaThetaX,x0,Beam_thetaX);
+         RandomGaussian2D(0,0,m_SigmaY / 2.35,m_SigmaPhiY  ,y0,Beam_phiY  );
       }
    }
    else {
-      RandomGaussian2D(0,0,0,m_BeamEmmitanceTheta,x0,Beam_thetaX);
-      RandomGaussian2D(0,0,0,m_BeamEmmitancePhi  ,y0,Beam_phiY  );
+      RandomGaussian2D(0,0,0,m_SigmaThetaX,x0,Beam_thetaX);
+      RandomGaussian2D(0,0,0,m_SigmaPhiY  ,y0,Beam_phiY  );
    }
 
    // write emittance angles to ROOT file
@@ -503,10 +503,10 @@ void EventGeneratorTransfert::SetEverything(string name1             ,        //
 		             double BeamEnergy        ,        // Beam Energy
 		             double ExcitationEnergy  ,        // Excitation of Heavy Nuclei
 		             double BeamEnergySpread  ,
-		             double BeamFWHMX         ,
-		             double BeamFWHMY         ,
-		             double BeamEmmitanceTheta       ,
-		             double BeamEmmitancePhi  ,
+		             double SigmaX         ,
+		             double SigmaY         ,
+		             double SigmaThetaX       ,
+		             double SigmaPhiY  ,
 		             bool   ShootLight        ,
 		             bool   ShootHeavy        ,
 		             string Path) 
@@ -521,10 +521,10 @@ void EventGeneratorTransfert::SetEverything(string name1             ,        //
 		
    m_BeamEnergy       =  BeamEnergy        ;
    m_BeamEnergySpread =  BeamEnergySpread  ;
-   m_BeamFWHMX        =  BeamFWHMX         ;
-   m_BeamFWHMY        =  BeamFWHMY         ;
-   m_BeamEmmitanceTheta      =  BeamEmmitanceTheta       ;
-   m_BeamEmmitancePhi      =  BeamEmmitancePhi      ;
+   m_SigmaX        =  SigmaX         ;
+   m_SigmaY        =  SigmaY         ;
+   m_SigmaThetaX      =  SigmaThetaX       ;
+   m_SigmaPhiY      =  SigmaPhiY      ;
    m_ShootLight       =  ShootLight        ;
    m_ShootHeavy       =  ShootHeavy        ;
 }
diff --git a/NPSimulation/src/VEventGenerator.cc b/NPSimulation/src/VEventGenerator.cc
index a59fcaca6..3149269f1 100644
--- a/NPSimulation/src/VEventGenerator.cc
+++ b/NPSimulation/src/VEventGenerator.cc
@@ -62,28 +62,5 @@ void VEventGenerator::RandomGaussian2D(double MeanX,double MeanY,double SigmaX,d
 		 		X= MeanX;
 		 		Y = m_RandomEngine.Gaus( MeanY , SigmaY) ;
 		 	}
-	
-//		if(SigmaX!=0)
-//			{
-//				X = m_RandomEngine.Gaus( MeanX , SigmaX) ;
-//		
-//				double NumberOfSigma ;
-//			
-//				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 ; 
-//			
-//				Y = m_RandomEngine.Gaus( MeanY , SigmaYPrim) ;
-//			
-//			}
-//	
-//		 else
-//		 	{
-//		 		X= MeanX;
-//		 		Y = m_RandomEngine.Gaus( MeanY , SigmaY) ;
-//		 	}
-		
 
 	}
-- 
GitLab