CMS 3D CMS Logo

VisG4ExampleGenerator Class Reference

#include <VisExamples/VisG4ExN02/src/VisG4ExampleGenerator.h>

List of all members.

Public Member Functions

virtual void GeneratePrimaries (G4Event *event)
 VisG4ExampleGenerator (VisG4ExampleDetector *detector)
 ~VisG4ExampleGenerator (void)

Private Attributes

VisG4ExampleDetectorm_detector
G4ParticleGun * m_gun


Detailed Description

Definition at line 20 of file VisG4ExampleGenerator.h.


Constructor & Destructor Documentation

VisG4ExampleGenerator::VisG4ExampleGenerator ( VisG4ExampleDetector detector  ) 

Definition at line 20 of file VisG4ExampleGenerator.cc.

References m_gun, and p.

00021     : m_detector (detector),
00022       m_gun (new G4ParticleGun (1))
00023 {
00024     G4ParticleTable             *pt = G4ParticleTable::GetParticleTable ();
00025     G4ParticleDefinition        *p = pt->FindParticle ("proton");
00026 
00027     m_gun->SetParticleDefinition (p);
00028     m_gun->SetParticleMomentumDirection (G4ThreeVector (0, 0, 1));
00029     m_gun->SetParticleEnergy (3. * GeV);
00030 }

VisG4ExampleGenerator::~VisG4ExampleGenerator ( void   ) 

Definition at line 32 of file VisG4ExampleGenerator.cc.

References m_gun.

00033 { delete m_gun; }


Member Function Documentation

void VisG4ExampleGenerator::GeneratePrimaries ( G4Event *  event  )  [virtual]

Definition at line 36 of file VisG4ExampleGenerator.cc.

References VisG4ExampleDetector::fullLength(), m_detector, and m_gun.

00037 {
00038     m_gun->SetParticlePosition
00039         (G4ThreeVector (0, 0, -m_detector->fullLength ()/2));
00040     m_gun->GeneratePrimaryVertex (event);
00041 }


Member Data Documentation

VisG4ExampleDetector* VisG4ExampleGenerator::m_detector [private]

Definition at line 32 of file VisG4ExampleGenerator.h.

Referenced by GeneratePrimaries().

G4ParticleGun* VisG4ExampleGenerator::m_gun [private]

Definition at line 33 of file VisG4ExampleGenerator.h.

Referenced by GeneratePrimaries(), VisG4ExampleGenerator(), and ~VisG4ExampleGenerator().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:24 2009 for CMSSW by  doxygen 1.5.4