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

#include <G4RayShooter.hh>

Public Member Functions

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

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{
41 SetInitialValues();
42}

◆ ~G4RayShooter()

G4RayShooter::~G4RayShooter ( )
virtual

Definition at line 55 of file G4RayShooter.cc.

56{
57}

Member Function Documentation

◆ Shoot()

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

Definition at line 59 of file G4RayShooter.cc.

60{
61 if(!particle_definition)
62 {
64 G4String particleName;
65 particle_definition = particleTable->FindParticle(particleName="geantino");
66 if(!particle_definition)
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
76 G4PrimaryVertex* vertex = new G4PrimaryVertex(vtx,particle_time);
77
78 // create new primaries and set them to the vertex
79 G4double mass = particle_definition->GetPDGMass();
80 G4PrimaryParticle* particle =
81 new G4PrimaryParticle(particle_definition);
82 particle->SetKineticEnergy( particle_energy );
83 particle->SetMass( mass );
84 particle->SetMomentumDirection( direc );
85 particle->SetPolarization(particle_polarization.x(),
86 particle_polarization.y(),
87 particle_polarization.z());
88 vertex->SetPrimary( particle );
89
90 evt->AddPrimaryVertex( vertex );
91}
@ FatalException
double G4double
Definition: G4Types.hh:64
double z() const
double x() const
double y() const
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
Definition: G4Event.hh:142
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
void SetPolarization(const G4ThreeVector &pol)
void SetKineticEnergy(G4double eKin)
void SetMomentumDirection(const G4ThreeVector &p)
void SetMass(G4double mas)
void SetPrimary(G4PrimaryParticle *pp)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4TheRayTracer::CreateBitMap().


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