Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:02:49

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Dmitry Kalinkin
0003 
0004 #pragma once
0005 
0006 namespace edm4eic {
0007 
0008   namespace unit {
0009 
0010     //
0011     // This provides definition for a unique unit system for this EDM. It is
0012     // neither Geant, nor TGeo. The DD4hep, by default, uses a system matching
0013     // the TGeo one.
0014     //
0015     // +------------+---------------------|-----------------+
0016     // | Geant      | TGeo                | EDM4hep/EDM4eic |
0017     // +------------+---------------------|-----------------+
0018     // | milimeter  | centimeter          | milimeter       |
0019     // | nanosecond | second              | nanosecond      |
0020     // | MeV        | GeV                 | GeV             |
0021     // +------------+---------------------|-----------------+
0022     //
0023 
0024     // distance
0025     static constexpr double mm = 1.0; // millimeter
0026     static constexpr double cm = 1e1 * mm; // centimeter
0027     static constexpr double um = 1e-3 * mm; // micrometer
0028     static constexpr double nm = 1e-6 * mm; // nanometer
0029     static constexpr double m = 1e3 * mm; // meter
0030 
0031     // time
0032     static constexpr double ns = 1.0; // nanosecond
0033     static constexpr double s = 1e9 * ns; // second
0034     static constexpr double ms = 1e6 * ns; // milisecond
0035     static constexpr double us = 1e3 * ns; // microsecond
0036     static constexpr double ps = 1e-3 * ns; // picosecond
0037 
0038     // energy
0039     static constexpr double GeV = 1.0; // giga electron volt
0040     static constexpr double MeV = 1e-3 * GeV; // mega electron volt
0041     static constexpr double keV = 1e-6 * GeV; // kilo electron volt
0042     static constexpr double eV = 1e-9 * GeV; // electron volt
0043 
0044   }
0045 
0046 }