[1337] | 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 | // $Id: pyG4ParticleDefinition.cc,v 1.6 2008/03/13 07:32:18 kmura Exp $ |
---|
| 27 | // $Name: geant4-09-04-beta-01 $ |
---|
| 28 | // ==================================================================== |
---|
| 29 | // pyG4ParticleDefinition.cc |
---|
| 30 | // |
---|
| 31 | // 2005 Q |
---|
| 32 | // ==================================================================== |
---|
| 33 | #include <boost/python.hpp> |
---|
| 34 | #include "G4Version.hh" |
---|
| 35 | #include "G4ParticleDefinition.hh" |
---|
| 36 | #include "G4ParticleTable.hh" |
---|
| 37 | #include "G4DecayTable.hh" |
---|
| 38 | #include "G4ProcessManager.hh" |
---|
| 39 | |
---|
| 40 | using namespace boost::python; |
---|
| 41 | |
---|
| 42 | // ==================================================================== |
---|
| 43 | // module definition |
---|
| 44 | // ==================================================================== |
---|
| 45 | void export_G4ParticleDefinition() |
---|
| 46 | { |
---|
| 47 | class_<G4ParticleDefinition, G4ParticleDefinition*, boost::noncopyable> |
---|
| 48 | ("G4ParticleDefinition", "particle definition", no_init) |
---|
| 49 | // --- |
---|
| 50 | .def("GetParticleName", &G4ParticleDefinition::GetParticleName, |
---|
| 51 | return_value_policy<return_by_value>()) |
---|
| 52 | .def("GetPDGMass", &G4ParticleDefinition::GetPDGMass) |
---|
| 53 | .def("GetPDGWidth", &G4ParticleDefinition::GetPDGWidth) |
---|
| 54 | .def("GetPDGCharge", &G4ParticleDefinition::GetPDGCharge) |
---|
| 55 | .def("GetPDGSpin", &G4ParticleDefinition::GetPDGSpin) |
---|
| 56 | .def("GetPDGiSpin", &G4ParticleDefinition::GetPDGiSpin) |
---|
| 57 | .def("GetPDGiParity", &G4ParticleDefinition::GetPDGiParity) |
---|
| 58 | .def("GetPDGiConjugation", &G4ParticleDefinition::GetPDGiConjugation) |
---|
| 59 | .def("GetPDGIsospin", &G4ParticleDefinition::GetPDGIsospin) |
---|
| 60 | .def("GetPDGIsospin3", &G4ParticleDefinition::GetPDGIsospin3) |
---|
| 61 | .def("GetPDGiIsospin", &G4ParticleDefinition::GetPDGiIsospin) |
---|
| 62 | .def("GetPDGiIsospin3", &G4ParticleDefinition::GetPDGiIsospin3) |
---|
| 63 | .def("GetPDGiGParity", &G4ParticleDefinition::GetPDGiGParity) |
---|
| 64 | .def("GetParticleType", &G4ParticleDefinition::GetParticleType, |
---|
| 65 | return_value_policy<return_by_value>()) |
---|
| 66 | .def("GetParticleSubType", &G4ParticleDefinition::GetParticleSubType, |
---|
| 67 | return_value_policy<return_by_value>()) |
---|
| 68 | .def("GetLeptonNumber", &G4ParticleDefinition::GetLeptonNumber) |
---|
| 69 | .def("GetBaryonNumber", &G4ParticleDefinition::GetBaryonNumber) |
---|
| 70 | .def("GetPDGEncoding", &G4ParticleDefinition::GetPDGEncoding) |
---|
| 71 | .def("GetAntiPDGEncoding", &G4ParticleDefinition::GetAntiPDGEncoding) |
---|
| 72 | .def("GetQuarkContent", &G4ParticleDefinition::GetQuarkContent) |
---|
| 73 | .def("GetAntiQuarkContent",&G4ParticleDefinition::GetAntiQuarkContent) |
---|
| 74 | .def("IsShortLived", &G4ParticleDefinition::IsShortLived) |
---|
| 75 | .def("GetPDGStable", &G4ParticleDefinition::GetPDGStable) |
---|
| 76 | .def("SetPDGStable", &G4ParticleDefinition::SetPDGStable) |
---|
| 77 | .def("GetPDGLifeTime", &G4ParticleDefinition::GetPDGLifeTime) |
---|
| 78 | .def("SetPDGLifeTime", &G4ParticleDefinition::SetPDGLifeTime) |
---|
| 79 | .def("GetDecayTable", &G4ParticleDefinition::GetDecayTable, |
---|
| 80 | return_internal_reference<>()) |
---|
| 81 | .def("SetDecayTable", &G4ParticleDefinition::SetDecayTable) |
---|
| 82 | .def("GetProcessManager", &G4ParticleDefinition::GetProcessManager, |
---|
| 83 | return_internal_reference<>()) |
---|
| 84 | .def("SetProcessManager", &G4ParticleDefinition::SetProcessManager) |
---|
| 85 | // cludge!! (G4ParticleTable object is sigleton!!) |
---|
| 86 | .def("GetParticleTable", &G4ParticleDefinition::GetParticleTable, |
---|
| 87 | return_value_policy<reference_existing_object>()) |
---|
| 88 | .def("DumpTable", &G4ParticleDefinition::DumpTable) |
---|
| 89 | #if G4VERSION_NUMBER >= 701 |
---|
| 90 | .def("GetAtomicNumber", &G4ParticleDefinition::GetAtomicNumber) |
---|
| 91 | .def("GetAtomicMass", &G4ParticleDefinition::GetAtomicMass) |
---|
| 92 | #endif |
---|
| 93 | .def("SetVerboseLevel", &G4ParticleDefinition::SetVerboseLevel) |
---|
| 94 | .def("GetVerboseLevel", &G4ParticleDefinition::GetVerboseLevel) |
---|
| 95 | .def("SetApplyCutsFlag", &G4ParticleDefinition::SetApplyCutsFlag) |
---|
| 96 | .def("GetApplyCutsFlag", &G4ParticleDefinition::GetApplyCutsFlag) |
---|
| 97 | ; |
---|
| 98 | } |
---|
| 99 | |
---|