LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pymodG4particles.cc File Reference
#include <boost/python.hpp>

Go to the source code of this file.

Functions

void export_G4ParticleDefinition ()
 
void export_G4DynamicParticle ()
 
void export_G4ParticleTable ()
 
void export_G4DecayTable ()
 
void export_G4PrimaryParticle ()
 
void export_G4PrimaryVertex ()
 
void export_PyG4ParticleList ()
 
 BOOST_PYTHON_MODULE (G4particles)
 

Function Documentation

BOOST_PYTHON_MODULE ( G4particles  )
void export_G4DecayTable ( )

Definition at line 39 of file pyG4DecayTable.cc.

Referenced by BOOST_PYTHON_MODULE().

40 {
41  class_<G4DecayTable, G4DecayTable*, boost::noncopyable>
42  ("G4DecayTable", "decay table")
43  // ---
44  .def("DumpInfo", &G4DecayTable::DumpInfo)
45  ;
46 
47  // reduced functionality...
48  // ...
49 
50 }
void export_G4DynamicParticle ( )

Definition at line 41 of file pyG4DynamicParticle.cc.

Referenced by BOOST_PYTHON_MODULE().

42 {
43  class_<G4DynamicParticle, G4DynamicParticle*>
44  ("G4DynamicParticle", "dynamic particle")
45  // ---
46  .def("GetMomentumDirection", &G4DynamicParticle::GetMomentumDirection,
47  return_value_policy<return_by_value>())
48  .def("GetMomentum", &G4DynamicParticle::GetMomentum,
49  return_value_policy<return_by_value>())
50  //.def("Get4Momentum", &G4DynamicParticle::Get4Momentum,
51  //return_value_policy<return_by_value>())
52  .def("GetTotalMomentum", &G4DynamicParticle::GetTotalMomentum)
53  .def("GetTotalEnergy", &G4DynamicParticle::GetTotalEnergy)
54  .def("GetKineticEnergy", &G4DynamicParticle::GetKineticEnergy)
55  .def("GetProperTime", &G4DynamicParticle::GetProperTime)
56  .def("GetPolarization", &G4DynamicParticle::GetPolarization,
57  return_value_policy<return_by_value>())
58  .def("GetMass", &G4DynamicParticle::GetMass)
59  .def("GetCharge", &G4DynamicParticle::GetCharge)
60  //.def("GetElectronOccupancy", &G4DynamicParticle::GetElectronOccupancy,
61  //return_internal_reference<>())
62  .def("GetTotalOccupancy", &G4DynamicParticle::GetTotalOccupancy)
63  .def("GetOccupancy", &G4DynamicParticle::GetOccupancy)
64  .def("GetDefinition", &G4DynamicParticle::GetDefinition,
65  return_internal_reference<>())
66  .def("GetPreAssignedDecayProperTime",
67  &G4DynamicParticle::GetPreAssignedDecayProperTime)
68  .def("DumpInfo", &G4DynamicParticle::DumpInfo)
69  .def("SetVerboseLevel", &G4DynamicParticle::SetVerboseLevel)
70  .def("GetVerboseLevel", &G4DynamicParticle::GetVerboseLevel)
71  .def("GetPrimaryParticle", &G4DynamicParticle::GetPrimaryParticle,
72  return_internal_reference<>())
73  .def("GetPDGcode", &G4DynamicParticle::GetPDGcode)
74  ;
75 }
void export_G4ParticleDefinition ( )

Definition at line 43 of file pyG4ParticleDefinition.cc.

Referenced by BOOST_PYTHON_MODULE().

