Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ( )

Definition at line 39 of file G4RayShooter.cc.

40 {
41  SetInitialValues();
42 }
G4RayShooter::~G4RayShooter ( )
virtual

Definition at line 55 of file G4RayShooter.cc.

56 {
57 }

Member Function Documentation

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 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
double x() const
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
Definition: G4Event.hh:154
double z() const
void SetKineticEnergy(G4double eKin)
void SetMass(G4double mas)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
void SetMomentumDirection(const G4ThreeVector &p)
double y() const
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:


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