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

#include <G4UniformGravityField.hh>

+ Inheritance diagram for G4UniformGravityField:

Public Member Functions

 G4UniformGravityField (const G4ThreeVector &FieldVector)
 
 G4UniformGravityField (const G4double gy=-9.81 *CLHEP::m/CLHEP::s/CLHEP::s)
 
virtual ~G4UniformGravityField ()
 
 G4UniformGravityField (const G4UniformGravityField &p)
 
G4UniformGravityFieldoperator= (const G4UniformGravityField &p)
 
G4bool DoesFieldChangeEnergy () const
 
virtual void GetFieldValue (const G4double Point[4], G4double *field) const
 
virtual G4FieldClone () const
 
- Public Member Functions inherited from G4Field
 G4Field (G4bool gravityOn=false)
 
 G4Field (const G4Field &)
 
virtual ~G4Field ()
 
G4Fieldoperator= (const G4Field &p)
 
virtual void GetFieldValue (const G4double Point[4], G4double *fieldArr) const =0
 
virtual G4bool DoesFieldChangeEnergy () const =0
 
G4bool IsGravityActive () const
 
void SetGravityActive (G4bool OnOffFlag)
 
virtual G4FieldClone () const
 

Additional Inherited Members

- Static Public Attributes inherited from G4Field
static constexpr G4int MAX_NUMBER_OF_COMPONENTS = 24
 

Detailed Description

Definition at line 44 of file G4UniformGravityField.hh.

Constructor & Destructor Documentation

◆ G4UniformGravityField() [1/3]

G4UniformGravityField::G4UniformGravityField ( const G4ThreeVector FieldVector)

Definition at line 38 of file G4UniformGravityField.cc.

39 : G4Field ( true ) // Gravity flag *on*
40{
41 fFieldComponents[0] = FieldVector.x();
42 fFieldComponents[1] = FieldVector.y();
43 fFieldComponents[2] = FieldVector.z();
44}
double z() const
double x() const
double y() const

◆ G4UniformGravityField() [2/3]

G4UniformGravityField::G4UniformGravityField ( const G4double  gy = -9.81*CLHEP::m/CLHEP::s/CLHEP::s)

Definition at line 47 of file G4UniformGravityField.cc.

48 : G4Field ( true )
49{
50 fFieldComponents[0] = 0.0;
51 fFieldComponents[1] = gy;
52 fFieldComponents[2] = 0.0;
53}

◆ ~G4UniformGravityField()

G4UniformGravityField::~G4UniformGravityField ( )
virtual

Definition at line 55 of file G4UniformGravityField.cc.

56{
57}

◆ G4UniformGravityField() [3/3]

G4UniformGravityField::G4UniformGravityField ( const G4UniformGravityField p)

Definition at line 59 of file G4UniformGravityField.cc.

60 : G4Field(p)
61{
62 for (auto i=0; i<3; ++i)
63 {
64 fFieldComponents[i] = p.fFieldComponents[i];
65 }
66}

Member Function Documentation

◆ Clone()

G4Field * G4UniformGravityField::Clone ( ) const
virtual

Reimplemented from G4Field.

Definition at line 80 of file G4UniformGravityField.cc.

81{
82 return new G4UniformGravityField( G4ThreeVector(fFieldComponents[0],
83 fFieldComponents[1],
84 fFieldComponents[2]) );
85}
CLHEP::Hep3Vector G4ThreeVector

◆ DoesFieldChangeEnergy()

G4bool G4UniformGravityField::DoesFieldChangeEnergy ( ) const
inlinevirtual

Implements G4Field.

Definition at line 60 of file G4UniformGravityField.hh.

60{ return true; }

◆ GetFieldValue()

void G4UniformGravityField::GetFieldValue ( const G4double  Point[4],
G4double field 
) const
virtual

Implements G4Field.

Definition at line 89 of file G4UniformGravityField.cc.

91{
92 G[0]= fFieldComponents[0];
93 G[1]= fFieldComponents[1];
94 G[2]= fFieldComponents[2];
95}

◆ operator=()

G4UniformGravityField & G4UniformGravityField::operator= ( const G4UniformGravityField p)

Definition at line 69 of file G4UniformGravityField.cc.

70{
71 if (&p == this) return *this;
73 for (auto i=0; i<3; ++i)
74 {
75 fFieldComponents[i] = p.fFieldComponents[i];
76 }
77 return *this;
78}
G4Field & operator=(const G4Field &p)
Definition: G4Field.cc:42

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