Skip to content
Snippets Groups Projects
Commit c4bfc6cd authored by adrien-matta's avatar adrien-matta
Browse files

* Adding sigmaX and sigmaY to isotropic source generation

parent a9afff12
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,18 @@ void EventGeneratorIsotropic::ReadConfiguration(string Path,int){
G4cout << "z0 " << m_z0 << " mm" << G4endl;
}
else if (DataBuffer == "SigmaX=" ) {
ReactionFile >> DataBuffer;
m_SigmaX = atof(DataBuffer.c_str()) * mm;
G4cout << "SigmaX " << m_SigmaX << " mm" << G4endl;
}
else if (DataBuffer == "SigmaY=" ) {
ReactionFile >> DataBuffer;
m_SigmaY = atof(DataBuffer.c_str()) * mm;
G4cout << "SigmaY " << m_SigmaY << " mm" << G4endl;
}
else if (DataBuffer=="Particle=" || DataBuffer=="particle=") {
check_particle = true ;
ReactionFile >> m_particleName;
......@@ -224,7 +236,10 @@ void EventGeneratorIsotropic::GenerateEvent(G4Event*){
G4double momentum_y = sin(theta) * sin(phi) ;
G4double momentum_z = cos(theta) ;
Particle particle(m_particle, theta,particle_energy,G4ThreeVector(momentum_x, momentum_y, momentum_z),G4ThreeVector(m_x0, m_y0, m_z0));
G4double x0 = RandGauss::shoot(m_x0,m_SigmaX);
G4double y0 = RandGauss::shoot(m_y0,m_SigmaY);
Particle particle(m_particle, theta,particle_energy,G4ThreeVector(momentum_x, momentum_y, momentum_z),G4ThreeVector(x0, y0, m_z0));
m_ParticleStack->AddParticleToStack(particle);
......
......@@ -51,6 +51,8 @@ private: // Source parameter from input file
G4double m_x0 ; // Vertex Position X
G4double m_y0 ; // Vertex Position Y
G4double m_z0 ; // Vertex Position Z
G4double m_SigmaX ;
G4double m_SigmaY ;
G4ParticleDefinition* m_particle ; // Kind of particle to shoot isotropically
G4double m_ExcitationEnergy ; // Excitation energy of the emitted particle
string m_particleName ;
......
......@@ -37,7 +37,7 @@ namespace MUST2
const G4double ResoTimeMust = 0.212765957 ;// = 500ps // Unit is ns/2.35
const G4double ResoSiLi = 0.055 ;// = 130 keV of resolution // Unit is MeV/2.35
const G4double ResoCsI = 0.08 ;// = 188 kev of resolution // Unit is MeV/2.35
const G4double ResoStrip = 0.022 ;// = 52keV of Resolution // Unit is MeV/2.35
const G4double ResoStrip = 0.017 ;// = 52keV of Resolution // Unit is MeV/2.35
// Geometry
const G4double FaceFront = 11.*cm ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment