Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MedicalBeam Class Reference

#include <MedicalBeam.hh>

Inheritance diagram for MedicalBeam:
Collaboration diagram for MedicalBeam:

Public Types

enum  FieldShape {
  SQUARE =0, CIRCLE, kSQUARE =0, kCIRCLE,
  kSQUARE =0, kCIRCLE
}
 
enum  FieldShape {
  SQUARE =0, CIRCLE, kSQUARE =0, kCIRCLE,
  kSQUARE =0, kCIRCLE
}
 
enum  FieldShape {
  SQUARE =0, CIRCLE, kSQUARE =0, kCIRCLE,
  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)
 
 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 MedicalBeam.hh.

Member Enumeration Documentation

Enumerator
SQUARE 
CIRCLE 
kSQUARE 
kCIRCLE 
kSQUARE 
kCIRCLE 

Definition at line 42 of file MedicalBeam.hh.

Enumerator
SQUARE 
CIRCLE 
kSQUARE 
kCIRCLE 
kSQUARE 
kCIRCLE 

Definition at line 42 of file MedicalBeam.hh.

Enumerator
SQUARE 
CIRCLE 
kSQUARE 
kCIRCLE 
kSQUARE 
kCIRCLE 

Definition at line 48 of file MedicalBeam.hh.

Constructor & Destructor Documentation

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

Definition at line 49 of file MedicalBeam.cc.

50  : particle(0),
51  kineticE(1.*MeV),
53  SSD(1.*m),
55  fieldR(10.*cm)
57 {
58  fieldXY[0]= fieldXY[1]= 10.*cm;
59 }
G4ThreeVector sourcePosition
Definition: MedicalBeam.hh:53
FieldShape fieldShape
Definition: MedicalBeam.hh:56
CLHEP::Hep3Vector G4ThreeVector
static constexpr double m
Definition: G4SIunits.hh:129
static constexpr double cm
Definition: G4SIunits.hh:119
G4double fieldXY[2]
Definition: MedicalBeam.hh:57
G4double kineticE
Definition: MedicalBeam.hh:52
G4double SSD
Definition: MedicalBeam.hh:55
static constexpr double MeV
Definition: G4SIunits.hh:214
G4ParticleDefinition * particle
Definition: MedicalBeam.hh:51
G4double fieldR
Definition: MedicalBeam.hh:58
MedicalBeam::~MedicalBeam ( )

Definition at line 63 of file MedicalBeam.cc.

65 {
66 }

Member Function Documentation

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

Implements G4VUserPrimaryGeneratorAction.

Definition at line 112 of file MedicalBeam.cc.

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 }
G4ThreeVector sourcePosition
Definition: MedicalBeam.hh:53
double x() const
G4ThreeVector GenerateBeamDirection() const
const char * p
Definition: xmltok.h:285
double z() const
G4double kineticE
Definition: MedicalBeam.hh:52
double y() const
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
G4ParticleDefinition * particle
Definition: MedicalBeam.hh:51
#define ns
Definition: xmlparse.cc:614

Here is the call graph for this function:

virtual void MedicalBeam::GeneratePrimaries ( G4Event anEvent)
virtual
G4double MedicalBeam::GetFieldR ( ) const
G4double MedicalBeam::GetFieldR ( ) const
G4double MedicalBeam::GetFieldR ( ) const
inline

Definition at line 140 of file MedicalBeam.hh.

141 { return fieldR; }
G4double fieldR
Definition: MedicalBeam.hh:58

Here is the caller graph for this function:

FieldShape MedicalBeam::GetFieldShape ( ) const
FieldShape MedicalBeam::GetFieldShape ( ) const
MedicalBeam::FieldShape MedicalBeam::GetFieldShape ( ) const
inline

Definition at line 119 of file MedicalBeam.hh.

120 { return fieldShape; }
FieldShape fieldShape
Definition: MedicalBeam.hh:56

Here is the caller graph for this function:

G4double MedicalBeam::GetFieldX ( ) const
G4double MedicalBeam::GetFieldX ( ) const
G4double MedicalBeam::GetFieldX ( ) const
inline

Definition at line 131 of file MedicalBeam.hh.

132 { return fieldXY[0]; }
G4double fieldXY[2]
Definition: MedicalBeam.hh:57

Here is the caller graph for this function:

G4double MedicalBeam::GetFieldY ( ) const
G4double MedicalBeam::GetFieldY ( ) const
G4double MedicalBeam::GetFieldY ( ) const
inline

Definition at line 134 of file MedicalBeam.hh.

135 { return fieldXY[1]; }
G4double fieldXY[2]
Definition: MedicalBeam.hh:57

Here is the caller graph for this function:

G4double MedicalBeam::GetKineticE ( ) const
G4double MedicalBeam::GetKineticE ( ) const
G4double MedicalBeam::GetKineticE ( ) const
inline

Definition at line 107 of file MedicalBeam.hh.

108 { return kineticE; }
G4double kineticE
Definition: MedicalBeam.hh:52

