source: trunk/environments/g4py/source/run/pyG4VUserPhysicsList.cc @ 1337

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 5.4 KB
Line 
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: pyG4VUserPhysicsList.cc,v 1.5 2006/06/29 15:35:30 gunter Exp $
27// $Name: geant4-09-04-beta-01 $
28// ====================================================================
29//   pyG4VUserPhysicsList.cc
30//
31//                                         2005 Q
32// ====================================================================
33#include <boost/python.hpp>
34#include "G4VUserPhysicsList.hh"
35
36using namespace boost::python;
37
38// ====================================================================
39// thin wrappers
40// ====================================================================
41namespace pyG4VUserPhysicsList {
42
43struct CB_G4VUserPhysicsList :
44  G4VUserPhysicsList, wrapper<G4VUserPhysicsList> {
45
46  void ConstructParticle() {
47    get_override("ConstructParticle")();
48  }
49
50  void ConstructProcess() {
51    get_override("ConstructProcess")();
52  }
53
54  void SetCuts() {
55    get_override("SetCuts")();
56  }
57};
58
59// SetCutValue
60void (G4VUserPhysicsList::*f1_SetCutValue)(G4double, const G4String&)
61  = &G4VUserPhysicsList::SetCutValue;
62void (G4VUserPhysicsList::*f2_SetCutValue)(G4double, const G4String&,
63                                           const G4String&)
64  = &G4VUserPhysicsList::SetCutValue;
65
66// StorePhysicsTable
67BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_StorePhysicsTable,
68                                       StorePhysicsTable, 0, 1);
69// SetParticleCuts
70BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetParticleCuts,
71                                       SetParticleCuts, 2, 3);
72
73}
74
75using namespace pyG4VUserPhysicsList;
76
77// ====================================================================
78// module definition
79// ====================================================================
80void export_G4VUserPhysicsList()
81{
82  class_<CB_G4VUserPhysicsList, CB_G4VUserPhysicsList*, boost::noncopyable>
83    ("G4VUserPhysicsList", "base class of user physics list")
84    // ---
85    .def("ConstructParticle",
86         pure_virtual(&G4VUserPhysicsList::ConstructParticle))
87    .def("ConstructProcess",
88         pure_virtual(&G4VUserPhysicsList::ConstructProcess))
89    .def("SetCuts",
90         pure_virtual(&G4VUserPhysicsList::SetCuts))
91    // ---
92    .def("SetDefaultCutValue",    &G4VUserPhysicsList::SetDefaultCutValue)
93    .def("GetDefaultCutValue",    &G4VUserPhysicsList::GetDefaultCutValue)
94    // ---
95    .def("StorePhysicsTable",     &G4VUserPhysicsList::StorePhysicsTable,
96         f_StorePhysicsTable())
97    .def("IsPhysicsTableRetrieved", 
98         &G4VUserPhysicsList::IsPhysicsTableRetrieved)
99    .def("IsStoredInAscii",       &G4VUserPhysicsList::IsStoredInAscii)
100    .def("GetPhysicsTableDirectory", 
101         &G4VUserPhysicsList::GetPhysicsTableDirectory,
102         return_value_policy<return_by_value>())
103    .def("SetStoredInAscii",      &G4VUserPhysicsList::SetStoredInAscii)
104    .def("ResetStoredInAscii",    &G4VUserPhysicsList::ResetStoredInAscii)
105    // ---
106    .def("DumpList",              &G4VUserPhysicsList::DumpList)
107
108    .def("DumpCutValuesTable",    &G4VUserPhysicsList::DumpCutValuesTable)
109    .def("DumpCutValuesTableIfRequested", 
110         &G4VUserPhysicsList::DumpCutValuesTableIfRequested)
111    .def("SetCutValue",           f1_SetCutValue)
112    .def("SetCutValue",           f2_SetCutValue)
113    .def("SetParticleCuts",       &G4VUserPhysicsList::SetParticleCuts,
114         f_SetParticleCuts())
115    // ---
116    .def("SetVerboseLevel",       &G4VUserPhysicsList::SetVerboseLevel)
117    .def("GetVerboseLevel",       &G4VUserPhysicsList::GetVerboseLevel)
118    .def("SetCutsWithDefault",    &G4VUserPhysicsList::SetCutsWithDefault)
119    .def("SetCutsForRegion",      &G4VUserPhysicsList::SetCutsForRegion)
120    .def("GetApplyCuts",          &G4VUserPhysicsList::GetApplyCuts)
121    ;
122
123  // Note that exposed items are limited,
124  // because this class object is mainly for internal uses or obsolete.
125  // Construct
126  // BuildPhysicsTable
127  // PreparePhysicsTable
128  // SetPhysicsTableRetrieved
129  // ReSetPhysicsTableRetrieved
130  // SetApplyCuts
131  // DumpCutValues (obsolete)
132  // ResetCuts;
133}
Note: See TracBrowser for help on using the repository browser.