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
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
np
nptool
Commits
f4191f7f
Commit
f4191f7f
authored
6 years ago
by
Elidiano Tronchin
Browse files
Options
Downloads
Patches
Plain Diff
*Fixed bug and def. of ray's origin from central circle
- Radius of central sensitive circle = 3 R
parent
2f59ddec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
NPSimulation/EventGenerator/EventGeneratorCosmic.cc
+16
-14
16 additions, 14 deletions
NPSimulation/EventGenerator/EventGeneratorCosmic.cc
with
16 additions
and
14 deletions
NPSimulation/EventGenerator/EventGeneratorCosmic.cc
+
16
−
14
View file @
f4191f7f
...
...
@@ -159,9 +159,9 @@ void EventGeneratorCosmic::GenerateEvent(G4Event*){
G4double
angle
=
RandFlat
::
shoot
()
*
2
*
pi
;
G4double
shift
=
(
.5
-
RandFlat
::
shoot
())
*
pi
;
G4double
angle2
=
(
.5
-
RandFlat
::
shoot
())
*
pi
;
G4double
momentum_y
=
RandFlat
::
shoot
()
;
G4double
dis
=
acos
(
sqrt
(
momentum_y
));
G4double
CosmicAngle
=
acos
(
sqrt
(
momentum_y
));
G4double
H
=
600
;
G4double
R
=
300
;
G4double
x0
=
0
;
...
...
@@ -174,11 +174,11 @@ void EventGeneratorCosmic::GenerateEvent(G4Event*){
/* //Putting a cylinder
if(randomize>0){ //top
momentum_x = cos(angle)*
dis
;
momentum_z = sin(angle)*
dis
;
momentum_x = cos(angle)*
CosmicAngle
;
momentum_z = sin(angle)*
CosmicAngle
;
x0 = cos(
shift
*2)*R*(randomize*2);
z0 = sin(
shift
*2)*R*(randomize*2);
x0 = cos(
angle2
*2)*R*(randomize*2);
z0 = sin(
angle2
*2)*R*(randomize*2);
par.m_y0 = H/2;
} else { //lateral surface
...
...
@@ -186,18 +186,20 @@ void EventGeneratorCosmic::GenerateEvent(G4Event*){
z0 = sin(angle)*R;
par.m_y0 = (.5-RandFlat::shoot())*H; ///!!!!!!!
momentum_x = -cos(angle+
shift)*dis
;
momentum_z = -sin(angle+
shift)*dis
;
momentum_x = -cos(angle+
angle2)*CosmicAngle
;
momentum_z = -sin(angle+
angle2)*CosmicAngle
;
}
*/
// Constrain to pass in a circle with radius
2
R
momentum_x
=
cos
(
angle
)
*
dis
;
momentum_z
=
sin
(
angle
)
*
dis
;
x0
=
cos
(
shift
*
2
)
*
R
*
2
*
(
randomize
*
2
)
-
momentum_x
*
(
H
/
2
/
momentum_y
);
z0
=
sin
(
shift
*
2
)
*
R
*
2
*
(
randomize
*
2
)
-
momentum_z
*
(
H
/
2
/
momentum_y
);
//
Begin
Constrain to pass in a circle with radius
3
R
momentum_x
=
cos
(
angle
)
*
CosmicAngle
;
momentum_z
=
sin
(
angle
)
*
CosmicAngle
;
x0
=
cos
(
angle2
*
2
)
*
R
*
(
0.5
-
randomize
)
*
3
-
momentum_x
*
(
H
/
2
/
momentum_y
);
// *( H/2 / momentum_y) this is to have the origin always with par.m_y0 = H/2;
z0
=
sin
(
angle2
*
2
)
*
R
*
(
0.5
-
randomize
)
*
3
-
momentum_z
*
(
H
/
2
/
momentum_y
);
par
.
m_y0
=
H
/
2
;
// End Constrain to pass in a circle with radius 3R
momentum_y
=
-
momentum_y
;
...
...
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