Here is the caller graph for this function:

const G4ParticleDefinition* MedicalBeam::GetParticleDefinition ( ) const
const G4ParticleDefinition* MedicalBeam::GetParticleDefinition ( ) const
const G4ParticleDefinition * MedicalBeam::GetParticleDefinition ( ) const
inline

Definition at line 101 of file MedicalBeam.hh.

102 { return particle; }
G4ParticleDefinition * particle
Definition: MedicalBeam.hh:51
G4ThreeVector MedicalBeam::GetSourcePosition ( ) const
G4ThreeVector MedicalBeam::GetSourcePosition ( ) const
G4ThreeVector MedicalBeam::GetSourcePosition ( ) const
inline

Definition at line 113 of file MedicalBeam.hh.

114 { return sourcePosition; }
G4ThreeVector sourcePosition
Definition: MedicalBeam.hh:53

Here is the caller graph for this function:

G4double MedicalBeam::GetSSD ( ) const
G4double MedicalBeam::GetSSD ( ) const
G4double MedicalBeam::GetSSD ( ) const
inline

Definition at line 125 of file MedicalBeam.hh.

126 { return SSD; }
G4double SSD
Definition: MedicalBeam.hh:55

Here is the caller graph for this function:

void MedicalBeam::SetFieldR ( G4double  r)
void MedicalBeam::SetFieldR ( G4double  r)
void MedicalBeam::SetFieldR ( G4double  r)
inline

Definition at line 137 of file MedicalBeam.hh.

138 { fieldR= r; }
G4double fieldR
Definition: MedicalBeam.hh:58

Here is the caller graph for this function:

void MedicalBeam::SetFieldShape ( FieldShape  shape)
void MedicalBeam::SetFieldShape ( FieldShape  shape)
void MedicalBeam::SetFieldShape ( MedicalBeam::FieldShape  shape)
inline

Definition at line 116 of file MedicalBeam.hh.

117 { fieldShape= shape; }
FieldShape fieldShape
Definition: MedicalBeam.hh:56

Here is the caller graph for this function:

void MedicalBeam::SetFieldXY ( G4double  fx,
G4double  fy 
)
void MedicalBeam::SetFieldXY ( G4double  fx,
G4double  fy 
)
void MedicalBeam::SetFieldXY ( G4double  fx,
G4double  fy 
)
inline

Definition at line 128 of file MedicalBeam.hh.

129 { fieldXY[0]= fx; fieldXY[1]= fy; }
G4double fieldXY[2]
Definition: MedicalBeam.hh:57
void MedicalBeam::SetKineticE ( G4double  e)
void MedicalBeam::SetKineticE ( G4double  e)
void MedicalBeam::SetKineticE ( G4double  e)
inline

Definition at line 104 of file MedicalBeam.hh.

105 { kineticE= e; }
G4double kineticE
Definition: MedicalBeam.hh:52

Here is the caller graph for this function:

void MedicalBeam::SetParticleDefinition ( G4ParticleDefinition pd)
void MedicalBeam::SetParticleDefinition ( G4ParticleDefinition pd)
void MedicalBeam::SetParticleDefinition ( G4ParticleDefinition pd)
inline

Definition at line 98 of file MedicalBeam.hh.

99 { particle= pd; }
G4ParticleDefinition * particle
Definition: MedicalBeam.hh:51
void MedicalBeam::SetSourcePosition ( const G4ThreeVector pos)
void MedicalBeam::SetSourcePosition ( const G4ThreeVector pos)
void MedicalBeam::SetSourcePosition ( const G4ThreeVector pos)
inline

Definition at line 110 of file MedicalBeam.hh.

111 { sourcePosition= pos; }
G4ThreeVector sourcePosition
Definition: MedicalBeam.hh:53
static const G4double pos

Here is the caller graph for this function:

void MedicalBeam::SetSSD ( G4double  ssd)
void MedicalBeam::SetSSD ( G4double  ssd)
void MedicalBeam::SetSSD ( G4double  ssd)
inline

Definition at line 122 of file MedicalBeam.hh.

123 { SSD= ssd; }
G4double SSD
Definition: MedicalBeam.hh:55

Here is the caller graph for this function:

Member Data Documentation

G4double MedicalBeam::fieldR
protected

Definition at line 58 of file MedicalBeam.hh.

FieldShape MedicalBeam::fieldShape
protected

Definition at line 56 of file MedicalBeam.hh.

G4double MedicalBeam::fieldXY[2]
protected

Definition at line 57 of file MedicalBeam.hh.

G4double MedicalBeam::kineticE
protected

Definition at line 52 of file MedicalBeam.hh.

G4ParticleDefinition* MedicalBeam::particle
protected

Definition at line 51 of file MedicalBeam.hh.

G4ThreeVector MedicalBeam::sourcePosition
protected

Definition at line 53 of file MedicalBeam.hh.

G4double MedicalBeam::SSD
protected

Definition at line 55 of file MedicalBeam.hh.


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