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
9024f778
Commit
9024f778
authored
1 month ago
by
audrey.chatillon
Browse files
Options
Downloads
Patches
Plain Diff
Update DecayLaw in EventGeneratorIsotropic
parent
d4837e2a
No related branches found
No related tags found
1 merge request
!27
Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline
#383140
passed
1 month 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/EventGenerator/EventGeneratorIsotropic.cc
+15
-8
15 additions, 8 deletions
NPSimulation/EventGenerator/EventGeneratorIsotropic.cc
NPSimulation/EventGenerator/EventGeneratorIsotropic.hh
+1
-1
1 addition, 1 deletion
NPSimulation/EventGenerator/EventGeneratorIsotropic.hh
with
16 additions
and
9 deletions
NPSimulation/EventGenerator/EventGeneratorIsotropic.cc
+
15
−
8
View file @
9024f778
...
...
@@ -129,10 +129,10 @@ void EventGeneratorIsotropic::ReadConfiguration(NPL::InputParser parser){
if
(
blocks
[
i
]
->
HasToken
(
"SigmaZ"
))
it
->
m_SigmaZ
=
blocks
[
i
]
->
GetDouble
(
"SigmaZ"
,
"mm"
);
if
(
blocks
[
i
]
->
HasToken
(
"Multiplicity"
))
it
->
m_Multiplicty
=
blocks
[
i
]
->
GetVectorInt
(
"Multiplicity"
);
it
->
m_Multiplic
i
ty
=
blocks
[
i
]
->
GetVectorInt
(
"Multiplicity"
);
if
(
blocks
[
i
]
->
HasToken
(
"DecayLaw"
))
it
->
m_DecayLaw
=
blocks
[
i
]
->
GetString
(
"DecayLaw"
);
if
(
blocks
[
i
]
->
HasToken
(
"Activity
_
Bq"
))
if
(
blocks
[
i
]
->
HasToken
(
"ActivityBq"
))
it
->
m_ActivityBq
=
blocks
[
i
]
->
GetDouble
(
"ActivityBq"
,
"Bq"
);
}
else
{
...
...
@@ -143,8 +143,8 @@ void EventGeneratorIsotropic::ReadConfiguration(NPL::InputParser parser){
for
(
auto
&
par
:
m_Parameters
)
{
if
(
par
.
m_ExcitationEnergy
.
size
()
==
0
)
par
.
m_ExcitationEnergy
.
resize
(
par
.
m_particleName
.
size
(),
0
);
if
(
par
.
m_Multiplicty
.
size
()
==
0
)
par
.
m_Multiplicty
.
resize
(
par
.
m_particleName
.
size
(),
1
);
if
(
par
.
m_Multiplic
i
ty
.
size
()
==
0
)
par
.
m_Multiplic
i
ty
.
resize
(
par
.
m_particleName
.
size
(),
1
);
if
(
par
.
m_EnergyDistribution
!=
"flat"
&&
par
.
m_EnergyDistribution
!=
"FromHisto"
){
if
(
par
.
m_EnergyDistribution
==
"Watt"
){
...
...
@@ -162,9 +162,14 @@ void EventGeneratorIsotropic::ReadConfiguration(NPL::InputParser parser){
void
EventGeneratorIsotropic
::
GenerateEvent
(
G4Event
*
){
for
(
auto
&
par
:
m_Parameters
)
{
double
delta_t
=
0
;
double
delta_t
=
0.
;
bool
DecayOn
=
true
;
for
(
unsigned
int
p
=
0
;
p
<
par
.
m_particleName
.
size
();
p
++
){
for
(
int
i
=
0
;
i
<
par
.
m_Multiplicty
[
p
];
i
++
){
double
step_t
=
1.e-2
/
par
.
m_ActivityBq
;
// [s]
if
(
par
.
m_DecayLaw
==
"on"
){
par
.
m_Multiplicity
[
p
]
=
((
int
)(
50.e-9
/
step_t
)
==
0
)
?
1
:
(
int
)(
50.e-9
/
step_t
);
}
for
(
int
i
=
0
;
i
<
par
.
m_Multiplicity
[
p
];
i
++
){
par
.
m_particle
=
NULL
;
if
(
par
.
m_particle
==
NULL
){
...
...
@@ -178,11 +183,13 @@ void EventGeneratorIsotropic::GenerateEvent(G4Event*){
par
.
m_particle
=
G4ParticleTable
::
GetParticleTable
()
->
GetIonTable
()
->
GetIon
(
N
->
GetZ
(),
N
->
GetA
(),
par
.
m_ExcitationEnergy
[
p
]);
delete
N
;
if
(
par
.
m_DecayLaw
==
"on"
&&
i
>
0
){
delta_t
+=
G4RandExponential
::
shoot
(
1.
/
par
.
m_ActivityBq
)
;
delta_t
=
i
*
step_t
;
DecayOn
=
!
(
par
.
m_DecayLaw
==
"on"
&&
RandFlat
::
shoot
()
>
1.e-2
);
}
}
}
if
(
delta_t
>
50.e-9
)
continue
;
//to do to parametrize (time_window)
if
(
!
DecayOn
)
continue
;
//cout << " Process decay at delta_t = " << delta_t << endl;
G4double
cos_theta_min
=
cos
(
par
.
m_HalfOpenAngleMin
);
G4double
cos_theta_max
=
cos
(
par
.
m_HalfOpenAngleMax
);
G4double
cos_theta
=
cos_theta_min
+
(
cos_theta_max
-
cos_theta_min
)
*
RandFlat
::
shoot
();
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/EventGenerator/EventGeneratorIsotropic.hh
+
1
−
1
View file @
9024f778
...
...
@@ -71,7 +71,7 @@ private: // Source parameter from input file
G4ParticleDefinition
*
m_particle
;
// Kind of particle to shoot isotropically
vector
<
G4double
>
m_ExcitationEnergy
;
// Excitation energy of the emitted particle
vector
<
string
>
m_particleName
;
vector
<
G4int
>
m_Multiplicty
;
vector
<
G4int
>
m_Multiplic
i
ty
;
TString
m_DecayLaw
;
// [on]: mult follows the decay law controlled by T1/2 [off]: fix mult
G4double
m_ActivityBq
;
// if m_DecayLaw = "on" gives here the Activity in Bq of the sample
};
...
...
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