Geant4  10.02.p03
G4RayShooter Class Reference

#include <G4RayShooter.hh>

Collaboration diagram for G4RayShooter:

Public Member Functions

 G4RayShooter ()
 
virtual ~G4RayShooter ()
 
void Shoot (G4Event *evt, G4ThreeVector vtx, G4ThreeVector direc)
 

Private Member Functions

void SetInitialValues ()
 

Private Attributes

G4ParticleDefinitionparticle_definition
 
G4ParticleMomentum particle_momentum_direction
 
G4double particle_energy
 
G4ThreeVector particle_position
 
G4double particle_time
 
G4ThreeVector particle_polarization
 

Detailed Description

Definition at line 49 of file G4RayShooter.hh.

Constructor & Destructor Documentation

◆ G4RayShooter()

G4RayShooter::G4RayShooter ( )

Definition at line 39 of file G4RayShooter.cc.

40 {
42 }
void SetInitialValues()
Definition: G4RayShooter.cc:44
Here is the call graph for this function:

◆ ~G4RayShooter()

G4RayShooter::~G4RayShooter ( )
virtual

Definition at line 55 of file G4RayShooter.cc.

56 {
57 }

Member Function Documentation

◆ SetInitialValues()

void G4RayShooter::SetInitialValues ( )
private

Definition at line 44 of file G4RayShooter.cc.

45 {
47  G4ThreeVector zero;
49  particle_energy = 1.0*GeV;
50  particle_position = zero;
51  particle_time = 0.0;
52  particle_polarization = zero;
53 }
G4ThreeVector particle_position
Definition: G4RayShooter.hh:68
G4ThreeVector particle_polarization
Definition: G4RayShooter.hh:70
static const double GeV
Definition: G4SIunits.hh:214
G4double particle_time
Definition: G4RayShooter.hh:69
G4double particle_energy
Definition: G4RayShooter.hh:67
G4ParticleMomentum particle_momentum_direction
Definition: G4RayShooter.hh:66
G4ParticleDefinition * particle_definition
Definition: G4RayShooter.hh:65
G4ThreeVector G4ParticleMomentum
Here is the caller graph for this function:

◆ Shoot()

void G4RayShooter::Shoot ( G4Event evt,
G4ThreeVector  vtx,
G4ThreeVector  direc 
)

Definition at line 59 of file G4RayShooter.cc.

60 {
62  {
64  G4String particleName;
65  particle_definition = particleTable->FindParticle(particleName="geantino");
67  {
68  G4String msg;
69  msg = " G4RayTracer uses geantino to trace the ray, but your physics list does not\n";
70  msg += "define G4Geantino. Please add G4Geantino in your physics list.";
71  G4Exception("G4RayShooter::Shoot","RayTracer001",FatalException,msg);
72  }
73  }
74 
75  // create a new vertex
77 
78  // create new primaries and set them to the vertex
80  G4PrimaryParticle* particle =
82  particle->SetKineticEnergy( particle_energy );
83  particle->SetMass( mass );
84  particle->SetMomentumDirection( direc );
88  vertex->SetPrimary( particle );
89 
90  evt->AddPrimaryVertex( vertex );
91 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ThreeVector particle_polarization
Definition: G4RayShooter.hh:70
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
Definition: G4Event.hh:154
void SetKineticEnergy(G4double eKin)
void SetMass(G4double mas)
G4double particle_time
Definition: G4RayShooter.hh:69
G4double particle_energy
Definition: G4RayShooter.hh:67
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double x() const
static G4ParticleTable * GetParticleTable()
double y() const
void SetMomentumDirection(const G4ThreeVector &p)
double z() const
G4ParticleDefinition * particle_definition
Definition: G4RayShooter.hh:65
void SetPrimary(G4PrimaryParticle *pp)
double G4double
Definition: G4Types.hh:76
void SetPolarization(const G4ThreeVector &pol)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ particle_definition

G4ParticleDefinition* G4RayShooter::particle_definition
private

Definition at line 65 of file G4RayShooter.hh.

◆ particle_energy

G4double G4RayShooter::particle_energy
private

Definition at line 67 of file G4RayShooter.hh.

◆ particle_momentum_direction

G4ParticleMomentum G4RayShooter::particle_momentum_direction
private

Definition at line 66 of file G4RayShooter.hh.

◆ particle_polarization

G4ThreeVector G4RayShooter::particle_polarization
private

Definition at line 70 of file G4RayShooter.hh.

◆ particle_position

G4ThreeVector G4RayShooter::particle_position
private

Definition at line 68 of file G4RayShooter.hh.

◆ particle_time

G4double G4RayShooter::particle_time
private

Definition at line 69 of file G4RayShooter.hh.


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