thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Config
Unitsystem.h
1
// -*- C++ -*-
2
//
3
// Unitsystem.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad, David Grellscheid
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_Units_H
10
#define ThePEG_Units_H
11
12
#include "ThePEG/Vectors/Lorentz5Vector.fh"
13
#include "ThePEG/Vectors/LorentzVector.fh"
14
#include "ThePEG/Vectors/ThreeVector.fh"
15
#include "ThePEG/Vectors/Transverse.fh"
16
17
#include "
PhysicalQty.h
"
18
#include "
PhysicalQtyOps.h
"
19
#include "
PhysicalQtyComplex.h
"
20
21
22
namespace
ThePEG
{
23
35
namespace
Units {
36
38
template
<
long
int
L,
long
int
E,
long
int
Q,
long
int
DL=1,
long
int
DE=1,
long
int
DQ=1>
39
using
Qty
=
ThePEG::Qty<std::ratio<L,DL>
, std::ratio<E,DE>, std::ratio<Q,DQ>>;
40
42
typedef
Qty<0,1,0>
Energy
;
43
45
typedef
Energy
Mass
;
46
48
typedef
Qty<1,0,0>
Length
;
49
51
typedef
Length
Time
;
52
54
typedef
Qty
<-1,0,0>
InvLength
;
55
57
typedef
double
Velocity
;
58
60
typedef
Qty<0,0,1>
Charge
;
61
63
typedef
Qty<1,1,0>
AngularMomentum
;
64
66
typedef
Qty
<-1,1,0>
Tension
;
67
69
typedef
Qty<2,0,0>
Area
;
70
72
typedef
Qty
<-2,0,0>
InvArea
;
73
75
typedef
Area
CrossSection
;
76
82
typedef
Qty<0, 2, 0>
Energy2
;
83
typedef
Qty<0, 3, 0>
Energy3
;
84
typedef
Qty<0, 4, 0>
Energy4
;
85
typedef
Qty<0, 5, 0>
Energy5
;
86
typedef
Qty<0, 6, 0>
Energy6
;
87
typedef
Qty<0, 7, 0>
Energy7
;
88
typedef
Qty<0, 8, 0>
Energy8
;
89
typedef
Qty<0, 9, 0>
Energy9
;
90
typedef
Qty<0,10, 0>
Energy10
;
91
typedef
Qty<0,11, 0>
Energy11
;
92
typedef
Qty<0,12, 0>
Energy12
;
93
94
typedef
Qty<0, 1,0, 1,2,1>
SqrtEnergy
;
95
typedef
Qty
<0,-1,0, 1,2,1>
InvSqrtEnergy
;
96
97
typedef
Qty
<0, -1, 0>
InvEnergy
;
98
typedef
Qty
<0, -2, 0>
InvEnergy2
;
99
typedef
Qty
<0, -3, 0>
InvEnergy3
;
100
typedef
Qty
<0, -4, 0>
InvEnergy4
;
101
typedef
Qty
<0, -5, 0>
InvEnergy5
;
102
typedef
Qty
<0, -6, 0>
InvEnergy6
;
103
typedef
Qty
<0, -7, 0>
InvEnergy7
;
104
typedef
Qty
<0, -8, 0>
InvEnergy8
;
105
typedef
Qty
<0, -9, 0>
InvEnergy9
;
106
typedef
Qty
<0,-10, 0>
InvEnergy10
;
107
typedef
Qty
<0,-11, 0>
InvEnergy11
;
108
typedef
Qty
<0,-12, 0>
InvEnergy12
;
110
112
typedef
Qty<2,2,0>
Energy2XSec
;
113
115
typedef
Qty
<2,-2,0>
DiffXSec
;
116
118
typedef
Qty
<2,-4,0>
Diff2XSec
;
119
121
typedef
Qty
<2,-6,0>
Diff3XSec
;
122
124
typedef
Energy2
Scale
;
125
127
typedef
ThreeVector<Length>
Point
;
128
130
typedef
ThreeVector<Length>
Distance
;
131
133
typedef
ThreeVector<double>
Axis
;
134
136
typedef
ThreeVector<Energy>
Momentum3
;
137
139
typedef
ThreeVector<double>
Boost
;
140
142
typedef
LorentzVector<Length>
LorentzDistance
;
143
146
typedef
Lorentz5Vector<Length>
Lorentz5Distance
;
147
149
typedef
LorentzVector<Length>
LorentzPoint
;
150
152
typedef
LorentzVector<Energy>
LorentzMomentum
;
153
156
typedef
Lorentz5Vector<Energy>
Lorentz5Momentum
;
157
159
typedef
Transverse<Energy>
TransverseMomentum
;
160
162
163
constexpr
Length
operator
""
_mm(
long
double
x ) {
164
return
Length
{Length::baseunit(),
static_cast<
double
>
(x)};
165
}
166
constexpr
Length
operator
""
_mm(
unsigned
long
long
x ) {
167
return
Length
{Length::baseunit(),
static_cast<
double
>
(x)};
168
}
169
170
constexpr
Length
meter = 1.0e+3_mm;
171
constexpr
Length
millimeter = 1_mm;
172
constexpr
Length
mm = 1_mm;
173
constexpr
Length
centimeter = 10_mm;
174
constexpr
Length
micrometer = 1.0e-3_mm;
175
constexpr
Length
nanometer = 1.0e-6_mm;
176
constexpr
Length
picometer = 1.0e-9_mm;
177
constexpr
Length
femtometer = 1.0e-12_mm;
178
179
constexpr
Energy
operator
""
_MeV(
long
double
x ) {
180
return
Energy
{Energy::baseunit(),
static_cast<
double
>
(x)};
181
}
182
constexpr
Energy
operator
""
_MeV(
unsigned
long
long
x ) {
183
return
Energy
{Energy::baseunit(),
static_cast<
double
>
(x)};
184
}
185
186
constexpr
Energy
operator
""
_GeV(
long
double
x ) {
187
return
Energy
{1000_MeV,
static_cast<
double
>
(x)};
188
}
189
constexpr
Energy
operator
""
_GeV(
unsigned
long
long
x ) {
190
return
Energy
{1000_MeV,
static_cast<
double
>
(x)};
191
}
192
193
constexpr
Energy
operator
""
_TeV(
long
double
x ) {
194
return
Energy
{1000_GeV,
static_cast<
double
>
(x)};
195
}
196
constexpr
Energy
operator
""
_TeV(
unsigned
long
long
x ) {
197
return
Energy
{1000_GeV,
static_cast<
double
>
(x)};
198
}
199
200
constexpr
Energy
keV = 1.0e-3_MeV;
201
constexpr
Energy
MeV = 1_MeV;
202
constexpr
Energy
GeV = 1_GeV;
203
constexpr
Energy
TeV = 1_TeV;
204
205
206
207
constexpr
Energy2
operator
""
_MeV2(
long
double
x ) {
208
return
Energy2{Energy2::baseunit(),
static_cast<
double
>
(x)};
209
}
210
constexpr
Energy2
operator
""
_MeV2(
unsigned
long
long
x ) {
211
return
Energy2{Energy2::baseunit(),
static_cast<
double
>
(x)};
212
}
213
214
constexpr
Energy2
operator
""
_GeV2(
long
double
x ) {
215
return
Energy2{1.0e+6_MeV2,
static_cast<
double
>
(x)};
216
}
217
constexpr
Energy2
operator
""
_GeV2(
unsigned
long
long
x ) {
218
return
Energy2{1.0e+6_MeV2,
static_cast<
double
>
(x)};
219
}
220
221
constexpr
Energy2 MeV2 = 1_MeV2;
222
constexpr
Energy2 GeV2 = 1_GeV2;
223
224
constexpr
InvEnergy InvGeV = 1/GeV;
225
226
227
constexpr
Area
operator
""
_pb(
long
double
x ) {
228
return
Area
{1.0e-34 *
Area::baseunit
(),
static_cast<
double
>
(x)};
229
}
230
constexpr
Area
operator
""
_pb(
unsigned
long
long
x ) {
231
return
Area
{1.0e-34 *
Area::baseunit
(),
static_cast<
double
>
(x)};
232
}
233
234
constexpr
Area
femtobarn = 1.0e-03_pb;
235
constexpr
Area
picobarn = 1_pb;
236
constexpr
Area
nanobarn = 1.0e+03_pb;
237
constexpr
Area
microbarn = 1.0e+06_pb;
238
constexpr
Area
millibarn = 1.0e+09_pb;
239
constexpr
Area
barn = 1.0e+12_pb;
240
241
constexpr
Charge
eplus =
Charge::baseunit
();
243
245
constexpr
Qty<1,1,0>
hbarc
= 197.326968e-15 * MeV * meter;
247
constexpr
Qty<1,1,0>
hbar_Planck
=
hbarc
/ 1.0;
// c is one
248
}
249
254
namespace
UnitRemoval {
256
257
constexpr
Units::Energy
E = Units::Energy::baseunit();
258
259
constexpr
Units::Energy2
E2 = E*E;
260
constexpr
Units::Energy3
E3 = E*E2;
261
constexpr
Units::Energy4
E4 = E2*E2;
262
263
constexpr
Units::InvEnergy
InvE = 1.0/E;
264
constexpr
Units::InvEnergy2
InvE2 = 1.0/E2;
265
constexpr
Units::InvEnergy3
InvE3 = 1.0/E3;
266
constexpr
Units::InvEnergy4
InvE4 = 1.0/E4;
267
268
constexpr
Units::SqrtEnergy
SqrtE =
Units::SqrtEnergy::baseunit
();
269
constexpr
Units::InvSqrtEnergy
InvSqrtE =
Units::InvSqrtEnergy::baseunit
();
271
}
272
273
}
274
275
#endif
/* ThePEG_Units_H */
PhysicalQtyComplex.h
Overloads for operations on complex physical quantities.
PhysicalQtyOps.h
Overloads for mathematical operations on physical quantities.
PhysicalQty.h
The PhysicalQty class allows compile-time checking of dimensional correctness.
ThePEG::Lorentz5Vector
The Lorentz5Vector inherits from the LorentzVector class.
Definition:
Lorentz5Vector.h:42
ThePEG::LorentzVector
A 4-component Lorentz vector.
Definition:
LorentzVector.h:44
ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >
Definition:
PhysicalQty.h:77
ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::baseunit
static constexpr Type baseunit()
Basic unit of this quantity.
Definition:
PhysicalQty.h:113
ThePEG::Qty
This template class allows the compiler to check calculations with physical quantities for dimensiona...
Definition:
PhysicalQty.h:52
ThePEG::ThreeVector
A 3-component vector.
Definition:
ThreeVector.h:35
ThePEG::Transverse
Transverse represents the transverse components of a LorentzVector.
Definition:
Transverse.h:30
ThePEG::Units::Tension
Qty<-1, 1, 0 > Tension
Tension.
Definition:
Unitsystem.h:66
ThePEG::Units::Distance
ThreeVector< Length > Distance
A distance in three-dimensional euclidean space.
Definition:
Unitsystem.h:130
ThePEG::Units::Energy
Qty< 0, 1, 0 > Energy
Energy.
Definition:
Unitsystem.h:42
ThePEG::Units::Point
ThreeVector< Length > Point
A point in three-dimensional euclidean space.
Definition:
Unitsystem.h:127
ThePEG::Units::DiffXSec
Qty< 2,-2, 0 > DiffXSec
CrossSection/Energy2.
Definition:
Unitsystem.h:115
ThePEG::Units::InvLength
Qty<-1, 0, 0 > InvLength
Inverse Length.
Definition:
Unitsystem.h:54
ThePEG::Units::Momentum3
ThreeVector< Energy > Momentum3
A momentum in three-dimensional euclidean space.
Definition:
Unitsystem.h:136
ThePEG::Units::Area
Qty< 2, 0, 0 > Area
Area will be assumed to be Length .
Definition:
Unitsystem.h:69
ThePEG::Units::hbarc
constexpr Qty< 1, 1, 0 > hbarc
Planck's constant times c (PDG 2006 value 197.326968(17) MeV fm)
Definition:
Unitsystem.h:245
ThePEG::Units::Lorentz5Momentum
Lorentz5Vector< Energy > Lorentz5Momentum
A momentum in four-dimensional space-time with an explicit invariant mass component.
Definition:
Unitsystem.h:156
ThePEG::Units::LorentzDistance
LorentzVector< Length > LorentzDistance
A distance in four-dimensional space-time.
Definition:
Unitsystem.h:142
ThePEG::Units::Length
Qty< 1, 0, 0 > Length
Length.
Definition:
Unitsystem.h:48
ThePEG::Units::LorentzPoint
LorentzVector< Length > LorentzPoint
A point in four-dimensional space-time.
Definition:
Unitsystem.h:149
ThePEG::Units::LorentzMomentum
LorentzVector< Energy > LorentzMomentum
A momentum in four-dimensional space-time.
Definition:
Unitsystem.h:152
ThePEG::Units::Diff2XSec
Qty< 2,-4, 0 > Diff2XSec
CrossSection/Energy4.
Definition:
Unitsystem.h:118
ThePEG::Units::CrossSection
Area CrossSection
Cross section is an area.
Definition:
Unitsystem.h:75
ThePEG::Units::AngularMomentum
Qty< 1, 1, 0 > AngularMomentum
Angular momentum.
Definition:
Unitsystem.h:63
ThePEG::Units::Lorentz5Distance
Lorentz5Vector< Length > Lorentz5Distance
A distance in four-dimensional space-time with an explicit invariant time component.
Definition:
Unitsystem.h:146
ThePEG::Units::Axis
ThreeVector< double > Axis
A direction in three-dimensional euclidean space.
Definition:
Unitsystem.h:133
ThePEG::Units::Mass
Energy Mass
Mass has the same unit as Energy <=> c == 1.
Definition:
Unitsystem.h:45
ThePEG::Units::Charge
Qty< 0, 0, 1 > Charge
Charge.
Definition:
Unitsystem.h:60
ThePEG::Units::Boost
ThreeVector< double > Boost
A three-dimensional boost vector.
Definition:
Unitsystem.h:139
ThePEG::Units::hbar_Planck
constexpr Qty< 1, 1, 0 > hbar_Planck
Planck's constant (PDG 2006 value 197.326968(17) MeV fm)
Definition:
Unitsystem.h:247
ThePEG::Units::Diff3XSec
Qty< 2,-6, 0 > Diff3XSec
CrossSection/Energy6.
Definition:
Unitsystem.h:121
ThePEG::Units::TransverseMomentum
Transverse< Energy > TransverseMomentum
Transverse components of a momentum.
Definition:
Unitsystem.h:159
ThePEG::Units::Time
Length Time
Time has the same unit as Length.
Definition:
Unitsystem.h:51
ThePEG::Units::Scale
Energy2 Scale
Scale is the same as a squared energy.
Definition:
Unitsystem.h:124
ThePEG::Units::Energy2XSec
Qty< 2, 2, 0 > Energy2XSec
CrossSection*Energy2.
Definition:
Unitsystem.h:112
ThePEG::Units::Velocity
double Velocity
Velocities are dimensionless fractions of c.
Definition:
Unitsystem.h:57
ThePEG::Units::InvArea
Qty<-2, 0, 0 > InvArea
Inverse Area.
Definition:
Unitsystem.h:72
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6