Introduction to GEANT4

From UCL HEP PBT Wiki

Jump to: navigation, search
m
m
Line 431: Line 431:
<u> Simple example of <span style="color:#ff0000"> MyPrimaryGeneratorAction </span> using general particle source </u>:
<u> Simple example of <span style="color:#ff0000"> MyPrimaryGeneratorAction </span> using general particle source </u>:
 +
 +
<span style="color:#800000"> class MyPrimaryGeneratorAction:public G4VUserPrimaryGeneratorAction { </span>
 +
 +
<span style="color:#800000"> public: </span>
 +
 +
<span style="color:#800000"> MyPrimaryGeneratorAction(); </span>   
 +
 +
<span style="color:#800000"> ~MyPrimaryGeneratorAction(); </span>
 +
 +
<span style="color:#800000"> virtual void GeneratePrimaries(G4Event*); </span>
 +
 +
 +
<span style="color:#800000"> private: </span>
 +
 +
<span style="color:#800000"> static const G4String fgkDefaultParticleName; </span>
 +
 +
<span style="color:#800000"> static const G4double fgkDefaultEnergy; </span>
 +
 +
<span style="color:#800000"> G4GeneralParticleSource*  fGeneralParticleSource; }; </span>
== <span style="color:#000080"> Optional user classes </span> ==
== <span style="color:#000080"> Optional user classes </span> ==

Revision as of 12:07, 8 July 2014

Personal tools