44 {
45  class_<G4ParticleDefinition, G4ParticleDefinition*, boost::noncopyable>
46  ("G4ParticleDefinition", "particle definition", no_init)
47  // ---
48  .def("GetParticleName", &G4ParticleDefinition::GetParticleName,
49  return_value_policy<return_by_value>())
50  .def("GetPDGMass", &G4ParticleDefinition::GetPDGMass)
51  .def("GetPDGWidth", &G4ParticleDefinition::GetPDGWidth)
52  .def("GetPDGCharge", &G4ParticleDefinition::GetPDGCharge)
53  .def("GetPDGSpin", &G4ParticleDefinition::GetPDGSpin)
54  .def("GetPDGiSpin", &G4ParticleDefinition::GetPDGiSpin)
55  .def("GetPDGiParity", &G4ParticleDefinition::GetPDGiParity)
56  .def("GetPDGiConjugation", &G4ParticleDefinition::GetPDGiConjugation)
57  .def("GetPDGIsospin", &G4ParticleDefinition::GetPDGIsospin)
58  .def("GetPDGIsospin3", &G4ParticleDefinition::GetPDGIsospin3)
59  .def("GetPDGiIsospin", &G4ParticleDefinition::GetPDGiIsospin)
60  .def("GetPDGiIsospin3", &G4ParticleDefinition::GetPDGiIsospin3)
61  .def("GetPDGiGParity", &G4ParticleDefinition::GetPDGiGParity)
62  .def("GetParticleType", &G4ParticleDefinition::GetParticleType,
63  return_value_policy<return_by_value>())
64  .def("GetParticleSubType", &G4ParticleDefinition::GetParticleSubType,
65  return_value_policy<return_by_value>())
66  .def("GetLeptonNumber", &G4ParticleDefinition::GetLeptonNumber)
67  .def("GetBaryonNumber", &G4ParticleDefinition::GetBaryonNumber)
68  .def("GetPDGEncoding", &G4ParticleDefinition::GetPDGEncoding)
69  .def("GetAntiPDGEncoding", &G4ParticleDefinition::GetAntiPDGEncoding)
70  .def("GetQuarkContent", &G4ParticleDefinition::GetQuarkContent)
71  .def("GetAntiQuarkContent",&G4ParticleDefinition::GetAntiQuarkContent)
72  .def("IsShortLived", &G4ParticleDefinition::IsShortLived)
73  .def("GetPDGStable", &G4ParticleDefinition::GetPDGStable)
74  .def("SetPDGStable", &G4ParticleDefinition::SetPDGStable)
75  .def("GetPDGLifeTime", &G4ParticleDefinition::GetPDGLifeTime)
76  .def("SetPDGLifeTime", &G4ParticleDefinition::SetPDGLifeTime)
77  .def("GetDecayTable", &G4ParticleDefinition::GetDecayTable,
78  return_internal_reference<>())
79  .def("SetDecayTable", &G4ParticleDefinition::SetDecayTable)
80  .def("GetProcessManager", &G4ParticleDefinition::GetProcessManager,
81  return_internal_reference<>())
82  .def("SetProcessManager", &G4ParticleDefinition::SetProcessManager)
83  // cludge!! (G4ParticleTable object is sigleton!!)
84  .def("GetParticleTable", &G4ParticleDefinition::GetParticleTable,
85  return_value_policy<reference_existing_object>())
86  .def("DumpTable", &G4ParticleDefinition::DumpTable)
87 #if G4VERSION_NUMBER >= 701
88  .def("GetAtomicNumber", &G4ParticleDefinition::GetAtomicNumber)
89  .def("GetAtomicMass", &G4ParticleDefinition::GetAtomicMass)
90 #endif
91  .def("SetVerboseLevel", &G4ParticleDefinition::SetVerboseLevel)
92  .def("GetVerboseLevel", &G4ParticleDefinition::GetVerboseLevel)
93  .def("SetApplyCutsFlag", &G4ParticleDefinition::SetApplyCutsFlag)
94  .def("GetApplyCutsFlag", &G4ParticleDefinition::GetApplyCutsFlag)
95  ;
96 }
void export_G4ParticleTable ( )

Definition at line 97 of file pyG4ParticleTable.cc.

References pyG4ParticleTable::f1_contains, pyG4ParticleTable::f1_FindAntiParticle, pyG4ParticleTable::f1_FindParticle, pyG4ParticleTable::f2_contains, pyG4ParticleTable::f2_FindAntiParticle, pyG4ParticleTable::f2_FindParticle, pyG4ParticleTable::f3_FindAntiParticle, pyG4ParticleTable::f3_FindParticle, pyG4ParticleTable::GetParticleList(), and util::size().

