~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to include/OpenMS/CONCEPT/Constants.h

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2012-11-12 15:58:12 UTC
  • Revision ID: package-import@ubuntu.com-20121112155812-vr15wtg9b50cuesg
Tags: upstream-1.9.0
ImportĀ upstreamĀ versionĀ 1.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: C++; tab-width: 2; -*-
 
2
// vi: set ts=2:
 
3
//
 
4
// --------------------------------------------------------------------------
 
5
//                   OpenMS Mass Spectrometry Framework 
 
6
// --------------------------------------------------------------------------
 
7
//  Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
 
8
//
 
9
//  This library is free software; you can redistribute it and/or
 
10
//  modify it under the terms of the GNU Lesser General Public
 
11
//  License as published by the Free Software Foundation; either
 
12
//  version 2.1 of the License, or (at your option) any later version.
 
13
//
 
14
//  This library is distributed in the hope that it will be useful,
 
15
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
//  Lesser General Public License for more details.
 
18
//
 
19
//  You should have received a copy of the GNU Lesser General Public
 
20
//  License along with this library; if not, write to the Free Software
 
21
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
22
//
 
23
// --------------------------------------------------------------------------
 
24
// $Maintainer: Stephan Aiche$
 
25
// $Authors: Marc Sturm $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
#ifndef OPENMS_CONCEPT_CONSTANTS_H
 
29
#define OPENMS_CONCEPT_CONSTANTS_H
 
30
 
 
31
#include <OpenMS/config.h>
 
32
 
 
33
/**     
 
34
        @brief Main %OpenMS namespace.
 
35
                
 
36
        In this namespace all the main %OpenMS classes are located.
 
37
*/
 
38
namespace OpenMS 
 
