Geant4 9.6.0
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)
 
virtual ~G4SDKineticEnergyFilter ()
 
virtual G4bool Accept (const G4Step *) const
 
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 51 of file G4SDKineticEnergyFilter.hh.

Constructor & Destructor Documentation

◆ G4SDKineticEnergyFilter()

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

Definition at line 44 of file G4SDKineticEnergyFilter.cc.

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

◆ ~G4SDKineticEnergyFilter()

G4SDKineticEnergyFilter::~G4SDKineticEnergyFilter ( )
virtual

Definition at line 50 of file G4SDKineticEnergyFilter.cc.

51{;}

Member Function Documentation

◆ Accept()

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

Implements G4VSDFilter.

Definition at line 53 of file G4SDKineticEnergyFilter.cc.

54{
55 G4double kinetic = aStep->GetPreStepPoint()->GetKineticEnergy();
56 if ( kinetic < fLowEnergy ) return FALSE;
57 if ( kinetic >= fHighEnergy ) return FALSE;
58 return TRUE;
59}
double G4double
Definition: G4Types.hh:64
G4double GetKineticEnergy() const
G4StepPoint * GetPreStepPoint() const
#define TRUE
Definition: globals.hh:55
#define FALSE
Definition: globals.hh:52

Referenced by G4SDParticleWithEnergyFilter::Accept().

◆ SetHighEnergy()

void G4SDKineticEnergyFilter::SetHighEnergy ( G4double  ehigh)

◆ SetKineticEnergy()

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

Definition at line 61 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.

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

Referenced by G4SDParticleWithEnergyFilter::show().


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