Referenced by BOOST_PYTHON_MODULE().

98 {
99  class_<G4ParticleTable, G4ParticleTable*, boost::noncopyable>
100  ("G4ParticleTable", "particle table", no_init)
101  // ---
102  .def("GetParticleTable", &G4ParticleTable::GetParticleTable,
103  return_value_policy<reference_existing_object>())
104  .staticmethod("GetParticleTable")
105  .def("contains", f1_contains)
106  .def("contains", f2_contains)
107  .def("entries", &G4ParticleTable::entries)
108  .def("size", &G4ParticleTable::size)
109  // ---
110  .def("GetParticle", &G4ParticleTable::GetParticle,
111  return_value_policy<reference_existing_object>())
112  .def("GetParticleName", &G4ParticleTable::GetParticleName,
113  return_value_policy<return_by_value>())
114  .def("FindParticle", f1_FindParticle,
115  return_value_policy<reference_existing_object>())
116  .def("FindParticle", f2_FindParticle,
117  return_value_policy<reference_existing_object>())
118  .def("FindParticle", f3_FindParticle,
119  return_value_policy<reference_existing_object>())
120  .def("FindAntiParticle", f1_FindAntiParticle,
121  return_value_policy<reference_existing_object>())
122  .def("FindAntiParticle", f2_FindAntiParticle,
123  return_value_policy<reference_existing_object>())
124  .def("FindAntiParticle", f3_FindAntiParticle,
125  return_value_policy<reference_existing_object>())
126  .def("DumpTable", &G4ParticleTable::DumpTable, f_DumpTable())
127  //.def("GetIonTable", &G4ParticleTable::GetIonTable,
128  //...)
129  //.def("GetShortLivedTable", &G4ParticleTable::GetShortLivedTable,
130  //...)
131  .def("SetVerboseLevel", &G4ParticleTable::SetVerboseLevel)
132  .def("GetVerboseLevel", &G4ParticleTable::GetVerboseLevel)
133  .def("SetReadiness", &G4ParticleTable::SetReadiness)
134  .def("GetReadiness", &G4ParticleTable::GetReadiness)
135  // ---
136  // additionals
137  .def("GetParticleList", GetParticleList)
138  ;
139 }
G4bool(G4ParticleTable::* f1_contains)(const G4ParticleDefinition *) const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
G4ParticleDefinition *(G4ParticleTable::* f3_FindParticle)(const G4ParticleDefinition *)
G4ParticleDefinition *(G4ParticleTable::* f2_FindAntiParticle)(const G4String &)
G4ParticleDefinition *(G4ParticleTable::* f1_FindParticle)(G4int)
G4ParticleDefinition *(G4ParticleTable::* f2_FindParticle)(const G4String &)
G4ParticleDefinition *(G4ParticleTable::* f3_FindAntiParticle)(const G4ParticleDefinition *)
G4ParticleDefinition *(G4ParticleTable::* f1_FindAntiParticle)(G4int)
G4bool(G4ParticleTable::* f2_contains)(const G4String &) const
list GetParticleList(G4ParticleTable *particleTable)
void export_G4PrimaryParticle ( )

Definition at line 40 of file pyG4PrimaryParticle.cc.

References pyG4Element::Print().

Referenced by BOOST_PYTHON_MODULE().

