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
and
there
.
Show more breadcrumbs
np
nptool
Commits
81e52298
Commit
81e52298
authored
3 years ago
by
Adrien Matta
Browse files
Options
Downloads
Patches
Plain Diff
* Progress on Phase space
parent
9d572c3a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NPLib/Physics/NPPhaseSpace.cxx
+31
-5
31 additions, 5 deletions
NPLib/Physics/NPPhaseSpace.cxx
NPLib/Physics/NPPhaseSpace.h
+14
-5
14 additions, 5 deletions
NPLib/Physics/NPPhaseSpace.h
NPSimulation/Process/BeamReaction.cc
+32
-9
32 additions, 9 deletions
NPSimulation/Process/BeamReaction.cc
with
77 additions
and
19 deletions
NPLib/Physics/NPPhaseSpace.cxx
+
31
−
5
View file @
81e52298
...
...
@@ -53,30 +53,34 @@ void NPL::PhaseSpace::ReadConfigurationFile(NPL::InputParser parser){
vector
<
string
>
token
=
{
"Beam"
,
"Target"
,
"Daughters"
,
"ExcitationEnergies"
,
"Fermi"
};
fDaughters
.
clear
();
fMasses
.
clear
();
for
(
unsigned
int
i
=
0
;
i
<
blocks
.
size
()
;
i
++
){
if
(
blocks
[
i
]
->
HasTokenList
(
token
)){
int
v
=
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
();
NPOptionManager
::
getInstance
()
->
SetVerboseLevel
(
0
);
fBeam
.
ReadConfigurationFile
(
parser
);
NPOptionManager
::
getInstance
()
->
SetVerboseLevel
(
v
);
fBeamEnergy
=
fBeam
.
GetEnergy
();
fTarget
=
GetParticle
(
blocks
[
i
]
->
GetString
(
"Target"
),
parser
);
fTargetLV
=
TLorentzVector
(
0
,
0
,
0
,
fTarget
.
Mass
());
vector
<
string
>
vDaughters
=
blocks
[
i
]
->
GetVectorString
(
"Daughters"
);
fExcitations
=
blocks
[
i
]
->
GetVectorDouble
(
"ExcitationEnergies"
,
"MeV"
);
for
(
auto
d
:
vDaughters
){
for
(
auto
d
:
vDaughters
){
fDaughters
.
push_back
(
GetParticle
(
d
,
parser
));
fMasses
.
push_back
(
fDaughters
.
rend
()
->
Mass
());
}
SetBeamLV
(
0
,
0
,
1
,
fBeam
.
GetGamma
()
*
fBeam
.
Mass
());
}
else
{
cout
<<
"ERROR: check your input file formatting
\033
[0m"
<<
endl
;
exit
(
1
);
}
}
}
}
////////////////////////////////////////////////////////////////////////////////
Particle
NPL
::
PhaseSpace
::
GetParticle
(
string
name
,
NPL
::
InputParser
parser
){
vector
<
NPL
::
InputBlock
*>
blocks
=
parser
.
GetAllBlocksWithTokenAndValue
(
"DefineParticle"
,
name
);
...
...
@@ -109,3 +113,25 @@ Particle NPL::PhaseSpace::GetParticle(string name, NPL::InputParser parser){
return
(
NPL
::
Particle
());
}
////////////////////////////////////////////////////////////////////////////////
bool
NPL
::
PhaseSpace
::
SetBeamLV
(
const
TLorentzVector
&
LV
){
fBeamLV
=
LV
;
fTotalLV
=
fBeamLV
+
fTargetLV
;
static
std
::
string
option
;
option
=
""
;
if
(
fFermi
)
option
=
"Fermi"
;
return
fPhaseSpace
.
SetDecay
(
fTotalLV
,
fMasses
.
size
(),
&
fMasses
[
0
],
option
.
c_str
());
}
////////////////////////////////////////////////////////////////////////////////
bool
NPL
::
PhaseSpace
::
SetBeamLV
(
double
dirX
,
double
dirY
,
double
dirZ
,
double
Kinetic
){
fBeam
.
SetKineticEnergy
(
Kinetic
);
double
E
=
fBeam
.
GetGamma
()
*
fBeam
.
Mass
();
double
pc
=
sqrt
(
E
*
E
-
fBeam
.
Mass
()
*
fBeam
.
Mass
());
TVector3
p
(
dirX
,
dirY
,
dirZ
);
p
.
Unit
();
p
*=
pc
;
TLorentzVector
beamLV
(
p
,
E
);
return
SetBeamLV
(
fBeamLV
);
}
This diff is collapsed.
Click to expand it.
NPLib/Physics/NPPhaseSpace.h
+
14
−
5
View file @
81e52298
...
...
@@ -63,13 +63,22 @@ namespace NPL{
public
:
// Getters and Setters
void
SetBeamEnergy
(
const
double
&
eBeam
)
{
fBeamEnergy
=
eBeam
;
initializePrecomputeVariable
();}
bool
SetBeamLV
(
const
TLorentzVector
&
LV
);
bool
SetBeamLV
(
double
dirX
,
double
dirY
,
double
dirZ
,
double
Kinetic
);
Particle
*
GetBeam
(){
return
&
fBeam
;};
double
Generate
(){
return
fPhaseSpace
.
Generate
();}
TLorentzVector
*
GetDecayLV
(
unsigned
int
&
n
){
return
fPhaseSpace
.
GetDecay
(
n
);}
size_t
GetDecaySize
(){
return
fDaughters
.
size
();}
Particle
*
GetParticle
(
unsigned
int
&
n
){
return
&
fDaughters
[
n
];}
double
GetExcitation
(
unsigned
int
&
n
){
return
fExcitations
[
n
];}
private
:
// intern precompute variable
void
initializePrecomputeVariable
();
TLorentzVector
fInitialEnergyImpulsion
;
std
::
vector
<
double
>
fmasses
;
void
Init
();
TLorentzVector
fBeamLV
;
TLorentzVector
fTargetLV
;
TLorentzVector
fTotalLV
;
std
::
vector
<
double
>
fMasses
;
ClassDef
(
PhaseSpace
,
0
)
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/Process/BeamReaction.cc
+
32
−
9
View file @
81e52298
...
...
@@ -197,7 +197,7 @@ G4bool NPS::BeamReaction::ModelTrigger(const G4FastTrack& fastTrack) {
if
(
m_shoot
&&
m_length
<
m_StepSize
)
{
if
(
m_ReactionType
==
QFS
){
//if ( m_QFS.IsAllowed() ) {
return
true
;
return
true
;
//}
//else{
// m_shoot=false;
...
...
@@ -505,16 +505,16 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack,
int
j
=
0
;
m_QFS
.
SetIsAllowed
(
false
);
while
(
!
m_QFS
.
IsAllowed
()){
// Shoot internal momentum for the removed cluster
// if a momentum Sigma is given then shoot in 3 indep. Gaussians
// if input files are given for distributions use them instead
m_QFS
.
ShootInternalMomentum
();
// Shoot internal momentum for the removed cluster
// if a momentum Sigma is given then shoot in 3 indep. Gaussians
// if input files are given for distributions use them instead
m_QFS
.
ShootInternalMomentum
();
// Go from CM to Lab
m_QFS
.
KineRelativistic
(
Theta1
,
Phi1
,
TKE1
,
Theta2
,
Phi2
,
TKE2
);
// Go from CM to Lab
m_QFS
.
KineRelativistic
(
Theta1
,
Phi1
,
TKE1
,
Theta2
,
Phi2
,
TKE2
);
j
++
;
if
(
j
>
100
)
cout
<<
"ERROR: too many iteration and QFS kinematical conditions not allowed"
<<
endl
;
j
++
;
if
(
j
>
100
)
cout
<<
"ERROR: too many iteration and QFS kinematical conditions not allowed"
<<
endl
;
}
//---------------------------------------------------------
...
...
@@ -666,6 +666,29 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack,
}
// end QFS
//////////////////////////
// Phase space Case //
//////////////////////////
else
if
(
m_ReactionType
==
PhaseSpace
){
// Prepare beam LV
if
(
m_PhaseSpace
.
SetBeamLV
(
pdirection
.
x
(),
pdirection
.
y
(),
pdirection
.
z
(),
energy
)){
for
(
unsigned
int
i
=
0
,
size
=
m_PhaseSpace
.
GetDecaySize
()
;
i
<
size
;
i
++
){
int
d_Z
=
m_QFS
.
GetParticle1
()
->
GetZ
();
int
d_A
=
m_QFS
.
GetParticle1
()
->
GetA
();
static
G4IonTable
*
IonTable
=
G4ParticleTable
::
GetParticleTable
()
->
GetIonTable
();
G4ParticleDefinition
*
dName
;
if
(
d_Z
==
0
&&
d_A
==
1
)
// neutron is special case
dName
=
G4Neutron
::
Definition
();
else
dName
=
IonTable
->
GetIon
(
d_Z
,
d_A
);
}
}
}
////////////////////
// Fusion Case //
////////////////////
...
...
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