| 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: G4gspart.cc,v 1.7 2006/06/29 18:14:40 gunter Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-03 $
|
|---|
| 29 | //
|
|---|
| 30 | #include "G4ProcessManager.hh"
|
|---|
| 31 | #include "G3toG4.hh"
|
|---|
| 32 | #include "G3PartTable.hh"
|
|---|
| 33 |
|
|---|
| 34 | void PG4gspart(G4String tokens[])
|
|---|
| 35 | {
|
|---|
| 36 | // fill the parameter containers
|
|---|
| 37 | G3fillParams(tokens,PTgspart);
|
|---|
| 38 |
|
|---|
| 39 | // interpret the parameters
|
|---|
| 40 | G4String chnpar = Spar[0];
|
|---|
| 41 | G4int ipart = Ipar[0];
|
|---|
| 42 | G4int itrtyp = Ipar[1];
|
|---|
| 43 | G4int nwb = Ipar[2];
|
|---|
| 44 | G4double amass = Rpar[0];
|
|---|
| 45 | G4double charge = Rpar[1];
|
|---|
| 46 | G4double tlife = Rpar[2];
|
|---|
| 47 | G4double *ubuf = &Rpar[3];
|
|---|
| 48 |
|
|---|
| 49 | G4gspart(ipart,chnpar,itrtyp,amass,charge,tlife,ubuf,nwb);
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | void G4gspart(G4int, G4String, G4int, G4double,
|
|---|
| 53 | G4double, G4double, G4double*, G4int)
|
|---|
| 54 | {
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | #ifdef OMIT_CODE
|
|---|
| 58 | void G4gspart(G4int ipart, G4String chnpar, G4int itrtyp, G4double amass,
|
|---|
| 59 | G4double charge, G4double tlife, G4double*, G4int)
|
|---|
| 60 | {
|
|---|
| 61 | // Handle conversion of itrtyp into an appropriate ProcessManager
|
|---|
| 62 | G4ProcessManager *mgr = 0;
|
|---|
| 63 | switch (itrtyp) {
|
|---|
| 64 | case 1:
|
|---|
| 65 | // gamma
|
|---|
| 66 | // $$$ mgr = gammaProcessManager;
|
|---|
| 67 | break;
|
|---|
| 68 | case 2:
|
|---|
| 69 | // electron
|
|---|
| 70 | // $$$ mgr = electronProcessManager;
|
|---|
| 71 | break;
|
|---|
| 72 | case 3:
|
|---|
| 73 | // neutron
|
|---|
| 74 | // $$$ mgr = neutronProcessManager;
|
|---|
| 75 | break;
|
|---|
| 76 | case 4:
|
|---|
| 77 | // hadron
|
|---|
| 78 | // $$$ mgr = hadronProcessManager;
|
|---|
| 79 | break;
|
|---|
| 80 | case 5:
|
|---|
| 81 | // muon
|
|---|
| 82 | // $$$ mgr = muonProcessManager;
|
|---|
| 83 | break;
|
|---|
| 84 | case 6:
|
|---|
| 85 | // geantino
|
|---|
| 86 | // $$$ mgr = geantinoProcessManager;
|
|---|
| 87 | break;
|
|---|
| 88 | case 7:
|
|---|
| 89 | // heavy ion
|
|---|
| 90 | // $$$ mgr = heavyIonProcessManager;
|
|---|
| 91 | break;
|
|---|
| 92 | case 8:
|
|---|
| 93 | // light ion
|
|---|
| 94 | // $$$ mgr = lightIonProcessManager;
|
|---|
| 95 | break;
|
|---|
| 96 | default:
|
|---|
| 97 | // $$$ mgr = theProcessManager;
|
|---|
| 98 | break;
|
|---|
| 99 | }
|
|---|
| 100 |
|
|---|
| 101 | // Create the particle; provide parameters and a process mgr.
|
|---|
| 102 | G4ParticleDefinition *part = new G4ParticleDefinition(chnpar);
|
|---|
| 103 | part->SetProcessManager(mgr);
|
|---|
| 104 | part->SetPDGMass(amass);
|
|---|
| 105 | part->SetPDGCharge(charge);
|
|---|
| 106 | part->SetPDGLifeTime(tlife);
|
|---|
| 107 |
|
|---|
| 108 | // add to particle table
|
|---|
| 109 | G3Part.put(&ipart, part);
|
|---|
| 110 | }
|
|---|
| 111 | #endif
|
|---|