remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGOutputTools.hh
1// Copyright (C) 2025 Toby Dixon <https://orcid.org/0000-0001-8787-6336>
2//
3// This program is free software: you can redistribute it and/or modify it under
4// the terms of the GNU Lesser General Public License as published by the Free
5// Software Foundation, either version 3 of the License, or (at your option) any
6// later version.
7//
8// This program is distributed in the hope that it will be useful, but WITHOUT
9// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11// details.
12//
13// You should have received a copy of the GNU Lesser General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16#ifndef _RMG_OUTPUT_TOOLS_HH_
17#define _RMG_OUTPUT_TOOLS_HH_
18
19#include <map>
20#include <vector>
21
22#include "G4Step.hh"
23
24#include "RMGDetectorHit.hh"
25#include "RMGDetectorMetadata.hh"
26
30namespace RMGOutputTools {
31
43
44
46 struct ClusterPars {
47 bool combine_low_energy_tracks;
48 bool reassign_gamma_energy;
49 double track_energy_threshold;
50 double surface_thickness;
51 double cluster_distance;
52 double cluster_distance_surface;
53 double cluster_time_threshold;
54 };
55
66
72
73
79 double distance_to_surface(const G4VPhysicalVolume* pv, const G4ThreeVector& position);
80
99 std::shared_ptr<RMGDetectorHitsCollection> pre_cluster_hits(
100 const RMGDetectorHitsCollection* hits,
101 ClusterPars cluster_pars,
102 bool has_distance_to_surface,
103 bool has_velocity
104 );
105
119 std::vector<RMGDetectorHit*> hits,
120 bool compute_distance_to_surface,
121 bool compute_velocity
122 );
123
129 bool check_step_point_containment(const G4StepPoint* step_point, RMGDetectorType det_type);
130
151 std::map<int, std::vector<RMGDetectorHit*>> combine_low_energy_tracks(
152 const std::map<int, std::vector<RMGDetectorHit*>>& hits_map,
153 const ClusterPars& cluster_pars,
154 bool has_distance_to_surface
155 );
156
165 std::map<int, std::vector<RMGDetectorHit*>> hits_map,
166 ClusterPars cluster_pars,
167 bool has_distance_to_surface
168 );
169
170
171} // namespace RMGOutputTools
172
173#endif
174
175// vim: tabstop=2 shiftwidth=2 expandtab
Class to store hits in the Germanium or Scintillator detectors, extends G4VHit.
Definition RMGDetectorHit.hh:40
Functionality for simple output post-processing (i.e., pre-clustering and similar) shared between mul...
Definition RMGOutputTools.hh:30
double distance_to_surface(const G4VPhysicalVolume *pv, const G4ThreeVector &position)
Compute the distance from the point to the surface of the physical volume.
Definition RMGOutputTools.cc:423
double get_distance(RMGDetectorHit *hit, RMGOutputTools::PositionMode mode)
Get the distance to surface to save for a given hit.
Definition RMGOutputTools.cc:59
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.
Definition RMGOutputTools.cc:83
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.
Definition RMGOutputTools.cc:226
G4ThreeVector get_position(RMGDetectorHit *hit, RMGOutputTools::PositionMode mode)
Get the position to save for a given hit.
Definition RMGOutputTools.cc:35
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.
Definition RMGOutputTools.cc:180
PositionMode
Enum of which position of the hit to store.
Definition RMGOutputTools.hh:33
@ kPostStep
Definition RMGOutputTools.hh:37
@ kBoth
Definition RMGOutputTools.hh:41
@ kPreStep
Definition RMGOutputTools.hh:35
@ kAverage
Definition RMGOutputTools.hh:39
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.
Definition RMGOutputTools.cc:323
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.
Definition RMGOutputTools.cc:145
Container for the parameters of step pre-clustering.
Definition RMGOutputTools.hh:46