LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pyG4Isotope.cc
Go to the documentation of this file.
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 // pyG4Isotope.cc
28 //
29 // 2005 Q
30 // ====================================================================
31 #include <boost/python.hpp>
32 #include "G4Version.hh"
33 #include "pyG4indexing.hh"
34 #include "G4Isotope.hh"
35 
36 using namespace boost::python;
37 
38 // ====================================================================
39 // thin wrappers
40 // ====================================================================
41 namespace pyG4Isotope {
42 
43 BOOST_PYTHON_FUNCTION_OVERLOADS(f_GetIsotope, G4Isotope::GetIsotope, 1, 2)
44 
45 // copy constructor is private, so ...
46 void Print(G4Isotope& iso)
47 {
48  G4cout << iso;
49 }
50 
51 }
52 
53 using namespace pyG4Isotope;
54 
55 // ====================================================================
56 // module definition
57 // ====================================================================
59 {
60  class_<G4Isotope, G4Isotope*, boost::noncopyable>
61  ("G4Isotope", "isotope class", no_init)
62  // constructors
63  .def(init<const G4String&, G4int, G4int>())
64  .def(init<const G4String&, G4int, G4int, G4double>())
65  // ---
66  .def("GetName", &G4Isotope::GetName,
67  return_value_policy<reference_existing_object>())
68  .def("SetName", &G4Isotope::SetName)
69  .def("GetZ", &G4Isotope::GetZ)
70  .def("GetN", &G4Isotope::GetN)
71  .def("GetA", &G4Isotope::GetA)
72  .def("GetIsotope", &G4Isotope::GetIsotope,
73  f_GetIsotope()
74  [return_value_policy<reference_existing_object>()])
75  .staticmethod("GetIsotope")
76  .def("GetIsotopeTable", &G4Isotope::GetIsotopeTable,
77  return_value_policy<reference_existing_object>())
78  .staticmethod("GetIsotopeTable")
79  .def("GetNumberOfIsotopes", &G4Isotope::GetNumberOfIsotopes)
80  .staticmethod("GetNumberOfIsotopes")
81 
82  .def("GetIndex", &G4Isotope::GetIndex)
83  // ---
84  .def("Print", Print)
85  .def(self == self)
86  .def(self != self)
87  ;
88 
89  // G4IsotopeTable
90  class_<G4IsotopeTable> ("G4IsotopeTable", "isotope table")
92  .def(self_ns::str(self))
93  ;
94 }
BOOST_PYTHON_FUNCTION_OVERLOADS(f_func2, func2, 1, 2)
void Print(G4Isotope &iso)
Definition: pyG4Isotope.cc:46
void export_G4Isotope()
Definition: pyG4Isotope.cc:58