39
{
 
40
        /**     
 
41
                @brief Mathematical and physical constants namespace.
 
42
                        
 
43
                This namespace contains definitions for some basic mathematical and physical constants.
 
44
                All constants are double precision.
 
45
                <BR>
 
46
                There are basically two ways of accessing these constants:
 
47
                <UL>
 
48
                        <LI> specify all namespaces:
 
49
                        <BR>
 
50
                        <tt>double my_pi = OpenMS::Constants::PI</tt>
 
51
                        <BR>
 
52
                        <LI>shortcut via the <tt>using directive</tt>:
 
53
                        <BR>
 
54
                        <tt>using namespace OpenMS::Constants;
 
55
                        <BR>
 
56
                        double my_pi = PI;</tt>
 
57
                </UL>
 
58
                
 
59
                @ingroup Concept
 
60
        */
 
61
        namespace Constants 
 
62
        {
 
63
                /**     @name   Mathematical constants.
 
64
                */
 
65
                //@{
 
66
 
 
67
                /// PI
 
68
                extern OPENMS_DLLAPI const double  PI;
 
69
 
 
70
                /// Euler's number - base of the natural logarithm
 
71
                extern OPENMS_DLLAPI const double  E;
 
72
 
 
73
                /**     Internal theshold for equality comparisons.
 
74
                                Default value is 1e-6.
 
75
                */
 
76
                extern OPENMS_DLLAPI double EPSILON;
 
77
                //@}
 
78
                        
 
79
                /**     @name Chemical/physical constants.
 
80
                */
 
81
                //@{
 
82
                
 
83
                /**     Elementary charge.
 
84
                          In units of C (\f$1.60217738 \cdot 10^{-19} C\f$).
 
85
                */
 
86
                extern OPENMS_DLLAPI const double       ELEMENTARY_CHARGE;       // C     
 
87
        
 
88
                /// Elementary charge (alias)
 
89
                extern OPENMS_DLLAPI const double       e0;
 
90
 
 
91
                /** Electron mass.
 
92
                                In units of kg (\f$9.1093897 \cdot 10^{-31}\f$ kg).
 
93
                */
 
94
                extern OPENMS_DLLAPI const double       ELECTRON_MASS           ;        // kg
 
95
 
 
96
                /** Electron mass
 
97
                                In units (\f$1,822.88850204(77)^{-1}\f$u).
 
98
                */
 
99
                extern OPENMS_DLLAPI const double ELECTRON_MASS_U   ;      // u
 
100
 
 
101
                /** Proton mass.
 
102
                                In units of kg (\f$1.6726230 \cdot 10^{-27}\f$ kg).
 
103
                */
 
104
                extern OPENMS_DLLAPI const double       PROTON_MASS             ;        // kg
 
105
 
 
106
                /** Proton mass.
 
107
                                In units (\f$1.00727646677(10)\f$u)
 
108
                */
 
109
                extern OPENMS_DLLAPI const double PROTON_MASS_U     ;      // u
 
110
 
 
111
                /** Neutron mass.
 
112
                                In units of kg (\f$1.6749286 \cdot 10^{-27}\f$ kg).
 
113
                */
 
114
                extern OPENMS_DLLAPI const double       NEUTRON_MASS            ;        // kg
 
115
 
 
116
                /** Neutron mass.
 
117
                                In units (\f$1.0086649156(6)\f$u)
 
118
                */
 
119
                extern OPENMS_DLLAPI const double NEUTRON_MASS_U    ;      // u
 
120
 
 
121
                /** Avogadro constant.
 
122
                                In units of \f$mol^{-1}\f$ (\f$6.0221367 \cdot 10^{23} mol^{-1}\f$).
 
123
                */
 
124
                extern OPENMS_DLLAPI const double       AVOGADRO;
 
125
 
 
126
                /** Avogadro constant (alias)
 
127
                */
 
128
                extern OPENMS_DLLAPI const double       NA;
 
129
 
 
130
                /** Avogadro constant (alias)
 
131
                */
 
132
                extern OPENMS_DLLAPI const double       MOL;
 
133
 
 
134
                /** Boltzmann constant.
 
135
                                In units of J/K (\f$1.380657 \cdot 10^{-23}\f$ J/K).
 
136
                */
 
137
                extern OPENMS_DLLAPI const double       BOLTZMANN;
 
138
 
 
139
                /** Boltzmann constant (alias)
 
140
                */
 
141
                extern OPENMS_DLLAPI const double       k;
 
142
                
 
143
                /** Planck constant.
 
144
                                In units of Js (\f$6.6260754 \cdot 10^{-34}\f$ Js).
 
145
                */
 
146
                extern OPENMS_DLLAPI const double       PLANCK;
 
147
 
 
148
                /** Planck constant (alias)
 
149
                */
 
150
                extern OPENMS_DLLAPI const double       h;
 
151
 
 
152
                /** Gas constant (= NA * k)     
 
153
                */
 
154
                extern OPENMS_DLLAPI const double       GAS_CONSTANT;
 
155
 
 
156
                /** Gas constant (alias)
 
157
                */
 
158
                extern OPENMS_DLLAPI const double R;
 
159
 
 
160
                /** Faraday constant (= NA * e0)
 
161
                */
 
162
                extern OPENMS_DLLAPI const double       FARADAY;
 
163
 
 
164
                /** Faraday constant (alias)
 
165
                */
 
166
                extern OPENMS_DLLAPI const double       F;
 
167
 
 
168
                /** Bohr radius.
 
169
                                In units m (\f$5.29177249 \cdot 10^{-11}\f$ m).
 
170
                */
 
171
                extern OPENMS_DLLAPI const double       BOHR_RADIUS;
 
172
 
 
173
                /** Bohr radius (alias)
 
174
                */
 
175
                extern OPENMS_DLLAPI const double       a0;
 
176
 
 
177
                //  the following values from: 
 
178
                //  P.W.Atkins: Physical Chemistry, 5th ed., Oxford University Press, 1995
 
179
 
 
180
                /** Vacuum permittivity.
 
181
                                In units of \f$C^2J^{-1}m^{-1}\f$ (\f$8.85419 \cdot 10^{-12} C^2J^{-1}m^{-1}\f$).
 
182
                */
 
183
                extern OPENMS_DLLAPI const double       VACUUM_PERMITTIVITY;
 
184
 
 
185
                /** Vacuum permeability.
 
186
                                In units of \f$Js^2C^{-2}m^{-1}\f$ (\f$4\pi \cdot 10^{-7} Js^2C^{-2}m^{-1}\f$).
 
187
                */
 
188
                extern OPENMS_DLLAPI const double       VACUUM_PERMEABILITY;
 
189
 
 
190
                /** Speed of light.
 
191
                                In units of m/s (\f$2.99792458 \cdot 10^8 ms^{-1}\f$).
 
192
                */
 
193
                extern OPENMS_DLLAPI const double       SPEED_OF_LIGHT;
 
194
 
 
195
                /** Speed of Light (alias)
 
196
                */
 
197
                extern OPENMS_DLLAPI const double       c;
 
198
 
 
199
                /** Gravitational constant.
 
200
                                In units of \f$Nm^2kg^{-2}\f$ (\f$6.67259 \cdot 10^{-11} Nm^2kg^{-2}\f$).
 
201
                */
 
202
                extern OPENMS_DLLAPI const double       GRAVITATIONAL_CONSTANT;
 
203
 
 
204
                /** Fine structure constant.
 
205
                                Without unit (\f$7.29735 \cdot 10^{-3}\f$).
 
206
                */
 
207
                extern OPENMS_DLLAPI const double       FINE_STRUCTURE_CONSTANT;
 
208
                //@}
 
209
 
 
210
                /**     @name   Conversion factors
 
211
                */
 
212
                //@{            
 
213
                        
 
214
                /** Degree per rad.
 
215
                                57.2957795130823209
 
216
                */
 
217
                extern OPENMS_DLLAPI const double       DEG_PER_RAD;
 
218
 
 
219
                /** Rad per degree.
 
220
                                0.0174532925199432957
 
221
                */
 
222
                extern OPENMS_DLLAPI const double       RAD_PER_DEG;
 
223
 
 
224
                /** mm per inch.
 
225
                                25.4
 
226
                */
 
227
                extern OPENMS_DLLAPI const double       MM_PER_INCH                     ;
 
228
 
 
229
                /** m per foot.
 
230
                                3.048
 
231
                */
 
232
                extern OPENMS_DLLAPI const double       M_PER_FOOT                      ;
 
233
 
 
234
                /** Joules per calorie.
 
235
                                4.184
 
236
                */
 
237
                extern OPENMS_DLLAPI const double       JOULE_PER_CAL;
 
238
 
 
239
                /** Calories per Joule.
 
240
                                1/JOULE_PER_CAL
 
241
                */
 
242
                extern OPENMS_DLLAPI const double       CAL_PER_JOULE;
 
243
 
 
244
                //@}
 
245
        }
 
246
}
 
247
 
 
248
#endif // OPENMS_CONCEPT_CONSTANTS_H