source: trunk/environments/MOMO/MomoHome/src/MomoPrimaryGeneratorAction.cc @ 1358

Last change on this file since 1358 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 3.0 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// This code implementation is the intellectual property of
27// the RD44 GEANT4 collaboration.
28//
29// By copying, distributing or modifying the Program (or any work
30// based on the Program) you indicate your acceptance of this statement,
31// and all its terms.
32//
33
34// 1998 Dec 10, updated for geant4-00 , Hajime Yoshida
35// 2002 March update for geant4.4.0
36
37#include "MomoPrimaryGeneratorAction.hh"
38
39#include "G4Event.hh"
40#include "G4ParticleGun.hh"
41#include "G4UImanager.hh"
42#include "globals.hh"
43
44MomoPrimaryGeneratorAction::MomoPrimaryGeneratorAction()
45{
46  G4int n_particle = 1;
47  particleGun = new G4ParticleGun(n_particle);
48
49  //  G4UImanager* UI = G4UImanager::GetUIpointer();
50  //UI->ApplyCommand("/gun/particle geantino");
51  //UI->ApplyCommand("/gun/energy 1.0 GeV");
52  //UI->ApplyCommand("/gun/position -2.0 0.0 0.0 m");
53}
54
55MomoPrimaryGeneratorAction::~MomoPrimaryGeneratorAction()
56{
57  delete particleGun;
58}
59
60void MomoPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
61{
62  /*
63  G4UImanager* UI = G4UImanager::GetUIpointer();
64  G4int i = anEvent->GetEventID() % 3;
65  switch(i)
66  {
67    case 0:
68      UI->ApplyCommand("/gun/direction 1.0 0.0 0.0");
69      break;
70    case 1:
71      UI->ApplyCommand("/gun/direction 1.0 0.1 0.0");
72      break;
73    case 2:
74      UI->ApplyCommand("/gun/direction 1.0 0.0 0.1");
75      break;
76  }
77  */
78  particleGun->GeneratePrimaryVertex(anEvent);
79}
80
81
Note: See TracBrowser for help on using the repository browser.