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
eb83b90c
Commit
eb83b90c
authored
14 years ago
by
deserevi
Browse files
Options
Downloads
Patches
Plain Diff
* Add error message and exit NPSimulation when charge or mass is not conserved
in the reaction.
parent
556cddd9
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
NPLib/Physics/NPReaction.cxx
+15
-9
15 additions, 9 deletions
NPLib/Physics/NPReaction.cxx
with
15 additions
and
9 deletions
NPLib/Physics/NPReaction.cxx
+
15
−
9
View file @
eb83b90c
...
@@ -83,20 +83,26 @@ void Reaction::SetEveryThing(string name1, string name2, string name3, string na
...
@@ -83,20 +83,26 @@ void Reaction::SetEveryThing(string name1, string name2, string name3, string na
{
{
//------------- Constructor with nuclei names and beam energy ------------
//------------- Constructor with nuclei names and beam energy ------------
fNuclei1
=
new
Nucleus
(
name1
);
fNuclei1
=
new
Nucleus
(
name1
);
fNuclei2
=
new
Nucleus
(
name2
);
fNuclei2
=
new
Nucleus
(
name2
);
fNuclei3
=
new
Nucleus
(
name3
);
fNuclei3
=
new
Nucleus
(
name3
);
fNuclei4
=
new
Nucleus
(
name4
);
fNuclei4
=
new
Nucleus
(
name4
);
fBeamEnergy
=
BeamEnergy
;
fBeamEnergy
=
BeamEnergy
;
fThetaCM
=
0
;
fThetaCM
=
0
;
fExcitationLight
=
ExcitationEnergyLight
;
fExcitationLight
=
ExcitationEnergyLight
;
fExcitationHeavy
=
ExcitationEnergyHeavy
;
fExcitationHeavy
=
ExcitationEnergyHeavy
;
fQValue
=
(
fNuclei1
->
GetMassExcess
()
+
fNuclei2
->
GetMassExcess
()
fQValue
=
(
fNuclei1
->
GetMassExcess
()
+
fNuclei2
->
GetMassExcess
()
-
fNuclei3
->
GetMassExcess
()
-
fNuclei4
->
GetMassExcess
())
/
1000
;
-
fNuclei3
->
GetMassExcess
()
-
fNuclei4
->
GetMassExcess
())
/
1000
;
int
masse
=
fNuclei1
->
GetA
()
+
fNuclei2
->
GetA
()
-
fNuclei3
->
GetA
()
-
fNuclei4
->
GetA
();
int
masse
=
fNuclei1
->
GetA
()
+
fNuclei2
->
GetA
()
-
fNuclei3
->
GetA
()
-
fNuclei4
->
GetA
();
int
charge
=
fNuclei1
->
GetZ
()
+
fNuclei2
->
GetZ
()
-
fNuclei3
->
GetZ
()
-
fNuclei4
->
GetZ
();
int
charge
=
fNuclei1
->
GetZ
()
+
fNuclei2
->
GetZ
()
-
fNuclei3
->
GetZ
()
-
fNuclei4
->
GetZ
();
if
(
masse
||
charge
)
cout
<<
"Problem with charge or mass conservation"
<<
endl
;
if
(
masse
||
charge
)
{
cout
<<
endl
;
cout
<<
"********************************** Error **********************************"
<<
endl
;
cout
<<
"* NPReaction: charge of mass not conserved. Check you event generator file *"
<<
endl
;
cout
<<
"***************************************************************************************"
<<
endl
;
exit
(
1
);
}
///Read the differential cross section
///Read the differential cross section
string
GlobalPath
=
getenv
(
"NPTOOL"
);
string
GlobalPath
=
getenv
(
"NPTOOL"
);
...
...
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