|Message: Re: Access to smart voxels during tracking||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
On Mon, 03 Sep 2012 16:53:36 GMT, John Apostolakis wrote:
> Scenario A) Build an alternative geometry [...] > Scenario B) You intend to use the voxels of the 'mass' geometry.[...]
I have in mind scenario B.
Background: my code has a single GlobalField instance (i.e. no per-volume fields -- fringe fields overlap). The code has an instance of FieldEntry for each magnet and RF cavity, which has a bounding box and a getFieldValue(). There can be thousands of magnets and RF cavities. At present GlobalField::getFieldValue() simply loops over all FieldEntry-s, checking the bounding box before doing the (expensive) global->local transformation and evaluating the field.
New Algorithm: 1. Create a map from Voxel* to a pointer to vector<FieldEntry*>. Initially the map is empty. 2. In GlobalField::getFieldValue(), obtain the current Voxel. If the map value is NULL, scan all FieldEntry-s and make the map entry point to a vector of the ones whose bounding boxes intersect the Voxel. Then sum the fields for the FieldEntries in the vector corresponding to the Voxel.
This is based on the observation that the Geant4 mass hierarchy is a pretty good match to the bounding boxes, because fringe fields usually do not extend very far outside the magnets or RF cavities (each of which has several physical volumes). Also, I have profiled my code for a case with many magnets but no bounding boxes overlap -- my loop over all FieldEntry-s dominates completely, implying the Geant4 navigator does much better than looping over all physical volumes -- I want to build on that.
This means I need: * The type Voxel. * Voxel *getVoxel(point) -- it would be best if this is optimized to start searching from the current track's current Voxel. * A method to get the boundaries of a given Voxel. * The ability to enumerate all Voxels (for testing/diagnostics).
Note I see none of the above list in G4Navigator. I could, of course, re-invent the wheel, but it seems best to use what Geant4 has already done for this.