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
30a6581f
Commit
30a6581f
authored
8 years ago
by
adrien-matta
Browse files
Options
Downloads
Patches
Plain Diff
* Fixing Drift Electron amplification process
parent
6acec344
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/Process/G4DEAmplification.cc
+8
-9
8 additions, 9 deletions
NPSimulation/Process/G4DEAmplification.cc
with
8 additions
and
9 deletions
NPSimulation/Process/G4DEAmplification.cc
+
8
−
9
View file @
30a6581f
...
@@ -151,21 +151,20 @@ G4DEAmplification::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
...
@@ -151,21 +151,20 @@ G4DEAmplification::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// Create the secondary tracks
// Create the secondary tracks
for
(
G4int
i
=
0
;
i
<
number_electron
;
i
++
){
for
(
G4int
i
=
0
;
i
<
number_electron
;
i
++
){
// Electron follow the field direction
// Random direction at creation
G4ThreeVector
field
(
0
,
1
,
0
);
G4double
cost
=
1
-
2
*
G4UniformRand
();
G4double
v_drift
=
aMaterialPropertiesTable
->
GetConstProperty
(
"DE_DRIFTSPEED"
);
G4double
theta
=
acos
(
cost
);
G4double
v_long
=
G4RandGauss
::
shoot
(
0
,
aMaterialPropertiesTable
->
GetConstProperty
(
"DE_LONGITUDINALSPREAD"
)
/
v_drift
);
G4double
phi
=
twopi
*
G4UniformRand
();
G4double
v_trans
=
G4RandGauss
::
shoot
(
0
,
aMaterialPropertiesTable
->
GetConstProperty
(
"DE_TRANSVERSALSPREAD"
)
/
v_drift
);
G4ThreeVector
p
;
cout
<<
v_drift
<<
" "
<<
v_long
<<
" "
<<
v_trans
<<
endl
;
p
.
setRThetaPhi
(
1
,
theta
,
phi
);
G4ThreeVector
v
=
v_drift
*
field
+
v_long
*
G4ThreeVector
(
0
,
0
,
1
)
+
v_trans
*
G4ThreeVector
(
1
,
0
,
0
);
// Random Position along the step with matching time
// Random Position along the step with matching time
G4double
rand
=
G4UniformRand
();
G4double
rand
=
G4UniformRand
();
G4ThreeVector
pos
=
x0
+
rand
*
aStep
.
GetDeltaPosition
();
G4ThreeVector
pos
=
x0
+
rand
*
aStep
.
GetDeltaPosition
();
G4double
time
=
t0
+
rand
*
aStep
.
GetDeltaTime
();
G4double
time
=
t0
+
rand
*
aStep
.
GetDeltaTime
();
G4DynamicParticle
*
particle
=
new
G4DynamicParticle
(
G4DriftElectron
::
DriftElectron
(),
v
.
unit
(),
electron_mass_c2
*
v
.
mag
()
/
c_squared
);
G4DynamicParticle
*
particle
=
new
G4DynamicParticle
(
G4DriftElectron
::
DriftElectron
(),
p
,
pair_energy
);
G4Track
*
aSecondaryTrack
=
new
G4Track
(
particle
,
time
,
pos
);
G4Track
*
aSecondaryTrack
=
new
G4Track
(
particle
,
time
,
pos
);
aSecondaryTrack
->
SetTouchableHandle
(
aSecondaryTrack
->
SetTouchableHandle
(
aStep
.
GetPreStepPoint
()
->
GetTouchableHandle
());
aStep
.
GetPreStepPoint
()
->
GetTouchableHandle
());
...
...
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