Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
np
nptool
Commits
bdb40b69
Commit
bdb40b69
authored
4 years ago
by
Adrien Matta
Browse files
Options
Downloads
Patches
Plain Diff
* Fixing minor bug in vertex generation
parent
461f431b
No related branches found
No related tags found
No related merge requests found
Pipeline
#81618
passed
4 years ago
Stage: build-NPLib
Stage: build-NPSimulation
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPSimulation/Process/BeamReaction.cc
+11
-5
11 additions, 5 deletions
NPSimulation/Process/BeamReaction.cc
NPSimulation/Process/BeamReaction.hh
+1
-0
1 addition, 0 deletions
NPSimulation/Process/BeamReaction.hh
with
12 additions
and
5 deletions
NPSimulation/Process/BeamReaction.cc
+
11
−
5
View file @
bdb40b69
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/Process/BeamReaction.hh
+
1
−
0
View file @
bdb40b69
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment