Message: Re: Access to smart voxels during tracking Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Access to smart voxels during tracking 

Forum: Geometry
Re: Question Access to smart voxels during tracking (Tom Roberts)
Re: None Re: Access to smart voxels during tracking (John Apostolakis)
Date: 03 Sep, 2012
From: Tom Roberts <Tom Roberts>

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.

 Add Message Add Message
to: "Re: Access to smart voxels during tracking"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]