aboutsummaryrefslogtreecommitdiff
path: root/src/partial_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-04-04 15:56:53 -0700
committerThomas White <taw@physics.org>2015-04-20 12:55:40 +0200
commit1bc3157cb6c11e3572d13f3bc228f05b8d1153b5 (patch)
tree575bd9a7ea2c54978422d422ac98e4a5b1262d09 /src/partial_sim.c
parent2868423d46b61118eee93187d3f0046a3e33fb62 (diff)
partial_sim: Complain if geometry contains HDF5 references
Diffstat (limited to 'src/partial_sim.c')
-rw-r--r--src/partial_sim.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c
index 18689565..411e47ad 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -415,6 +415,27 @@ static void finalise_job(void *vqargs, void *vwargs)
}
+static void fixup_geom(struct detector *det)
+{
+ int i;
+
+ for ( i=0; i<det->n_panels; i++ ) {
+ det->panels[i].clen += det->panels[i].coffset;
+ }
+}
+
+
+static int geom_contains_references(struct detector *det)
+{
+ int i;
+
+ for ( i=0; i<det->n_panels; i++ ) {
+ if ( det->panels[i].clen_from != NULL ) return 1;
+ }
+ return 0;
+}
+
+
int main(int argc, char *argv[])
{
int c;
@@ -708,6 +729,13 @@ int main(int argc, char *argv[])
ERROR("The value given on the command line "
"(with --photon-energy) will be used instead.\n");
}
+ if ( geom_contains_references(det) ) {
+ ERROR("Geometry file contains a reference to an HDF5 location"
+ " for the camera length. Change it to a numerical value "
+ " and try again.\n");
+ return 1;
+ }
+ fixup_geom(det);
if ( sym_str == NULL ) sym_str = strdup("1");
sym = get_pointgroup(sym_str);