source: trunk/CLHEP/src/ZMxpv.cc@ 15

Last change on this file since 15 was 4, checked in by Pavel Demin, 16 years ago

first commit

File size: 5.7 KB
RevLine 
[4]1// ----------------------------------------------------------------------
2//
3// ZMxpv.cc Support for Vector package in the ZOOM context, where
4// probelmatic conditions are handled via ZOOM Exceptions.
5//
6// In the CLHEP context (that is, unless ENABLE_ZOOM_EXCEPTIONS
7// is defined) this file is content-free.
8//
9// ZMexception's are ZMthrown by classes in the PhysicsVectors
10// package. (To avoid name clashes, these start with ZMxpv.)
11// Each possible such exception must be provided with some
12// defining properties: thowe are in this file.
13//
14// History:
15// 19-Nov-1997 MF Initial version, to enable the ZMthrow exceptions
16// in SpaceVector.
17// 15-Jun-1998 WEB Added namespace support
18// 08-Jan-2001 MF Moved into CLHEP
19// 09-Oct-2003 MF Major addition: Exception class defs for CLHEP case
20//
21// ----------------------------------------------------------------------
22
23
24#include "CLHEP/Vector/ZMxpv.h"
25
26#ifndef ENABLE_ZOOM_EXCEPTIONS
27
28CLHEP_vector_exception::CLHEP_vector_exception
29 ( const std::string & s ) throw() : message(s) {}
30
31const char*
32CLHEP_vector_exception::what() const throw() {
33 static std::string answer;
34 answer = name();
35 answer += ": ";
36 answer += message;
37 return answer.c_str();
38}
39
40#define CLHEP_vector_exception_methods(NAME) \
41 NAME::NAME(const std::string & s) throw() : CLHEP_vector_exception(s) {} \
42 const char* NAME::name() const throw() { \
43 return #NAME; \
44 }
45
46CLHEP_vector_exception_methods( ZMxPhysicsVectors )
47CLHEP_vector_exception_methods( ZMxpvSpacelike )
48CLHEP_vector_exception_methods( ZMxpvNegativeMass )
49CLHEP_vector_exception_methods( ZMxpvVectorInputFails )
50CLHEP_vector_exception_methods( ZMxpvIndexRange )
51CLHEP_vector_exception_methods( ZMxpvFixedAxis )
52
53CLHEP_vector_exception_methods( ZMxpvTachyonic )
54CLHEP_vector_exception_methods( ZMxpvZeroVector )
55CLHEP_vector_exception_methods( ZMxpvImproperTransformation )
56CLHEP_vector_exception_methods( ZMxpvInfiniteVector )
57CLHEP_vector_exception_methods( ZMxpvInfinity )
58CLHEP_vector_exception_methods( ZMxpvImproperRotation )
59CLHEP_vector_exception_methods( ZMxpvAmbiguousAngle )
60
61CLHEP_vector_exception_methods( ZMxpvNegativeR )
62CLHEP_vector_exception_methods( ZMxpvUnusualTheta )
63CLHEP_vector_exception_methods( ZMxpvParallelCols )
64CLHEP_vector_exception_methods( ZMxpvNotOrthogonal )
65CLHEP_vector_exception_methods( ZMxpvNotSymplectic )
66
67#endif // endif for ifndef ENABLE_ZOOM_EXCEPTIONS
68
69// ========================================================================
70// ========================================================================
71// ========================================================================
72
73#ifdef ENABLE_ZOOM_EXCEPTIONS
74
75ZM_BEGIN_NAMESPACE( zmpv ) /* namespace zmpv { */
76
77
78ZMexClassInfo ZMxPhysicsVectors::_classInfo (
79 "ZMxPhysicsVectors",
80 "PhysicsVectors",
81 ZMexSEVERE );
82// General Exception in a PhysicsVectors routine
83
84ZMexClassInfo ZMxpvInfiniteVector::_classInfo (
85 "InfiniteVector",
86 "PhysicsVectors",
87 ZMexERROR );
88// Infinite vector component
89
90ZMexClassInfo ZMxpvZeroVector::_classInfo (
91 "ZeroVector",
92 "PhysicsVectors",
93 ZMexERROR );
94// Zero Vector cannot be converted to Unit Vector
95
96ZMexClassInfo ZMxpvTachyonic::_classInfo (
97 "Tachyonic",
98 "PhysicsVectors",
99 ZMexERROR );
100// Relativistic method using vector representing speed greater than light
101
102ZMexClassInfo ZMxpvSpacelike::_classInfo (
103 "Spacelike",
104 "PhysicsVectors",
105 ZMexERROR );
106// Spacelike 4-vector used in context where rest mass or gamma needs computing
107
108ZMexClassInfo ZMxpvInfinity::_classInfo (
109 "Infinity",
110 "PhysicsVectors",
111 ZMexERROR );
112// Mathematical operation will lead to infinity as a Scalar result
113
114ZMexClassInfo ZMxpvNegativeMass::_classInfo (
115 "NegativeMass",
116 "PhysicsVectors",
117 ZMexERROR );
118// Kinematic operation was rendered meaningless by an input with negative t
119
120ZMexClassInfo ZMxpvAmbiguousAngle::_classInfo (
121 "AmbiguousAngle",
122 "PhysicsVectors",
123 ZMexWARNING );
124// Angle requested ill-defined, due to null or collinear vectors
125
126ZMexClassInfo ZMxpvNegativeR::_classInfo (
127 "NegativeR",
128 "PhysicsVectors",
129 ZMexWARNING );
130// Negative value supplied for vector magnitude
131
132ZMexClassInfo ZMxpvUnusualTheta::_classInfo (
133 "UnusualTheta",
134 "PhysicsVectors",
135 ZMexWARNING );
136// Theta supplied for polar coordinates outside of [0,PI]
137
138ZMexClassInfo ZMxpvVectorInputFails::_classInfo (
139 "VectorInputFails",
140 "PhysicsVectors",
141 ZMexERROR );
142// Theta supplied for polar coordinates outside of [0,PI]
143
144ZMexClassInfo ZMxpvParallelCols::_classInfo (
145 "ParallelCols",
146 "PhysicsVectors",
147 ZMexERROR );
148// Col's supplied to form a Rotation are parallel instead of orthogonal
149
150ZMexClassInfo ZMxpvImproperRotation::_classInfo (
151 "ImproperRotation",
152 "PhysicsVectors",
153 ZMexERROR );
154// Col's supplied to form a Rotation form a (rotation+reflection) instead
155
156ZMexClassInfo ZMxpvImproperTransformation::_classInfo (
157 "ImproperRotation",
158 "PhysicsVectors",
159 ZMexERROR );
160// Rows supplied to form a LorentzTransformation form tachyonic or reflection
161
162ZMexClassInfo ZMxpvNotOrthogonal::_classInfo (
163 "NotOrthogonal",
164 "PhysicsVectors",
165 ZMexWARNING );
166// Col's supplied to form a Rotation or LorentzTransformation are not orthogonal
167
168ZMexClassInfo ZMxpvNotSymplectic::_classInfo (
169 "NotSymplectic",
170 "PhysicsVectors",
171 ZMexWARNING );
172// A row supplied as part of a LorentzTransformation has wrong restmass()
173
174
175ZMexClassInfo ZMxpvFixedAxis::_classInfo (
176 "FixedAxis",
177 "PhysicsVectors",
178 ZMexERROR );
179// An attempt to change the axis is of a rotation fixed to be about X Y or Z.
180
181ZMexClassInfo ZMxpvIndexRange::_classInfo (
182 "IndexRange",
183 "PhysicsVectors",
184 ZMexERROR );
185// An attempt to access a vector in the p(i) notation, where i is out of range.
186
187
188ZM_END_NAMESPACE( zmpv ) /* } // namespace zmpv */
189
190#endif // endif for ifdef ENAMBLE_ZOOM_EXCEPTIONS
Note: See TracBrowser for help on using the repository browser.