Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
MedicalBeam Class Reference

#include <MedicalBeam.hh>

Inheritance diagram for MedicalBeam:
G4VUserPrimaryGeneratorAction G4VUserPrimaryGeneratorAction

Public Types

enum  FieldShape { SQUARE =0, CIRCLE, kSQUARE =0, kCIRCLE }
 
enum  FieldShape { SQUARE =0, CIRCLE, kSQUARE =0, kCIRCLE }
 

Public Member Functions

 MedicalBeam ()
 
 ~MedicalBeam ()
 
void SetParticleDefinition (G4ParticleDefinition *pd)
 
const G4ParticleDefinitionGetParticleDefinition () const
 
void SetKineticE (G4double e)
 
G4double GetKineticE () const
 
void SetSourcePosition (const G4ThreeVector &pos)
 
G4ThreeVector GetSourcePosition () const
 
void SetFieldShape (FieldShape shape)
 
FieldShape GetFieldShape () const
 
void SetSSD (G4double ssd)
 
G4double GetSSD () const
 
void SetFieldXY (G4double fx, G4double fy)
 
G4double GetFieldX () const
 
G4double GetFieldY () const
 
void SetFieldR (G4double r)
 
G4double GetFieldR () const
 
virtual void GeneratePrimaries (G4Event *anEvent)
 
 MedicalBeam ()
 
 ~MedicalBeam ()
 
void SetParticleDefinition (G4ParticleDefinition *pd)
 
const G4ParticleDefinitionGetParticleDefinition () const
 
void SetKineticE (G4double e)
 
G4double GetKineticE () const
 
void SetSourcePosition (const G4ThreeVector &pos)
 
G4ThreeVector GetSourcePosition () const
 
void SetFieldShape (FieldShape shape)
 
FieldShape GetFieldShape () const
 
void SetSSD (G4double ssd)
 
G4double GetSSD () const
 
void SetFieldXY (G4double fx, G4double fy)
 
G4double GetFieldX () const
 
G4double GetFieldY () const
 
void SetFieldR (G4double r)
 
G4double GetFieldR () const
 
virtual void GeneratePrimaries (G4Event *anEvent)
 
- Public Member Functions inherited from G4VUserPrimaryGeneratorAction
 G4VUserPrimaryGeneratorAction ()
 
virtual ~G4VUserPrimaryGeneratorAction ()
 

Protected Member Functions

G4ThreeVector GenerateBeamDirection () const
 

Protected Attributes

G4ParticleDefinitionparticle
 
G4double kineticE
 
G4ThreeVector sourcePosition
 
G4double SSD
 
FieldShape fieldShape
 
G4double fieldXY [2]
 
G4double fieldR
 

Detailed Description

Definition at line 46 of file environments/g4py/site-modules/primaries/MedicalBeam/MedicalBeam.hh.

Member Enumeration Documentation

Constructor & Destructor Documentation

MedicalBeam::MedicalBeam ( )
MedicalBeam::~MedicalBeam ( )
MedicalBeam::MedicalBeam ( )

Definition at line 49 of file environments/g4py/site-modules/primaries/MedicalBeam/MedicalBeam.cc.

References python.hepunit::cm, and fieldXY.

MedicalBeam::~MedicalBeam ( )

Member Function Documentation

G4ThreeVector MedicalBeam::GenerateBeamDirection ( ) const
protected
void MedicalBeam::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 112 of file environments/g4py/site-modules/primaries/MedicalBeam/MedicalBeam.cc.

References ns, sqr(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

114 {
115  if(particle==0) return;
116 
117  // create a new vertex
119 
120  // momentum
121  G4double mass= particle-> GetPDGMass();
122  G4double p= std::sqrt(sqr(mass+kineticE)-sqr(mass));
125  pmon.x(),
126  pmon.y(),
127  pmon.z());
128  // set primary to vertex
129  vertex-> SetPrimary(primary);
130 
131  // set vertex to event
132  anEvent-> AddPrimaryVertex(vertex);
133 }
double x() const
G4ThreeVector GenerateBeamDirection() const
const char * p
Definition: xmltok.h:285
double z() const
double y() const
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
#define ns
Definition: xmlparse.cc:597
virtual void MedicalBeam::GeneratePrimaries ( G4Event anEvent)
virtual
G4double MedicalBeam::GetFieldR ( ) const
G4double MedicalBeam::GetFieldR ( ) const
inline
FieldShape MedicalBeam::GetFieldShape ( ) const
MedicalBeam::FieldShape MedicalBeam::GetFieldShape ( ) const
inline
G4double MedicalBeam::GetFieldX ( ) const
G4double MedicalBeam::GetFieldX ( ) const
inline
G4double MedicalBeam::GetFieldY ( ) const
G4double MedicalBeam::GetFieldY ( ) const
inline
G4double MedicalBeam::GetKineticE ( ) const
G4double MedicalBeam::GetKineticE ( ) const
inline
const G4ParticleDefinition* MedicalBeam::GetParticleDefinition ( ) const
const G4ParticleDefinition * MedicalBeam::GetParticleDefinition ( ) const
inline
G4ThreeVector MedicalBeam::GetSourcePosition ( ) const
G4ThreeVector MedicalBeam::GetSourcePosition ( ) const
inline
G4double MedicalBeam::GetSSD ( ) const
G4double MedicalBeam::GetSSD ( ) const
inline
void MedicalBeam::SetFieldR ( G4double  r)
void MedicalBeam::SetFieldR ( G4double  r)
inline
void MedicalBeam::SetFieldShape ( FieldShape  shape)
void MedicalBeam::SetFieldShape ( MedicalBeam::FieldShape  shape)
inline
void MedicalBeam::SetFieldXY ( G4double  fx,
G4double  fy 
)
void MedicalBeam::SetFieldXY ( G4double  fx,
G4double  fy 
)
inline
void MedicalBeam::SetKineticE ( G4double  e)
void MedicalBeam::SetKineticE ( G4double  e)
inline
void MedicalBeam::SetParticleDefinition ( G4ParticleDefinition pd)
void MedicalBeam::SetParticleDefinition ( G4ParticleDefinition pd)
inline
void MedicalBeam::SetSourcePosition ( const G4ThreeVector pos)
void MedicalBeam::SetSourcePosition ( const G4ThreeVector pos)
inline
void MedicalBeam::SetSSD ( G4double  ssd)
void MedicalBeam::SetSSD ( G4double  ssd)
inline

Field Documentation

G4double MedicalBeam::fieldR
protected
FieldShape MedicalBeam::fieldShape
protected
G4double MedicalBeam::fieldXY[2]
protected
G4double MedicalBeam::kineticE
protected
G4ParticleDefinition* MedicalBeam::particle
protected
G4ThreeVector MedicalBeam::sourcePosition
protected
G4double MedicalBeam::SSD
protected

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