Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,55 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: ExN01PrimaryGeneratorAction.cc,v 1.1 1998/11/14 20:52:45 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN01PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4UImanager.hh"
#include "globals.hh"
ExN01PrimaryGeneratorAction::ExN01PrimaryGeneratorAction()
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
G4UImanager* UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/gun/particle geantino");
UI->ApplyCommand("/gun/energy 1.0 GeV");
UI->ApplyCommand("/gun/position -2.0 0.0 0.0 m");
}
ExN01PrimaryGeneratorAction::~ExN01PrimaryGeneratorAction()
{
delete particleGun;
}
void ExN01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
G4UImanager* UI = G4UImanager::GetUIpointer();
G4int i = anEvent->GetEventID() % 3;
switch(i)
{
case 0:
UI->ApplyCommand("/gun/direction 1.0 0.0 0.0");
break;
case 1:
UI->ApplyCommand("/gun/direction 1.0 0.1 0.0");
break;
case 2:
UI->ApplyCommand("/gun/direction 1.0 0.0 0.1");
break;
}
particleGun->GeneratePrimaryVertex(anEvent);
}