Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VCurvedTrajectoryFilter Class Referenceabstract

G4VCurvedTrajectoryFilter defines a filter for deciding which intermediate points on a curved trajectory merit being stored. It defines the compromise between accuracy of representation of the curved trajectory and memory use. Derived classes should implement the filtering algorithm. More...

#include <G4VCurvedTrajectoryFilter.hh>

Inheritance diagram for G4VCurvedTrajectoryFilter:

Public Member Functions

 G4VCurvedTrajectoryFilter ()=default
virtual ~G4VCurvedTrajectoryFilter ()=default
void CreateNewTrajectorySegment ()
virtual void TakeIntermediatePoint (G4ThreeVector newPoint)=0
std::vector< G4ThreeVector > * GimmeThePointsAndForgetThem ()

Protected Attributes

std::vector< G4ThreeVector > * fpFilteredPoints = nullptr

Detailed Description

G4VCurvedTrajectoryFilter defines a filter for deciding which intermediate points on a curved trajectory merit being stored. It defines the compromise between accuracy of representation of the curved trajectory and memory use. Derived classes should implement the filtering algorithm.

Definition at line 57 of file G4VCurvedTrajectoryFilter.hh.

Constructor & Destructor Documentation

◆ G4VCurvedTrajectoryFilter()

G4VCurvedTrajectoryFilter::G4VCurvedTrajectoryFilter ( )
default

Default Constructor & Destructor.

◆ ~G4VCurvedTrajectoryFilter()

virtual G4VCurvedTrajectoryFilter::~G4VCurvedTrajectoryFilter ( )
virtualdefault

Member Function Documentation

◆ CreateNewTrajectorySegment()

void G4VCurvedTrajectoryFilter::CreateNewTrajectorySegment ( )

Each segment stores the auxiliary points of a single step.

Definition at line 50 of file G4VCurvedTrajectoryFilter.cc.

51{
52 if (fpFilteredPoints != nullptr)
53 {
54 // GimmePoints has not been called (it would have set the
55 // pointer to nullptr), therefore nobody has taken charge of the
56 // points and they will never be deleted!
57 G4cout << "!!!!!!!! Filter: auxiliary points are being memory leaked !!!!!"
58 << G4endl;
59 }
60 fpFilteredPoints = new std::vector<G4ThreeVector>;
61}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
std::vector< G4ThreeVector > * fpFilteredPoints

◆ GimmeThePointsAndForgetThem()

std::vector< G4ThreeVector > * G4VCurvedTrajectoryFilter::GimmeThePointsAndForgetThem ( )

Returns the vector of points, transferring the ownership.

Definition at line 34 of file G4VCurvedTrajectoryFilter.cc.

35{
36 std::vector<G4ThreeVector>* tmp = fpFilteredPoints;
37 // ParticleChangeForTransport invokes this method (via
38 // PropagatorInField) at every Step, even if the step did not
39 // involve PropagatorInField. Must, therefore, ensure that points
40 // submitted by previous invocations of PIF are not
41 // copied. Therefore the points must be cleared. (Note that the
42 // responsibility for deleting the vector lies with the
43 // SmoothTrajctoryPoint, which is the vector's final destination.)
44 // (jacek 08/11/2002)
45 fpFilteredPoints = nullptr;
46 return tmp;
47}

◆ TakeIntermediatePoint()

virtual void G4VCurvedTrajectoryFilter::TakeIntermediatePoint ( G4ThreeVector newPoint)
pure virtual

Submits intermediate points for the filter to consider keeping or rejecting. Derived classes should implement the filtering algorithm in this method.

Implemented in G4IdentityTrajectoryFilter.

Member Data Documentation

◆ fpFilteredPoints

std::vector<G4ThreeVector>* G4VCurvedTrajectoryFilter::fpFilteredPoints = nullptr
protected

The documentation for this class was generated from the following files: