LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
pyG4TwoVector.cc File Reference
#include <boost/python.hpp>
#include "G4Version.hh"

Go to the source code of this file.

Functions

void export_G4TwoVector ()
 

Function Documentation

void export_G4TwoVector ( )

Definition at line 61 of file pyG4TwoVector.cc.

References geo::vect::dot(), geo::vect::mag2(), x, and y.

Referenced by BOOST_PYTHON_MODULE().

62 {
63 #if G4VERSION_NUMBER >= 830
64 
65  class_<G4TwoVector>("G4TwoVector", "general 2-vector")
66  // constructors
67  .def(init<G4double>())
68  .def(init<G4double, G4double>())
69  .def(init<const XXX&>())
70 
71  // property
72  .add_property("x", &XXX::x, &XXX::setX)
73  .add_property("y", &XXX::y, &XXX::setY)
74 
75  // methods
76  .def("set", &XXX::set)
77  .def("phi", &XXX::phi)
78  .def("mag", &XXX::mag)
79  .def("mag2", &XXX::mag2)
80  .def("r", &XXX::r)
81  .def("setPhi", &XXX::setPhi)
82  .def("setMag", &XXX::setMag)
83  .def("setR", &XXX::setR)
84  .def("setPolar", &XXX::setPolar)
85  .def("howNear", &XXX::howNear)
86  .def("isNear", &XXX::isNear, f_isNear())
87  .def("howParallel", &XXX::howParallel)
88  .def("isParallel", &XXX::isParallel, f_isParallel())
89  .def("howOrthogonal", &XXX::howOrthogonal)
90  .def("isOrthogonal", &XXX::isOrthogonal, f_isOrthogonal())
91  .def("unit", &XXX::unit)
92  .def("orthogonal", &XXX::orthogonal)
93  .def("dot", &XXX::dot)
94  .def("angle", &XXX::angle)
95  .def("rotate", &XXX::rotate)
96 
97  // operators
98  .def(self_ns::str(self))
99  .def(self == self)
100  .def(self != self)
101  .def(self += self)
102  .def(self -= self)
103  .def(self - self)
104  .def(self + self)
105  .def(self * self)
106  .def(self * G4double())
107  .def(self / G4double())
108  .def(G4double() * self)
109  .def(self *= G4double())
110  .def(self > self)
111  .def(self < self)
112  .def(self >= self)
113  .def(self <= self)
114  ;
115 #endif
116 
117 }
Float_t x
Definition: compare.C:6
constexpr auto dot(Vector const &a, Vector const &b)
Return cross product of two vectors.
Float_t y
Definition: compare.C:6
auto mag2(Vector const &v)
Return norm of the specified vector.