aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/examples/lcls-dec.beam3
-rw-r--r--doc/examples/lcls-june.beam3
-rw-r--r--doc/examples/lcls-xpp-estimate.beam3
-rw-r--r--src/beam-parameters.c7
-rw-r--r--src/beam-parameters.h1
5 files changed, 17 insertions, 0 deletions
diff --git a/doc/examples/lcls-dec.beam b/doc/examples/lcls-dec.beam
index 59b8f8f6..21304711 100644
--- a/doc/examples/lcls-dec.beam
+++ b/doc/examples/lcls-dec.beam
@@ -12,6 +12,9 @@ beam/photon_energy = 2000.0
; distribution with this as its (full) width.
beam/bandwidth = 0.001
+; Beam divergence in radians
+beam/divergence = 0.001
+
; Detector's quantum efficiency
detector/dqe = 0.9
diff --git a/doc/examples/lcls-june.beam b/doc/examples/lcls-june.beam
index db4ef84b..37e4c3ef 100644
--- a/doc/examples/lcls-june.beam
+++ b/doc/examples/lcls-june.beam
@@ -12,6 +12,9 @@ beam/photon_energy = 2000.0
; distribution with this as its (full) width.
beam/bandwidth = 0.001
+; Beam divergence in radians
+beam/divergence = 0.001
+
; Detector's quantum efficiency
detector/dqe = 0.9
diff --git a/doc/examples/lcls-xpp-estimate.beam b/doc/examples/lcls-xpp-estimate.beam
index 0fe866d6..c9f3a498 100644
--- a/doc/examples/lcls-xpp-estimate.beam
+++ b/doc/examples/lcls-xpp-estimate.beam
@@ -12,6 +12,9 @@ beam/photon_energy = 8000.0
; distribution with this as its (full) width.
beam/bandwidth = 0.001
+; Beam divergence in radians
+beam/divergence = 0.001
+
; Detector's quantum efficiency
detector/dqe = 1.0
diff --git a/src/beam-parameters.c b/src/beam-parameters.c
index 9f5a0dde..8d34eacf 100644
--- a/src/beam-parameters.c
+++ b/src/beam-parameters.c
@@ -38,6 +38,7 @@ struct beam_params *get_beam_parameters(const char *filename)
b->beam_radius = -1.0;
b->photon_energy = -1.0;
b->bandwidth = -1.0;
+ b->divergence = -1.0;
b->dqe = -1.0;
b->adu_per_photon = -1.0;
b->water_radius = -1.0;
@@ -74,6 +75,8 @@ struct beam_params *get_beam_parameters(const char *filename)
b->photon_energy = atof(bits[2]);
} else if ( strcmp(bits[0], "beam/bandwidth") == 0 ) {
b->bandwidth = atof(bits[2]);
+ } else if ( strcmp(bits[0], "beam/divergence") == 0 ) {
+ b->divergence = atof(bits[2]);
} else if ( strcmp(bits[0], "detector/dqe") == 0 ) {
b->dqe = atof(bits[2]);
} else if ( strcmp(bits[0], "detector/adu_per_photon") == 0 ) {
@@ -109,6 +112,10 @@ struct beam_params *get_beam_parameters(const char *filename)
ERROR("Invalid or unspecified value for 'beam/bandwidth'.\n");
reject = 1;
}
+ if ( b->divergence < 0.0 ) {
+ ERROR("Invalid or unspecified value for 'beam/divergence'.\n");
+ reject = 1;
+ }
if ( b->dqe < 0.0 ) {
ERROR("Invalid or unspecified value for 'detector/dqe'.\n");
reject = 1;
diff --git a/src/beam-parameters.h b/src/beam-parameters.h
index aec2c6aa..1fadc3f8 100644
--- a/src/beam-parameters.h
+++ b/src/beam-parameters.h
@@ -27,6 +27,7 @@ struct beam_params
* Note: current simulation code just uses
* a rectangular distribution with this as
* its (full) width. */
+ double divergence; /* divergence (radians) */
double dqe; /* Detector DQE (fraction) */
double adu_per_photon; /* Detector "gain" */