[966] | 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 | // $Id: Tst01ParticleGun.hh,v 1.4 2006/06/29 19:31:48 gunter Exp $ |
---|
[1196] | 28 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
[966] | 29 | // |
---|
| 30 | |
---|
| 31 | #ifndef Tst01ParticleGun_h |
---|
| 32 | #define Tst01ParticleGun_h 1 |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | #include "globals.hh" |
---|
| 36 | #include "G4ParticleGun.hh" |
---|
| 37 | #include "G4PrimaryParticle.hh" |
---|
| 38 | #include <vector> |
---|
| 39 | |
---|
| 40 | class G4Event; |
---|
| 41 | class G4DecayProducts; |
---|
| 42 | |
---|
| 43 | class Tst01ParticleGunMessenger; |
---|
| 44 | |
---|
| 45 | class Tst01ParticleGun : public G4ParticleGun |
---|
| 46 | { |
---|
| 47 | public: |
---|
| 48 | Tst01ParticleGun(); |
---|
| 49 | Tst01ParticleGun(G4int numberofparticles); |
---|
| 50 | Tst01ParticleGun(G4ParticleDefinition * particleDef, |
---|
| 51 | G4int numberofparticles = 1); |
---|
| 52 | |
---|
| 53 | public: |
---|
| 54 | virtual ~Tst01ParticleGun(); |
---|
| 55 | Tst01ParticleGun(const Tst01ParticleGun &right); |
---|
| 56 | |
---|
| 57 | const Tst01ParticleGun & operator=(const Tst01ParticleGun &right); |
---|
| 58 | |
---|
| 59 | public: |
---|
| 60 | void GeneratePrimaryVertex(G4Event* evt); |
---|
| 61 | void SetDecayProperTime(G4double t); |
---|
| 62 | void AddDaughter(const G4PrimaryParticle *daughter); |
---|
| 63 | |
---|
| 64 | public: |
---|
| 65 | G4double GetDecayProperTime() const; |
---|
| 66 | |
---|
| 67 | protected: |
---|
| 68 | virtual void SetInitialValues(); |
---|
| 69 | G4double particle_decay_time; |
---|
| 70 | |
---|
| 71 | std::vector<const G4PrimaryParticle*> decay_products; |
---|
| 72 | |
---|
| 73 | private: |
---|
| 74 | Tst01ParticleGunMessenger* theMessenger; |
---|
| 75 | }; |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | inline |
---|
| 79 | void Tst01ParticleGun::SetDecayProperTime(G4double t) |
---|
| 80 | { |
---|
| 81 | particle_decay_time = t; |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | inline |
---|
| 85 | G4double Tst01ParticleGun::GetDecayProperTime() const |
---|
| 86 | { |
---|
| 87 | return particle_decay_time; |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | inline |
---|
| 91 | void Tst01ParticleGun::AddDaughter(const G4PrimaryParticle *daughter) |
---|
| 92 | { |
---|
| 93 | decay_products.push_back(daughter); |
---|
| 94 | } |
---|
| 95 | |
---|
| 96 | #endif |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | |
---|