Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/HepMC/Units.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #ifndef HEPMC_UNITS_H
0002 #define HEPMC_UNITS_H
0003 
0004 //--------------------------------------------------------------------------
0005 // Units.h
0006 // Author:  A. Buckley, D. Grellscheid
0007 //
0008 // units used by a GenEvent
0009 // The default units are set by a configure switch at compile time in Units.cc.
0010 //--------------------------------------------------------------------------
0011 
0012 #include <iostream>
0013 #include <string>
0014 
0015 namespace HepMC {
0016 
0017   ///
0018   /// \namespace Units
0019   /// Allow units to be specified within HepMC.
0020   /// The default units are set at compile time. 
0021   ///
0022   namespace Units {
0023 
0024     // Convention: if both types are passed, MomentumUnit always goes first.
0025     enum MomentumUnit { MEV, GEV }; //!< momentum units
0026     enum LengthUnit   { MM, CM };   //!< position units
0027     
0028     LengthUnit   default_length_unit();     //!< default unit is defined by configure
0029     MomentumUnit default_momentum_unit();   //!< default unit is defined by configure
0030 
0031     // helper functions
0032     std::string name( MomentumUnit );   //!< convert enum to string
0033     std::string name( LengthUnit ); //!< convert enum to string
0034 
0035     /// scaling factor relative to MeV
0036     double conversion_factor( MomentumUnit from, MomentumUnit to ); 
0037     double conversion_factor( LengthUnit from, LengthUnit to );
0038 
0039   } // Units
0040 }   // HepMC
0041 
0042 #endif // HEPMC_UNITS_H