| 1 | Fred's 3rd test suite DCW 10/12/98
|
|---|
| 2 |
|
|---|
| 3 | Test 3 is designed to thoroughly test volumes without user intervention
|
|---|
| 4 | (i.e. batch job) looking for logical contradictions between the routines:
|
|---|
| 5 |
|
|---|
| 6 | DistanceToIn(p,v)
|
|---|
| 7 | DistanceToOut(p,v)
|
|---|
| 8 | Inside(p)
|
|---|
| 9 |
|
|---|
| 10 | A list of errors are reported for later debugging.
|
|---|
| 11 |
|
|---|
| 12 | Test 3 does not use GEANT4 tracking: instead, it calls a volume's
|
|---|
| 13 | routines directly. Errors are output to an error file with enough
|
|---|
| 14 | information to reproduce them for later debugging.
|
|---|
| 15 |
|
|---|
| 16 | Algorithm:
|
|---|
| 17 |
|
|---|
| 18 | 1. A random point is three dimensions is generated. The distribution
|
|---|
| 19 | of these points is roughly Gaussian in each dimension,
|
|---|
| 20 | centered on a user defined point (default 0,0,0) with a user
|
|---|
| 21 | defined width (detault 1,1,1). Points beyond a 10 meter box
|
|---|
| 22 | are discarded. Optionally, points are rounded to the nearest
|
|---|
| 23 | specified increment (i.e. moved to the nearest point on a grid).
|
|---|
| 24 |
|
|---|
| 25 | 2. Inside is called to determine if the point is inside, outside,
|
|---|
| 26 | or on the surface of the test volume.
|
|---|
| 27 |
|
|---|
| 28 | 3. Depending on the result, the point is placed in a list of 100
|
|---|
| 29 | inside, outside, or surface points. If the list is full, it
|
|---|
| 30 | replaces a random point on the list.
|
|---|
| 31 |
|
|---|
| 32 | 4. If the point is outside, then, for each point in the inside list:
|
|---|
| 33 |
|
|---|
| 34 | 4.1 A directional vector to the inside point is calculated
|
|---|
| 35 | and DistanceToIn(p,v) is called.
|
|---|
| 36 |
|
|---|
| 37 | 4.2 The result must not be kInfinity nor zero, or it's an error.
|
|---|
| 38 | If the result is less than the answer from DistanceToIn(p),
|
|---|
| 39 | it is an error.
|
|---|
| 40 |
|
|---|
| 41 | 4.3 The point is moved to the calculated intersection point
|
|---|
| 42 | and Inside is called. The result must be on the surface,
|
|---|
| 43 | or it is an error.
|
|---|
| 44 |
|
|---|
| 45 | 4.4 Using this surface point, DistanceToIn(p,v) is invoked.
|
|---|
| 46 | The result must be zero, or it is an error.
|
|---|
| 47 |
|
|---|
| 48 | *** 4.5 Using this surface point, DistanceToOut(p,v) is invoked.
|
|---|
| 49 | *** The result must be > zero, or it is an error.
|
|---|
| 50 |
|
|---|
| 51 | 4.6 The plane normal returned by the previous routine,
|
|---|
| 52 | if valid, is checked against the trajectory. If
|
|---|
| 53 | incorrect (i.e. dot product < 0), this is an error.
|
|---|
| 54 |
|
|---|
| 55 | 4.7 The point is moved by the result of 4.5. Inside is
|
|---|
| 56 | invoked. If the point is not on the surface, it is
|
|---|
| 57 | an error.
|
|---|
| 58 |
|
|---|
| 59 | 4.8 Using this point, DistanceToOut(p,v) is invoked. If
|
|---|
| 60 | the result is zero, it is an error.
|
|---|
| 61 |
|
|---|
| 62 | 5. If the point is inside, then, for each point in the outside list:
|
|---|
| 63 |
|
|---|
| 64 | 5.1 A directional vector to the outside point is calculated
|
|---|
| 65 | and DistanceToOut(p,v) is called.
|
|---|
| 66 |
|
|---|
| 67 | 5.2 The result must not be kInfinity nor zero, or it's an error.
|
|---|
| 68 | If it is less than DistanceToOut(p), it is an error.
|
|---|
| 69 |
|
|---|
| 70 | 5.3 The plane normal returned in step 5.1, if valid, is
|
|---|
| 71 | checked against the trajectory. If incorrect (i.e. dot
|
|---|
| 72 | product < 0), this is an error.
|
|---|
| 73 |
|
|---|
| 74 | 5.4 The point is moved to the calculated intersection point
|
|---|
| 75 | and Inside is called. The result must be on the surface,
|
|---|
| 76 | or it is an error.
|
|---|
| 77 |
|
|---|
| 78 | *** 5.5 Using this surface point, DistanceToOut(p,v) is invoked.
|
|---|
| 79 | *** The result must not be zero, or it is an error.
|
|---|
| 80 | ***
|
|---|
| 81 | *** Waiting for clarification of DistanceToIn specification?
|
|---|
| 82 | ***
|
|---|
| 83 | *** 5.6 DistanceToIn(p,v) is invoked. If the result is zero,
|
|---|
| 84 | *** it is an error.
|
|---|
| 85 | ***
|
|---|
| 86 | *** 5.7 If the result of the previous step is not kInfinity,
|
|---|
| 87 | *** the point is moved by the specified distance and
|
|---|
| 88 | *** inside is called. The result must be on the surface,
|
|---|
| 89 | *** or it is an error.
|
|---|
| 90 | ***
|
|---|
| 91 | *** 5.8 Go back to step 5.5 and repeat.
|
|---|
| 92 | ***
|
|---|
| 93 |
|
|---|
| 94 | 6. If the point is on the surface, then, for each point in the
|
|---|
| 95 | outside list:
|
|---|
| 96 |
|
|---|
| 97 | 6.1 A directional vector to the outside point is calculated
|
|---|
| 98 | and DistanceToOut(p,v) is called.
|
|---|
| 99 |
|
|---|
| 100 | 6.2 If the result of the previous step is zero, it is an error.
|
|---|
| 101 |
|
|---|
| 102 | 7. If the point is on the surface, then, for each point in the
|
|---|
| 103 | inside list:
|
|---|
| 104 |
|
|---|
| 105 | 7.1 A directional vector to the inside point is calculated
|
|---|
| 106 | and DistanceToIn(p,v) is called.
|
|---|
| 107 |
|
|---|
| 108 | 7.2 If the result is kInfinity, it is an error.
|
|---|
| 109 |
|
|---|
| 110 | 8. Step 1 is repeated until: a maximum number of points have been
|
|---|
| 111 | generated or a maximum number of errors have been generated.
|
|---|