File indexing completed on 2026-08-06 09:38:20
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ThePEG_Units_H
0010 #define ThePEG_Units_H
0011
0012 #include "ThePEG/Vectors/Lorentz5Vector.fh"
0013 #include "ThePEG/Vectors/LorentzVector.fh"
0014 #include "ThePEG/Vectors/ThreeVector.fh"
0015 #include "ThePEG/Vectors/Transverse.fh"
0016
0017 #include "PhysicalQty.h"
0018 #include "PhysicalQtyOps.h"
0019 #include "PhysicalQtyComplex.h"
0020
0021
0022 namespace ThePEG {
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 namespace Units {
0036
0037
0038 template<long int L, long int E, long int Q, long int DL=1, long int DE=1, long int DQ=1>
0039 using Qty = ThePEG::Qty<std::ratio<L,DL>, std::ratio<E,DE>, std::ratio<Q,DQ>>;
0040
0041
0042 typedef Qty<0,1,0> Energy;
0043
0044
0045 typedef Energy Mass;
0046
0047
0048 typedef Qty<1,0,0> Length;
0049
0050
0051 typedef Length Time;
0052
0053
0054 typedef Qty<-1,0,0> InvLength;
0055
0056
0057 typedef double Velocity;
0058
0059
0060 typedef Qty<0,0,1> Charge;
0061
0062
0063 typedef Qty<1,1,0> AngularMomentum;
0064
0065
0066 typedef Qty<-1,1,0> Tension;
0067
0068
0069 typedef Qty<2,0,0> Area;
0070
0071
0072 typedef Qty<-2,0,0> InvArea;
0073
0074
0075 typedef Area CrossSection;
0076
0077
0078
0079
0080
0081
0082 typedef Qty<0, 2, 0> Energy2;
0083 typedef Qty<0, 3, 0> Energy3;
0084 typedef Qty<0, 4, 0> Energy4;
0085 typedef Qty<0, 5, 0> Energy5;
0086 typedef Qty<0, 6, 0> Energy6;
0087 typedef Qty<0, 7, 0> Energy7;
0088 typedef Qty<0, 8, 0> Energy8;
0089 typedef Qty<0, 9, 0> Energy9;
0090 typedef Qty<0,10, 0> Energy10;
0091 typedef Qty<0,11, 0> Energy11;
0092 typedef Qty<0,12, 0> Energy12;
0093
0094 typedef Qty<0, 1,0, 1,2,1> SqrtEnergy;
0095 typedef Qty<0,-1,0, 1,2,1> InvSqrtEnergy;
0096
0097 typedef Qty<0, -1, 0> InvEnergy;
0098 typedef Qty<0, -2, 0> InvEnergy2;
0099 typedef Qty<0, -3, 0> InvEnergy3;
0100 typedef Qty<0, -4, 0> InvEnergy4;
0101 typedef Qty<0, -5, 0> InvEnergy5;
0102 typedef Qty<0, -6, 0> InvEnergy6;
0103 typedef Qty<0, -7, 0> InvEnergy7;
0104 typedef Qty<0, -8, 0> InvEnergy8;
0105 typedef Qty<0, -9, 0> InvEnergy9;
0106 typedef Qty<0,-10, 0> InvEnergy10;
0107 typedef Qty<0,-11, 0> InvEnergy11;
0108 typedef Qty<0,-12, 0> InvEnergy12;
0109
0110
0111
0112 typedef Qty<2,2,0> Energy2XSec;
0113
0114
0115 typedef Qty<2,-2,0> DiffXSec;
0116
0117
0118 typedef Qty<2,-4,0> Diff2XSec;
0119
0120
0121 typedef Qty<2,-6,0> Diff3XSec;
0122
0123
0124 typedef Energy2 Scale;
0125
0126
0127 typedef ThreeVector<Length> Point;
0128
0129
0130 typedef ThreeVector<Length> Distance;
0131
0132
0133 typedef ThreeVector<double> Axis;
0134
0135
0136 typedef ThreeVector<Energy> Momentum3;
0137
0138
0139 typedef ThreeVector<double> Boost;
0140
0141
0142 typedef LorentzVector<Length> LorentzDistance;
0143
0144
0145
0146 typedef Lorentz5Vector<Length> Lorentz5Distance;
0147
0148
0149 typedef LorentzVector<Length> LorentzPoint;
0150
0151
0152 typedef LorentzVector<Energy> LorentzMomentum;
0153
0154
0155
0156 typedef Lorentz5Vector<Energy> Lorentz5Momentum;
0157
0158
0159 typedef Transverse<Energy> TransverseMomentum;
0160
0161
0162
0163 constexpr Length operator "" _mm( long double x ) {
0164 return Length{Length::baseunit(), static_cast<double>(x)};
0165 }
0166 constexpr Length operator "" _mm( unsigned long long x ) {
0167 return Length{Length::baseunit(), static_cast<double>(x)};
0168 }
0169
0170 constexpr Length meter = 1.0e+3_mm;
0171 constexpr Length millimeter = 1_mm;
0172 constexpr Length mm = 1_mm;
0173 constexpr Length centimeter = 10_mm;
0174 constexpr Length micrometer = 1.0e-3_mm;
0175 constexpr Length nanometer = 1.0e-6_mm;
0176 constexpr Length picometer = 1.0e-9_mm;
0177 constexpr Length femtometer = 1.0e-12_mm;
0178
0179 constexpr Energy operator "" _MeV( long double x ) {
0180 return Energy{Energy::baseunit(), static_cast<double>(x)};
0181 }
0182 constexpr Energy operator "" _MeV( unsigned long long x ) {
0183 return Energy{Energy::baseunit(), static_cast<double>(x)};
0184 }
0185
0186 constexpr Energy operator "" _GeV( long double x ) {
0187 return Energy{1000_MeV, static_cast<double>(x)};
0188 }
0189 constexpr Energy operator "" _GeV( unsigned long long x ) {
0190 return Energy{1000_MeV, static_cast<double>(x)};
0191 }
0192
0193 constexpr Energy operator "" _TeV( long double x ) {
0194 return Energy{1000_GeV, static_cast<double>(x)};
0195 }
0196 constexpr Energy operator "" _TeV( unsigned long long x ) {
0197 return Energy{1000_GeV, static_cast<double>(x)};
0198 }
0199
0200 constexpr Energy keV = 1.0e-3_MeV;
0201 constexpr Energy MeV = 1_MeV;
0202 constexpr Energy GeV = 1_GeV;
0203 constexpr Energy TeV = 1_TeV;
0204
0205
0206
0207 constexpr Energy2 operator "" _MeV2( long double x ) {
0208 return Energy2{Energy2::baseunit(), static_cast<double>(x)};
0209 }
0210 constexpr Energy2 operator "" _MeV2( unsigned long long x ) {
0211 return Energy2{Energy2::baseunit(), static_cast<double>(x)};
0212 }
0213
0214 constexpr Energy2 operator "" _GeV2( long double x ) {
0215 return Energy2{1.0e+6_MeV2, static_cast<double>(x)};
0216 }
0217 constexpr Energy2 operator "" _GeV2( unsigned long long x ) {
0218 return Energy2{1.0e+6_MeV2, static_cast<double>(x)};
0219 }
0220
0221 constexpr Energy2 MeV2 = 1_MeV2;
0222 constexpr Energy2 GeV2 = 1_GeV2;
0223
0224 constexpr InvEnergy InvGeV = 1/GeV;
0225
0226
0227 constexpr Area operator "" _pb( long double x ) {
0228 return Area{1.0e-34 * Area::baseunit(), static_cast<double>(x)};
0229 }
0230 constexpr Area operator "" _pb( unsigned long long x ) {
0231 return Area{1.0e-34 * Area::baseunit(), static_cast<double>(x)};
0232 }
0233
0234 constexpr Area femtobarn = 1.0e-03_pb;
0235 constexpr Area picobarn = 1_pb;
0236 constexpr Area nanobarn = 1.0e+03_pb;
0237 constexpr Area microbarn = 1.0e+06_pb;
0238 constexpr Area millibarn = 1.0e+09_pb;
0239 constexpr Area barn = 1.0e+12_pb;
0240
0241 constexpr Charge eplus = Charge::baseunit();
0242
0243
0244
0245 constexpr Qty<1,1,0> hbarc = 197.326968e-15 * MeV * meter;
0246
0247 constexpr Qty<1,1,0> hbar_Planck = hbarc / 1.0;
0248 }
0249
0250
0251
0252
0253
0254 namespace UnitRemoval {
0255
0256
0257 constexpr Units::Energy E = Units::Energy::baseunit();
0258
0259 constexpr Units::Energy2 E2 = E*E;
0260 constexpr Units::Energy3 E3 = E*E2;
0261 constexpr Units::Energy4 E4 = E2*E2;
0262
0263 constexpr Units::InvEnergy InvE = 1.0/E;
0264 constexpr Units::InvEnergy2 InvE2 = 1.0/E2;
0265 constexpr Units::InvEnergy3 InvE3 = 1.0/E3;
0266 constexpr Units::InvEnergy4 InvE4 = 1.0/E4;
0267
0268 constexpr Units::SqrtEnergy SqrtE = Units::SqrtEnergy::baseunit();
0269 constexpr Units::InvSqrtEnergy InvSqrtE = Units::InvSqrtEnergy::baseunit();
0270
0271 }
0272
0273 }
0274
0275 #endif