Skip to content

Commit

Permalink
Merge pull request #148
Browse files Browse the repository at this point in the history
Update the electron rest mass value.
  • Loading branch information
ftessier committed Jan 24, 2017
2 parents bcca067 + 5a7c557 commit 1eaf898
Show file tree
Hide file tree
Showing 39 changed files with 325 additions and 173 deletions.
2 changes: 1 addition & 1 deletion HEN_HOUSE/egs++/ausgab_objects/beam_dose_scoring/Makefile
Expand Up @@ -40,7 +40,7 @@ my_deps = $(common_ausgab_deps)
extra_dep = $(addprefix $(DSOLIBS), $(my_deps))

#redefined from egspp.spec
INC2 = -I$(IEGS2) -I..$(DSEP).. -I$(HEN_HOUSE)/user_codes/beampp -I$(HEN_HOUSE)interface
INC2 = -I$(IEGS2) -I..$(DSEP).. -I$(HEN_HOUSE)interface

include $(SPEC_DIR)egspp_libs.spec

Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/egs++/egs_advanced_application.cpp
Expand Up @@ -649,7 +649,7 @@ int EGS_AdvancedApplication::helpInit(EGS_Input *transportp, bool do_hatch) {
egsInformation("%3d %-24s AE=%7.4f AP=%7.4f %d\n",j,
geometry->getMediumName(j),the_thresh->ae[imed],
the_thresh->ap[imed],imed);
if (Emax > the_thresh->ue[imed]-0.511 ||
if (Emax > the_thresh->ue[imed]-the_useful->rm ||
Emax > the_thresh->up[imed]) {
egsInformation(" upper limits (UE=%g UP=%g) not enough for "
"maximum source energy (%g)\n",the_thresh->ue[imed],
Expand Down
1 change: 1 addition & 0 deletions HEN_HOUSE/egs++/egs_advanced_application.h
Expand Up @@ -25,6 +25,7 @@
#
# Contributors: Ernesto Mainegra-Hing
# Frederic Tessier
# Reid Townson
#
###############################################################################
*/
Expand Down
4 changes: 4 additions & 0 deletions HEN_HOUSE/egs++/sources/egs_beam_source/Makefile
Expand Up @@ -39,6 +39,10 @@ lib_files = egs_beam_source
my_deps = $(common_source_deps)
extra_dep = $(addprefix $(DSOLIBS), $(my_deps))

#redefined from egspp.spec
INC2 = -I$(IEGS2) -I..$(DSEP).. -I$(HEN_HOUSE)interface -I.$(DSEP)

include $(SPEC_DIR)egspp_libs.spec

$(make_depend)

47 changes: 47 additions & 0 deletions HEN_HOUSE/egs++/sources/egs_beam_source/array_sizes.h
@@ -0,0 +1,47 @@
/*
###############################################################################
#
# EGSnrc egs++ egs_chamber application array sizes headers
# Copyright (C) 2015 National Research Council Canada
#
# This file is part of EGSnrc.
#
# EGSnrc is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
# more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
#
# Author: Reid Townson, 2016
#
# Contributors:
#
###############################################################################
#
# Defines he maximum number of media (MXMED) and the maximum number of
# particles on the stack (MXSTACK). This file gets included by the egsnrc
# fortran subroutines (egsnrc_$my_machine.F), the base application
# (egs_simple_application.cpp or egs_advanced_application.cpp in
# $HEN_HOUSE/egs++), and possibly the user code, if it uses the particle
# stack or one of the structures that depends on the maximum number of media.
#
###############################################################################
*/


#ifndef ARRAY_SIZES_
#define ARRAY_SIZES_

#define MXMED 0
#define MXSTACK 0

#endif
4 changes: 3 additions & 1 deletion HEN_HOUSE/egs++/sources/egs_beam_source/egs_beam_source.cpp
Expand Up @@ -25,6 +25,7 @@
#
# Contributors: Blake Walters
# Frederic Tessier
# Reid Townson
#
###############################################################################
*/
Expand All @@ -40,6 +41,7 @@
#include "egs_functions.h"
#include "egs_library.h"
#include "egs_application.h"
#include "egs_interface2.h"

#include <cstdlib>
#include <cstring>
Expand Down Expand Up @@ -201,7 +203,7 @@ EGS_I64 EGS_BeamSource::getNextParticle(EGS_RandomGenerator *, int &q,
// " x=(%g,%g,%g) latch=%d count=%lld\n",te,tq,twt,tx,ty,tz,
// tlatch,count);
if (tq) {
te -= 0.5110034;
te -= the_useful->rm;
}
ok = true;
if (te > Emax) {
Expand Down
3 changes: 3 additions & 0 deletions HEN_HOUSE/egs++/sources/egs_phsp_source/Makefile
Expand Up @@ -39,6 +39,9 @@ lib_files = egs_phsp_source
my_deps = $(common_source_deps)
extra_dep = $(addprefix $(DSOLIBS), $(my_deps))

#redefined from egspp.spec
INC2 = -I$(IEGS2) -I..$(DSEP).. -I$(HEN_HOUSE)interface -I.$(DSEP)

include $(SPEC_DIR)egspp_libs.spec

$(make_depend)
47 changes: 47 additions & 0 deletions HEN_HOUSE/egs++/sources/egs_phsp_source/array_sizes.h
@@ -0,0 +1,47 @@
/*
###############################################################################
#
# EGSnrc egs++ egs_chamber application array sizes headers
# Copyright (C) 2015 National Research Council Canada
#
# This file is part of EGSnrc.
#
# EGSnrc is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
# more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
#
# Author: Reid Townson, 2016
#
# Contributors:
#
###############################################################################
#
# Defines he maximum number of media (MXMED) and the maximum number of
# particles on the stack (MXSTACK). This file gets included by the egsnrc
# fortran subroutines (egsnrc_$my_machine.F), the base application
# (egs_simple_application.cpp or egs_advanced_application.cpp in
# $HEN_HOUSE/egs++), and possibly the user code, if it uses the particle
# stack or one of the structures that depends on the maximum number of media.
#
###############################################################################
*/


#ifndef ARRAY_SIZES_
#define ARRAY_SIZES_

#define MXMED 0
#define MXSTACK 0

#endif
4 changes: 3 additions & 1 deletion HEN_HOUSE/egs++/sources/egs_phsp_source/egs_phsp_source.cpp
Expand Up @@ -25,6 +25,7 @@
#
# Contributors: Ernesto Mainegra-Hing
# Frederic Tessier
# Reid Townson
#
###############################################################################
*/
Expand All @@ -38,6 +39,7 @@
#include "egs_phsp_source.h"
#include "egs_input.h"
#include "egs_functions.h"
#include "egs_interface2.h"

EGS_PhspSource::EGS_PhspSource(const string &phsp_file,
const string &Name, EGS_ObjectFactory *f) : EGS_BaseSource(Name,f) {
Expand Down Expand Up @@ -396,7 +398,7 @@ void EGS_PhspSource::readParticle() {
}
first = false;
if (p.q) {
p.E -= 0.5110034;
p.E -= the_useful->rm;
Nreuse = Nreuse_e;
}
else {
Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/pegs_page.cpp
Expand Up @@ -23,7 +23,7 @@
#
# Author: Ernesto Mainegra-Hing, 2015
#
# Contributors:
# Contributors: Reid Townson
#
###############################################################################
*/
Expand Down Expand Up @@ -56,7 +56,7 @@ QStringList *elements = 0;

TableEventHandler *tfilter = 0;

const double rm=0.5110034;
const double rm=0.5109989461;

Element element_data[] = {
{1,"H",1.0079,19.2,8.3748e-05},
Expand Down
5 changes: 3 additions & 2 deletions HEN_HOUSE/interface/egs_c_interface2.macros
Expand Up @@ -25,6 +25,7 @@
" "
" Contributors: Ernesto Mainegra-Hing "
" Blake Walters "
" Reid Townson "
" "
"#############################################################################"
" "
Expand Down Expand Up @@ -444,7 +445,7 @@ REPLACE {$COMIN-SET-DEFAULTS;} WITH {;
};
REPLACE {$COMIN-INIT-COMPT;} WITH {;
;integer max_med; parameter (max_med = MXMED);
;COMIN/COMPTON-DATA,BREMPR,EDGE,MEDIA,MISC,EGS-IO/;
;COMIN/COMPTON-DATA,BREMPR,EDGE,MEDIA,MISC,USEFUL,EGS-IO/;
};
REPLACE {$COMIN-COMPT;} WITH {;
;integer max_med; parameter (max_med = MXMED);
Expand All @@ -459,7 +460,7 @@ REPLACE {$COMIN-ELECTR;} WITH {;
};
REPLACE {$COMIN-MSCATI;} WITH {;
;integer max_med; parameter (max_med = MXMED);
;COMIN/BOUNDS,ELECIN,MEDIA,MISC,RANDOM,ET-Control,EGS-IO/;
;COMIN/BOUNDS,ELECIN,MEDIA,MISC,RANDOM,ET-Control,USEFUL,EGS-IO/;
};
REPLACE {$COMIN-MOLLER;} WITH {;
;integer max_med; parameter (max_med = MXMED);
Expand Down
31 changes: 16 additions & 15 deletions HEN_HOUSE/omega/beamnrc/beamnrc.mortran
Expand Up @@ -36,6 +36,7 @@
" Iwan Kawrakow "
" Ernesto Mainegra-Hing "
" Frederic Tessier "
" Reid Townson "
" "
"#############################################################################"
" "
Expand Down Expand Up @@ -5716,8 +5717,8 @@ IF (IARG = 5) ["Particle step just taken"
IF(W(NP)>0)["electron going forward, split it"
count_esplit=count_esplit+1;
IF(IWATCH=1|IWATCH=2)[
OUTPUT NP,E(NP)-0.511,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP),
W(NP),LATCH(NP),WT(NP);
OUTPUT NP,E(NP)-PRM,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),
U(NP),V(NP),W(NP),LATCH(NP),WT(NP);
(' Electron',T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3);
OUTPUT NBRSPL;(' about to be split ',I10, ' times (DBS).');
IF(IRAD_DBS=1)[
Expand All @@ -5731,8 +5732,8 @@ IF (IARG = 5) ["Particle step just taken"
ANG_DBS=2.*3.1415926/FLOAT(NBRSPL);
]
IF(IWATCH=1|IWATCH=2)[
OUTPUT NP,E(NP)-0.511,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP),
W(NP),LATCH(NP),WT(NP);
OUTPUT NP,E(NP)-PRM,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),
U(NP),V(NP),W(NP),LATCH(NP),WT(NP);
(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3);
]
DO I=1,NBRSPL-1[
Expand All @@ -5750,8 +5751,8 @@ IF (IARG = 5) ["Particle step just taken"
U(NP)=U(NP-1);V(NP)=V(NP-1);
]
IF(IWATCH=1|IWATCH=2)[
OUTPUT NP,E(NP)-0.511,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP),
W(NP),LATCH(NP),WT(NP);
OUTPUT NP,E(NP)-PRM,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),
U(NP),V(NP),W(NP),LATCH(NP),WT(NP);
(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3);
]
]
Expand Down Expand Up @@ -5874,7 +5875,7 @@ IF (IARG = 5) ["Particle step just taken"

"Energy fluence:"
SCFLU_TMP(IQL,ISCORE,ISZ,IPAR+3)=SCFLU_TMP(IQL,ISCORE,ISZ,IPAR+3)+
WEIGHT*(E(NP)-0.511*ABS(IQ(NP)))/
WEIGHT*(E(NP)-PRM*ABS(IQ(NP)))/
MAX(0.08716,ABS(WL));
"Angle:"
"change to degrees on output"
Expand All @@ -5894,7 +5895,7 @@ IF (IARG = 5) ["Particle step just taken"
SCFLU_COV(IQL,ISCORE,ISZ,IPAR/2+1)=SCFLU_COV(IQL,ISCORE,ISZ,IPAR/2+1)+
SCFLU_TMP(IQL,ISCORE,ISZ,IPAR+3)*
SCFLU_TMP(IQL,ISCORE,ISZ,IPAR+2);
SCFLU_TMP(IQL,ISCORE,ISZ,IPAR+3)=WEIGHT*(E(NP)-0.511*ABS(IQ(NP)))/
SCFLU_TMP(IQL,ISCORE,ISZ,IPAR+3)=WEIGHT*(E(NP)-PRM*ABS(IQ(NP)))/
MAX(0.08716,ABS(WL));

"Angle: also score angle*no. (weighted) now for covariance"
Expand Down Expand Up @@ -5958,12 +5959,12 @@ IF (IARG = 5) ["Particle step just taken"
IF (IO_OPT = 0)|((IO_OPT = 3)&(IHSTRY <= 100000))|(IO_OPT=4)[
"phase-space output"
NPPHSP(ISCORE)=NPPHSP(ISCORE)+1;"increment # of particles in file"
IF((E(NP)-0.511*ABS(IQ(NP)))>EKMAXPHSP(ISCORE))[
EKMAXPHSP(ISCORE)=E(NP)-0.511*ABS(IQ(NP));
IF((E(NP)-PRM*ABS(IQ(NP)))>EKMAXPHSP(ISCORE))[
EKMAXPHSP(ISCORE)=E(NP)-PRM*ABS(IQ(NP));
]
IF(IQ(NP)=-1)[
IF((E(NP)-0.511)<EKMINPHSPE(ISCORE))[
EKMINPHSPE(ISCORE)=E(NP)-0.511;
IF((E(NP)-PRM)<EKMINPHSPE(ISCORE))[
EKMINPHSPE(ISCORE)=E(NP)-PRM;
]
]
ELSEIF(IQ(NP)=0)[
Expand Down Expand Up @@ -6020,8 +6021,8 @@ IF (IARG = 5) ["Particle step just taken"
OUTPUT NSPLIT_ELEC;
(' SPLITTING ELECTRON INTO ',I4,' ELECTRONS EACH WITH THE',
' FOLLOWING PROPERTIES:');
OUTPUT NP,NP+NSPLIT_ELEC-1,E(NP)-0.511,IQ(NP),IR(NP),X(NP),Y(NP),
Z(NP),U(NP),V(NP),W(NP),LATCH(NP),WT(NP);
OUTPUT NP,NP+NSPLIT_ELEC-1,E(NP)-PRM,IQ(NP),IR(NP),
X(NP),Y(NP),Z(NP),U(NP),V(NP),W(NP),LATCH(NP),WT(NP);
(' RESULTING ELECTRONS',T29,':',I5,' -',I5,F9.3,2I4,3F8.3,3F7.3,
I10,1PE10.3);
]
Expand Down Expand Up @@ -11319,7 +11320,7 @@ END; "End of subroutine SRCOUT
$IMPLICIT-NONE;
;COMIN/
CMs,EPCONT,GEOM,IO_INFO,MEDIA,MISC,SCORE,SOURCE,STACK,UPHIOT,USER,
RANDOM,RWPHSP,EGS-IO/;
RANDOM,RWPHSP,USEFUL,EGS-IO/;


"T>****************************
Expand Down
7 changes: 4 additions & 3 deletions HEN_HOUSE/omega/progs/beamdp/beamdp.mortran
Expand Up @@ -30,6 +30,7 @@
" Zdenko Sego "
" Ernesto Mainegra-Hing "
" Frederic Tessier "
" Reid Townson "
" "
"#############################################################################"
" "
Expand Down Expand Up @@ -2125,7 +2126,7 @@ integer lnblnk1;
]

IF(IQ ~= 0)[ "We need kinetic energy only"
EI=EI-0.5110034;
EI=EI-0.5109989461;
]

"processing the ph-sp data"
Expand Down Expand Up @@ -4835,14 +4836,14 @@ LOOP["read phase-space data from the data file"
]

IF(IQ = -1)[ "We need kinetic energy only"
EI=EI-0.5110034;
EI=EI-0.5109989461;
N_ph_sp_e = N_ph_sp_e + 1; E_ph_sp_e = E_ph_sp_e+EI;
]
ELSEIF(IQ = 0)[
N_ph_sp_g = N_ph_sp_g + 1; E_ph_sp_g = E_ph_sp_g+EI;
]
ELSEIF(IQ = +1)[
EI=EI-0.5110034;
EI=EI-0.5109989461;
N_ph_sp_p = N_ph_sp_p + 1; E_ph_sp_p = E_ph_sp_p+EI;
]
ELSE[
Expand Down
5 changes: 3 additions & 2 deletions HEN_HOUSE/omega/progs/beamdp/beammodel_macros.mortran
Expand Up @@ -27,6 +27,7 @@
" Iwan Kawrakow "
" Zdenko Sego "
" Dave Rogers "
" Reid Townson "
" "
"#############################################################################"
" "
Expand Down Expand Up @@ -314,10 +315,10 @@ REPLACE {;$BEAMMODEL-SOURCE4-OUTPUT} WITH {
}
;
REPLACE{$BEAMMODEL-SOURCE4-ENERGY} WITH {
;IF(iqin ~= 0)[etotin = einsrc +0.511;]
;IF(iqin ~= 0)[etotin = einsrc +0.5109989461;]
ELSE[etotin = einsrc;]
esrc = esrc + einsrc;
IF(iqin =1)[esrc = esrc + 0.5110034;]
IF(iqin =1)[esrc = esrc + 0.5109989461;]
}
;
REPLACE {$BEAMMODEL_SOURCE_OUTPUT} WITH
Expand Down

0 comments on commit 1eaf898

Please sign in to comment.