LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 40 of file pyG4DecayTable.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 42 of file pyG4DynamicParticle.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 44 of file pyG4ParticleDefinition.cc.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 98 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, and pyG4ParticleTable::GetParticleList().

Referenced by BOOST_PYTHON_MODULE().

99 {
100  class_<G4ParticleTable, G4ParticleTable*, boost::noncopyable>
101  ("G4ParticleTable", "particle table", no_init)
102  // ---
103  .def("GetParticleTable", &G4ParticleTable::GetParticleTable,
104  return_value_policy<reference_existing_object>())
105  .staticmethod("GetParticleTable")
106  .def("contains", f1_contains)
107  .def("contains", f2_contains)
108  .def("entries", &G4ParticleTable::entries)
109  .def("size", &G4ParticleTable::size)
110  // ---
111  .def("GetParticle", &G4ParticleTable::GetParticle,
112  return_value_policy<reference_existing_object>())
113  .def("GetParticleName", &G4ParticleTable::GetParticleName,
114  return_value_policy<return_by_value>())
115  .def("FindParticle", f1_FindParticle,
116  return_value_policy<reference_existing_object>())
117  .def("FindParticle", f2_FindParticle,
118  return_value_policy<reference_existing_object>())
119  .def("FindParticle", f3_FindParticle,
120  return_value_policy<reference_existing_object>())
121  .def("FindAntiParticle", f1_FindAntiParticle,
122  return_value_policy<reference_existing_object>())
123  .def("FindAntiParticle", f2_FindAntiParticle,
124  return_value_policy<reference_existing_object>())
125  .def("FindAntiParticle", f3_FindAntiParticle,
126  return_value_policy<reference_existing_object>())
127  .def("DumpTable", &G4ParticleTable::DumpTable, f_DumpTable())
128  //.def("GetIonTable", &G4ParticleTable::GetIonTable,
129  //...)
130  //.def("GetShortLivedTable", &G4ParticleTable::GetShortLivedTable,
131  //...)
132  .def("SetVerboseLevel", &G4ParticleTable::SetVerboseLevel)
133  .def("GetVerboseLevel", &G4ParticleTable::GetVerboseLevel)
134  .def("SetReadiness", &G4ParticleTable::SetReadiness)
135  .def("GetReadiness", &G4ParticleTable::GetReadiness)
136  // ---
137  // additionals
138  .def("GetParticleList", GetParticleList)
139  ;
140 }
G4bool(G4ParticleTable::* f1_contains)(const G4ParticleDefinition *) const
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 41 of file pyG4PrimaryParticle.cc.

References pyG4Element::Print().

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 51 of file pyG4PrimaryVertex.cc.

References pyG4Element::Print().

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 85 of file pyG4ParticleList.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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