VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
RootGM
source
common
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
28
const
double
RootGM::Units::fgkLength = 10.;
// cm
29
const
double
RootGM::Units::fgkAngle = 1.;
// deg
30
const
double
RootGM::Units::fgkMassDensity = 1.;
// g/cm3;
31
const
double
RootGM::Units::fgkAtomicWeight = 1.;
// g/mole;
32
const
double
RootGM::Units::fgkTemperature = 1.;
// kelvin
33
const
double
RootGM::Units::fgkPressure = 1. / 6.32420e+8;
// MeV/mm3
34
35
//_____________________________________________________________________________
36
RootGM::Units::Units
()
37
{
39
}
40
41
//_____________________________________________________________________________
42
RootGM::Units::~Units
()
43
{
44
//
45
}
46
47
//
48
// public functions
49
//
50
51
//_____________________________________________________________________________
52
double
RootGM::Units::AxisUnit
(
VGM::Axis
axis)
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
}
Units.h
RootGM::Units::~Units
virtual ~Units()
Definition
Units.cxx:42
RootGM::Units::Units
Units()
Definition
Units.cxx:36
RootGM::Units::AxisUnit
static double AxisUnit(VGM::Axis axis)
Return Root unit for the given axis in VGM units.
Definition
Units.cxx:52
RootGM::Units::Length
static double Length()
Return Root length unit in VGM units.
Definition
Units.h:84
RootGM::Units::Angle
static double Angle()
Return Root angle unit in VGM units.
Definition
Units.h:85
VGM::Axis
Axis
Definition
Axis.h:34
VGM::kRho
@ kRho
Definition
Axis.h:38
VGM::kPhi
@ kPhi
Definition
Axis.h:40
VGM::kYAxis
@ kYAxis
Definition
Axis.h:36
VGM::kRadial3D
@ kRadial3D
Definition
Axis.h:39
VGM::kXAxis
@ kXAxis
Definition
Axis.h:35
VGM::kZAxis
@ kZAxis
Definition
Axis.h:37
VGM::kSphTheta
@ kSphTheta
Definition
Axis.h:41
Generated on
for VGM by
1.17.0