Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SDKineticEnergyFilter Class Reference

#include <G4SDKineticEnergyFilter.hh>

+ Inheritance diagram for G4SDKineticEnergyFilter:

Public Member Functions

 G4SDKineticEnergyFilter (G4String name, G4double elow=0.0, G4double ehigh=DBL_MAX)
 
 ~G4SDKineticEnergyFilter () override=default
 
G4bool Accept (const G4Step *) const override
 
void SetKineticEnergy (G4double elow, G4double ehigh)
 
void SetLowEnergy (G4double elow)
 
void SetHighEnergy (G4double ehigh)
 
void show ()
 
- Public Member Functions inherited from G4VSDFilter
 G4VSDFilter (G4String name)
 
virtual ~G4VSDFilter ()
 
virtual G4bool Accept (const G4Step *) const =0
 
G4String GetName () const
 

Additional Inherited Members

- Protected Attributes inherited from G4VSDFilter
G4String filterName
 

Detailed Description

Definition at line 50 of file G4SDKineticEnergyFilter.hh.

Constructor & Destructor Documentation

◆ G4SDKineticEnergyFilter()

G4SDKineticEnergyFilter::G4SDKineticEnergyFilter ( G4String  name,
G4double  elow = 0.0,
G4double  ehigh = DBL_MAX 
)

Definition at line 43 of file G4SDKineticEnergyFilter.cc.

45 : G4VSDFilter(name)
46 , fLowEnergy(elow)
47 , fHighEnergy(ehigh)
48{}

◆ ~G4SDKineticEnergyFilter()

G4SDKineticEnergyFilter::~G4SDKineticEnergyFilter ( )
overridedefault

Member Function Documentation

◆ Accept()

G4bool G4SDKineticEnergyFilter::Accept ( const G4Step aStep) const
overridevirtual

Implements G4VSDFilter.

Definition at line 50 of file G4SDKineticEnergyFilter.cc.

51{
52 G4double kinetic = aStep->GetPreStepPoint()->GetKineticEnergy();
53 if(kinetic < fLowEnergy)
54 return false;
55 if(kinetic >= fHighEnergy)
56 return false;
57 return true;
58}
double G4double
Definition: G4Types.hh:83
G4double GetKineticEnergy() const
G4StepPoint * GetPreStepPoint() const

Referenced by G4SDParticleWithEnergyFilter::Accept().

◆ SetHighEnergy()

void G4SDKineticEnergyFilter::SetHighEnergy ( G4double  ehigh)

◆ SetKineticEnergy()

void G4SDKineticEnergyFilter::SetKineticEnergy ( G4double  elow,
G4double  ehigh 
)

Definition at line 60 of file G4SDKineticEnergyFilter.cc.

61{
62 fLowEnergy = elow;
63 fHighEnergy = ehigh;
64}

Referenced by G4SDParticleWithEnergyFilter::SetKineticEnergy().

◆ SetLowEnergy()

void G4SDKineticEnergyFilter::SetLowEnergy ( G4double  elow)

◆ show()

void G4SDKineticEnergyFilter::show ( )

Definition at line 66 of file G4SDKineticEnergyFilter.cc.

67{
68 G4cout << " G4SDKineticEnergyFilter:: " << GetName() << " LowE "
69 << G4BestUnit(fLowEnergy, "Energy") << " HighE "
70 << G4BestUnit(fHighEnergy, "Energy") << G4endl;
71}
#define G4BestUnit(a, b)
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4String GetName() const
Definition: G4VSDFilter.hh:55

Referenced by G4SDParticleWithEnergyFilter::show().


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