| [819] | 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: G4DummyFinalState.cc,v 1.2 2007/10/15 08:36:35 pia Exp $
|
|---|
| [961] | 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $
|
|---|
| [819] | 29 | //
|
|---|
| 30 | // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
|---|
| 31 | //
|
|---|
| 32 | // Reference: TNS Geant4-DNA paper
|
|---|
| 33 | // Reference for implementation model: NIM. 155, pp. 145-156, 1978
|
|---|
| 34 |
|
|---|
| 35 | // History:
|
|---|
| 36 | // -----------
|
|---|
| 37 | // Date Name Modification
|
|---|
| 38 | // 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper
|
|---|
| 39 | //
|
|---|
| 40 | // -------------------------------------------------------------------
|
|---|
| 41 |
|
|---|
| 42 | // Class description:
|
|---|
| 43 | // Geant4-DNA dummy final state for test purpose
|
|---|
| 44 | // Further documentation available from http://www.ge.infn.it/geant4/dna
|
|---|
| 45 |
|
|---|
| 46 | // -------------------------------------------------------------------
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | #include "G4DummyFinalState.hh"
|
|---|
| 50 | #include "G4Track.hh"
|
|---|
| 51 | #include "G4Step.hh"
|
|---|
| 52 | #include "G4DynamicParticle.hh"
|
|---|
| 53 |
|
|---|
| 54 | #include "G4ParticleTypes.hh"
|
|---|
| 55 | #include "G4ParticleDefinition.hh"
|
|---|
| 56 | #include "G4Electron.hh"
|
|---|
| 57 | #include "G4SystemOfUnits.hh"
|
|---|
| 58 | #include "G4ParticleMomentum.hh"
|
|---|
| 59 |
|
|---|
| 60 | G4DummyFinalState::G4DummyFinalState()
|
|---|
| 61 | {
|
|---|
| 62 | // These data members will be used in the next implementation iteration,
|
|---|
| 63 | // when the enriched PhysicsModel policy is implemented
|
|---|
| 64 | name = "dummyFinalState";
|
|---|
| 65 | lowEnergyLimit = 7.4 * eV;
|
|---|
| 66 | highEnergyLimit = 10 * MeV;
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | G4DummyFinalState::~G4DummyFinalState()
|
|---|
| 71 | {
|
|---|
| 72 | // empty
|
|---|
| 73 | }
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | const G4FinalStateProduct& G4DummyFinalState::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
|
|---|
| 77 | {
|
|---|
| 78 | // Clear previous secondaries, energy deposit and particle kill status
|
|---|
| 79 | product.Clear();
|
|---|
| 80 |
|
|---|
| 81 | // Create fake final state consisting of one electron product with 1 keV kinetic energy
|
|---|
| 82 |
|
|---|
| 83 | G4double energy = 1. * keV;
|
|---|
| 84 |
|
|---|
| 85 | // Kill incident particle if its energy is too low to create secondary
|
|---|
| 86 | G4double primaryEnergy = track.GetKineticEnergy();
|
|---|
| 87 | if ( primaryEnergy < energy)
|
|---|
| 88 | {
|
|---|
| 89 | product.KillPrimaryParticle();
|
|---|
| 90 | product.AddEnergyDeposit(primaryEnergy);
|
|---|
| 91 | }
|
|---|
| 92 | else
|
|---|
| 93 | {
|
|---|
| 94 | // Create a DynamicParticle
|
|---|
| 95 | G4ParticleDefinition* electron = G4Electron::ElectronDefinition();
|
|---|
| 96 | G4double initX = 0.;
|
|---|
| 97 | G4double initY = 0.;
|
|---|
| 98 | G4double initZ = 1.;
|
|---|
| 99 | G4ParticleMomentum direction(initX,initY,initZ);
|
|---|
| 100 | G4DynamicParticle* dynamicParticle = new G4DynamicParticle(electron,direction,energy);
|
|---|
| 101 | product.AddSecondary(dynamicParticle);
|
|---|
| 102 | }
|
|---|
| 103 |
|
|---|
| 104 | return product;
|
|---|
| 105 | }
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|