source: trunk/source/geometry/solids/test/fred/include/SprayParticleGun.hh @ 1316

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

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

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//
27// SprayParticleGun.hh
28//
29// Declaration of test particle gun
30//
31// G4ParticleGun unfortunately is not written with enough modularity to
32// inherit. So, this stuff here is written from scratch, but while refering
33// to G4ParticleGun's code.
34//
35
36#ifndef SprayParticleGun_HH
37#define SprayParticleGun_HH
38
39#include "globals.hh"
40#include "G4VPrimaryGenerator.hh"
41#include "G4ThreeVector.hh"
42#include "G4ParticleDefinition.hh"
43#include "G4PrimaryVertex.hh"
44#include "G4ParticleMomentum.hh"
45
46class G4Event;
47class SprayParticleGunMessenger;
48
49class SprayParticleGun : public G4VPrimaryGenerator
50{
51        public:
52        SprayParticleGun();
53        SprayParticleGun( G4ThreeVector start );
54        ~SprayParticleGun();
55       
56        void GeneratePrimaryVertex( G4Event *evt );
57       
58        inline void SetPosition( G4ThreeVector position ) { start = position; }
59        inline G4ThreeVector GetPosition() { return start; }
60       
61        inline void SetXSpray( G4int xSpray ) {spray[0] = xSpray; }
62        inline G4int GetXSpray() { return spray[0]; }
63       
64        inline void SetYSpray( G4int ySpray ) {spray[1] = ySpray; }
65        inline G4int GetYSpray() { return spray[1]; }
66       
67        inline void SetZSpray( G4int zSpray ) {spray[2] = zSpray; }
68        inline G4int GetZSpray() { return spray[2]; }
69       
70       
71        private:
72        void SetDefaults();
73
74        protected:
75        G4int spray[3];
76        G4ThreeVector start;
77        G4ParticleDefinition  *particleType;
78
79        private:
80        SprayParticleGunMessenger       *messenger;
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.