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

* Fixing minor bug in vertex generation

parent 461f431b
No related branches found
No related tags found
No related merge requests found
Pipeline #81618 passed
...@@ -127,8 +127,12 @@ G4bool NPS::BeamReaction::ModelTrigger(const G4FastTrack& fastTrack) { ...@@ -127,8 +127,12 @@ G4bool NPS::BeamReaction::ModelTrigger(const G4FastTrack& fastTrack) {
bool is_first = (to_entrance==0); bool is_first = (to_entrance==0);
if(is_first && m_shoot){ if(is_first && m_shoot){
std::cout << "Something went wrong in beam reaction, m_shoot cannot be true at beginning of event" << std::endl; /* std::cout << "Something went wrong in beam reaction, m_shoot cannot be true at beginning of event" << std::endl;
std::cout << "rand: " << m_rand << std::endl; std::cout << "rand: " << m_rand << std::endl;
std::cout << "length: " << m_length << std::endl;
std::cout << "step: " << m_StepSize << std::endl;
std::cout << "Z: " << m_Z << std::endl;
std::cout << "S: " << m_S << std::endl;*/
m_shoot = false; m_shoot = false;
} }
...@@ -141,9 +145,11 @@ G4bool NPS::BeamReaction::ModelTrigger(const G4FastTrack& fastTrack) { ...@@ -141,9 +145,11 @@ G4bool NPS::BeamReaction::ModelTrigger(const G4FastTrack& fastTrack) {
m_shoot=true; m_shoot=true;
} }
// curviligne coordinate along beam patch // curviligne coordinate along beam path
double S = to_entrance - 0.5*(to_exit+to_entrance); m_S = to_entrance - 0.5*(to_exit+to_entrance);
m_length = m_Z-S; m_length = m_Z-m_S;
m_StepSize = PrimaryTrack->GetStepLength();
// If the condition is met, the event is generated // If the condition is met, the event is generated
if (m_shoot && m_length < m_StepSize) { if (m_shoot && m_length < m_StepSize) {
if(m_ReactionType=="QFSReaction"){ if(m_ReactionType=="QFSReaction"){
...@@ -176,7 +182,7 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, ...@@ -176,7 +182,7 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack,
// std::cout << "DOIT" << std::endl; // std::cout << "DOIT" << std::endl;
m_shoot=false; m_shoot=false;
m_length=abs(m_length);
// Get the track info // Get the track info
const G4Track* PrimaryTrack = fastTrack.GetPrimaryTrack(); const G4Track* PrimaryTrack = fastTrack.GetPrimaryTrack();
G4ThreeVector pdirection = PrimaryTrack->GetMomentum().unit(); G4ThreeVector pdirection = PrimaryTrack->GetMomentum().unit();
......
...@@ -52,6 +52,7 @@ namespace NPS{ ...@@ -52,6 +52,7 @@ namespace NPS{
bool m_shoot; bool m_shoot;
double m_StepSize; double m_StepSize;
double m_Z; double m_Z;
double m_S;
double m_rand; double m_rand;
double m_length; double m_length;
int m_Parent_ID; int m_Parent_ID;
......
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