Skip to content

Commit 134cc3c

Browse files
committed
Prototype 2 compiles, but for now produces 0 intensity
1 parent 9d37a60 commit 134cc3c

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

common/lib/share/mccode-r.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4807,6 +4807,7 @@ mcparseoptions(int argc, char *argv[])
48074807
#ifdef TOF_TRAIN
48084808
else if(!strncmp("--tof-trains=", argv[i], 13)) {
48094809
NTOF=atoi(&argv[i][13]);
4810+
}
48104811
#endif
48114812
#ifdef USE_NEXUS
48124813
else if(!strcmp("--IDF", argv[i])) {

mcstas-comps/examples/Prototypes/ODIN_TOF_train2/DiskChopper.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ TRACE
174174
int one_did_hit = 0;
175175
double this_train_t;
176176
int all_dead = 1;
177-
for (train_index=0; train_index<N_trains; train_index++) {
177+
for (train_index=0; train_index<_particle->N_trains; train_index++) {
178178

179179
if (_particle->alive_trains[train_index] == 0) continue;
180180
all_dead = 0;

mcstas-comps/examples/Prototypes/ODIN_TOF_train2/ESS_butterfly.comp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ SETTING PARAMETERS (string sector="N",int beamline=1, yheight=0.03, cold_frac=0.
110110
c_performance=1, t_performance=1, Lmin, Lmax, tmax_multiplier=3, int n_pulses=1,
111111
acc_power=5,tfocus_dist=0,tfocus_time=0,tfocus_width=0)
112112

113-
DEPENDENCY " -DTOF_TRAINS "
113+
DEPENDENCY " -DTOF_TRAIN "
114114

115115
SHARE %{
116116
%include "ESS_butterfly-lib"
@@ -549,7 +549,7 @@ TRACE
549549
vx = v*dx/r;
550550

551551
int train_index;
552-
for (train_index=0; train_index<N_trains; train_index++) {
552+
for (train_index=0; train_index<_particle->N_trains; train_index++) {
553553

554554
/* Are we using time focusing? */
555555
if (tfocus_width>0) {
@@ -589,7 +589,7 @@ TRACE
589589
// Save these to t_offset and p_train
590590

591591
_particle->t_offset[train_index] = t;
592-
_particle->p_trains[train_index] = p/N_trains;
592+
_particle->p_trains[train_index] = p/_particle->N_trains;
593593
_particle->alive_trains[train_index] = 1;
594594

595595
}

mcstas-comps/examples/Prototypes/ODIN_TOF_train2/Monitor_nD.comp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,9 @@ TRACE
571571
double p_original = p;
572572

573573
if (tsplit==1) {
574-
double pp_array[N_trains];
574+
double pp_array[_particle->N_trains];
575575
double t_original = t;
576-
for (train_index=0; train_index<N_trains; train_index++) {
576+
for (train_index=0; train_index<_particle->N_trains; train_index++) {
577577

578578
if (_particle->alive_trains[train_index] == 1) {
579579
p = p_original*_particle->p_trains[train_index];
@@ -587,7 +587,7 @@ TRACE
587587
t = t_original;
588588

589589
int pp_total = 0;
590-
for (train_index=0; train_index<N_trains; train_index++) {
590+
for (train_index=0; train_index<_particle->N_trains; train_index++) {
591591
pp_total += pp_array[train_index];
592592
}
593593
if (pp_total == 0.0) {
@@ -598,7 +598,7 @@ TRACE
598598
} else {
599599

600600
double total_p = 0;
601-
for (train_index=0; train_index<N_trains; train_index++) {
601+
for (train_index=0; train_index<_particle->N_trains; train_index++) {
602602
if (_particle->alive_trains[train_index]) total_p += p_original*_particle->p_trains[train_index];
603603
}
604604

mcstas-comps/examples/Prototypes/ODIN_TOF_train2/MultiDiskChopper.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ TRACE
286286
int this_t_hit;
287287
double this_train_t;
288288
int all_dead = 1;
289-
for (train_index=0; train_index<N_trains; train_index++) {
289+
for (train_index=0; train_index<_particle->N_trains; train_index++) {
290290

291291
if (_particle->alive_trains[train_index] == 0) continue;
292292
all_dead = 0;

0 commit comments

Comments
 (0)