Geant4 11.2.2
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)
 
 ~G4UniformGravityField () override
 
 G4UniformGravityField (const G4UniformGravityField &p)
 
G4UniformGravityFieldoperator= (const G4UniformGravityField &p)
 
G4bool DoesFieldChangeEnergy () const override
 
void GetFieldValue (const G4double Point[4], G4double *field) const override
 
G4FieldClone () const override
 
- Public Member Functions inherited from G4Field
 G4Field (G4bool gravityOn=false)
 
 G4Field (const G4Field &)
 
virtual ~G4Field ()
 
G4Fieldoperator= (const G4Field &p)
 
G4bool IsGravityActive () const
 
void SetGravityActive (G4bool OnOffFlag)
 

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
G4Field(G4bool gravityOn=false)
Definition G4Field.cc:33

Referenced by Clone().

◆ 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 ( )
overridedefault

◆ G4UniformGravityField() [3/3]

G4UniformGravityField::G4UniformGravityField ( const G4UniformGravityField & p)

Definition at line 57 of file G4UniformGravityField.cc.

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

Member Function Documentation

◆ Clone()

G4Field * G4UniformGravityField::Clone ( ) const
overridevirtual

Reimplemented from G4Field.

Definition at line 78 of file G4UniformGravityField.cc.

79{
80 return new G4UniformGravityField( G4ThreeVector(fFieldComponents[0],
81 fFieldComponents[1],
82 fFieldComponents[2]) );
83}
CLHEP::Hep3Vector G4ThreeVector
G4UniformGravityField(const G4ThreeVector &FieldVector)

◆ DoesFieldChangeEnergy()

G4bool G4UniformGravityField::DoesFieldChangeEnergy ( ) const
inlineoverridevirtual

Implements G4Field.

Definition at line 60 of file G4UniformGravityField.hh.

60{ return true; }

◆ GetFieldValue()

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

Implements G4Field.

Definition at line 87 of file G4UniformGravityField.cc.

89{
90 G[0]= fFieldComponents[0];
91 G[1]= fFieldComponents[1];
92 G[2]= fFieldComponents[2];
93}

◆ operator=()

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

Definition at line 67 of file G4UniformGravityField.cc.

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

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