41 {
42  class_<G4PrimaryParticle, G4PrimaryParticle*>
43  ("G4PrimaryParticle", "primary particle")
44  .def(init<G4int>())
45  // ---
46  .add_property("Px", &G4PrimaryParticle::GetPx)
47  .add_property("Py", &G4PrimaryParticle::GetPy)
48  .add_property("Pz", &G4PrimaryParticle::GetPz)
49  // ---
50  .def("Print", &G4PrimaryParticle::Print)
51  .def("GetPDGcode", &G4PrimaryParticle::GetPDGcode)
52  .def("GetG4code", &G4PrimaryParticle::GetG4code,
53  return_internal_reference<>())
54  .def("GetMomentun", &G4PrimaryParticle::GetMomentum,
55  return_value_policy<return_by_value>())
56  .def("GetPx", &G4PrimaryParticle::GetPx)
57  .def("GetPy", &G4PrimaryParticle::GetPy)
58  .def("GetPz", &G4PrimaryParticle::GetPz)
59  .def("Set4Momentum", &G4PrimaryParticle::Set4Momentum)
60  .def("SetMomentumDirection", &G4PrimaryParticle::SetMomentumDirection)
61 
62  .def("GetNext", &G4PrimaryParticle::GetNext,
63  return_internal_reference<>())
64  .def("GetDaughter", &G4PrimaryParticle::GetNext,
65  return_internal_reference<>())
66  .def("GetTrackID", &G4PrimaryParticle::GetTrackID)
67  .def("GetMass", &G4PrimaryParticle::GetMass)
68  .def("SetMass", &G4PrimaryParticle::SetMass)
69  .def("GetCharge", &G4PrimaryParticle::GetCharge)
70  .def("SetCharge", &G4PrimaryParticle::SetCharge)
71  .def("GetPolarization", &G4PrimaryParticle::GetPolarization,
72  return_value_policy<return_by_value>())
73  .def("GetPolX", &G4PrimaryParticle::GetPolX)
74  .def("GetPolY", &G4PrimaryParticle::GetPolY)
75  .def("GetPolZ", &G4PrimaryParticle::GetPolZ)
76  .def("GetWeight", &G4PrimaryParticle::GetWeight)
77  .def("SetWeight", &G4PrimaryParticle::SetWeight)
78  .def("GetProperTime", &G4PrimaryParticle::GetProperTime)
79  ;
80 }
void Print(G4Element &ele)
Definition: pyG4Element.cc:55
void export_G4PrimaryVertex ( )

Definition at line 50 of file pyG4PrimaryVertex.cc.

References pyG4Element::Print().

Referenced by BOOST_PYTHON_MODULE().

51 {
52  class_<G4PrimaryVertex, G4PrimaryVertex*>
53  ("G4PrimaryVertex", "primary vertex")
54  .def(init<>())
55  .def(init<G4double, G4double, G4double, G4double>())
56  .def(init<G4ThreeVector, G4double>())
57  // ---
58  .add_property("X0", &G4PrimaryVertex::GetX0)
59  .add_property("Y0", &G4PrimaryVertex::GetY0)
60  .add_property("Z0", &G4PrimaryVertex::GetZ0)
61  .add_property("T0", &G4PrimaryVertex::GetT0)
62  // ---
63  .def("GetPosition", &G4PrimaryVertex::GetPosition,
64  return_value_policy<return_by_value>())
65  .def("GetX0", &G4PrimaryVertex::GetX0)
66  .def("GetY0", &G4PrimaryVertex::GetY0)
67  .def("GetZ0", &G4PrimaryVertex::GetZ0)
68  .def("GetT0", &G4PrimaryVertex::GetT0)
69  .def("GetNumberOfParticle", &G4PrimaryVertex::GetNumberOfParticle)
70  .def("GetPrimary", &G4PrimaryVertex::GetPrimary,
71  return_internal_reference<>(), f_GetPrimary())
72  .def("SetPrimary", &G4PrimaryVertex::SetPrimary)
73  .def("GetWeight", &G4PrimaryVertex::GetWeight)
74  .def("SetWeight", &G4PrimaryVertex::SetWeight)
75  .def("Print", &G4PrimaryVertex::Print)
76  ;
77 }
void Print(G4Element &ele)
Definition: pyG4Element.cc:55
void export_PyG4ParticleList ( )

Definition at line 84 of file pyG4ParticleList.cc.

References PyG4ParticleList::p_begin(), and PyG4ParticleList::p_end().

Referenced by BOOST_PYTHON_MODULE().

85 {
86  class_<PyG4ParticleList>("PyG4ParticleList", "particle list")
88  .add_property("particles", range(&PyG4ParticleList::p_begin,
90  ;
91 }
p_iterator p_end()
p_iterator p_begin()