VGM Version 5.3
Loading...
Searching...
No Matches
Units.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The RootGM package of the Virtual Geometry Model
5// Copyright (C) 2007, Ivana Hrivnacova
6// All rights reserved.
7//
8// For the licensing terms see vgm/LICENSE.
9// Contact: ivana@ipno.in2p3.fr
10// -----------------------------------------------------------------------
11
12//
13// Class Units
14// ------------------
15// Conversion from Root physical units to VGM units.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "RootGM/common/Units.h"
20
21#include <cstdlib>
22#include <iostream>
23
24//
25// static const data members
26//
27
28const double RootGM::Units::fgkLength = 10.; // cm
29const double RootGM::Units::fgkAngle = 1.; // deg
30const double RootGM::Units::fgkMassDensity = 1.; // g/cm3;
31const double RootGM::Units::fgkAtomicWeight = 1.; // g/mole;
32const double RootGM::Units::fgkTemperature = 1.; // kelvin
33const double RootGM::Units::fgkPressure = 1. / 6.32420e+8; // MeV/mm3
34
35//_____________________________________________________________________________
40
41//_____________________________________________________________________________
43{
44 //
45}
46
47//
48// public functions
49//
50
51//_____________________________________________________________________________
53{
54 if (axis == VGM::kXAxis || axis == VGM::kYAxis || axis == VGM::kZAxis ||
55 axis == VGM::kRho || axis == VGM::kRadial3D) {
56
57 return Length();
58 }
59
60 if (axis == VGM::kPhi || axis == VGM::kSphTheta) {
61 return Angle();
62 }
63
64 // axis == kUndefined
65 std::cerr << " RootGM::Units::AxisUnit:" << std::endl;
66 std::cerr << " Undefined axis" << std::endl;
67 std::cerr << "*** Error: Aborting execution ***" << std::endl;
68 exit(1);
69}
virtual ~Units()
Definition Units.cxx:42
static double AxisUnit(VGM::Axis axis)
Return Root unit for the given axis in VGM units.
Definition Units.cxx:52
VGM Axis enumeration.
@ kRho
Definition Axis.h:38
@ kPhi
Definition Axis.h:40
@ kYAxis
Definition Axis.h:36
@ kRadial3D
Definition Axis.h:39
@ kXAxis
Definition Axis.h:35
@ kZAxis
Definition Axis.h:37
@ kSphTheta
Definition Axis.h:41