Functionality for simple output post-processing (i.e., pre-clustering and similar) shared between multiple output schemes. More...
Classes | |
| struct | ClusterPars |
| Container for the parameters of step pre-clustering. More... | |
Enumerations | |
| enum class | PositionMode { kPreStep , kPostStep , kAverage , kBoth } |
| Enum of which position of the hit to store. More... | |
Functions | |
| G4ThreeVector | get_position (RMGDetectorHit *hit, RMGOutputTools::PositionMode mode) |
| Get the position to save for a given hit. | |
| double | get_distance (RMGDetectorHit *hit, RMGOutputTools::PositionMode mode) |
| Get the distance to surface to save for a given hit. | |
| double | distance_to_surface (const G4VPhysicalVolume *pv, const G4ThreeVector &position) |
| Compute the distance from the point to the surface of the physical volume. | |
| std::shared_ptr< RMGDetectorHitsCollection > | pre_cluster_hits (const RMGDetectorHitsCollection *hits, ClusterPars cluster_pars, bool has_distance_to_surface, bool has_velocity) |
| Perform a basic reduction of the hits collection removing very short steps. | |
| RMGDetectorHit * | average_hits (std::vector< RMGDetectorHit * > hits, bool compute_distance_to_surface, bool compute_velocity) |
| Average a cluster of hits to produce one effective hit. | |
| bool | check_step_point_containment (const G4StepPoint *step_point, RMGDetectorType det_type) |
| Check if the step point is contained in a physical volume registered as a detector. | |
| std::map< int, std::vector< RMGDetectorHit * > > | combine_low_energy_tracks (const std::map< int, std::vector< RMGDetectorHit * > > &hits_map, const ClusterPars &cluster_pars, bool has_distance_to_surface) |
| Combine low energy electron tracks into their neighbours. | |
| void | redistribute_gamma_energy (std::map< int, std::vector< RMGDetectorHit * > > hits_map, ClusterPars cluster_pars, bool has_distance_to_surface) |
| Search for hits close to any gamma track and reassign the energy deposit to that track. | |
Functionality for simple output post-processing (i.e., pre-clustering and similar) shared between multiple output schemes.
|
strong |
| RMGDetectorHit * RMGOutputTools::average_hits | ( | std::vector< RMGDetectorHit * > | hits, |
| bool | compute_distance_to_surface, | ||
| bool | compute_velocity ) |
Average a cluster of hits to produce one effective hit.
The steps in a cluster are average with the energy being the sum over the steps, and the pre/post step position / distance / velcity to surface computed from the first/last step. Other fields must be the same for all steps in the cluster and are taken from the first step.
| hits | the vector of hits to average |
| compute_distance_to_surface | boolean flag of whether to compute the distance to surface. |
| compute_velocity | boolean flag of whether to compute velocity. |
| bool RMGOutputTools::check_step_point_containment | ( | const G4StepPoint * | step_point, |
| RMGDetectorType | det_type ) |
Check if the step point is contained in a physical volume registered as a detector.
| step_point | The step point (either post or pre step) to check. |
| det_type | Type of detector to check for. |
| std::map< int, std::vector< RMGDetectorHit * > > RMGOutputTools::combine_low_energy_tracks | ( | const std::map< int, std::vector< RMGDetectorHit * > > & | hits_map, |
| const ClusterPars & | cluster_pars, | ||
| bool | has_distance_to_surface ) |
Combine low energy electron tracks into their neighbours.
Some interactions of gammas, eg. Compton scattering or the photoelectric effect can produce very low energy electron tracks. This function reads a map of steps in each track (keyed by trackid), it then computes the total energy in each electron track. If a track is below a certain threshold then the code searches through the other tracks to see if there is one where the first pre-step point is within the cluster distance of this track. If so they are combined for further pre-clustering. In the case multiple nearby tracks are found the highest energy one is used.
| hits_map | a map of vectors of RMGDetectorHit pointers with the key being the track id. |
| cluster_pars | a RMGOutputTools::ClusterPars struct of the parameters for clustering. |
| has_distance_to_surface | a flag of whether the hits have the distance to surface field, and clustering should be performed separately for surface and bulk. |
| double RMGOutputTools::distance_to_surface | ( | const G4VPhysicalVolume * | pv, |
| const G4ThreeVector & | position ) |
Compute the distance from the point to the surface of the physical volume.
Checks distance to surfaces of mother volume.
| pv | The physical volume to find the distance to. |
| position | The position to evaluate the distance for. |
| double RMGOutputTools::get_distance | ( | RMGDetectorHit * | hit, |
| RMGOutputTools::PositionMode | mode ) |
Get the distance to surface to save for a given hit.
The logic is the same as for RMGOutputTools::get_position
| G4ThreeVector RMGOutputTools::get_position | ( | RMGDetectorHit * | hit, |
| RMGOutputTools::PositionMode | mode ) |
Get the position to save for a given hit.
If the mode is kPostStep or if the particle is a gamma then the post-step point is used. This is since gamma's have only discrete interactions happening at the post-step. Otherwise if mode is kPreStep the prestep point is extracted, if it is either kBoth or kAverage the average of pre and post step is used (in the case of kBoth the pre and post step should also be saved separately).
| std::shared_ptr< RMGDetectorHitsCollection > RMGOutputTools::pre_cluster_hits | ( | const RMGDetectorHitsCollection * | hits, |
| RMGOutputTools::ClusterPars | cluster_pars, | ||
| bool | has_distance_to_surface, | ||
| bool | has_velocity ) |
Perform a basic reduction of the hits collection removing very short steps.
This is based on a "within" track clustering (but note that some low energy tracks can be merged by CombineLowEnergyTracks . The steps in every track are looped through and combined into effective steps. A step is added to the current cluster if:
has_distance_to_surface is set. The step must not move from the surface region (defined by the distance_to_surface<fSurfaceThickness) to the bulk or visa versa.fClusterTimeThreshold ,fClusterDistance (for the bulk) or fClusterSurfaceDistance for the surface (if has_distance_to_surface is true).AverageHits | void RMGOutputTools::redistribute_gamma_energy | ( | std::map< int, std::vector< RMGDetectorHit * > > | hits_map, |
| RMGOutputTools::ClusterPars | cluster_pars, | ||
| bool | has_distance_to_surface ) |
Search for hits close to any gamma track and reassign the energy deposit to that track.
Gamma particles do not deposit energy, however as part of some interactions a very small "local" energy deposit happen, due to atomic binding energy. This method search through the gamma tracks and for each it looks for a nearby electron hit to instead assign this small local energy deposit too, this can avoid writing out the gamma tracks in the output scheme.