G4Utils.h
Go to the documentation of this file.
1 #ifndef _G4StationSimulator_G4Utils_h_
2 #define _G4StationSimulator_G4Utils_h_
3 
4 #include <utl/AugerUnits.h>
5 #include <utl/CoordinateSystemPtr.h>
6 #include <utl/Vector.h>
7 #include <G4ThreeVector.hh>
8 
9 
10 namespace G4StationSimulatorOG {
11 
12  template<class V>
13  inline
14  G4ThreeVector
15  ToG4Vector(const V& v, const utl::CoordinateSystemPtr& cs, const double unitConversion)
16  {
17  const utl::Vector::Triple xyz = v.GetCoordinates(cs);
18  return
19  G4ThreeVector(
20  unitConversion * xyz.get<0>(),
21  unitConversion * xyz.get<1>(),
22  unitConversion * xyz.get<2>()
23  );
24  }
25 
26 
27  template<class V>
28  inline
29  V
30  To(const G4ThreeVector& v, const utl::CoordinateSystemPtr& cs, const double unitConversion)
31  {
32  return
33  V(
34  unitConversion* v.x(),
35  unitConversion* v.y(),
36  unitConversion* v.z(),
37  cs
38  );
39  }
40 
41 }
42 
43 
44 #endif
boost::tuple< double, double, double > Triple
Coordinate triple for easy getting or setting of coordinates.
Definition: BasicVector.h:147
#define V
V To(const G4ThreeVector &v, const utl::CoordinateSystemPtr &cs, const double unitConversion)
Definition: G4Utils.h:30
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
G4ThreeVector ToG4Vector(const V &v, const utl::CoordinateSystemPtr &cs, const double unitConversion)
Definition: G4Utils.h:15

, generated on Tue Sep 26 2023.