@@ -111,12 +111,13 @@ double mass_attenuation_coef( float atomic_number, float energy );
111
111
double transmition_coefficient_generic ( float atomic_number, float areal_density,
112
112
float energy );
113
113
114
+
115
+ void example_integration ();
116
+
114
117
// When debugging we will grab a static mutex so we dont get jumbled stdout
115
118
#define DEBUG_RAYTRACE_CALCS 0
116
119
117
120
118
- void example_integration ();
119
-
120
121
/* * Runs some simple test cases for #cylinder_exit_position, and cause assert(0) on error. */
121
122
void test_cylinder_exit_position ();
122
123
@@ -144,6 +145,16 @@ double exit_point_of_sphere_z( const double source_point[3],
144
145
double observation_dist,
145
146
bool postiveSolution = true );
146
147
148
+ /* * An enum to to tell #cylinder_exit_position which exit point from sphere you want.
149
+
150
+ A better name would be CylinderIntersectionDirection, but thats too long.
151
+ */
152
+ enum class CylExitDir
153
+ {
154
+ TowardDetector,
155
+ AwayFromDetector
156
+ };
157
+
147
158
/* * Starting from a 'source_point' within the volume of the cylinder, and heading towards the 'detector_point' (think center
148
159
of the detector face), returns the total attenuation coefficient along the path, including recursing into any sub-tubes, as well as
149
160
sets the point where the ray leaves the cylinder.
@@ -156,7 +167,9 @@ double exit_point_of_sphere_z( const double source_point[3],
156
167
@param[in] detector The {x, y, z} point on the detector face we care about (so center of detector, unless you are integrating over
157
168
the detector face), in the coordinate system where cylinder is centered at {0,0,0}.
158
169
@param[out] exit_point The final exit point from the cylinder, where the path will no longer go through the volume.
159
- @returns the attenuation coefficient from the path through the cylinder and its sub-cylinders. E.g.,
170
+ @returns The distance from source location to exit point. Returns 0.0 if line does not intersect cylinder. Note that this is not the
171
+ distance in the cylinder, but the total distance from source to exit point, so if source is outside volume, may be larger than cylinder
172
+ dimensions.
160
173
\code{.cpp}
161
174
double exit_point[3];
162
175
const double distance_in_m = cylinder_exit_position( 0.5*m, 100*cm, {0,0.1*m,20*cm}, {0,0,10*m}, exit_point );
@@ -166,6 +179,7 @@ double exit_point_of_sphere_z( const double source_point[3],
166
179
double cylinder_exit_position ( const double radius, const double half_length,
167
180
const double source[3 ],
168
181
const double detector[3 ],
182
+ const CylExitDir direction,
169
183
double exit_point[3 ] );
170
184
171
185
@@ -199,7 +213,7 @@ struct DistributedSrcCalc
199
213
void eval_spherical ( const double xx[], const int *ndimptr,
200
214
double ff[], const int *ncompptr ) const ;
201
215
202
- void eval_cyl_end_on ( const double xx[], const int *ndimptr,
216
+ void eval_single_cyl_end_on ( const double xx[], const int *ndimptr,
203
217
double ff[], const int *ncompptr ) const ;
204
218
205
219
void eval_cylinder ( const double xx[], const int *ndimptr,
0 commit comments