Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
11e988a5
Commit
11e988a5
authored
10 years ago
by
Markus Frank
Browse files
Options
Downloads
Patches
Plain Diff
Normalize direction vector to 1
parent
aa65cd71
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDG4/src/Geant4ParticleGenerator.cpp
+7
-7
7 additions, 7 deletions
DDG4/src/Geant4ParticleGenerator.cpp
with
7 additions
and
7 deletions
DDG4/src/Geant4ParticleGenerator.cpp
+
7
−
7
View file @
11e988a5
...
...
@@ -76,7 +76,7 @@ void Geant4ParticleGenerator::operator()(G4Event*) {
Geant4Vertex
*
vtx
=
new
Geant4Vertex
();
int
multiplicity
=
m_multiplicity
;
ROOT
::
Math
::
XYZVector
position
=
m_position
;
ROOT
::
Math
::
XYZVector
unit_direction
,
direction
,
position
=
m_position
;
getVertexPosition
(
position
);
getParticleMultiplicity
(
multiplicity
);
vtx
->
mask
=
m_mask
;
...
...
@@ -86,18 +86,18 @@ void Geant4ParticleGenerator::operator()(G4Event*) {
inter
->
vertices
.
insert
(
make_pair
(
inter
->
vertices
.
size
(),
vtx
));
for
(
int
i
=
0
;
i
<
m_multiplicity
;
++
i
)
{
double
momentum
=
m_energy
;
ROOT
::
Math
::
XYZVector
direction
=
m_direction
;
getParticleDirection
(
i
,
direction
,
momentum
);
Particle
*
p
=
new
Particle
();
direction
=
m_direction
;
getParticleDirection
(
i
,
direction
,
momentum
);
unit_direction
=
direction
.
unit
();
p
->
id
=
inter
->
nextPID
();
p
->
status
|=
G4PARTICLE_GEN_STABLE
;
p
->
mask
=
m_mask
;
p
->
pdgID
=
m_particle
->
GetPDGEncoding
();
p
->
psx
=
direction
.
X
()
*
momentum
;
p
->
psy
=
direction
.
Y
()
*
momentum
;
p
->
psz
=
direction
.
Z
()
*
momentum
;
p
->
psx
=
unit_
direction
.
X
()
*
momentum
;
p
->
psy
=
unit_
direction
.
Y
()
*
momentum
;
p
->
psz
=
unit_
direction
.
Z
()
*
momentum
;
p
->
mass
=
m_particle
->
GetPDGMass
();
p
->
vsx
=
vtx
->
x
;
p
->
vsy
=
vtx
->
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