LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pyG4UnitsTable.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 // pyG4UnitsTable.cc
28 //
29 // 2005 Q
30 // ====================================================================
31 #include <boost/python.hpp>
32 #include "pyG4indexing.hh"
33 #include "G4UnitsTable.hh"
34 
35 using namespace boost::python;
36 
37 // ====================================================================
38 // module definition
39 // ====================================================================
41 {
42  class_<G4UnitsTable>("G4UnitsTable", "Units Table")
44  ;
45 
46  class_<G4UnitsContainer>("G4UnitsContainer", "Units Container")
48  ;
49 
50  class_<G4UnitDefinition, boost::noncopyable>
51  ("G4UnitDefinition", "Unit Definition", no_init)
52  .def(init<const G4String&, const G4String&, const G4String&, G4double>())
53  // ---
54  .def("GetName", &G4UnitDefinition::GetName,
55  return_value_policy<return_by_value>())
56  .def("GetSymbol", &G4UnitDefinition::GetSymbol,
57  return_value_policy<return_by_value>())
58  .def("GetValue", &G4UnitDefinition::GetValue)
59  .def("PrintDefinition", &G4UnitDefinition::PrintDefinition)
60  // ---
61  .def("BuildUnitsTable", &G4UnitDefinition::BuildUnitsTable)
62  .staticmethod("BuildUnitsTable")
63  .def("PrintUnitsTable", &G4UnitDefinition::PrintUnitsTable)
64  .staticmethod("PrintUnitsTable")
65  .def("GetUnitsTable", &G4UnitDefinition::GetUnitsTable,
66  return_value_policy<reference_existing_object>())
67  .staticmethod("GetUnitsTable")
68  // ---
69  .def("GetValueOf", &G4UnitDefinition::GetValueOf)
70  .staticmethod("GetValueOf")
71  .def("GetCategory", &G4UnitDefinition::GetCategory)
72  .staticmethod("GetCategory")
73  ;
74 
75  class_<G4UnitsCategory, boost::noncopyable>
76  ("G4UnitsCategory", "Units Category", no_init)
77  .def(init<const G4String&>())
78  // ---
79  .def("GetName", &G4UnitsCategory::GetName,
80  return_value_policy<return_by_value>())
81  .def("GetUnitsList", &G4UnitsCategory::GetUnitsList,
82  return_value_policy<reference_existing_object>())
83  .def("GetNameMxLen", &G4UnitsCategory::GetNameMxLen)
84  .def("GetSymbMxLen", &G4UnitsCategory::GetSymbMxLen)
85  .def("UpdateNameMxLen", &G4UnitsCategory::UpdateNameMxLen)
86  .def("UpdateSymbMxLen", &G4UnitsCategory::UpdateSymbMxLen)
87  .def("PrintCategory", &G4UnitsCategory::PrintCategory)
88  ;
89 
90  class_<G4BestUnit>("G4BestUnit", "present best unit", no_init)
91  .def(init<G4double, const G4String&>())
92  .def(init<const G4ThreeVector&, const G4String&>())
93  // ---
94  .def("GetCategory", &G4BestUnit::GetCategory,
95  return_value_policy<return_by_value>())
96  .def("GetIndexOfCategory", &G4BestUnit::GetIndexOfCategory)
97  .def(self_ns::str(self))
98  ;
99 
100 }
101 
void export_G4UnitsTable()