LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
pyG4VUserPhysicsList.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 // $Id: pyG4VUserPhysicsList.cc 76884 2013-11-18 12:54:03Z gcosmo $
27 // ====================================================================
28 // pyG4VUserPhysicsList.cc
29 //
30 // 2005 Q
31 // ====================================================================
32 #include <boost/python.hpp>
33 #include "G4VUserPhysicsList.hh"
34 
35 using namespace boost::python;
36 
37 // ====================================================================
38 // thin wrappers
39 // ====================================================================
41 
43  G4VUserPhysicsList, wrapper<G4VUserPhysicsList> {
44 
46  get_override("ConstructParticle")();
47  }
48 
50  get_override("ConstructProcess")();
51  }
52 
53  void SetCuts() {
54  get_override("SetCuts")();
55  }
56 };
57 
58 // SetCutValue
59 void (G4VUserPhysicsList::*f1_SetCutValue)(G4double, const G4String&)
60  = &G4VUserPhysicsList::SetCutValue;
61 void (G4VUserPhysicsList::*f2_SetCutValue)(G4double, const G4String&,
62  const G4String&)
63  = &G4VUserPhysicsList::SetCutValue;
64 
65 // SetParticleCuts
66 void (G4VUserPhysicsList::*f1_SetParticleCuts)(G4double,
67  G4ParticleDefinition*,
68  G4Region*)
70 void (G4VUserPhysicsList::*f2_SetParticleCuts)(G4double,
71  G4ParticleDefinition*,
72  G4Region*)
74 
75 // StorePhysicsTable
76 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_StorePhysicsTable,
77  StorePhysicsTable, 0, 1)
78 // SetParticleCuts
81 
82 }
83 
84 using namespace pyG4VUserPhysicsList;
85 
86 // ====================================================================
87 // module definition
88 // ====================================================================
90 {
91  class_<CB_G4VUserPhysicsList, CB_G4VUserPhysicsList*, boost::noncopyable>
92  ("G4VUserPhysicsList", "base class of user physics list")
93  // ---
94  .def("ConstructParticle",
95  pure_virtual(&G4VUserPhysicsList::ConstructParticle))
96  .def("ConstructProcess",
97  pure_virtual(&G4VUserPhysicsList::ConstructProcess))
98  .def("SetCuts",
99  pure_virtual(&G4VUserPhysicsList::SetCuts))
100  // ---
101  .def("SetDefaultCutValue", &G4VUserPhysicsList::SetDefaultCutValue)
102  .def("GetDefaultCutValue", &G4VUserPhysicsList::GetDefaultCutValue)
103  // ---
104  .def("StorePhysicsTable", &G4VUserPhysicsList::StorePhysicsTable,
105  f_StorePhysicsTable())
106  .def("IsPhysicsTableRetrieved",
107  &G4VUserPhysicsList::IsPhysicsTableRetrieved)
108  .def("IsStoredInAscii", &G4VUserPhysicsList::IsStoredInAscii)
109  .def("GetPhysicsTableDirectory",
110  &G4VUserPhysicsList::GetPhysicsTableDirectory,
111  return_value_policy<return_by_value>())
112  .def("SetStoredInAscii", &G4VUserPhysicsList::SetStoredInAscii)
113  .def("ResetStoredInAscii", &G4VUserPhysicsList::ResetStoredInAscii)
114  // ---
115  .def("DumpList", &G4VUserPhysicsList::DumpList)
116 
117  .def("DumpCutValuesTable", &G4VUserPhysicsList::DumpCutValuesTable)
118  .def("DumpCutValuesTableIfRequested",
119  &G4VUserPhysicsList::DumpCutValuesTableIfRequested)
120  .def("SetCutValue", f1_SetCutValue)
121  .def("SetCutValue", f2_SetCutValue)
122  .def("SetParticleCuts", f1_SetParticleCuts, f_SetParticleCuts())
123  .def("SetParticleCuts", f2_SetParticleCuts, f_SetParticleCuts())
124  // ---
125  .def("SetVerboseLevel", &G4VUserPhysicsList::SetVerboseLevel)
126  .def("GetVerboseLevel", &G4VUserPhysicsList::GetVerboseLevel)
127  .def("SetCutsWithDefault", &G4VUserPhysicsList::SetCutsWithDefault)
128  .def("SetCutsForRegion", &G4VUserPhysicsList::SetCutsForRegion)
129  .def("GetApplyCuts", &G4VUserPhysicsList::GetApplyCuts)
130  ;
131 
132  // Note that exposed items are limited,
133  // because this class object is mainly for internal uses or obsolete.
134  // Construct
135  // BuildPhysicsTable
136  // PreparePhysicsTable
137  // SetPhysicsTableRetrieved
138  // ReSetPhysicsTableRetrieved
139  // SetApplyCuts
140  // DumpCutValues (obsolete)
141  // ResetCuts;
142 }
void(G4VUserPhysicsList::* f2_SetCutValue)(G4double, const G4String &, const G4String &)
void(G4VUserPhysicsList::* f1_SetCutValue)(G4double, const G4String &)
void(G4VUserPhysicsList::* f1_SetParticleCuts)(G4double, G4ParticleDefinition *, G4Region *)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_StorePhysicsTable, StorePhysicsTable, 0, 1) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetParticleCuts
void(G4VUserPhysicsList::* f2_SetParticleCuts)(G4double, G4ParticleDefinition *, G4Region *)
void export_G4VUserPhysicsList()